Professional Documents
Culture Documents
Introduction to Database
What is data?
Examples:
Banking: all transactions
Airlines: reservations, schedules
Universities: registration, grades
Sales: customers, products, purchases
Manufacturing: production, stocking, orders
Human resources: employee records, salaries, ..……
Scientific data such as biology, etc.
Spatial data such as maps, travel networks,
E-commerce : Amazon.com, etc.
?
Why Study Databases??
Lack of Integration –
data stored in
separate files
hard to combine data
Data Dependence –
changing the file format requires changing the program…
Database Management Approach
Consolidates data records into one CENTRAL
database that can be accessed by many different
application programs.
Advantages of databases
Each column within a table defines the fields, while each row defines the
records.
For examples information about employees can be held in one table, while
Customers Products
CID FName LName Address PID Description Cost
508 Eric Breimer ... 199 vitamin c $45.99
509 Andrew Zych ... 200 Tooth Paste $2.58
510 Greg Smith ... 201 Hair Gel $5.99
Databases
But, databases are not just a set of tables
Orders
OID CID PID Quantity
001 508 199 500,000
002 508 201 2
003 510 201 1
Customers Products
CID FName LName Address PID Description Cost
508 Eric Breimer ... 199 vitamin c $45.99
509 Andrew Zych ... 200 Tooth Paste $2.58
510 Greg Smith ... 201 Hair Gel $5.99
EMPLOYEES
Record
SALARIES DEPARTMENTS
DEPARTMENTS PROFESSORS
COURSES STUDENTS
Faculty Student
One to Many
Student
Examples?
Advises
Analysis Technique
Get Advisement
Consider ThingA and ThingB
Can ThingA be related to more than one ThingB?
Can ThingB be related to more than one ThingA?
If only one answer is yes, then you have a one to many
relationship
student takes course
Types of Relationships Student
Course Student
Student
Many to Many Course
Examples? Student
Microsoft Access provides several data types for the fields of database
tables, some examples of these types are:
Text
Number
Date/Time
Currency
Auto Number
OLE Object
Hyper Link
Look UP Wizard
Type of Database Relationships
The term one of the relation types refers to that the field is
primary key in its table, while the term many refers to that the
field is not primary key.
EX1: Determine the relationships and its types between the
following fields:
EMPLOYEES
Record
SALARIES DEPARTMENTS
Record
One-to-One relationship
1 ∞
One-to-Many relationship
1 SALARIES 1 DEPARTMENTS
DEPARTMENTS PROFESSORS
COURSES STUDENTS
DEPARTMENTS PROFESSORS
1 one-to-many relationship ∞ ∞
one-to-many relationship
1 COURSES STUDENTS
1 ∞
End