Вы находитесь на странице: 1из 4

Activity 1

A database used in an order-entry system is to contain information about customers, items, and orders.
The following information is to be included.

• For each customer


o Customer number (unique)
o Valid ``ship-to" addresses (several per customer)
o Balance
o Credit limit
o Discount
• For each order
o Heading information: customer number, ``ship-to" address, date of order. Details lines
(several per order): each giving item number, quantity ordered.
• For each item
o Item number (unique)
o Manufacturing plants
o Quantity on hand at each plant
o Stock danger level for each plant
o Item description

For internal processing reasons a “quantity outstanding” value is associated with each detail line of each
order. This value is initially set equal to the quantity of the item ordered and is (progressively) reduced
to zero as (partial) shipments are made. Design a database for this data.

Activity 2
Wah Man Vehicles Rentals (WMVR) is a big corporation which rents vehicles to customers in China.
There are currently 32 local depots in 12 provinces. The ranges of vehicle are 3 models of vans and 6
models of cars. The current fleet of WMVR is approximately 680 cars and 300 vans. The capacity of a car
and a van range from 1100 c.c. to 3000 c.c. and 1.5 tons to 3.5 tons respectively. Each depot stocks from
28 to 50 vehicles and operates the same procedures.

Customers can come to the booking office ``on-specification" to hire a vehicle. Reservation can be made
1 week in advance, either by phone, fax, or in person.

When a customer reserves a vehicle, he discusses his requirements with the booking clerk. The clerk has
to check the availability status from the vehicle file and records the appropriate details in the
reservation file. The details include vehicle type, model, capacity, date of hire, date of return, hiring rate,
and depots to collect and return of the vehicle. When the customer collects the vehicle, the reservation
becomes a hire.

A customer can pay either cash, credit card or a cheque for his hire of a vehicle. When a hire is
established, the service clerk will record the payment method, applicable discount and number of hires
of the customers within the last 6 months (NH). A customer can choose either a 10% discount if NH >3
or a 20% if NH > 6 for his current hire. After the discount, NH will be reset to 0. After a hire has been
established, receipts are issued. One copy is given to the customer, whilst the other copy is filed in the
current hire file. The reservation and vehicle files will be updated accordingly.

All hires must be for whole numbers of days and charges are per day. A customer cannot have more
than 10 vehicles on hire.

When a vehicle is returned, a service clerk checks for defect or damage. If it is in good conditions, the
clerk then checks whether there are any additional charges (e.g. in excess of original number of days of
hire). If so, the charge is calculated, and the payment is collected from the customer. When there exists
defects or damages, the vehicle will be sent to a local garage for repair. The repair cost plus any
additional charges are then later billed towards the customer. The details of the completed hire are
archived from the current hire file to the hire history file for future analysis. The vehicle file will be
updated as well.

Maintenance and repair work on all vehicles are carried out by a number of appointed local garages.
Periodic routine maintenance will be done for all vehicles. Each van will be checked for services every 3
months; while it is 6 months for each car. Maintenance and minor repair work of less than $3,000 do not
require approval from the head office. The details of major repair work must be faxed to the head office
to seek for approval.

After maintenance and/or repair work is completed, an invoice will be received from the garage. All
maintenance and repair work are recorded in the maintenance and repair file. The details include
vehicle identity, type and description of work, costs, dates of commencement and completion of work,
garage's invoice number, and identity of garage which did the work. All work must be accepted by the
local depot. The accepted invoice will be faxed by the local depot to the head office for payment.

The head office is responsible for purchase of new vehicles. When a vehicle has accumulated more than
$20,000 in repair cost, the vehicle is disposed. A vehicle is then bought to replace the disposed one in
the original depot.

Derive a relational model in Third Normal Form from the description above.
Activity 3
The following is an unnormalized PATIENT record:

(PIDNO, PNAME, FAMDOCNO, DOCNAME, DOCADDR, *(APPTMT-DATE, APPTMT-TIME, CONSULTANT-


NAME-CONSULTANT-PHONE, HOSPITAL, HOSPITAL-ADDR)) where * represents repeating groups of
information. The business rules are

• On any given day, a consultant attends at just one hospital


• On any given day, a patient will have only one appointment (APPTMT) with a given consultant
• Patient id numbers (PIDNO) and consultant names are unique
• Family doctor numbers (FAMDOCNO) and hospital names are unique
• Family doctor names (DOCNAME) and patient names (PNAME) are not unique
• Consultants have just one phone number, used as home base.

Reduce the above relation into normalized forms.

Activity 4
Given the sample receipt of Wally Vehicle Rentals as shown below, produce the Third Normal Form of
this document by normalization.
Activity 5
Produce the Third Normal Form of this document by normalization.

Note: Kindly show your normalization from 0NF to 3NF

Вам также может понравиться