Hometown Bakeries Page 1

HOMETOWN BAKERIES

Given below are some details of a bakery company and an example of a form used by the company in its operations. Produce a set of tables in Third Normal Form that will adequately store all of the data shown in the example form. Ensure that all Primary Keys and Foreign Keys are clearly marked in your answer.

State clearly any assumptions that you make.

Hometown Bakeries produce baked products (cakes, biscuits etc) for local shops. Each day a decision is made concerning the products that will be baked during the next day and in which of the ovens each product will be made. Each.slIch individual decision is known as a 'Bake Order'. These decisionsare all recorded on the 'Baking Record' form for that day, an example of which is shown below. Note that within _each Bake Order is shown the code, name and quantity of every ingredient that is needed to produce the chosen quantity of the particular product that is to be baked. The~~:J?I:edient:s and quantities are standard for each product. Also recorded is the required oven temperature; note that this varies depending on the quantity of the particular product that is being baked.

. ~e of Baking Record : 3/5/9G

1 Required Required ingredients
Bake Oven Product Product Qty to
Order number Number Desc. oven be
temp. baked Ingredient Ingredient Qty
code name required
436 1 27 Top 220 20 A1 Fine flour 50
loaf, /.
A3.,: Dublin mix 15
French Y20, Yeast 3
twisted
F100 Flour, w/m 100
437 2 12 Small 190 100 F110 Ass. fruits 12
Irish A2 Molasses 3
Millom
tarts A21 Baking fat 40
A23 Salt 1
"'t;;; .Hlii;: !·:';::11'it[i··. 1;iUil:,:'!i·;· ... < .'C' Hometown Bakeries Normalisation

.1

J

SAMPLE ANSWER

Hometown Bakeries Page 2

The table below shows the results at each stage of the normalisation

n

Ba ke order date

Bake order number Product number Product description Required temperature Product quantit Ingredient code Ingredient name

I ngedient quantity

n

Ingredient code Ingredient name

Ingredient code Ingredient name

Bake order date

Bake order date

Bake order number Product number Product description Required temperature Product quantity

Bake order date Bake order number Ingredient code Ingedient quantity

Bake order date Bake order nu mber Ingredient code Ingredient name Ingedient quantity

Bake order date

Bake order date Bake order number Product number Product quantity

Product nu mber Product description

Product nu mber Product quantity Required temperature

Bake order date Bake order number I ng redien! code Ingedient quantity

o Note in particular what happens in the move to 3NF. Not only is the 'Product description' dependent upon the 'Product number' but also (as we are told in the information gathered about the situation) the 'Required temperature' for the oven is dependent upon the 'Product number' plus 'Product quantity'. This is an example of where a dependency is upon a combination of more than one other attribute.

Hometown Bakeries Normalisation

® The Classic Film Society's index holds details of cinema films produced in the US, ~ and elsewhere

'<:: between 1910 and 1950. Only films of which at least one member of the society has a copy are recorded inthe index.

® When a member obtains a copy of an unindexed film then details of that film are recorded in the index. If they obtain a copy of an already indexed film then the fact that they now hold a copy is recorded on the index card for that film.

® Each index card records details of one film.

® Films were sometimes released under different titles in different countries. It is the accepted convention that the title used at the first screening will be the title by which a film is normally known, but a record is . kept of other titles used and the country where that title was first used . ./'

® Members of the society are very interested in knowing about the principal actors of each indexed film, and details are kept of these, together with details of their sex and the year in which they made their first screen appearance. Most actors (both male actors and female actors are described by this term) did of course appear in more than one film.

Among the indexed films are cartoon films for which no actors are credited.

The names of producers, directors and actors may be considered as uniquely identifying an individual Films may have several produc:_ry..and directors but only one person is given credit for the music.

