02.01 relational databases

4

Click here to load reader

Upload: bishal-ghimire

Post on 06-Jul-2015

32 views

Category:

Education


0 download

TRANSCRIPT

Page 1: 02.01 relational databases

B Y B I S H A L G H I M I R E

B I S H A L . G H I M I R E @ G M A I L . C O M

Relational Databases

Page 2: 02.01 relational databases

The Relational Model

More then 35 year old

Used by all major commercial database systems

Very Simple Model

Query with High-Level Languages: Simple yet expressive

Efficient implementation

Page 3: 02.01 relational databases

The Relational Model

Database = set of named relations ( or tables )

Each relation has a set of named attributes ( or columns )

Each tuple ( or row ) has a value for each attribute

Each attribute has a type ( or domain )

ID Name GPA

1001 Ram 3.5

1002 Sita 3.8

ID Name City

101 LBF KTM

102 ICA PKR

Students Colleges

Page 4: 02.01 relational databases

The Relational Model

Schema Structural description of relations in database

Instance Actual Contents at given point in time

NULL Special Value for “unknown” or “undefined”

Key Attribute whose value is unique in each tuple

OR Set of attributes whose combined values are unique

E.g.- CREATE TABLE Student ( name STRING, GPA integer)