You are on page 1of 5

PART1: Datamodel 20 : 20 = 1

Case Election
You were contacted by a manager at “Kranshi” to make a data model for a database that contains
data of the elections and the results. Figure 1 shows examples of two elections with information
they should be able to generate.

Election results 2002


Election date: 18-jan-2002
Election type: Staten
Amount of voters: 126203
Can Candidate Candidate Candidate Candidate Gend Party
Political party Votes
code name Firstname Birthdate address er code
1 Godett Anthony 12-11-1958 Kaya Oranjo 1 M FOL Frente Obrero i Liberashon 30 di Mei 15362
2 Adriaens Maurice Bario Oranjo 2 M FOL Frente Obrero i Liberashon 30 di Mei 393
3 Gijsberta Kenneth Kaya Blou 1 M MAN Movementu Antia Nobo 1365
4 Coffie Mayra 23-3-1946 Kaya Blou 2 F MAN Movementu Antia Nobo 736
5 Ys Etienne 26-2-1962 Kaya Hel 21 M PAR Partido Antia Restruktura 9861
6 de Jongh Emily 7-12-1946 Kaya Hel 4 F PAR Partido Antia Restruktura 3937
geb. Elhage
..... Etc.

Election results 2003


Election date: 09-May-2003
Election type: Eilandsraad
Amount of voters: 109629
Can Candidate Candidate Candidate Candidate Gend Party
Political party Votes
code name Firstname Birthdate address er code
1 Godett Anthony 12-Nov-58 Kaya Oranjo 1 M FOL Frente Obrero i Liberashon 30 di Mei 19462
2 Adriaens Maurice 09-Sep-62 Bario Oranjo 2 M FOL Frente Obrero i Liberashon 30 di Mei 446
8 Cooper Charles 28-May-63 Kaya Blou 1 M MAN Movementu Antia Nobo 4242
9 Konket Armin 08-May-61 Kaya Blou 2 M MAN Movementu Antia Nobo 245
10 Ys Etienne 26-Feb-62 Kaya Hel 21 M PAR Partido Antia Restruktura 4667
6 de Jongh geb. Emily 12-Jul-46 Kaya Hel 4 F PAR Partido Antia Restruktura 2890
Elhage
..... Etc.

Figure 1: Partial list of results

INSTRUCTIONS
4 1. Draw the Entities.
4 2. Draw the relationships between the Entities.
4 3. If there are M:M relationships, make a new drawing and resolve this issue.
8 4. Add the attributes to the drawing (add more attributes if this is necessary), underline the
Primary keys and place the (FK) sign behind the Foreign keys.
PART II Database and Application 99 : 11= 9
The manager of the exclusive restaurant contacted you to make a data model
for a database that takes care of the administration of their orders. Figure 1 presents an example
of their invoices.

Order number:OR00934 Customer Id: 1990.03.06.19


Order date: 12-mar-09 Customer: Quincy Cijntje
Time: 8:15 PM Phone: 888-9987
Address: Kaya Bolombonchi 76

Item Item Price Quantity Total


code Description
LLS Lomito in lemon sause € 16.25 2 € 32.50
GSH Grilled Shrimps € 10.00 2 € 20.00
BAP Apple juice € 2.50 1 € 2.50
BPC Pepsi Cola € 2.00 3 € 6.00
Grand total: € 61.00

Order number:OR00821 Customer Id: 1970.12.12.19


Order date: 25-Oct-08 Customer: Nihaila Walle
Time: 2:34 PM Phone: 416-6742
Address:

Item Item Price Quantity Total


code Description
SLS Sir loin steak € 12.34 2 € 24.68
GSH Grilled Shrimps € 10.00 3 € 30.00
BAP Apple juice € 2.50 4 € 10.00
BPC Pepsi Cola € 2.00 3 € 6.00
Grand total: € 70.68
Figure 1: Sample invoices of the Orders
INSTRUCTIONS
1. Draw the Entities.
2. Draw the relationships between the Entities.
3. If there are M:M relationships, make a new drawing and resolve this issue.
4. Add the attributes to the drawing (add more attributes if this is necessary), underline the
Primary keys and place the (FK) sign behind the Foreign keys.
Figure 2 shows the structure of the tables of . Make the following assignments using this
structure.

CUSTOMER ORDER ORDERLINE ITEM


CustId OrderId OrderId ItemId
CustFirstName CustID ItemId ItemDescr
CustLastName OrderDate Quantity ItemPrice
CustPhone OrderTime
CustAddress
Figure 2: Structure of the tables

A. Database (50pt)

Database and Tables (15pt)

12 1. Make the database RibsChicks_YourName_YourSticknumber.mdb in Access with the


3 tables and relationships according to Figure 2 and the data shown in figure 1.

Tables and Relationships (20pt)

2. The following adaptations should be made to the database:


 The data in ItemId should always appear in uppercase
1  The price cannot be more than 100 euros and can neither be a negative number.
2 A customized message should appear if the data is not filled in correctly.
 The field names should appear as shown in Figure 1, without changing the original
4 field names; e.g. the field CustID should appear as Customer Id.
 The order numbers start with two letters, followed by five numbers. Make the
2 necessary changes to make the users comply to this standard.
 Most customers order 3 of the same item. Let the number 3 appear automatically for
1
every new record in the field Quantity.
 All foreign keys should be provided with a list of available values from the primary
3
table e.g. when creating an order, the customer should be selected from a list.
3  Make sure the database only allows data that already exists in the primary key to be
filled in a foreign key.
4 3. Fill the data shown in figure 1 in the tables.

Queries (15pt)

Select the necessary fields to make the result understandable. You may add data to your tables to
test your results. Save the queries with their respective number, e.g. the first query is Query 1
4. Make a query that requests the user to fill in the order number. When this is filled it will
3 show the information shown in Figure 1, with the exception of the Grand total.
5. Show the total revenue for each year.
2 6. The beverages (drink) start with the letter B in the Item code. Make a query that shows
3 the amount of only food types ordered (not the drinks).
7. The average amount of items ordered is 3. Make a list that shows the text “Average” if
3 the quantity is 3 or “Not average” for other values in a field called Aver.
8. Make a pivot table of the amount of food ordered each day.
4
B. Application (30pt)

Forms (10pt)
Make the following forms
2 9. A form F_Customers to manage data in the table Customer.
2 10. A form F_ Item to manage data in the table Item.
6 11. A form F_OrderForm as shown in Figure 3 to manage all data in one form. The buttons
Customers and Items should open the forms F_Customer and F_Item respectively. Place
your name in the footer.

Figure 2: Layout form F_OrderForm

Reports (9pt)
Make the following reports. All reports should be formatted an have a professional
appearance.

5 12. Use Query 1 to make a report R_Invoice that looks as much as possible like Figure 1
(including Grand total per Order).
4 13. Make a report R_FoodOrdered using Query 3.
Menu (10pt)
14. When the application starts you should only see the following Main menu. Give the
application the name Ribs & Chicks (instead of Microsoft Access). Use the forms and
reports already created in the assignments.

Main menu
 Order form
 Forms submenu
 Reports submenu
 Exit

The Forms submenu and Reports submenu open the following submenus respectively

Forms submenu
 Customer
 Item
 Back

Reports submenu
 Invoice
 Food Report
 Back

You might also like