Posts Tagged ‘key’

How to Add Primary Key?

A primary key is used to uniquely identify each row in a table. Primary keys can be specified either when the table is created (using CREATE TABLE) or by changing the existing table structure (using ALTER TABLE). CREATING TABLE WITH PRIMARY KEY SYNTAX: CREATE TABLE table_name(field_name datatype(index),…,field_nameN datatype(index),PRIMARY KEY(field_name_primary_key)); Say for example, you are going […]

read more

How to Create a Foreign Key?

A foreign key is a field (or fields) that points to the primary key of another table. The purpose of the foreign key is to ensure referential integrity of the data. In other words, only values that are supposed to appear in the database are permitted. For example, say we have two tables, a CUSTOMER […]

read more

How to create a foreign key in a database table?

A foreign key is a field (or fields) that points to the primary key of another table. The purpose of the foreign key is to ensure referential integrity of the data. In other words, only values that are supposed to appear in the database are permitted. For example, say we have two tables, a CUSTOMER […]

read more

How to add a primary key in a database table?

A primary key is used to uniquely identify each row in a table. Primary keys can be specified either when the table is created (using CREATE TABLE) or by changing the existing table structure (using ALTER TABLE). CREATING TABLE WITH PRIMARY KEY SYNTAX: CREATE TABLE table_name(field_name datatype(index),…,field_nameN datatype(index),PRIMARY KEY(field_name_primary_key)); Say for example, you are going […]

read more