CIS2002 SEMESTER 1, 2014
Assignment 2 specification
Description |
Marks out of |
Mode |
Wtg(%) |
Due date |
ASSIGNMENT 2 |
100.00 |
External |
25.00 |
30 May 2014 |
ASSIGNMENT 2 |
100.00 |
On Campus |
18.00* |
30 May 2014 |
*On-campus students take practical tests and the weightings for assignments are different due to this.
IMPORTANT INFORMATION
You must submit the assignment electronically by the due date via the EASE link on the study desk. Instructions will be provided on the course study desk.
If you are unable to complete the whole assignment, submit what you have done rather than nothing.
There is an automatic extension until 6 June. The extra time is only if you need it. You should aim to submit at the due date. There is no need to apply for this extension. Once the model answers are released no further assignments can be accepted.
You must use the official USQ data modelling and normalization methodology. This methodology is based on Clive Finkelstein’s techniques (SR 2.1 and SR 2.2) and all the examples in the lectures, study book and the tutorials use this methodology.
If you do not use the USQ methodology, you will probably be awarded a mark of zero.
It is perfectly acceptable if you submit neat hand-drawn ERD’s. Alternatively, you might wish to use Word. If you use a CASE or drawing tool, you must adapt the drawing to conform to the USQ methodology.
SECTION A (Data Modelling) (40 marks)
Law Associates is a large legal practice based in Sydney. You have been asked to design a data model for the practice based upon the following specification:
The practice employs nearly sixty lawyers who work in a wide variety of specialty areas. A speciality id and description is stored for each speciality. Each lawyer employed by the practice is classified as a partner, an associate, a junior or an intern. The practice stores the following information for all lawyers: Name, address, telephone, email, base salary and the one area of law in which that lawyer specialises. For partners, the practice also stores information about the percentage of the partnership held by the lawyer and the area of speciality that lawyer leads. Each area of speciality has one partner who acts as a leader (or resident expert and consultant) in that area. For associates, the practice also stores details about the percentage of cases the associate has won.
Juniors and interns undertake prescribed training courses and a record is kept. All training courses are registered and the name of the course, the duration (in days), the start date, the end date and details about the training organisation. Although a course is only offered by one training organisation, these organisations typically offer many courses. We store the name, address, telephone, email and Law Society accreditation number for all training organisations. When a lawyer completes a course, the grade received on that course is recorded.
We store details about the qualifications of all lawyers. Each lawyer may have many qualifications and a list of qualifications is stored, including the name of the qualification, its level (undergraduate or postgraduate) and the name of the university offering the qualification.
Each lawyer may take on many cases. A case is assigned to at least one lawyer but may be assigned to as many as four. If more than one lawyer is assigned to the case, one of the lawyers must be designated as a leader. Only seniors may be leaders of cases involving multiple lawyers. A case must have one or more clients but a client may initiate many cases over time. For case, we store a unique identification number, the estimated duration of the case, the client number/s of the clients involved, and the estimated start date. For client, we store an identification number, name and address. When any lawyer is assigned to a case, we store the date assigned and the date the lawyer leaves the case. A lawyer may become involved in a case on multiple occasions.
As cases can take years to resolve during the cases proceedings the layer in charge of the case may be unavailable as they be working on other cases. During this period the work associated with the case is assigned to the junior lawyer with mentoring from the layer originally assigned to the case. Upon the return of the principal lawyer to the case an evaluation is done of the assisting lawyer to record their performance for future evaluation. In the instance where a junior is assigned to a case where more than one lawyer is involved the other layers provide an evaluation of the junior lawyer as well. During the length of the case a number of junior layers could be assigned to assist with the case.
Prepare the following:
a) An ER diagram for the system. Show all entities, relationships, cardinalities and optionalities. Also, include all intersection entities. You must use the Finkelstein methodology as per the study book and tutorials. (15 Marks)
b) A list of relations (equivalent to Finkelstein entity list). Produce complete relations for all entities and attributes. Show all primary and foreign keys. Include all attributes that are specifically mentioned and all key attributes. You may need to create primary and foreign keys that are not specifically mentioned. You must use the Finkelstein methodology as per the study book and tutorials. (15 Marks)
NOTE: We use PART MARKING for the relations and will mark four relations chosen at random.
c) A single SQL statement or multiple statements that create/s the table for the relation training courses for jurors and interns. All key and attribute constraints should be included and data types suitable to each attribute should be chosen.
(10 Marks)
SECTION B (Normalisation) (30 marks)
Produce a set of relations (equivalent to the Finkelstein entity list) in third normal form (3NF) from the following un-normalised relation. Show your working and entitles for 1NF, 2NF and 3NF. You must use the Finkelstein methodology as used in the study book and tutorials.
PATIENT(patient id, name, address, age, gender, admitting doctor id, admitting doctor name, admitting doctor grade, date of admission, date of release, number of days in hospital, ((ward id, ward name, (( bed number, date arrived, date departed )) )), reason for admission)
Notes:
MARKING CRITERIA
1. Four marks awarded for each correct SQL statement.
2. Alternative approaches to the model answer could be accepted unless they do not follow the rules / requirements set out in the specification, are poorly optimised or are poorly constructed (SQL).
3. Part marks may be awarded if an answer only has a small problem or an alternative solution is presented that works but is not ideally optimised / constructed.
4. There are 5 questions for the total of 20 marks.
The following E-R diagram represents a Car Hire database.
In this question, you will use the CAR HIRE database. The CAR HIRE database including
appropriate data will be made available on the USQ Oracle server. You may query any of these tables but may not make changes.
The table descriptions appear below, including the column names and data types.
I_CAR
Column Name |
Type and Size |
Constraints |
Description |
Registration |
VARCHAR2(7) |
NOT NULL |
Registration number of the car. This is the Primary key. |
Model_name |
VARCHAR2(8) |
FK |
Model for the car. Foreign key into the Models table. |
Car_group_name |
VARCHAR2(2) |
FK |
Group code defining type of car and rental cost. Foreign key into the CarGroups table. |
Date_bought |
DATE |
|
Date the car was purchased. |
Cost |
NUMBER(8,2) |
|
The original cost of the car. |
Miles_to_date |
NUMBER(6) |
|
The current mileage of the car as read at the end of the most recent rental. |
Miles_last_service |
NUMBER(6) |
|
The mileage of the car when it was last serviced. |
Status |
CHAR(1) |
|
The current status of the car. ‘A’ for available, ‘H’ for on hire, ‘S’ for being serviced, ‘X’ for in need of service or repair. |
I_CARGROUP
Column Name |
Type and Size |
Constraints |
Description |
Car_group_name |
VARCHAR2(2) |
NOT NULL |
The car group code. This will be one of the following values: ‘A1’, ‘A2’, ‘A3’, ‘A4’, ‘B1’, ‘B2’, ‘B3’, or ‘B4’. This column is the primary key for this table. |
Rate_per_mile |
NUMBER(3) |
|
The charge per mile for cars in this group in cents. |
Rate_per_day |
NUMBER(5,2) |
|
The rental charge per day for cars in this group in dollars and cents. |
I_MODEL
Column Name |
Type and Size |
Constraints |
Description |
Model_name |
VARCHAR2(8) |
NOT NULL |
The model name, an abbreviation of the full model name. This is the primary key for this table. |
Car_group_name |
VARCHAR2(2) |
FK |
The group to which this model of car belongs. |
Description |
VARCHAR2(30) |
|
Full description of the model. |
Maint_int |
NUMBER(5) |
|
Number of miles between services for this model. |
I_CUSTOMER
Column Name |
Type and Size |
Constraints |
Description |
Cust_no |
NUMBER(5) |
NOT NULL |
The customer account number. This is the primary key for this table. |
Cust_name |
VARCHAR2(20) |
NOT NULL |
The name of the customer. |
Address |
VARCHAR2(20) |
|
Street address of the customer. |
Town |
VARCHAR2(20) |
|
Town the customer lives in. |
County |
VARCHAR2(20) |
|
County the customer lives in. Default is Australia |
Post_code |
VARCHAR2(10) |
|
Postcode for the town. |
Contact |
VARCHAR2(20) |
|
Name of person to contact. |
Pay_method |
CHAR(1) |
|
Code to indicate the usual payment method for this customer. ‘A’ indicates an account, ‘C’ indicates cash or credit card, NULL indicates unknown. |
I_BOOKING
Column Name |
Type and Size |
Constraints |
Description |
Booking_no |
NUMBER(5) |
NOT NULL |
A serial number used to uniquely identify the booking. This is the primary key for this table. |
Cust_no |
NUMBER(5) |
FK |
Customer number of the customer making the booking. |
Date_reserved |
DATE |
|
Date on which the booking was made. |
Reserved_by |
VARCHAR2(12) |
|
Name of the person who took the reservation. |
Date_rent_start |
DATE |
|
Date on which the rental commences. |
Rental_period |
NUMBER(3) |
|
Length of rental period in days. |
Registration |
VARCHAR2(7) |
FK |
Registration of the car actually rented. |
Model_name |
VARCHAR2(8) |
|
Model of the car rented. |
Miles_out |
NUMBER(6) |
|
Miles on the odometer at the start of the rental. |
Miles_in |
NUMBER(6) |
|
Miles on the odometer at the end of the rental. |
Amount_due |
NUMBER(6,2) |
|
Cost of the rental. Calculated when the car is returned. |
Paid |
CHAR(1) |
|
Flag to indicate if this rental has been paid for. ‘Y’ if it has been paid and ‘N’ if not. |
1. Display the total number of customers that do not have a county recorded in for their address information.
2. Display each customer number and the total number of bookings that customer has made. Order the result by largest number of bookings at the top of the list.
3. Display full details for the oldest booking recoded in the database.
4. Display the registration and the number of times the car has been rented for the car/s that has been rented the greatest number of times.
5. Display the count of number cars whose cost is less than the average cost of all the cars that are available for booking (status = A)
PART MARKING: For this section, we will use part marking. This means we will supply model answers to all questions but we will only mark 5 questions. We will choose these randomly and each question chosen for marking will be worth two marks. The choice of the 5 random questions will be from the odd numbered questions. If you do not answer a question that is chosen for marking, you will receive no marks. You should therefore attempt all the questions. These questions are designed to hone your SQL skills before the exam.
Use the relations below to write SQL queries to solve the business problems specified.
Note: You do not have access to the tables or the data for this database. This is the same conditions you would be experiencing in an exam citation. These questions are designed to hone your SQL skills before the exam.
CLIENT(clientno#,name, client_referred_by#)
ORDER(orderno#, clientno#, order_date, empid#)
ORDER_LINE(orderno#, order line number#, item_number#, no_of_items, item_ cost, shipping_date)
ITEM(item_number#, item_type, cost)
EMPLOYEE(empid#, emp_type#, deptno, salary, firstname, lastname)
Notes:
29. Display the surname for all employees who earn less the average salary of all those employees in the department with the lowest average salary.
MARKING CRITERIA
SECTION A
1. Entities – no missing entities, appropriate names, no redundant entities, etc.
2. Cardinalities and optionalities all shown and correct.
3. Complete list of relations, showing all applicable attributes, primary keys and foreign keys.
4. Sophistication: well presented solution; good layout; innovative approach; correct
diagrams/notation; solution easy to read and understand; solution comprehensive
SECTION B
1. Relations – no missing relations, appropriate names, no redundant relations.
2. All primary keys present and correctly notated.
3. All foreign keys present and correctly notated.
4. All attributes present.
5. All repeating groups resolved.
6. Derived attributes indicated in brackets.
7. All 2NF and transitive dependencies resolved.
8. All relations correctly notated using USQ methodology.
SECTION C
1.Four marks awarded for each correct SQL statement.
2. Alternative approaches to the model answer could be accepted unless they do not follow the rules / requirements set out in the specification, are poorly optimised or are poorly constructed (SQL).
3. Part marks may be awarded if an answer only has a small problem or an alternative solution is presented that works but is not ideally optimised / constructed.
4. There are 5 questions for the total of 20 marks.
SECTION D
1.Two marks awarded for each correct SQL statement of the 5 chosen to mark.
2. Alternative approaches to the model answer will often be accepted unless they do not follow the rules / requirements set out in the specification, are poorly optimised or are poorly constructed (SQL).
3. Part marks may be awarded if an answer only has a small problem or an alternative solution is presented that works but is not ideally optimised / constructed.
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more