Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Database
CSC3064
Database Engineering
Types of database
Database Schema
Database models
Lecture 1
Muthu
muthma@sunway.edu.my
Data
Meta data
Metadata describes how and when and by whom a
particular set of data was collected, and how the data
is formatted.
Information
Data management
What is a database?
Database organization
Advantages of DBMS
queries.
10
Types of Databases
DBMS Facilities
Data Manipulation Language
has a central repository for all data and data descriptions
provides inquiry facilities to this data called a query
language.
Data Definition Language
allows users to specify the data-type and structures, and
the constraints on that data to be stored in the database
Single-user database
Desktop database
Multi-user database
Workgroup database
Enterprise database
11
12
Database Design
at a single site.
transactions
data-redundancy.
13
Schema
14
Database Schema:
The description of a database.
Includes descriptions of the database structure,
data types, and the constraints on the database.
Distinction
The database schema changes very infrequently.
The database state changes every time the database is
updated.
15
16
17
Three-Schema Architecture
18
Three-Schema Architecture
Defines DBMS schemas at three levels:
Internal schema at the internal level to describe physical
storage structures and access paths (e.g. indexes).
19
20
Data Independence
Logical Data Independence:
The capacity to change the conceptual schema
without having to change the external schemas and
their associated application programs.
Physical Data Independence:
The capacity to change the internal schema without
having to change the conceptual schema.
For example, the internal schema may be changed
when certain file structures are reorganized or new
indexes are created to improve database performance
21
Business rules
22
Business rules
Examples
A customer may generate many invoices.
training to be scheduled
23
24
Hierarchical Model
25
26
Hierarchical Model
types
DEPARTMENT
DEPTNO DNAME LOCATION
EMPLOYEE
EMPNO ENAME YEARS
DEPENDENT
DNAME AGE
SKILL
CODE SNAME NOYEARS
27
28
Relational Model
table.
DEPARTMENT
DEPT-EMP
DEPT-PROJ
PROJECT
EMPLOYEE
EMPNO ENAME YEARS
PROJNO DESCRIPTION
PROJ-EMP
user or designer.
A table is a matrix made up a series of row and columns.
29
30
Relational Model
Structural Independence
Bno.
Street
location
PostCode
TelNo.
B1
22, Oxley Rd
Central
589652
67894561
B2
South
548796
67896325
B3
East
585698
67665892
B4
West
526478
68875425
Powerful DBMS
Fname
Lname
Position
Salar
y
Sex
Bno
S11
John
Doe
Manager
5000
B1
S12
Stella
Chan
Clerk
1800
B3
S14
Muthu
Ramasam
y
Senior Exec
3200
B3
Sno.
31
32
Object-oriented Model
Substantial overhead
Can facilitate poor design and implementation
33
34
Database integrity
occurrence of an entity.
35
36
37
Tables
39
40
Table characteristics
Table - example
Bno.
Street
location
PostCode
Tel No.
B1
22, Oxley Rd
Central
589652
67894561
B2
South
548796
67896325
B3
East
585698
67665892
B4
West
526478
68875425
42
41
Relational Keys
Relational Keys
one attribute.
43
44
Integrity rules
Entity integrity
Referential integrity
45
46