You are on page 1of 19

Topic 04

Data Modeling Part 3- practical

Ivana Štrumberger, MSc


istrumberger@singidunum.ac.rs
Faculty of Technical Sciences, Singidunum University
Database Systems
2019/20
Notation used in presentations

▪ Each assignment follows topics from lecture presentations.

▪ Assignments within each topic are divided into Exercises (Exercise 1,2,3
etc.) and Solutions (Solution 1,2,3 etc.).

▪ Important terms are given in this type of textbox.

▪ SQL code is given in this type of textbox.

Note
▪ Notes and remarks are given in callouts like this

2
3

Exercise 1
• Review the following ERDs and show a pair of tables with sample data of
the online bookstore scenario:
4

Solution Exercise 1

Table: Books

Table: Authors
5

Solution Exercise 1

Table: Books

Table: Publishers
6

Exercise 2
• Review the relationships among STUDENT DETAILS, STUDENT COURSE
DETAILS and COURSE DETAILS in the academic database and show a pair
of tables with sample data.
7

Solution Exercise 2
8

Exercise 3
• Review the relationship between COURSE DETAILS and DEPARTMENT in
the academic database and show a pair of tables with sample data.
9

Solution Exercise 3
10

Exercise 4
• Review the scenario below. Identify the conceptual model and the
physical model from the scenario.

“Zoe was about to go into a store to purchase drinks for the birthday party
scheduled for that evening. Zoe knows that she needs drinks for 48 people
and is expecting the store to accept a check for payment and to provide her
with some assistance carrying the product to her car. Zoe wants to have
carbonated drinks, non-carbonated drinks, and sugar free drinks. She is
expecting to purchase eight six-packs. Zoe enters the store and discovers the
entire drink distribution system is automated. She also discovers that the
drinks come in varying package sizes and that she must choose the correct
vending option for the products to be disbursed. Drinks are packaged in four-
packs, six-packs, and ten-packs.”
11

Solution Exercise 4

• Conceptual model – Selecting products, providing a check for payment to


a person, and having a person assist with carrying the products out of the
store.

• Physical implementation – Automated vending system requiring payment


for each product distributed. No one available to assist with carrying the
products out of the store.
12

Exercise 5
• Identify the vocabulary word for each definition below.
13

Solution Exercise 5
14

Exercise 6
• Read the business scenario of a fast-food restaurant below:

“We are a small fast food business. Our menu features food items that can be
ordered by a customer. A customer places an order at the counter and
indicates what food items he/she would like on that order. Lately we've
noticed that we have some regular customers, so we started asking them for
information -- such as name and address, so we can mail them coupons when
we have specials.”

a. Using the restaurant entities ORDER, FOOD ITEM, AND CUSTOMER, identify
the attributes for each entity.

b. Where possible, indicate whether the attribute is mandatory or optional.

c. Where possible, pick out the UIDs for each entity.


15

Solution Exercise 6
a. Using the restaurant entities ORDER, FOOD ITEM, AND CUSTOMER,
identify the attributes for each entity.

ORDER: OrderNumber (or ID), Date, Time, NameF


FOOD ITEM: NameF (or ID), Type, Calories, Price
CUSTOMER: CustomerID, Name, Address, DateofBirth, Email

b. Where possible, indicate whether the attribute is mandatory or optional.

ORDER: #OrderNumber (or ID), oDate, oTime, *NameF


FOOD ITEM: #NameF (or ID), *Type, oCalories, *Price
CUSTOMER: #CustomerID, oName, oAddress, oDateofBirth, oEmail

c. Where possible, pick out the UIDs for each entity.


ORDER: #OrderNumber (or ID), CUSTOMER: #CustomerID
FOOD ITEM: #NameF (or ID),
QUESTIONS?

16
References
1. Oracle Academy courseware (Database Foundations and Database
Design and Programming with SQL), 2015.
2. Burleson, K. D., Physical Database Design Using Oracle (Foundations of
Database Design), 1st Edition, Auerebach Publications, 2006, p. 247.

17
IMPORTANT NOTICE!
Ova prezentacija je nekomercijalna.
Slajdovi mogu da sadrže materijale preuzete sa Interneta, stručne i naučne
građe, koji su zaštićeni Zakonom o autorskim i srodnim pravima. Ova
prezentacija se može koristiti samo privremeno tokom usmenog izlaganja
nastavnika u cilju informisanja i upućivanja studenata na dalji stručni,
istraživački i naučni rad i u druge svrhe se ne sme koristiti –
Član 44 - Dozvoljeno je bez dozvole autora i bez plaćanja autorske naknade za nekomercijalne svrhe nastave:
(1) javno izvođenje ili predstavljanje objavljenih dela u obliku neposrednog poučavanja na nastavi;
- ZAKON O AUTORSKOM I SRODNIM PRAVIMA ("Sl. glasnik RS", br. 104/2009 i 99/2011)
.................................................................................................................................................................................
Ivana Štrumberger
istrumberger@singidunum.ac.rs

18
Topic 04
Data Modeling Part 3- practical

Thank you for attention!


Ivana Štrumberger, MSc
istrumberger@singidunum.ac.rs
Faculty of Technical Sciences, Singidunum University
Database Systems
2019/20

You might also like