You are on page 1of 4

Database → Data warehouse

Database Management System- DBMS


(Insert,Update,Delete,Search)
RDBMS-Relational Database Management System

Relation
Student
Name Student Id Credit hr. Cgpa Course
Niloy 12 3.00 4.00 CSE-311
Nahid 14 3.00 3.98 CSE-312
Bob 11 3.00 3.50 CSE-311
Niloy 10 3.00 2.50 CSE-334
ROW → Tuple
Column → Attribute

PRIMARY KEY:
Primary Key → the attribute or set of attributes to uniquely
identify a tuple of a Relation.(Minimum)
Student(Student Id,Cgpa,Name,Course,Credit hr.)
Student(Student Id,Cgpa,Name,Course,Credit hr.)
Student(Student Id,Cgpa,Name,Course,Credit hr.)

Primary Key → {Student Id,Cgpa}


Student→ {Name,Student Id,Credit hr.,Cgpa,Course}
Teacher → {Name,Employee Id,Email,Address,Rank}
Teacher(Name,Employee Id,Email,Address,Rank)
Teacher(Name,Employee Id,Email,Address,Rank)
Teacher(Name,Employee Id,Email,Address,Rank)
Nishat Sultana Nusrat Sultana
710002097 710002098
nishat.cse@diu.edu.bd abc.cse@diu.edu.bd
Mohakhali Dhanmondi
Lecturer Lecturer

Super Key:

Ordered Items

Order Order Id Order Item Bill


Name Date
Aa 102X 2-1-2021 Glass 30$
Bb 103X 15-1-2021 Chain 40$
Aa 104X 16-1-2021 Watch 30$
Cc 102X 15-1-2021 Chain 60$
No unique attribute.
Super Key → {Order Name,Order Id}
Depositor(Name,Age,Address,Date,Amount)
Raihan
Raihan,50
Raihan,50,Mohakhali
Raihan,50,Mohakhali,15-05-2021

Candidate Key:

StudID Roll No First Name LastName Email

1 11 Tom Price abc@gmail.com

2 12 Nick Wright xyz@gmail.com

3 13 Dana Natan mno@yahoo.com

Candidate Key → {StudId,Roll No,Email,......}


No Repeated Attribute.
Primary Key → {StudId,Roll No}

Forgein Key: Referential Integrity


Student(Id,Name,Address)
Result(Id,Sgpa,Cgpa) _ _ _ _ _
Ordered Items→ {Order Name,Order Id,Order
Date,Item,Bill}
Forgein Key → {Order Id}
Order → {Order Id,Quantity,Delivery Date,Tax,Vat,Service
Charge}
CLASS WORK:
1. Find out the Primary,Super Key,Candidate Key & Forgein
Key from the following schemas,

University(Name,Id,Accreditation,Address,Ranking);
Employee(Name,Rank,Salary,Address,Email,Desk,univer
sityName);
Student(Name,Id,address,Courses,Result);
Result(Id,credit,sgpa,cgpa,PublishDate);

You might also like