Introduction to the relational model

12
1

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

Page 1: Introduction to the relational model

1

Page 2: Introduction to the relational model

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

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

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

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

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

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

Schema Diagram

8

Page 9: Introduction to the relational model

Relational Operational

9

Page 10: Introduction to the relational model

Relational Operational

10

Instructor relation (r1)

Department relation (r2)

Page 11: Introduction to the relational model

RELATIONAL ALGEBRA

11

Page 12: Introduction to the relational model

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