Could someone explain to me the create table command in mysql? I want to create a table that has two columns, one called user, the other called password. i can't seem to understand the command argument description at www.mysql.com. Thanks for help.
Could someone explain to me the create table command in mysql? I want to create a table that has two columns, one called user, the other called password. i can't seem to understand the command argument description at www.mysql.com. Thanks for help.
This would create a table named "users" in the current database.Code:CREATE TABLE users ( user_id INT NOT NULL AUTO_INCREMENT, user VARCHAR(40), password VARCHAR(40), PRIMARY KEY (user_id) );
"user_id" is a column used as the primary key.
It stores data of type "INT", does not allow NULL values.
AUTO_INCREMENT "can be used to generate a unique identity for new rows".
"user" is a column of type "VARCHAR", storing up to 40 characters, and allows NULL values.
The same goes for the "password" column.
check out this tutorial:
http://www.w3schools.com/sql/default.asp