L3 RelationalModel
L3 RelationalModel
DBMS Team
Bindu K R
Ms. Anisha Radhakrishnan
Ms. Uma J
Mr. Chakravartula Raghavachari
Department of CSE
Amrita School of Computing
Syllabus
19CSE202
2
19CSE202 DBMS Dept of CSE, Amrita School of Computing, Coimbatore
Brief Recap of Previous Lecture
❑ Database Abstraction
❑ Instances and Schemas
❑ Data Models
❑ Database Users
3
19CSE202 DBMS Dept of CSE, Amrita School of Computing, Coimbatore
Today’s Lecture
4
19CSE202 DBMS Dept of CSE, Amrita School of Computing, Coimbatore
Introduction
6
19CSE202 DBMS Dept of CSE, Amrita School of Computing, Coimbatore
Relational Database: Definitions
sid name login age gpa
53666 Jones jones@cs 18 3.4
53688 Smith smith@eecs 18 3.2
53650 Smith smith@math 19 3.8
❑ #Rows = cardinality=?
❑ #Rows = cardinality=3
❑ #fields = degree / arity=5
❑ All rows are distinct
tuples
(or rows)
❑ Relational DB is a collection of Tables
or Relation.
❑ E.g. Instructor Table.
• Course Table/Relation
❑ Four columns/attributes
❑ Is it Atomic domain?
Answer: Yes
❑ Why? – each element in this domain is single value ie., indivisible.
17
Concepts underlying Relational Model -
Database schema Vs Database Instance. Database Instance
Database Schema
18
Concepts underlying Relational Model -
relation Schema Vs relation instance
Relation Schemas Relation Instance
● Instance – changes.
● Schema – does not.
20
Let us proceed further with University Database
21
University Database – Relation Schemas
22
University Database – Relation Instances department
instructor course prerequisite
…
Dept. of CSE., Amrita School of Engineering, Coimbatore 23
Relation Schema and Instance
● If A1, A2, …, An are attributes
● Formally, given sets D1, D2, …. Dn which are the domains A1, A2, …, An, a
relation r is a subset of D1 x D2 x … x Dn.
❑ Super Key
❑ Candidate Key
❑ Primary Key
❑ Foreign Key
Dept. of CSE., Amrita School of Engineering, Coimbatore 26
Superkey
❑ Let K R
❑ K is a superkey of R if values for K are
sufficient to identify a unique tuple of each
possible relation r(R)
teaches
19CSE202 DBMS Dept of CSE, Amrita School of Computing, Coimbatore 33
Referential Integrity Constraints
❑ The constraint from section to teaches is an example of a referential integrity constraint.
❑ A referential integrity constraint requires that the value appearing in the specified attributes of any
tuple in the referencing relation also appears in specified attributes of at least one tuple in the
referenced relation.
○ Keys
○ Schema Diagrams
○ Relational Operations
36
Schema Diagram
● The database schema and its keys can be visualized in Schema Diagram.
Company database
37
Summary
❑ Structure of Relational Databases
❑ Keys
❑ Schema Diagrams
❑ Relational Algebra
⮚ https://docs.oracle.com/en/database/oracle/oracle-
database/20/newft/new-features.html
⮚ https://www.pda.org/scientific-and-regulatory-
affairs/regulatory-resources/data-integrity
⮚ https://www.digipay.guru/blog/all-you-need-to-know-
about-agency-banking/
⮚ https://md.ekstrandom.net/teaching/cs4332-f15.pdf
⮚ https://https://bit.ly/31eE2Ar
⮚ https://ipronline.com/oracle-the-pioneers-of-the-software-
world/
40
Thank You
41