Database Management Systems: Keys, Entities, and Normalization

Types of Keys in SQL

In SQL, a key is used to identify a record in a database table. There are several types of keys:

  • Primary Key: Uniquely identifies each record in a table. Each table can have only one primary key.
  • Foreign Key: A column or a set of columns in one table that refers to the primary key of another table. It is used to establish relationships between tables.
  • Candidate Key: A set of attributes that could uniquely identify a record in a table. A table can have multiple candidate keys.
  • Alternate
Read More

Relational Database Concepts and SQL Fundamentals

Normalization

Normalization is a database design technique used to organize the structure of relational databases. The goal is to reduce data redundancy and improve data integrity by dividing large tables into smaller ones and defining relationships between them. The process involves several normal forms (1NF, 2NF, 3NF, BCNF, etc.), each with its own set of rules:

  • 1NF (First Normal Form): Ensures that each column contains atomic values (no repeating groups).
  • 2NF (Second Normal Form): Ensures that the
Read More