Anda di halaman 1dari 3

This series of lectures introduces:

Lecture 1
• Enhanced Entity Relationship (EER) Data Model
• Methods to describe a universe of discourse (a
business area) using the EER Data Model
Database Design and Data • The Relational Data Model
Modelling - an Overview • Mapping of an EER design onto a Relational
Database Implementation
• How to describe and manipulate a relational
database using the Structured Query Language
Week 1 (SQL).
• Principles of good database design
© 2010 Griffith University 1 © 2010 Griffith University 2

Questions you should be able to Possible answers


answer after you studied this module
• Use the (Enhanced) Entity Relationship
• How can information (e.g. about an enterprise) Model to represent data (or IDEF1x, UML,
be represented ? EXPRESS,...)
• What languages can be used for this task? • Use the Relational Data Model to represent
• How to manipulate this information (store and data (or OO, XML,…)
retrieve it) ? • Use SQL (Structured Query Language) for
• What standards exist? describing and manipulating data (or
OSQL,…)
© 2010 Griffith University 3 © 2010 Griffith University 4

Information or Data?
The Universe of Discourse
(UoD) • Data: facts
• The UoD is that domain of the enterprise • Information: interpreted data (what element
about which information is to be stored in of news is carried by the data)
the database (accounting, personnel, • Databases store data but users interpret the
materials management, scheduling, product retrieved data and it becomes information
catalog, customers...etc) (for them)

© 2010 Griffith University 5 © 2010 Griffith University 6

1
Example Entity Relationship Relation schema
Diagram Relation name
CUSTOMER Attributes
name address
customer Holds account
ACCOUNT
number balance
name address number balance
CUST_ACCT
name number

© 2010 Griffith University 7 © 2010 Griffith University 8

Relation instance Databases can be queried using

CUSTOMER • Relational calculus


name address • Relational algebra
J smith 22 high st tuples • SQL
M hari 77 danger st
G grant 33 low st

Attribute values

© 2010 Griffith University 9 © 2010 Griffith University 10

Relational calculus Relational algebra


The query The query

“Show names and addresses of customers “Show names and addresses of customers
with balances > $10,000” with balances > $10,000”

can be expressed as: can be expressed as:


Tuple variables Conditions

{ u, v | customer (u,v) ∧ account (x,w) ∧ Π name,adress (σbalance>10000 (customer * account * cust_acct) )


cust_acct (u,x) ∧ w >10000 }

© 2010 Griffith University 11 © 2010 Griffith University 12

2
SQL
The query
“Show names and addresses of customers
with balances > $10,000”
The End
can be expressed as:
SELECT name, address
FROM customer c , account a, cust_acct ca
WHERE
c.name = ca.name AND
ca.number = a number AND
a.balance >10000;
© 2010 Griffith University 13 © 2010 Griffith University 14

Anda mungkin juga menyukai