mysql help

This is a discussion on mysql help within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Could someone explain to me the create table command in mysql? I want to create a table that has two ...

  1. #1
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753

    mysql 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.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,410
    Code:
    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.

  3. #3
    Registered User glUser3f's Avatar
    Join Date
    Aug 2003
    Posts
    345
    check out this tutorial:
    http://www.w3schools.com/sql/default.asp

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Change detection in MySQL.
    By amitbora27 in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 05-13-2009, 10:34 AM
  2. MySQL libraries
    By csonx_p in forum C++ Programming
    Replies: 6
    Last Post: 10-02-2008, 02:23 AM
  3. About C++ and MySQL or oether free database
    By xxxrugby in forum C++ Programming
    Replies: 18
    Last Post: 12-30-2005, 05:28 AM
  4. Get data from mysql and use in a system.
    By smaakage in forum Tech Board
    Replies: 3
    Last Post: 10-04-2005, 12:03 PM
  5. Get data from mysql and use in a system.
    By smaakage in forum C++ Programming
    Replies: 5
    Last Post: 10-02-2005, 01:25 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21