Primary Keys : PRIMARY KEY « Table « MySQL Tutorial

Home
MySQL Tutorial
1.Introduction
2.Select Query
3.Database
4.Table
5.Table Join
6.Subquery
7.Insert Update Delete
8.Logic Operator
9.View
10.Data Types
11.Procedure Function
12.Cursor
13.Trigger
14.Date Time Functions
15.Comparison Functions Operators
16.Aggregate Functions
17.Cast Functions Operators
18.Control Flow Functions
19.Encryption Compression Functions
20.Information Functions
21.Math Numeric Functions
22.Miscellaneous Functions
23.String Functions
24.Regular Expressions
25.Data Dictionary
26.MySQL Utilities
27.Privilege
MySQL Tutorial » Table » PRIMARY KEY 
4.15.1.Primary Keys

A primary key data must be unique.

Only one primary key can exist for each table.

A primary key values can never be null.

MySQL requires you to specify NOT NULL when creating a table with a given column specified as PRIMARY KEY.

4.15.PRIMARY KEY
4.15.1.Primary Keys
4.15.2.Create primary key in column definition
4.15.3.Create primary key after column definition
4.15.4.Multiple-Column Primary Keys
4.15.5.Auto_INCREMENT primary key
4.15.6.Use two columns as the combined primary key
4.15.7.Use partial indexing as the primary key
4.15.8.ALTER TABLE table_name ADD PRIMARY KEY index_name (column_name[,...]);
4.15.9.To drop a PRIMARY KEY
4.15.10.To remove a primary key
4.15.11.Alter table to drop primary key and foreign key
4.15.12.Add Index and primary key to a table in table creation command
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.