INST 327 Lecture Notes - Lecture 11: Mysql, Cmd.Exe, Unique Key
Document Summary
To begin with, the table creation command requires the following details . Here is a generic sql syntax to create a mysql table . Now, we will create the following table in the tutorials database. Field attribute not null is being used because we do not want this field to be null. So, if a user will try to create a record with a null value, then mysql will raise an error. Field attribute auto_increment tells mysql to go ahead and add the next available number to the id field. Keyword primary key is used to define a column as a primary key. You can use multiple columns separated by a comma to define a primary key. It is easy to create a mysql table from the mysql> prompt. Here is an example, which will create tutorials_tbl . Note mysql does not terminate a command until you give a semicolon (;) at the end of sql command.