Professional Documents
Culture Documents
What is a database ?
1. A database is a set of data which are modifiable and accessible by a computer program.
text, image, voice, structured information.
2. A database is a set of data which are . structured . integrated . non-redundant . shared
It is a source of data for a large number of different applications and for a variety of users.
Data Elements
Employee database
Payroll file Remunerations
Employee record1
Employee record2
Employee record3
Employee record4
Name SSN Salary Name SSN Salary Name SSN Salary Name SSN Salary
Field
represents an attribute of an entity
Record
Set of attributes that describe an entity
File
set of records of the same type transaction file, archive file, ...
Database
integrated set of logically related files and the rules they have to satisfy
Database
Employee database
Payroll data
Person data Training data
What Is a DBMS?
A Database Management System (DBMS) is a software package designed to store and manage databases.
Database Management
User Inquiry
Request
Applications
Corporate database
Text: OBrien : p. 146
Example
CARS (model, #cylinders, origin, tax, fee) Model #cyl origin tax fee -----------------------------------------------------Rabit 4 Germany 15 30 Mustang 6 USA 0 45 Mirafiori 4 Italy 18 30 Accord 4 Japan 20 30 Cutlass 8 USA 0 60 Laguna 4 France 20 30 BMW 6 Germany 15 45 Velsatis 6 France 20 45 Velsatis 4 France 20 30 Origin tax #cyl fee
Data Dictionary
Dictionary Access
Database Inquiry
Query Languages
SQL
Select Name, department, salary From Employee, Payroll Where Employee.number = Payroll.number and Function = Analyst. Employee Name number num number num function Analyst department salary
Payroll
DBMS
User interface
Query language
Report generator
DBMS utilities
Application generators
Data-dictionary programs
Characteristics of databases
Redundancy
. storage cost . multiple update needed
. inconsistency possible
Data independence
The degree on which data structures can be modified without affecting the related programs Solution : Database architecture with three levels ( conceptual, internal , external )
Types of Databases
Data Warehouses
contain historical data from various operational and external databases central source for standardized and integrated data for management and users data mart is a limited version for a specific subject used for data mining
Types of Databases
(2)
Distributed databases
mostly for local needs, can be copies consistency problems distributed over servers related, eventually via WWW or intranet
External databases
often access charge statistical , bibliographical
Types of Databases
Client-PC or NC
(3)
External databases
Distributed databases
Network server
Operational databases
End-user databases
Text: OBrien : p. 151
Datawarehouse
Management databases
WEBbrowser
Web-server software
Client-PC or NC
Network server
Hypermedia database
Database Administration
Benefits of a DBMS
reduces data redundancy and integrates data data accessible from all programs programs not dependent on data format query/answer and reporting facilities easier application development and programming better integrity and security
Limitations of a DBMS
increased complexity of the technology development of large databases is difficult and expensive slower than file management systems due to additional layer more sensible for fraud, errors and failures
Employee 1
Text: OBrien : p. 158
Employee 2
Department A
Department B
Employee 1
Employee 2
Employee 3
Project A
Text: OBrien : p. 158
Project B
Relational Structure
Department D# D1 D2 D3 D4 D5 Employee DName location Manager
D#
D1 D1 D2 D3 D3
Inheritance
Attributes number of withdrawals Quarterly statement Operations calculate interest print quarterly statement
EXTRA
Technical aspects
Files
Physical Logical
A
B C
E A D
1 inquiry
Accessibility Evolution
Database
type
Employee
Number STUDIES Diploma year Name City
occurrence
12 Duval Rome 16 Krols Dublin 38 Smets Berlin
Supplier file
SNUMBER S1 S2 S3 S4 S5
STATUS 20 10 30 20 30
City-index
Athens . London . London .
Paris
Paris
.
.
STATUS 20 10
Status-index
. . . . . 10 20 20 30 30
S1 S2
De Smet Janssens
London .
Paris Paris . .
S3
S4 S5
Blanchart
Clark Adams
30
20 30
Paris
London Athens
Non-dense index
Supplier file
S2 . S4 . S5 .
STATUS 20 10 30 20 30
data blocks
Ace Adams
Bodoo
Sample file
Supplier file
SNUMBER S1 S2 S3 S4 S5 SNAME De Smet Janssens Blanchart Clark Adams STATUS 20 10 30 20 30 CITY London Paris Paris London Athens
7 Adams 30 Athens
9 S100 De Smet 11 Clark 20 London
S500
8
20 London
10 S400 12
Database Development
1.Data Planning 2. Specification gathering 3. Conceptual design
4. Physical design
5. Logical design
Text: OBrien : p. 164
Data Modeling
Entity-relation diagram EMPLOYEE
SUPERVISED by
Allocated
MANAGER
COMPANY CAR
STAFFER
Authorizes
FREELANCER
Text: OBrien : p. 165
submits
INVOICE
Assignment
The university that has to keep track of student transcripts could use a database structured as follows. Student(Student Number - Last name - First name - SSSN - Street - Nr - Zip Code - City - State - Country - Phone Number - Birth Date - Gender Class - Major - Minor)
Example
Drivers having a driver-no , a name , a home address and a birthdate take out vehicles to make deliveries. A vehicle ( with a unique id-number ) may be taken out of a depot whenever available and kept out for any length of time . It is possible for a vehicle to be taken out more than once on a given day by any driver . Each time a driver takes out a vehicle , he or she takes out a load made up of any quantity of any number of item types , identified by an item-number. Every time a vehicle is taken out , the driver can incur expenses of allowed type (e.g. fuel cost ). Each expense type has a code-no. The amount and code-no are recorded each time an expense is incurred . Any number of stops can be made during the trip . An address of the stop is recorded for each stop , together with the quantity left on that stop for each item type . A driver stops at an address only one during a trip . However, stops can be made at the same address on different trips.