Addbase - Prelim: Slide 1 - Review of Theory of Databases
Addbase - Prelim: Slide 1 - Review of Theory of Databases
Addbase - Prelim: Slide 1 - Review of Theory of Databases
Integrity Constraint
Use to ensure accuracy and consistency of
data in a relational database.
Types of Integrity Constraints
Primary Key Constraints
Unique Constraints
Foreign Key Constraints
Not Null Constraints
Check Constraints
Normalization
Process of reducing data redundancy in a
database
Levels of Normal Forms Natural Joins
First Normal Form (1NF) Removes duplicate columns in the
Second Normal Form (2NF) joining columns
Third Normal Form (3RD)
Advantage of Normalization
Better overall database organization
Reduction of redundant data
Data consistency within the database
Flexible database design
Efficient database security handling
Enforces concept of referential integrity
Non-Equijoins Self Joins
It combines two or more tables based Combines tables to itself
on a specified column value not
equaling a specified column value in
another table
Cross Joins
It returns all possible combinations
Outer Joins of rows from the two tables
It produces all rows that exist in one
table, even if there are
corresponding rows do not exist in
the joined table
Left Outer Join
Preserves every row in the left-hand
table
Right Outer Join
Preserves every row in the right-hand
table
Full Outer Join
Preserves all row from both sides
SLIDE 3 – COMMON TABLE EXPRESSION
Common Table Expression (CTE)
Are temporary result set that are
known only within the scope of a
single SELECT, INSERT, UPDATE,
DELETE or CREATE VIEW statement
Common table expressions are
generally useful in a query that
involves multiple aggregate
functions.