Every indexed film is categorized as being of one of a number of types (comedy, drama, musical, or

-:

'\,_,.
@
®
@
@
®
® CLASSIC FILM SOCIETY PAGE 1

THE CLASSIC FilM SOCIETY

The Clas~!!1Y is (LgrPJJP interested in cinema f~lms produced in the period 1910 to 1950. Members maintain an index of all such films, to which members add details whenever they come into

___ ~ __ • __ -"""·'_~'~w"~ ••• _",,,,,_·,""_,,&_,,~-:-

possession of a print of the film.

The society wishes to make this index available to its members through a computer data base.

Given below is some information about the Classic Film Society, together with an example of an index card.

DESCRIPTION OF THE CURRENT SITUATION.

romance)

Details are kept of which members own a copy of an indexed film. Incases where many members own a_J copy, then only six members are recorded as owning a copy on the index card.

A separate index holds details of the members of the Classic Film Society. Each member is identified by a Membership number. Details are recorded of the member's name the date on which they joined the society and the archive numbers of any indexedfilms of which they possess a copy .

. ' " .

@ A third index records bibliographical details 'of actors, including some actors who have none of their

films included in the main film index.

e P J DUNNING' LEwIS (ClASSIC FILM SOCIETY)

.0

CLASSIC FILM SOCIETY PAGE 2

Example of an index card

c ,

''''--..J'

c Cc

<::

Film number: 98/234

Date added:

Film title:

Country of origin:

First release date:

Film type:

21110/98

Moon over-Morecambe (UK, 1946) UK

1946 ~

ComedylDramalMusi~ce

Other titles under

Holiday Romance (US, 1946")

-----:----

TheMerrymakers (Australia, 1947 )

i ------h- ...... _-----

I which this

I released

film

Director(s) :

Producer(s):

Music:

T.E. Philpott

G. Oldman & P. Oldman P.Forte

Actors appearing in this film:
Name I Nationality First screen
I
I I appearance
I
Georgie Witherspoon I British 1945 Female
I
Frank Douglas I British 1934 Male
I
Tommy Thompson I British 1938 Male
Meg Donnelly Irish 1931 Female ~ I

Copies of film are held by the following members:

F. Jones, membership no. 00213 J. Harris, membership no. 00214 R. Fitzroy, membership no. 00045

To vie~1/ copies please contact members directly.

e P J DUNNING-LEWIS (CLASSIC FILM SOCIeTY)

(".,_~ CLASSIC FILM SOCIETY PAGE 3

SAMPLE E-R DIAGRAM

The most interesting part of this exercise is the representation of the different categories offilm.

One way of doing this is to include four separate 'flag' attributes in the film entity. Then if the film is a comedy film you set the value of the attribute "comedy film?" to 'yes'. This is a pretty common programmers device, but is not at all advisable because:

1. If you increase the number of categories you have to then change the structure of the file

2. You have to include in code the rule that each film is only classified under only one category.

A second approach is to include the separate types of film as entities in their own right. This is the approach taken below, using exclusive sets. It is interesting to note that if we had been told that further information was held about different types of film (eg a 'giggle rating' for comedy films) then we might prefer to treat

L\ 'comedy film' as a sub-type of 'film' rather than, as here, a category.

In the diagram below we have modelled the present situation explicitly, showing the used categories and that only one can be used. Whilst this is accurate, it is not actua11y the best representation if we are moving to a database design. This is because when we came to think of the key atribute of the four entities it would be the same for each, and following the rule that entities with the same key should be merged we would end up with just one entity called 'category'.

So perhaps the best choice would be that shown in the second diagram below, where we have a single entity 'category' linked to the film.

Remember that we are only interested in those films that the society members own, not all films ever made, C: and only those directors and producers that are related to a film that the society has recorded details about.

This may explain any questions you have about the participations shown.

© P J DUNNING-LEWIS (CLASSIC FILM SOCIeTY)

CLASSIC FILM SOCIETY PAGE 4

PRODUCER

DIRECTOR

, ,

u

ACTOR

MEMBER

COMEDY FILM

MEMBER OWNING FILM

PRODUCER OF f+t--+~ FILM

DIRECTOR OF f-t+--+~ FILM

ACTOR IN FILM

TITLE OF FILM

ROMANCE FILM

TITLE

MEMBER
CD
MEMBER
OWNING FILM
PRODUCER PRODUCER OF
FILM

[ DIRECTOR ]-1+-+< DIRECTOR OF FILM h.,..... I I CATEGORY
FILM 1"''--' I I
J-l.

ACTOR r-; ACTOR IN FILM
TITLE OF FILM


TITLE
" .
. ' , . o

e P] DUNNING-lEWIS (CLASSIC FILM SOCIElY)

'I, .

CLASSIC FILM SOCIETY PAGE 5

NORMALIZATION

UN- lNF 2NF 3NF
NORMALIZED
** Film number ** Film number --------------> -------------->
Date added Date added
Film title Filmtitle
Country (origin) Country (origin)
Country (release) Country (release)
Date (release) Date (release)
Type Type
Music credit
Alias number
Alias title
Alias country Ntimes
Alias date ** Film number --------------> -------------->
** Alias number
Director N times Alias title
Producer N times Alias country
Music credit Alias date
Actor name ** . Film number ** Film number ----- ... -------->
Nationality N times ** Actor name ** Actor name
First appearance Nationality
Sex First appearance ** Actor name -:------------->
Sex Nationality
Member name Ntimes First appearance
Membership no. Sex

** Film number ** Film number -------------->
** Membership no. ** Membership no.
Member name
** Membership no. -------------->
Member name
** Film number --------------> -------------->
** Director
** Film number --------------> -------------->
** Producer . '.

e P ] DUNNING-i.EWlS (CLASSIC FILM SOCIElY)

CLASSIC FILM SOCIETY PAGE 6

COMPOSITE DATA MODEL

The model below would be a plausible bringing together of the results of the E-R modelling and the normalisation. This would be a simple structure to set up in MS Access for example.

It would be cap[able of meeting any demands currently made of the existing archives and would offer some additional flexibility. For example, at present the key-Only relations such as PRODUCER serve only as access paths (we could think of them being database indexes) but should the society wish to begin storing additional details about producers then this would only require some additional attributes to be added to the PRODUCER relation.

MEMBER

... membership no. member name date (lolo.d)

o

". film number

•• membership no.

MEMBER OWNING FILM

PRODUCER

PRODUCER OF i-H-HIFILM

:: ~~~d~~~ber W

.... producer

.... film number

date edded

film tltl.

country (.rlgln) c.untry (r.I •••• J date (reJ •• se) type

director producer

music credit

DIRECTOR OF

H-II--~ FILM

•• film number

•• dlrect.r I .>"

ACTOR IN FILM~

I-HI-E»~. •• rum number .... actor name

DIRECTOR

FILM

.'If director

ACTOR

... attar name natlonalJty

first appearance s ex bibliography

,. - -~,

U

TITLE OF FILM

,,* film number •• title

country date

TITLE

"'. tltZe

\ ... "t,

FILM TYPE

'"'" type

© P) DUNNING-LEWIS (CLASSIC FILM SOCIETY)

t

International Shipping

Given on the following pages are details of a company that deals in the storage and loading of containers onto ships. You will find a text description of the situation, examples of some forms and reports presently used, and details of known application requirements.

Use the materials provided to answer all of the following questions:

Question 1.

Produce an E-R model of the situation. Your model should show entities and relationships, and the cardinality and participation for each relationship.

Any single occurrence entities, recursive relationships or many-to-many relationships should be removed. There is no need to show any details of attributes or keys in this model.

Question 2.

Show the set of relations in 3rd Normal Form that result from normalizing the forms and reports provided. The primary key of each relation must be clearly marked, but do not indicate any Foreign Keys.

Question 3

Produce a composite data model by combining your answers to Question and Question 2. This should show the entities, the attributes associated with each entity, the relationships between entities, the cardinality and participation of each relationship, with all primary keys being clearly indicated.

PAGE 1

(0-·"1

The business of International Shipping Containers Ltd

International Shipping Containers Ltd is a company that arranges for the loading of containers onto ships in order that they may be sent overseas.

• When a customer enters into a contract with IsC Lt9.r the contract always and only ever concerns the storage and loading of one or many containers. The contract has a unique contract number.

The contract will specify a single destination for each container, the ship on which the container is to be loaded and the port at which it is to be loaded.

These details may be different for the individual containers named in the same contract.

• Each QlJl1:a.i.Aer that the company is asked to store and load is given a ,unique container number b'i1§.C, and these numbers are never re-used. This means that even if the same physical, metal box were loaded several times, under different contracts, it would each time be regarded as a different container and have been assigned a different number.

• A customer is defined as someone who has entered into at least one contract.

A customer may enter into several contracts over time.

• A Loading is the name givenJg the event of loading a container onto a ship. No container is ever involved in more tl1ar1One Loading. No Loading ever involves more than one container. Each Loading takes place at one of the several ports at which IsC operates.

• At each port, when a container is loaded onto a ship the date and time at which it was loaded

are recorded. )

One or many containers may be loaded onto the same ship, but each will be assigned its own Loading number. A Loading number always therefore identifies the loading of one particular container onto one particular ship. The same series of Loading numbers are used at all ports, so in order to identify a Loading uniquely it is necessary to specify both the port name and the Loading number.

• Containers may be delivered to ISC while the ship onto which it is to be loaded is still at sea.

Therefore, IsC has at every port 'a storage facility consisting of many storage bays.

Containers are placed into these bays until they can be loaded onto ships, Each storage bay is capable of holding many containers and is identified, within that port, by a bay number.

• At at least one port there are bays that have never been used to store any containers so far.

It is possible that a container may be moved, and so be stored in different bays at the same port over time. It is possible that a container may, for some short period of time, be en route to the port, and so never have been stored in a bay or loaded onto a ship.

• All ships are identified by a unique ship number which remains unchanged for the lifetime of the ship, even if the name of the ship changes.

PAGE 2

Example Forms and Reports

Shown below are examples of some of the records currently used by the company.

DAIL Y LIST OF COMPLETED LOADINGS
Port name Loading Container Contents Ship Ship name Loading Loading
Number no. no. date time
Felixstowe 00219" 14538 Plastics SS94/35/2385 Daphne G 1/6 23:03
Felixstowe 00220 14539 Plastics 8S94/35/2385 Daphne G 1/6 23:28
Felixstowe . 00221 14583 MIG tools 8S94/35/2385 Daphne C 1/6 23:45
--,
Dover 00217 15107 Elec. ass. 8S65/44/1432 Kriatania 1/6 06:45
Dovef 00218 15108 MIG tools 8S65/44/1432 Kriatania 1/6 07:10
<: 1/6
Dover -r 002,19 I 14540 Plastics 5S44/25/2115 Sao Paulo 07:12
Dover 00220 15184 Retail SS65/44/1432 Kriatania 1/6 07:23
assorted
PAGE: L r CONTAINER RECORD CARD
r> Container No: 14539
Contract number 99/3/0020
Contract customer: Edwards Shipping Ltd
Destination: Rotterdam
Contents y}astic mOUldings
Details of where loaded or stored
Port Name: Felixstowe
Bay no. 12
To be loaded onto:
Ship name: Daphne C
Ship number: 3594/35/2385
-, PAGE 3

.-.---...._

PORT RECORD

International Shipping Container

PORT NAME:

DOVER

Manager D A Harrison

Maximum number of containers that can be stored at port '108

Loadings completed in previous year from this port

:5276

Capacity of storage bays

Bay Max. number of
No. containers
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12 Bay Max. number of
No. containers'
9 12
10 6
11 6 PAGE 4

KNOWN APPLICATION REQUIREMENTS

It is known that the management require that certain reports be produced.

In order to assess whether your composite data model is complete you may ask yourself if the following example reports could be produced from your composite data model.

1. A list of all containers currently held in store (i.e. not already loaded) at the port 0 l' Tilbury

2. A list. of all containers with a destination of Piraeus loaded at any port in th month of May.

3. A list of all containers loaded for the customer Transworld Transport under the terms of contract number C21400 12 .

4. A list of all the bays in which container number 14583 was stored at the port 0 Felixstowe

PLEASE NOTE:

YOU ARE NOT REQUIRED TO DESCRIBE IN ANY WAY HOW YOU WOULD PRODUCE THESE REPORTS.

THIS IS ADDITIONAL INFORMATION, PROVIDED TO BE OF HELP TO YOU IN CREATING THE COMPOSITE DATA MODEL

PAGE 5

'~ INTERNATIONAL SHIPPING- SAMPLE SOLUTION

INTERNATIONAL SHIPPING CONTAINERS LTD SAIVIPLE SOLUTION

PAGE 1

RESULTS OF E-R MODELLING

There can of course br valid variants of the answer below, but the model you produce must accurately reflect the information you are given. A defensible answer is as below:

CUSTOMER
,
t
CONTRACT

PHYSICAL BOX CONTAINER STORED STORAGE BAY PORT
" r-; CONTAINER .r-.
~ ~ .....-
~~ <D
LOADING PORT CALL BY
J'\ SHIP
'-/

SHIP ©DUNNING-LEWIS (INTERNATIONAL SHIPPING - SAMPLE ANSWER.DOC)

INTERNATIONAL SHIPPING CONTAINERS LTD SAMPLE SOLUTION

PAGE 2

RESULTS OF NORMALISATION ,

~ ~':.,

The normalisation is straightforward, as shown below. Note that as the normalisation progresses a relation such as 'loading' generates new relations keyed on ship no and container no., but as theses already exist the newly created relations become merged with the existing ones.

Un-normalised lstNF 2ndNF 3rdNF
** Container no ** Container no
Contract no. Contract no.
Contract cust. Destination
Destination Contents
Contents Port name
Port name -----------> ---------------> Bayno.
Bayno. Ship no. I
" '<, ~fI...V.
Ship no. ** Ship no.
z,
Ship name Ship name 74-
** Contract no.
Contract cust. '7
~
** Port name ** Port name
** Loading no. ** Loading no.
Container no. Container no.
Contents Ship no.
Ship no. Date ofloading
Ship name ------------> ---------------> Time ofloading
Date ofloading
Time of loading
** Port name ** Port name
Manager name Manager
Total capacity Total capacity ---------------> ------------------->
Loads last year Loads last year
Bayno. ~ ** Port name
Bay capacity imes ** Bayno. --------------> ------------------>
Bay capacity ©DUNNING-LEWIS (INTERNATIONAL SHIPPING - SAMPLE ANSWER. DOC)

\

COMPOSITE MODEL

INTERNATIONAL SHIPPING CONTAINERS LTD SAMPLE SOLUTION

-----

PAGE 3

Port Name

Bay Number Container Number

! STORED CONTAINER

STORAGE BAY

Customer Name

~

Bay Number

Bay Capacity

Port Name

Port Manager Name Port Total Capacity Port loads last Year

Contract Number Customer Nama

Container Number Contract Number Destination Contents

Port Name

Bay Number Ship Number

CUSTOMER

CONTAINER

SHIP

(J

Shlo Number

Port Name

I '-1------------1°1 Slilj)Nuiiiiier

H Date ShIP Entered Port

Date Ship left Port

PORT CAll OF SHIP

©DUNNING-LEWIS (INTERNATIONAL SHIPPING - SAMPLE ANSWER. DOC)

Sign up to vote on this title
UsefulNot useful