2. Intro to the
Relational Model
DATABASE SYSTEM`
putu.sundika@gmail.com
References : Database System Concepts (Abraham Silberschatz, Henry F. Korth, S. Sudarshan)
3. Structure of Relational Databases
Relational Database consists of collection of
tables with unique tables name
Column
header
(field or
attribute)
Instructors Table
(information about instructor) row (record) Courses Table
(information about courses)
3
4. Structure of Relational Databases
relations refers to a tables, tuples refers to rows and attributes/fields refers to column of a table
4
5. Teaches relation
Department relation
Database Schema
Section relation
Relation Schema :
Department (dept_name, building, budget) Instructor relation
Teaches (id,course_id,sec_id,semester,year)
Instructor (id,name,dept_name,salary)
Section (course_id, sec_id, semester …)
Domain of attribute
Null value
5
6. 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
7. Foreign Key
A 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.
Department relation (r2)
Instructor relation (r1)
7
12. 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