0% found this document useful (0 votes)
9 views18 pages

SQL Primary Key and Column Addition Guide

A primary key can be created by combining two columns to ensure uniqueness. The CHECK constraint can be applied either inline on a column or as a table-level constraint to enforce data rules. To add more columns to an existing SQL table, the ALTER TABLE statement with ADD COLUMN should be used.

Uploaded by

hrjesgroup
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views18 pages

SQL Primary Key and Column Addition Guide

A primary key can be created by combining two columns to ensure uniqueness. The CHECK constraint can be applied either inline on a column or as a table-level constraint to enforce data rules. To add more columns to an existing SQL table, the ALTER TABLE statement with ADD COLUMN should be used.

Uploaded by

hrjesgroup
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

PRIMARY KEY

 Also we can make the two column combination a unique and we can
call that primary key
If either condition fails, the row is rejected.
Summary:
•Use CHECK to enforce rules on data.
•You can apply it:
•Directly on a column (inline)
•Or separately with a name (table-level constraint)
how to add more
columns in sql table

To add more columns to an


existing SQL table, use the
ALTER TABLE statement
with ADD COLUMN.

You might also like