Вы находитесь на странице: 1из 16
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 produets that will be baked during the next day and in which of the ovens each product will be made. Each such individual decision'is known as a ‘Bake Order’, These decisions are 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 ular ingredient that is needed to produce the chosen quantity of the part | product that is to be baked. The ingredients and quantities are standard for cach product. Aiso recorded is the required oven temperature; note that this varies depending on the quantity of the particular product that is being baked. Date of Baking Record: _ 315/98 \ Required ingrediems [Bake {Oven | Product|Product | Required | Quy to Order | number] Number|Dese. | oven be | temp. | baked | Ingredient | Ingredient | Quy code name required “436 a] 27 | 28 | 220 | 20 At | Fineflour | 50. | pea 3. | Dublinmix | 15 | eed y20, | Yeast 3 | | F100 | Flour, wim| 100 re 437 2] 12 | Small | 190 100 F410 | Ass. fruits | 12 Irish foe sie 3 Millom lolasses tarts A2i | Bakingfat| 40 | A23_| Salt 1 P aca ae ortoun Bakares Normasston Hometown Bakeries Page 2 SAMPLE ANSWER ‘The table below shows the results at each stage of the normalisation ake oder date Boke rir cote Boks oder oursS@7 ‘ake cde number Proauet rumber rodvetromber Product camer Bake terete rogues quaniy rode dectpton Product cesciton Bake onisc uber Reaites tener Required temperature | Produc number O »r if " Prod: descreion Pmduct umber Ingredient code Requtes temperature Product deszition Ingredientnama bu Product quantity ent quart Product oumber ‘roduet quantity Rocuted tomperature Bate outer murine ‘nore cai ingredient namo Ingesient quantity Oo Note in particular what happens in the move to 3NF. Not only is the “Product description’ dependent upon the ‘Product number’ but also (2s 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. Hematewn Gekares Nomalston Classic Fit Society Pace 1 THE CLASSIC FILM SOCIETY ‘The Classic Film Society is a group interested in cinema films produced in the period 1910 to 1950, ‘Members maintain an index of all such films, to which members add details whenever they come into 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. © The Classic Film Society's index holds details of cinema films produced in the US, UK and elsewhere O between 1910 and 1950, Only films of which at least one member of the society has a copy are recorded in the index. i © When a member obtains a copy of an unindexed film then details of that film are recorded in the index. If j 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. © Bach index card records details of one film. © Films were sometimes released under different titles in different countries. It is the accepted convention i that the tile used at the first sereening 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 ttle 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 C 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 producers 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 romance) eeee0e @ Details are kept of which members own a copy of an indexed film. In cases where many members own a ] 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 indexed films 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. ‘Shy ous a (aN Fan SOC Example of an index card CLassic FILM SOCIETY PAGE 2 The Classic Film Society Film number: 98/234 brbgng he past o We Date added : 210/98 Film title: Moon over Morecambe (UK, 1946) Country of origin: = UK First release date: 1946 Film type: ConedyDramantsifRonie Other titles under | Holiday Romance (US, 1946)" which this film | Tae Memymakers (Australia, 1947) released | | Director(s): T-E. Philpott Producer(s): G. Oldman & P. Oldman Music: P. Forte Actors appearing in this film: Name Nationality Georgie Witherspoon British Frank Douglas British ‘Tommy Thompson British ' Meg Donnelly Irish First screen Ippestance | 1985 | Female | 1934 | Male | 1938) [Male | 1931. | Female | 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 view copies please contact members directly. FP Toam ews COSTE SCT am CLassic FILM Society PAGE 3 SAMPLE E-R DIAGRAM ‘The most interesting part of this exercise is the representation of the different categories of film. 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. Ifyou inerease 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 “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 actually 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, 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. ‘Dame ns (een Fun Soc)

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