3

in mysql i can create a table named "select" using the following statement

CREATE TABLE `SELECT` (
Id INT,
Name VARCHAR(255)
}

mySql table named "select"

and it executed successfully and the table is created by the name "select" as you can see the image above. But the same couldn't be done in oracle 11g.

What would be the sql query that's required to create a table named "select" in other sql databases

Jeyanth Kumar
  • 1,589
  • 3
  • 23
  • 48
  • IMHO, table name should be in plural .. because table contains not just a single "select" but a lot of them .. just my 2 cents. – tereško Oct 17 '11 at 06:59
  • 1
    Not a duplicate but this should help: [How do I escape a reserved word in oracle](http://stackoverflow.com/questions/1162381/how-do-i-escape-a-reserved-word-in-oracle). Using reserved words as table or column names is still a bad idea. – Salman A Oct 17 '11 at 07:00
  • 1
    @teresko - Table Names should not be plural - the mere existence of a table implies they contain more than one object. – tsells Oct 18 '11 at 02:13
  • @jeyanth Kumar - Anytime you use reserved words you introduce complexity into your system - avoid this at all costs (even when learning). – tsells Oct 18 '11 at 02:14
  • @teresko you can also think of tables as prolog atomic statements, so customer(X) would find all customers matching properties X. It is a fact that every entry of customer is a customer. So its a reasonable naming convention. – Dmytro Apr 01 '18 at 07:41

3 Answers3

5

I think you should use

CREATE TABLE "SELECT" ...
Marco
  • 56,740
  • 14
  • 129
  • 152
1
use dumme
create table [select] 
( 
 i int
)

select * from [select]

i dont know why you in such need to create table with reserve word but in MS SQL server 2005 you can use the above statment to create a table with name select

rahularyansharma
  • 11,156
  • 18
  • 79
  • 135
0

Select is a reserved word, and tgus should actually not be used. The validation in mysql is just a little less strict.

Try using another name, like selectTable or selectId

Rene Pot
  • 24,681
  • 7
  • 68
  • 92