1. Database Normalization
Normalization is the systematic process of organizing database tables to minimize data redundancy and eliminate update, insert, and delete anomalies.
- First Normal Form (1NF): A relation is in 1NF if it contains no repeating groups or multi-valued attributes. Every attribute must contain atomic (indivisible) values, and a primary key must be defined.
- Second Normal Form (2NF): Must be in 1NF. All non-prime attributes must be fully functionally dependent on the entire primary key. In other words, there must be no partial dependencies (where a non-key column depends on only part of a composite primary key).
- Third Normal Form (3NF): Must be in 2NF. There must be no transitive dependencies (where a non-key column depends on another non-key column). Every non-prime attribute must depend only on the primary key (the key, the whole key, and nothing but the key).
2. Structured Query Language (SQL)
SQL is divided into two primary sub-languages:
- DDL (Data Definition Language): Alters schema structures.
CREATE TABLE Student ( StudentID INT PRIMARY KEY, Name VARCHAR(100) NOT NULL, Email VARCHAR(50) UNIQUE, DOB DATE ); - DML (Data Manipulation Language): Retrieves and modifies table tuples.
SELECT Student.Name, Exam.Score FROM Student INNER JOIN Exam ON Student.StudentID = Exam.StudentID WHERE Exam.Subject = 'ICT' AND Exam.Score >= 75;