INST 327 Lecture Notes - Lecture 11: Mysql, Cmd.Exe, Unique Key

106 views3 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents