0% found this document useful (0 votes)
10 views2 pages

Lab4

Uploaded by

Abc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Lab4

Uploaded by

Abc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

TDB1131 Database Systems

Tutorial 4
Topic: Developing ERD

1. What is a multivalued attribute? Give one example. Then, explain two methods to
implement a multi-valued attribute in a relational database.

2. What two conditions must be met before an entity can be classified as a weak entity?

3. Draw an entity relationship diagram (ERD) (crow’s foot and Chen’s model each) to
represent this business rule.
“A customer can make many payments, but each payment is made by only one customer.”

4. Draw a conceptual model for Deal Co by using Crow’s foot notation. One region can be
the location for many stores. Each store is located in only one region. Each store employs
one or more employees. Each employee is employed by one store. However, an employee
cannot work in more than one store at a time. A job -- such as accountant or sales
representative -- can be assigned to many employees. (For example, one would reasonably
assume that a store can have more than one sales representative. Therefore, the job title
“Sales Representative” can be assigned to more than one employee at a time.) However,
each employee can have only one job assignment at a time.

Lab 4: Hands-on exercise

1. Create “Orders” table in “Lab20” database. Then, insert this record into “Orders”
table. Use AUTO_INCREMENT for Customer ID.

Customer Customer Day of Product Quantity


ID order
1 Tizag 8th January Pen 4
2019
2 George 15th June Pencil 12
2019
3 Janice 5th Eraser 2
February

To do:
i) Please check the date format of MySQL before you insert the date.
ii) Define the auto increment syntax of Microsoft SQL server and Oracle.

2. View all records in “Orders” table.

3. Change the order of your attributes. Notice the difference in the displayed result.

4. SELECT by setting condition.


i) SELECT the customer named Tizag.

1
TDB1131 Database Systems

ii) SELECT the records with purchase quantity less than 5.


iii) Delete record with customer named George from orders.

EXTRA ACTIVITIES

(a) Given the following business rules, identify the needed entities and draw the ERD by using
Crow’s foot notation.
 A trainee can take more than one class, and each class contains many (ten or more)
trainees, so there is a M:N relationship between TRAINEE and CLASS. (Therefore, a
composite entity is used to serve as the bridge between TRAINEE and CLASS.)
 A class is taught by only one instructor, but an instructor can teach up to two classes.
Therefore, there is a 1:M relationship between INSTRUCTOR and CLASS.
 Finally, a COURSE may generate more than one CLASS, while each CLASS is based on
one COURSE, so there is a 1:M relationship between COURSE and CLASS.

Quotes of the day:

"I didn't get there by wishing for it or hoping for it, but by working for it." -Estée Lauder

You might also like