Recent Question/Assignment

ASSIGNMENT 1 SPECIFICATION
Description Marks out of Wtg(%) Due date
ASSIGNMENT 1 100.00 10% 16 January 2015
IMPORTANT INFORMATION
You must submit the assignment electronically by the due date via the online submission link on the CIS2002 Study Desk.
You must use the official USQ data modelling and normalization methodology. This methodology is based on Clive Finkelstein’s techniques (Readings 2.1 and 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 (which you can scan and paste into your assignment). Alternatively, you might wish to use Word or any other software to draw the diagrams. If you use a CASE or drawing tool, you must adapt the drawing to conform to the USQ methodologies.
SECTION A (APPLIED DATABASE THEORY) (20 marks)
BTC AU is the second largest Bitcoin exchange company in Australia. While it focused on keeping up with its core business in a new and emerging environment BTC AU paid scant attention to managing the rest of its rapidly expanding business operations. Integration of its business processes with IT became one of the priorities of BTC AU.
The current approach to its backroom data handling management has been ad hoc and piecemeal. There was no overall map, plan, or model guided approach to the evolution of its systems. Records of past business performance have been hard to elicit from the traditional file processing systems leaving the company with an inability to gain insights to drive business planning forward.
The CIO of the company Sam Nakamoto wants to look at a database approach to integrating the various applications currently running within the organization with the hope of ultimately using the data to support decision making and developing new insights for management in order to gain competitive advantage.
As a business consultant to BTC AU, you are asked to develop a short brief to management, in the form of an essay (around 1000 words), highlighting the following:
1. The existing and potential problems with the current data processing approach.
2. The need for a database approach to satisfy their organizational and decision making demands of the company.
3. A suggested database developmental approach
4. The primary activities associated with database design process.
You are required to extensively research on the relevant topics and present concise and workable solution.
There is no requirement for formal in-text referencing in this question. However, it is recommended you put a list of references at the end of the memo showing the published materials that you researched while answering this question.
SECTION B (SQL) (40 marks)
For each question, marks will be awarded for the SQL and for the correct output.
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 must use this data.
If you are using Oracle on your own computer and are unable to access the USQ server, email the course leader for a script file that will create the tables for you. Due to copyright issues, you will need to insert the data yourself but you will be provided with a template.
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.
Write SQL queries to solve the following specifications. Include the query AND THE OUTPUT. A screen dump of the output is acceptable. Show as many rows as you can. A screen dump is usually done via the ALT + PRNT SCRN command sequence.
While the output helps to understand your solution, you should not be analysing the output of the query in detail. As long as you are confident that your query corresponds to the question completely, your output may not be significant. You can have an output that says NO ROWS FOUND and it could be a perfectly valid output as long as your query fulfils the requirement.
1. Display structure of the i_model table. Display all the information stored in the i_model table belonging to car group ‘A4’. (3 marks)
2. Display the car registration, current mileage (miles_to_date column) and purchase date (date_bought column) for all cars. Order by current mileage in descending order.
(3 marks)
3. Display all the cars registration, miles to date and status for all the cars that have not had a service but are available for hire. Order the list in ascending order of miles to date. (3 marks)
4. Display the booking number, date rent started, period of rental and the expected end date of each rental (i.e. date_rent_start + rental_period) and sort the output by the expected end date in descending order. Label the expected end date of each rental as:
‘EXPECTED END DATE’. (4 marks)
5. Display full details for all the bookings where the distance travelled during that booking (i.e. miles_in – miles_out) is less than 1000 miles. (3 marks)
6. Display rental period, booking number, name of the person who took the reservation, the date that the rental period starts and where Paid is set to ‘N’ for all the bookings where the car has not been returned. List the result by the rental period for the booking in descending order. (3 marks)
7. Display full details for any car that: (a) costs more than $100,000.00 or the name of the car model starts with the letter ‘L’ and (b) belongs to group ‘A4‘ and has a registration whose second digit is 9. (3 marks)
8. Display full details for all car groups belonging to ‘A1’, ‘A2’, ‘B1’ or ‘B2’ AND the rate per mile is either 110 or 120. Find a way of optimising your code so that the complete SQL statement has only ONE logical operator (AND, OR, NOT). (4 marks)
9. Display full details for all cars that have not been serviced before and have a current mileage of greater than 900. (3 marks)
10. Display full details for any car that: (a) costs less than $50,000.00 or the name of the car model starts with the letter ‘D’ and (b) belongs to group ‘B2‘ and is currently available. (You should have a single query that completely fulfils all of the above conditions). (4 marks)
11. Display the name, town and usual payment method of all customers. Order by payment method ascending within town descending. Your query must NOT use the WHERE clause. (3 marks)
12. Display the booking number, registration and the name of the customer who made the booking. You may need to use traditional join between i_booking and i_customer tables to display all the required columns. (4 marks)
SECTION C (Data Modelling) (40 marks)
PART MARKING: We will only mark TWO of the four questions below but you must submit answers to all four. We will choose the questions we mark randomly and mark the same questions for all submissions. Model answers will be supply for all questions during the semester.
Construct data models for the following specifications. Include an ERD and a list of relations (entity list). Your relations must show all attributes, primary keys and foreign keys. You must use the USQ (Finkelstein) methodology as described in your Study Book, the lectures and the tutorials.
Question 1
A questionnaire is a research instrument consisting of a series of questions. We need to develop a model to store questionnaires and its underlying questions. A questionnaire records questionnaire name, primary contact name, start date and expected end date. A questionnaire may have many questions. Each question has a question number, question text and a category description for the question.
Question 2
A mobile phone model consists of a number of variants (different styles, colours and features) which are sold as separate units. We need to develop a data model to record different mobile phone models and their variants. A mobile phone model records brand name, model name, model number (unique) and start year. A mobile phone model may have several variants. Each variant has a variant code, style, colour, feature, launch year and discontinued year.
Question 3
A Bitcoin wallet manages your Bitcoins. A wallet does not store Bitcoins but holds the private keys of the owner of the wallet that allow him/her to access his/her bitcoin addresses and to sign transactions to allow the owner to spend his/her funds.
Question 4
An event coordinator may be working on a number of events over time. An event can have multiple event coordinators working on it but will only have a single event manager. For an event coordinator, we store a unique coordinator identification, his/her office number and area of specialty. We also need to store the date the event coordinator commenced work on the event and the name of the event, the event manager’s name and other relevant event details.
Prepare the following for all four questions:
1 An ER diagram: Show all entities, relationships, cardinalities and optionalities. Also, include all intersection entities but do not create entities that are not specifically covered by the specification. You must use the Finkelstein methodology as per the study book and tutorials.
2 A list of relations (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 but do not create any other additional attributes.

MARKING CRITERIA
SECTION A
1. Solution addresses the business problem and provides a workable resolution to the problem.
2. Solution demonstrates appropriate reference to relevant sections of the selected readings, textbook and, if applicable, other reference material.
3. Solution addresses the assumptions of the problem appropriately.
5. Solution is grammatically and structurally sound.
6. Presentation is neat and professional.
SECTION B
1. Marks are awarded for each correct SQL statement and for the correct output.
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.
SECTION C
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