Introduction to the relational model
-
Upload
putu-sundika -
Category
Education
-
view
296 -
download
3
description
Transcript of Introduction to the relational model
![Page 1: Introduction to the relational model](https://reader030.fdocuments.us/reader030/viewer/2022020115/54820ba2b07959520c8b46db/html5/thumbnails/1.jpg)
1
![Page 2: Introduction to the relational model](https://reader030.fdocuments.us/reader030/viewer/2022020115/54820ba2b07959520c8b46db/html5/thumbnails/2.jpg)
Intro to the Relational ModelDATABASE SYSTEM`[email protected]
References : Database System Concepts (Abraham Silberschatz, Henry F. Korth, S. Sudarshan)
![Page 3: Introduction to the relational model](https://reader030.fdocuments.us/reader030/viewer/2022020115/54820ba2b07959520c8b46db/html5/thumbnails/3.jpg)
Structure of Relational Databases
3
Instructors Table(information about instructor)
Relational Database consists of collection of tables with unique tables name
Column header(field or
attribute)
Courses Table(information about courses)
row (record)
![Page 4: Introduction to the relational model](https://reader030.fdocuments.us/reader030/viewer/2022020115/54820ba2b07959520c8b46db/html5/thumbnails/4.jpg)
Structure of Relational Databasesrelations refers to a tables, tuples refers to rows and attributes/fields refers to column of a table
4
![Page 5: Introduction to the relational model](https://reader030.fdocuments.us/reader030/viewer/2022020115/54820ba2b07959520c8b46db/html5/thumbnails/5.jpg)
Database Schema
5
Section relation
Department relation
Teaches relation
Instructor relation
Domain of attribute Null value
Relation Schema : Department (dept_name, building, budget) Teaches (id,course_id,sec_id,semester,year) Instructor (id,name,dept_name,salary) Section (course_id, sec_id, semester …)
![Page 6: Introduction to the relational model](https://reader030.fdocuments.us/reader030/viewer/2022020115/54820ba2b07959520c8b46db/html5/thumbnails/6.jpg)
Keys how tuples within a given relation are distinguished the values of the attribute values of a
tuple must be such that they can uniquely identify the tuple
Superkey one or more attributes that, taken collectively, allow us to identify uniquely a tuple in the relation ID attribute of the relation instructor
Candidate Key combination of NO candidate key such as name and dept_name is sufficient to distinguish {ID} and {name,dept_name} are candidate keys
Primary Key winner candidate chosen by programmer ID
6
![Page 7: Introduction to the relational model](https://reader030.fdocuments.us/reader030/viewer/2022020115/54820ba2b07959520c8b46db/html5/thumbnails/7.jpg)
Instructor relation (r1)
Foreign KeyA relation r1, may include among its attributes the primary key of an other relation, r2. This attribute is called a foreign key from r1, referencing r2.
The relation r1 is also called the referencing relation of the foreign key dependency, and r2 is called the referenced relation of the foreign key.
7
Department relation (r2)
![Page 8: Introduction to the relational model](https://reader030.fdocuments.us/reader030/viewer/2022020115/54820ba2b07959520c8b46db/html5/thumbnails/8.jpg)
Schema Diagram
8
![Page 9: Introduction to the relational model](https://reader030.fdocuments.us/reader030/viewer/2022020115/54820ba2b07959520c8b46db/html5/thumbnails/9.jpg)
Relational Operational
9
![Page 10: Introduction to the relational model](https://reader030.fdocuments.us/reader030/viewer/2022020115/54820ba2b07959520c8b46db/html5/thumbnails/10.jpg)
Relational Operational
10
Instructor relation (r1)
Department relation (r2)
![Page 11: Introduction to the relational model](https://reader030.fdocuments.us/reader030/viewer/2022020115/54820ba2b07959520c8b46db/html5/thumbnails/11.jpg)
RELATIONAL ALGEBRA
11
![Page 12: Introduction to the relational model](https://reader030.fdocuments.us/reader030/viewer/2022020115/54820ba2b07959520c8b46db/html5/thumbnails/12.jpg)
TUGAS KELOMPOK Rangkum materi hari ini dengan menggunakan kalimat sendiri
(untuk setiap kelompok) buat relation schema versi sendiri untuk :1. Facebook
2. Google Plus
3. Gmail
4. Yahoo Mail
5. Blogspot.com
6. Wordpress.com
7. Google Earth
8. Google Drive
9. DropBox
10. Youtube.com
11. Kaskus.com
12