0% found this document useful (0 votes)
113 views8 pages

ERD NORMALISATION ACCESS QUESTIONs

The document outlines exercises for designing data models for various scenarios including a company database, university database, and hospital database, focusing on entity-relationship diagrams and normalization. It also includes practical exercises for creating and managing databases using Microsoft Access, with tasks such as creating tables, queries, and reports. Additionally, there are sections on composite and multivalued attributes, and normalization exercises to ensure data integrity.

Uploaded by

7gzghxjcxz
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)
113 views8 pages

ERD NORMALISATION ACCESS QUESTIONs

The document outlines exercises for designing data models for various scenarios including a company database, university database, and hospital database, focusing on entity-relationship diagrams and normalization. It also includes practical exercises for creating and managing databases using Microsoft Access, with tasks such as creating tables, queries, and reports. Additionally, there are sections on composite and multivalued attributes, and normalization exercises to ensure data integrity.

Uploaded by

7gzghxjcxz
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/ 8

BIT 121: DATA AND INFORMATION MANAGEMENT

CLASS EXERCISE
DATA MODELS
Design a conceptual, a logical and a physical data model for the following scenarios. Specify key attributes of each
entity type and structural constraints on each relationship type. Note any unspecified requirements, and make
appropriate assumptions to make the specification complete. Additionally, specify the data structures, data types etc.
using a database technology of your choice.

1. The COMPANY database keeps track of a company’s employees, departments, and projects. Suppose that, after the
requirements collection and analysis phase, the database designers stated the following description of the
company to be represented in the database:
a. The company is organized into departments. Each department has a unique name, a unique number, and a
particular employee who manages the department. We keep track of the start date when that employee began
managing the department. A department may have several locations.
b. A department controls a number of projects, each of which has a unique name, a unique number, and a single
location.
c. We store each employee’s name, NRC number, address, salary, gender, and birth date. An employee is
assigned to one department but may work on several projects, which are not necessarily controlled by the
same department. We keep track of the number of hours per week that an employee works on each project.
We also keep track of the direct supervisor of each employee.
d. We want to keep track of the dependents of each employee for insurance purposes. We keep each dependent’s
first name, gender, birth date, and relationship to the employee.
2. Consider the following set of requirements for a university database that is used to keep track of students’
transcripts.
a. The university keeps track of each student’s name, student number, NRC number, current address and phone,
phone, birthdate, gender, class, and department name. Both NRC number and student number have unique values
for each student.
b. Each department is described by a name, department code, office number, office phone, and college. Both
name and code have unique values for each department.
c. Each course has a course name, description, course number, number of semester hours, level, and offering
department. The value of course number is unique for each course.
d. Each section has an instructor, semester, year, course, and section number. The section number distinguishes
sections of the same course that are taught during the same semester/year; its values are 1, 2, 3, . . ., up to the
number of sections taught during each semester.
e. A grade report has a studentnumber, section, letter grade, and numeric grade (0, 1, 2, 3, or 4).
3. A manufacturing company produces products. The following product information is stored: product name,
product ID and quantity on hand. These products are made up of many components. Each component can be
supplied by one or more suppliers. The following component information is kept: component ID, name,
description, suppliers who supply them. The Supplier information kept is Supplier ID, Supplier Name, contact
number, location.

Page 1 of 8
Entity-Relationship diagrams
1. Consider the following scenario:
A school is looking at creating a database to keep their information safe and in one place. This
school has pupils of which their names, PID, address, guardian’s names and name of grade are
kept. Pupils are assigned to a particular grade of which the name of grade, teacher_ID, room_No,
are kept. Teacher_ID, name, gender, qualification and date of birth are needed about teachers. A
teacher can only teach one grade at any given time. The headmaster has a name, ID and
qualification. All teachers report to the headmaster. All pupils must participate in at least one sport
in order to help them keep physically fit. Name, PID, trainer and teacher_ID is data kept about
sports. The school has a school bus which takes some pupils to and from home to school. Model,
PID, reg_No, driver and route are some of the information needed about the bus. The headmaster
oversees the overall management and running of all school activities (teachers, pupils, sports, etc).
a) Create an entity relationship diagram from the above information, clearly showing the
cardinalities and ordinalities.

2. Consider the following scenario:

A hospital in a certain city has started receiving more patients everyday due the increase in
population in the area. Due to this, they have decided to create a database. The hospital has doctors
who are identified by their DocID, Dname, speciality, Pnumber and university_attended. Age,
Pname, Pnumber, DocID, testID, wardNo and address are kept about patients. A doctor sees many
patients while working within his/her shift, which is identified by time, DocID and supervisor. All
patients have to undergo tests which are identified by testID, nurseID and type. Patients are
sometimes admitted in a ward of which the wardNo, Wname, number_of_beds and nurse_on_duty
are kept. Nurses are always on hand to help with smooth running of the hospital by working in
different shifts. Nurses may carry out tests which are done in the laboratory and sometimes work
in the wards. Name, nurseID, wardNo, testID and time are kept about nurses. There are many
laboratories at the hospital that are identified by labNo, nurseID and type. Doctors may oversee
the overall running of the laboratories.

Page 2 of 8
a) Draw an entity relationship diagram for the information above clearly showing the
cardinalities and ordinalities.
3. The organisers of the ICT4D conference which is held every year in Uganda, need to keep track
of a large collection of workshops associated with the event. Initial requirements analysis brings
out the following information about what needs to be recorded.
• Each workshop has a name, and happens on a particular date — or dates, as some workshops
last more than one day.
 Each workshop must have an identified organiser among the conference participants
• There are several participants, each of which may sign up to one or more workshops. Every
participant must register for at least one workshop.
• For each participant, it is important to record their name, ID number, email address, and the
workshops which they wish to attend.
• There are a number of meeting rooms at the conference venue, each of a fixed capacity.
Meeting rooms are identified by a roomID which is a combination of the floor and room
number.
• Every workshop needs an allocated meeting room; where a workshop lasts for two days, it
will use the same room on both days.
 All the meeting rooms should be maintained by two cleaners, twice a day. Details such as their
full name (first name and surname), employeeNo. and shift time should be kept. Cleaners are
supposed to clock in when they report for their shift. There’s a need to keep track of the times
that a cleaner clocks in and clocks out. The shift is identified by the shiftcode.
(a) Draw an entity-relationship diagram suitable for representing this information.
(b) Identify the composite and multi-valued attributes if any.

4. Composite and multivalued attributes can be nested to any number of levels. Suppose we want
to design an attribute for an Employee entity type to keep track of previous professional and
Educational background. Such an attribute will have one entry for each company worked for,
and each such entry will be composed of company name, start date and end date,
responsibilities, and awards obtained if any. Additionally the attribute will have another entry
for previous colleges attended. Each college will be comprised of the college name, duration
and certificate(s) obtained. The certificates contain the name of the qualification and the level
obtained.
a) Design an attribute to hold this information. (10 Marks)
b) List down the multivalued and composite attributes from the scenario. (10 Marks)
c) Distinguish between multivalued and composite attributes. (5 Marks)
Page 3 of 8
NORMALISATION EXERCISE

CustomerId CustomerName Account Desc. Address OrderID Order Amount

Cus001 Mwansa Prepaid Acc, 4 Kabinga Ord001, Shoes, 5000


Rd, Ndola
Credit Acc Ord002 Bags 2000

Cus002 Bupe Prepaid Acc 10 Church Ord003 Shirts 1000


Rd, Lusaka
Cus003 Natasha Credit Acc 20 Chiwela Ord004 Shoes 2500
Rd Chipata
Cus004 Mumba Prepaid Acc, 26 Jumbo Ord005, Bags, 3500
Dr, Kitwe
Credit Acc Ord006 Dresses 4000
Cus005 Ntangi Prepaid Acc 34 Dumbo, Ord007 Belts 500
Livingstone
Cus006 Sparkle Credit Acc 4567 Ord008 Shirts 800
Chipata
Normalise the table below up to 3NF

Normalise the table below up to the 3rd Normal Form. Show all your working.

EmployeeNo EmployeeName Department SalaryScale Salary Address


No.
EHC001 Mary Accounts, IT P1 20000 Kitwe

EHC002 Peter Marketing P2 15000 Ndola


EHC003 John Sales, IT P3 9000 Lusaka

Page 4 of 8
MICROSOFT ACCESS EXERCISE

1. Load a Database application and create the following tables and format each field with the
appropriate datatype.
a) Under Indexed of the field properties, format the field CName to allow for duplicates.
b) Validate the Gender field to accept a maximum of six characters and only values ‘Female’ or ‘Male’.

