Wednesday, 13 June 2012

SQL PRIMARY KEY Constraint




SQL PRIMARY KEY Constraint - same as UNIQUE Constraint except that Primary Key constraints does not allow null values (whether or not the column definition specifies NOT NULL) and only one primary key constraint can be defined for each table.

Example of SQL PRIMARY KEY Constraint


CREATE TABLE Sells (
  bar   CHAR(20),
  beer  VARCHAR(20) DEFAULT 'Kingfisher',
  price REAL  NOT NULL,
  PRIMARY KEY (bar,beer)
 );

No comments:

Post a Comment

IE7 Issues Text Indent

                 Unfortunately IE 7 is still widespread among the users hence while theming we have to give special importance to the grea...