• Home
  • SQL Constraints

    Constraints help us to prevent invalid data entry into tables. Using constraints we can:

    • • Enforce rules on the data in a table when ever a row is inserted, updated or deleted.
    • • Prevents the deletion of a table if there are dependencies arising from other tables.

    There are several constraints are as follows:

    Constraint Description
    Not null Specifies that the column can't contain a null value.
    Unique Specifies a column or combination of columns whose values must be unique for all rows in the table.
    Primary key Uniquely identifies each rows of the table.
    Foreign key Established and enforces a foreign key relationship between the column and a column of the referenced table.
    Check Specifies a condition that must be true.

    All constraints are stored in data dictionary. Constraints are easy to refer if we give them meaningful names. If we dont give a name to a constraint , the server gives a name by its own.


    About the Author



    Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.

    We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc





     PreviousNext