CUSTOMER
NRCNumber CustomerName Address AccountNo Gender TransactionID Amount Date
324532/10/1 Mumbi Phiri Kasama 202400012 Male DEP120 5000 20/11/2018
222888/11/1 Maureen Luangwa 211900022 Female WIT130 100 12/10/2018
Mumba
447677/65/1 Anna Chileshe Livingston 192300010 Female DEP120 3000 22/11/2018
e
678933/10/1 Noyo Wamuwi Ndola 197800045 Male WIT130 300 24/12/2018
346590/11/1 Chioni Daka Chingola 345600012 Female WIT130 4000 10/10/2018
235487/67/1 Lisa Mkanda Luanshya 212100021 Female TRA120 550 20/11/2018

TRANSACTION
TransactionID TransactionName
DEP120 Deposit
WIT130 Withdraw
TRA120 Transfer

a) Create a relationship between the two tables. (2 marks)


b) Create a query to retrieve names and account numbers for customers who come from
a town that starts with letter L. (3 marks)
c) Create a query to calculate the total amount for the transactions in the database. (3
marks)
d) How many customers come from Chingola and Kasama. (2 marks)
e) Create a query to retrieve names and account numbers for customers who performed
the withdraw transaction. (3 marks)

Page 5 of 8
f) Create a query to retrieve names and account numbers and transaction IDs for
transactions carried out between 10/10/2018 to 22/11/2018
g) Generate a report to show the names of customers and transactions for amounts
greater than 1000. (6 marks)
[Total: 25 marks]

2. Load a Database application and create the following tables.

Doctor

DoctorID DName Field


D10 James Kunda Surgery
D11 Thandiwe Phiri Dental Surgery
D12 Thomas Chama Pediatrician
D13 Paul Mwale Bones
D14 Emma Phiri Gynaecology

Patient

PatientID PName Gender DoctorID Diagnosis


PT101 Chioni Daka F D11 Syphilis
PT102 Patience Phiri F D15 Cough
PT103 Bwalya Chanda M D11 Fungal Infection
PT104 Mercy Nkonde F D14 Tooth Ache
PT105 Jay Chikole M D13 Fracture
PT106 Paul Nvula M D12 Appendicitis
The primary keys for the Doctor Table and Patient table are DoctorID and PatientID respectively.

a) Create a form for each table using the wizard. Save the forms as DoctorDetails and PatientDetails. (2 marks)
b) Create a relationship between the two tables. (2 marks)
c) Create a query to retrieve the patients whose diagnosis starts with letter ‘F’ (3marks)
d) Create a query to show which patients were treated by Doctor Thandiwe Phiri. (3 marks)
e) Create a query that will show the Patient name, diagnosis, Doctor’s Name and Field. (2 marks)
f) Create a query to show the total number of patients in the database. (2 marks)
g) Create a report for each table to display all records that were captured in the database. (2 marks)
h) Create a report to display patients whose diagnosis starts with letter ‘F’. (2 marks)

Page 6 of 8
3. Create the following two tables with the following fields.
Projects
Project Projet title Cost Start Department Status END
No Date DATE

1 REHABILITATION 3,000 5/31/2013 PLANNING IN-PROGRESS 5/31/2014

2 COSTRUCTION 1,300 2/21/2013 ENGINEERING COMPLETED 8/12/2013

3 MAINTENANCE 5,000 4/13/2012 PLANNING IN-PROGRESS 11/30/2013

Project Activities
ProjectNo Activity Name

1 Mobilization of contructor

1 Purchase of material

2 Acquisition of machinery

2 Site inspection

2 Building, welding and final touches

3 Replacement of Cables, Swiches and General maintenance

a) Create a relationship beween the two tables.


b) Create a form for each of the two tables and use them for adding data to the tables. Save them
as Form Project and Form Project Activities. (2 marks)
c) Create a query that retrieves the details of all projects costing above K2,000. Save query as
QueryC. (3 marks)
d) Create a query to show project tiles and activity names of departments that start with the letter
P. (3 marks)
e) Create a query to show the number of projects that are being done in all the departments.
(3 marks)
f) Create a query to count the activities undertaken by the rehabilitation and maintenance projects.
g) Create a report that shows the title, start date and cost for all projects handled by the
‘PLANNING’ department. (3 Marks)

[20 marks]

Page 7 of 8
Page 8 of 8

You might also like