DBMS LAB
• Data: Known facts that can be recorded and have an implicit meaning.
• Database: A collection of related data.
• Database Management System (DBMS): A software package / system
to facilitate the creation and maintenance of a computerized
database.
• Database System: The DBMS software together with the data
• Schema: the logical and visual configuration of the entire relational database
• Schema diagram: a visual representation of structured data, illustrating how each
element interacts and relates with others
• Entity: real-world object, concept, or person about which data can be stored
• Attributes - characteristics that define entities within a database
• Relationship: logical association between two or more database tables
• ER diagram: visualizes the relationships between entities like people, things, or
concepts in a database.
• Primary key: The primary key is a unique identifier within its table. uniquely
identifying each record or row within a table.
• Foreign key: a foreign key is a reference in one table to a primary key in
another. used to establish and navigate relationships between tables.
• Constraints: help enforce rules at the database level, preventing the entry of
invalid data and ensuring data accuracy and reliability.
• The six main constraints in SQL are NOT NULL , UNIQUE , PRIMARY KEY ,
FOREIGN KEY , CHECK and DEFAULT
• NOT NULL: This constraint ensures that a column cannot have a NULL value. It
guarantees that every record in the table must have a value for this column.
• UNIQUE: The UNIQUE constraint ensures that all values in a column are
distinct—no duplicates are allowed.
• PRIMARY KEY: A PRIMARY KEY is a combination of NOT NULL and UNIQUE. It
uniquely identifies each record in a table. There can only be one PRIMARY KEY
in a table.
• FOREIGN KEY: A FOREIGN KEY is used to maintain referential integrity
between two tables. It links a column in one table to the PRIMARY KEY of
another table, ensuring that the values in the foreign key column match valid
values in the referenced table.
• CHECK: The CHECK constraint ensures that all values in a column
satisfy a specific condition. For example, you could use CHECK to
ensure that the "Age" column in a table only contains values greater
than or equal to 18.
• DEFAULT: This constraint provides a default value for a column when
no value is specified during the insertion of a record.