COIT20247 Database Design and Development (T1 2017)
Assessment item 2—Assignment 2
|Due date||11:45pm on Friday of Week 10 (May 19, 2017)|
This assessment item relates to the unit learning outcomes numbers 1, 2 and 3 as stated in the unit profile.
The sample solution of assignment 1 will be released on the unit website approximately two (2) weeks after the assignment 1 due date. You must use that sample solution of assignment 1 only for the following tasks:
- Map the ERD, from the sample solution, into a set of relations in at least Third Normal Form (3NF). You must ensure that your relations meet 3NF. There is no need to show your
- Select any two (2) of your relations from the previous step, 1a), and perform the following for each of those two relations:
- List all the functional dependencies exist in the
- Demonstrate that the relation meets Third Normal Form (3NF).
For your help, an example for a Student relation’s 3NF justification has been provided below:
STUDENT (StudentID, Name, Address, DateOfBirth)
- The primary key is StudentID which identifies a student. There will be one student name per Student ID because only one name is recorded for each student. Even though a student may have multiple addresses (e.g. a home address and a work address), the case study states that there is a need to record the home address only and hence there will be only one address for each student. There will be only one date of birth for each student. Thus, there are no repeating groups. Hence, this relation is in 1NF.
- The primary key is StudentID. This is the only candidate key since Name is not guaranteed to be unique (two different students may have the same name). Address is also not guaranteed to be unique. This means that Student ID functionally determines every other attribute in the table. There is a single valued simple candidate key (StudentId) and therefore no partial dependencies are possible. Hence, the relation is in 2NF.
- Name cannot be used to functionally determine any other attribute in the table since two different students may have the same name; likewise for address and date of birth. Therefore there are no transitive dependencies in the table. Therefore it meets the requirements of first, second and third normal
2 Relational database implementation
Note: Use the relations that you created in the above step 1-Normalization to create a database. The recommended tool for this work is Microsoft Access, version 2010 or later. One reason for recommending Microsoft Access is that your unit lecturer/tutor will be able to provide adequate support to you in the use of this tool. If you choose to use a different DBMS, then there is no guarantee that your lecturer/tutor will be able to provide enough support to you. The remainder of this document assumes that you are using MS-Access.
In implementing the ER model provided, you must complete the following tasks:
- Create all the relations in a Microsoft Access database. Consider each attribute in every table and make appropriate choices regarding data types & sizes, indexes, required/not required and validation rules. Your choices should be appropriate for each attribute and should support data integrity. (Note: see the Data Integrity section below for specific data integrity requirements)
- Create relationships as appropriate. Enforce referential integrity for all appropriate relationships in the database. Apply cascade update and/or delete options wherever necessary.
- Review the default index created by Access for each table. You should ensure that the indexes follow the guidelines given in the unit
- Populate the database with sample data of your own. You must include sufficient sample data to test your queries and report. Please note that the expected result of query questions may depend on the actual sample data
You are required to implement integrity constraints within the database to enforce the following requirements:
- Fees/Charges should be positive currency and expressed in 2 decimals only.
- Date values should not be predated.
- Name of patients/medical specialists should not be null.
- State values should be limited to Australian States/Territories only.
- Skills and experience values should not be null.
- Discount amount should be positive and cannot exceed $50.
Create queries to answer the following information requests. Note: Do not use the Access query builder (QBE) to create your queries – you should type the queries manually using SQL view/editor.
The marking process of the queries for information requests may also consider the effectiveness of your SQL statements that have been used in the queries. It is important that your SQL statement must reflect the correct business logic & SQL syntax. (Use enough sample data so that the output is produced by each and every query).
- Display the details of medical specialist(s) who has/have never performed/completed any appointment.
- Display the details of appointment, name of the patient and medical specialist involved in the most expensive appointment.
- For each of the medical specialists, display his/her name and the number of appointments completed so far.
- For each of the appointment completed, display the date, (start) time, name of the patient and total fees/charges of the appointment, discount amount and final amount payable. (Final amount payable = total appointment charges – discount amount )
- Which patients have consulted more than one specialist? Display the details of such patients only.
- Display the details of the patient(s) whose name contains the word “more”. Show the results in ascending order of the name.
Note: The word ‘name’ is a reserved word in MS Access. Wherever you use it for SQL query, you need to put a bracket like [name]. Follow the same technique for other reserved words too.
Create a simple report object showing the details of skills and experience of the each of the medical specialists. The details have to be presented in ascending order of the (first) name of the medical specialist.
- Create a query that lists all details needed for a report. If you are unable to formulate this query, then create a report that is based directly on the table(s). [Note: you will not be able to obtain full marks for the report creation if you base your report directly on the table(s) and some criteria are not met in your reports.]
- Use the report wizard to generate a basic report based upon your query [or the table(s) if you were unable to formulate the query].
- Once the report wizard finishes, switch to design view and rename the labels appropriately; for example, change the label ‘ConsultationDate’ to ‘Consultation Date’.