Warning: Creating default object from empty value in /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4991

Warning: Creating default object from empty value in /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4993
Question 31: Which of the following create-statements are valid? – MySQL Question of the Day

Skip to content

By urs in mysql questions

 
(Find all correct answers)
 
Assume that the sql_mode is default (empty).
 

a) create table table (from int,column int, order int, by int);
b) create table date (time int,timestamp timestamp);
c) create table `table` (`from` int,`column` int, `order` int, `by` int);
d) create table "table" ("from" int,"column" int, "order" int, "by" int);

 
[ Identifiers (5%) - Reserved Words as Identifiers ]
 

Tags: , ,

Comment Feed

One Response


  1.  
    Answers:
     
    b c
     
    When you look at b, you’ll notice, that mysql actually allows you to use some datatypes as identifiers. That doesn’t mean it is a good idea… The same goes for c: if you need backticks, so that you can use a word as an identifier, then you should rather change it.
     

You must be logged in to post a comment.