I wonder what is the difference between these three CREATE TABLE statements…
CREATE TABLE IF NOT EXISTS Files
(
files_id
smallint(10) unsigned NOT NULL AUTO_INCREMENT,
filename
varchar(250) DEFAULT NULL,
original_filename
varchar(250) DEFAULT NULL,
date_added
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (files_id
)
)
and
CREATE TABLE IF NOT EXISTS Files (
files_id smallint(10) unsigned NOT NULL AUTO_INCREMENT,
filename varchar(250) DEFAULT NULL,
original_filename varchar(250) DEFAULT NULL,
date_added timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (files_id`)
)
and
CREATE TABLE IF NOT EXISTS ‘Files’ (
‘files_id’ smallint(10) unsigned NOT NULL AUTO_INCREMENT,
‘filename’ varchar(250) DEFAULT NULL,
‘original_filename’ varchar(250) DEFAULT NULL,
‘date_added’ timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (‘files_id’)
)
Whats the difference between using `, ', nothing in the table name and the column names. Also do CAPS matter at all. and lastly does it matter if you declare the PRIMARY KEY in the column row or at the end in the CREATE TABLE statement? and also when declaring a FOREIGN KEY, whats the difference between
column_name REFERENCES Table(id),
and
FOREIGN KEY (column_name),
Thanks