Chapter 2 Practical SQL (1)
Chapter 2 Practical SQL (1)
Chapter - 2
Understanding
Database Languages
SQL + DDL + DML
Addis Ababa University, School of Commerce | Updated: Feb, 2025 2
Local #
Current session only Deleted when session ends
Temporary
Global All sessions (while
## Deleted when last session ends
Temporary one is active)
Addis Ababa University, School of Commerce | Updated: Feb, 2025 10
Practical SQL : DDL : Primary Key (PK) & Foreign Key (FK)
•…
• A Primary Key uniquely identifies
each record in a table.
• It cannot contain NULLs and must be
unique.
• A Foreign Key is a field (or combo of
fields) in one table that refers to the
Primary Key in another table.
• It is used to maintain referential
integrity between related tables.
Addis Ababa University, School of Commerce | Updated: Feb, 2025 27
Practical SQL : DDL : Primary Key (PK) & Foreign Key (FK)
•…
• Primary Key with IDENTITY
Practical SQL : DDL : Primary Key (PK) & Foreign Key (FK)
•…