Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Do you know how to use the naming conventions in mysql database? I ve downloaded a mysql sample database.
Here it is:
CREATE DATABASE IF NOT EXISTS classicmodels DEFAULT CHARACTER SET latin1;
USE classicmodels ;
DROP TABLE IF EXISTS customers ;
CREATE TABLE customers (
customerNumber int(11) NOT NULL,
customerName varchar(50) NOT NULL,
contactLastName varchar(50) NOT NULL,
contactFirstName varchar(50) NOT NULL,
phone varchar(50) NOT NULL,
addressLine1 varchar(50) NOT NULL,
addressLine2 varchar(50) default NULL,
city varchar(50) NOT NULL,
state varchar(50) default NULL,
postalCode varchar(15) default NULL,
country varchar(50) NOT NULL,
salesRepEmployeeNumber int(11) default NULL,
creditLimit double default NULL,
PRIMARY KEY ( customerNumber )
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Edit:
What i prefer:
CREATE DATABASE IF NOT EXISTS classic_models;
USE classic_models ;
DROP TABLE IF EXISTS customers ;
CREATE TABLE customers (
customer_number int(11) NOT NULL,
customer_name varchar(50) NOT NULL,
-- or i define the column name this way:
name varchar(50) NOT NULL, -- NOT customerName and NOT customer_name
PRIMARY KEY ( customer_number )
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Am i right?
I recommend an article: sql convention from Faruk Ateş Do you have any advice for naming conventions here?