PDA

View Full Version : mysql help



Leeman_s
11-12-2003, 08:13 PM
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.

laserlight
11-12-2003, 08:50 PM
CREATE TABLE users (
user_id INT NOT NULL AUTO_INCREMENT,
user VARCHAR(40),
password VARCHAR(40),
PRIMARY KEY (user_id)
);

This would create a table named "users" in the current database.
"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.

glUser3f
11-13-2003, 03:14 AM
check out this tutorial:
http://www.w3schools.com/sql/default.asp