Key Constraints – PRIMARY KEY, FOREIGN KEY :PRIMARY KEY: Primary key uniquely identifies each record in a table. It must have unique values and cannot contain nulls. In the below example the ROLL_NO field is marked as primary key, that means the ROLL_NO field cannot have duplicate and null values. CREATE TABLE STUDENT( ROLL_NO INT NOT NULL, STU_NAME VARCHAR (35) NOT NULL UNIQUE, STU_AGE INT NOT NULL, STU_ADDRESS VARCHAR (35) UNIQUE, PRIMARY KEY (ROLL_NO) );FOREIGN KEY: Foreign keys are the columns of a table that points to the primary key of another table. They act as a cross-reference between tables. - Study24x7
Social learning Network
study24x7

Default error msg

Login

New to Study24x7 ? Join Now
Already have an account? Login
56 followers study24x7 16 Mar 2019 03:17 PM study24x7 study24x7

Key Constraints – PRIMARY KEY, FOREIGN KEY :

PRIMARY KEY: Primary key uniquely identifies each record in a table. It must have unique values and cannot contain nulls. In the below example the ROLL_NO field is marked as primary key, that means the ROLL_NO field cannot ...

See more

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles