You are on page 1of 16

DATABASE MODEL

Mirza Asher Baig


HISTORY OF DATA MODELS

 Network Model
 Hierarchical Model
 Relational Model
 Object Oriented Model
 Data Models
 Object Relational Models

Present by Mirza Asher Baig


Present by Mirza Asher Baig
DATA MODELS

Hierarchical structure
 Records are arranged in multilevel with one root and any number of
subordinate levels. Thus all relationships are one-to- many.

Network structure
 Data can be accessed through many paths.

Relational structure
 Data stored in the database in viewed the form of simple tables.

Object-oriented
 It is a key technology to web-based multimedia applications where
data stored in the form of objects.

Present by Mirza Asher Baig


RELATIONAL DATABASE MODEL
(RDBMS)

 Stores both
 Data about real
world objects
(entities) in tables
 Relationships
between the tables
RELATIONAL DATABASE

 Fields (columns) in the


table store attributes.
 Each attribute has a specific
domain.
 Tuples (or records or rows)
in the table store
information.
 Each tuple is a unique instance
of an object.
 Tables are composed of a
set of tuples.
 A table is also called a relation.
TERMS

 Table
 A collection of relevant data relating to one type of real world objects.
 Column
 A specific place for one type of data relating to one type of real world
objects.
 Domain
 Set of all possible values for a specific column.
 Row
 Collection of data describing one real world object.
 Primary Key
 Columns, which are part of the row and uniquely identify any one row.
 Foreign Key
 A foreign key is generally a primary key from one table that appears as a
field in another where the first table has a relationship to the second
Present by Mirza Asher Baig
RECORDS

 Each record represents a logical entity (e.g. a


student)
 Each field represents an attribute of the logical
entity
Student
ID Last First Grade Class
1 Wood Bob C IST357
2 Kent Chuck B IST115
3 Smith Jane A IST357
4 Boone Dan B IST357

Present by Mirza Asher Baig


KEYS

 Each table has a primary key, one field (or a combination of


fields) that has a unique value for each and every record in
the table

Student
ID Last First Grade Class
ID is the primary key 1 Wood Bob C IST357
in this table (two
students may share 2 Kent Chuck B IST115
either a last or first 3 Smith Jane A IST357
name)
4 Boone Dan B IST357

Present by Mirza Asher Baig


RELATING TABLES

 Tables can be related (joined) together based on their keys


 The idea is to decompose into separate tables with no redundancy and
to provide a capability to reassemble with no information loss

Student
Class
ID Last First Grade Class
Name #Stud Instructor
1 Wood Bob C IST357
IST357 48 Jones
2 Kent Chuck B IST115
IST115 120 Brower
3 Smith Jane A IST357
IST20 120 Fountain
4 Boone Dan B IST357

Present by Mirza Asher Baig


RELATING TABLES
Primary key Foreign key Primary key

Student
Class
ID Last First Grade Class
1 Wood Bob C IST357 Name #Stud Instructor
IST357 48 Jones
2 Kent Chuck B IST115
IST115 120 Brower
3 Smith Jane A IST357
IST20 120 Mennis
4 Boone Dan B IST357

Present by Mirza Asher Baig


Present by Mirza Asher Baig
RELATING TABLES

Student
ID Last First Grade Class Class
Name #Stud Instructor
1 Wood Bob C IST357
IST20 120 Brower
2 Kent Chuck B IST115
IST115 120 Jones
3 Smith Jane A IST357
IST357 48 Jones
4 Boone Dan B IST357

Instructor
Name Office
Jones 332
Brower 517
Present by Mirza Asher Baig
RDBMS FEATURES

 Data Definition Language (DDL)


 Data Manipulation Language
(DML)
 Integrity Constraints
 Transaction Management
 Security
 Tuning of Storage

Present by Mirza Asher Baig


RELATIONSHIPS

 Link between entities.


 A relationship may
define constraints.
.
ADVANTAGES OF RDBMS

 Eliminate unnecessary duplication of data


 Enforce data integrity through constraints
 Changes to conceptual schema need not affect
external schema
 Changes to internal schema need not affect the
conceptual schema
 Many tools are available to manage the database

Present by Mirza Asher Baig

You might also like