Introduction to the relational model

Post on 05-Dec-2014

296 views 3 download

description

references : Database System Concepts (Abraham Silberschatz, Henry F. Korth, S. Sudarshan) .. brought to you by www.itmbali.com

Transcript of Introduction to the relational model

1

Intro to the Relational ModelDATABASE SYSTEM`putu.sundika@gmail.com

References : Database System Concepts (Abraham Silberschatz, Henry F. Korth, S. Sudarshan)

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)

Structure of Relational Databasesrelations refers to a tables, tuples refers to rows and attributes/fields refers to column of a table

4

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 …)

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

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)

Schema Diagram

8

Relational Operational

9

Relational Operational

10

Instructor relation (r1)

Department relation (r2)

RELATIONAL ALGEBRA

11

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