Database - siti nurbaya ismail

advertisement
CSC208
Management Infromation Systems
Introduction to Database
Siti Nurbaya Ismail
Faculty of Computer Science & Mathematics,
Universiti Teknologi MARA (UiTM), Kedah
| sitinurbaya@kedah.uitm.edu.my | http://www.sitinur151.wordpress.com |
| A2-3039 | ext:2561 | 012-7760562 |
Introduction to Database
1.1 Introducing Database
1.2 A Logical View Of Data
1.3 Primary & Foreign Keys
1.4 Relationship
1.1 Introducing The Database
Data and information
• Data?
– Raw facts
– Building blocks of information
– Examples:
• AHMAD
• 20011545789
• AM228
• CSC208
3
1.1 Introducing The Database
Data and information
• Information?
– Produce by processing data
– Reveal meaning of data
– Examples:
• 20011545789 is UiTM Student Number for Ahmad
who is currently studying in Faculty of Administrative Science &
policy StudiesUiTM Kedah and is register
for CSC208 (Management Information Systems) subject for
semester September 2012 – January 2013
4
1.1 Introducing The Database
Data and information
How do data and information relate?
5
1.1 Introducing The Database
A Glance of Database Concept
subject
student
register
subjectno
description
registerID
subjectNO
matrixNO
matrixNO
name
ITS232
Database
123
ITS232
2009451782
2009292768
Jefry
BEL123
Literature
124
ITS232
2009631908
2009631908
Farah
2009451782
Thohier
6
1.1 Introducing The Database
What is database?
Database
• A shared collection of integrated computer structure designed to meet
various needs of an organization.
–
It houses:
• End-user-data
• Metadata
: raw facts
: data about data
DBMS
 DataBase Management System
 A software that enable user to define, create, maintain and control access
to database
–
–
–
Possible to share data among multiple applications or users
Makes data management more efficient and effective
Examples:
• IBM DB2, MS Access, MySQL, ORACLE
7
1.1 Introducing The Database
What is database?
Create
Database
Retrieve
Data
DBMS
Create
Forms
allows
Sort Data
Create
Reports
8
1.1 Introducing The Database
What is database?
The importance of database:
•
•
•
•
•
Manage interactions between end users and database
Helps make data management more efficient and effective
Its query languages allows make quick answers to add-hoc queries
Provide end users better access to more and better managed data
Promote and integrated view of org’ operations big picture
9
1.1 Introducing The Database
What is database?
Advantages of database:
•
•
•
•
•
•
•
•
•
•
•
•
control of data redundancy
data consistency
more information from the same amount of data
sharing of data
improved data integrity
improved security
enforcement of standards
economy of scale
improved data accessibility and responsiveness
increased productivity
improved maintenance through data independence
improved backup and recovery services
10
1.1 Introducing The Database
What is database?
Disadvantages of database:
•
•
•
•
•
•
•
complexity
size (space)
cost of DBMS
additional hardware cost
cost of conversion
performance
higher impact of failure
11
1.2 A Logical View of Data
Table and Their Characteristics
• Table:
– two-dimensional structure composed of rows and columns
– Contains group of related entities = an entity set
12
1.2 A Logical View of Data
Table and Their Characteristics
Attribuite / Fields
Table
13
1.3 Primary and Foreign Keys
3.2 Keys: Types
Primary Key (PK)
• an attribute (or a combination of attributes) that uniquely
identifies any given entity (row)
Foreign key (FK)
• an attribute whose values match primary key values in the
related table
14
1.3 Primary and Foreign Keys
3.2 Keys: Types
Foreign Key
Primary Key
15
1.3 Primary and Foreign Keys
3.2 Keys: Types
Primary Key
Foreign Key
16
1.4 Relationship
(1:1) (1:m) (m:n)
• Relationship is a logical interaction among the entities in a relational
database.
• Operate in both directions
• There are 3 basic relationship in a database;
(1:1)
• one-to-one
• should be rare in
any relational
database
(1:m)
• one-to-many
• relational
modeling ideal
• should be norm in
any relational
database design
(m:n)
• many-to-many
• cannot be
implemented as
such in the
relational model
• m:n relationships
can be changed
into two 1:m
relationships
17
1.4 Relationship
(1:1) (1:m) (m:n)
1
m
18
1.4 Relationship
(1:1) (1:m) (m:n)
19
Download