COMP643 Advanced Database Management Semester 1 2026

Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due

Worth:40%
Due:Friday, 27 March 2026 5:00 p.m.
Late Penalty: Work not received by the due time attracts an immediate penalty of up to 25% of the marks available.

Less than 6 hours late
5% late penalty
Between 6 and 24 hours late (i.e., up to 1 day)
12.5% late penalty
Between 24 and 48 hours late (i.e., 1 - 2 days)
25% late penalty
Over 48 hours late (i.e., 2 days or longer)
100% late penalty

This is an individual assessment. You must not collaborate or confer with others. You ,may help others by verbally explaining concepts and making suggestions in general terms, but without directly showing or sharing your own work. You must develop the logical structure, the details of your scripts, and the database on your own, even if you are working alongside others. Any work that is copied or shares a similar logic to others will receive zero marks for both parties.

The University policy on Academic Integrity can be found here.

GenAI Usage: Partial Usage Permitted

Permitted Use: The use of any GenAI tools is permitted in this assessment only for data generation to be used to populate the database for Part A, Task 5.
Prohibited Use: The use of any GenAI tools for all other parts of this assessment: Part A,Task 1 – 4 and Part B is strictly prohibited.

GenAI tools include, but are not limited to, large language models (e.g. ChatGPT, Copilot, Perplexity, Bard), grammar/writing software (e.g. Grammarly Premium) language translation software (e.g. Lokalise, Quillbot), and coding (e.g., Qodo, Github Copilot). This is not an exhaustive list.

Acknowledgement Requirement: Any use of GenAI tools for data generation must be clearly acknowledged. This includes identifying the GenAI data generation tool used, describe how it was used, including the prompts utilised, and when it was used.

Compliance: Assessment submissions will be analysed for evidence of the use of GenAI, and any student suspected of violating this GenAI Usage may be referred to the Proctor.

Acceptance: By submitting your assessment, you accept and have agreed to adhere to the GenAI Usage as outlined above.

PART A

You are required to design and implement a new database for Lincoln University's Health and Wellness Centre based on the data requirements outlined below.

Scenario

The Health and Wellness Centre at LincolnUniversity maintains records for students who access medical and wellness services. These services are available exclusively to students currently enrolled at the university.

For each student, the centre records a student ID, full name, home address, phone number, university email, date of birth, and gender. Additional information includes degree program, student category (e.g., undergraduate, postgraduate, exchange), enrolment status, blood type, allergies, medical conditions, and any relevant medical notes. Students may also provide an emergency contact with name, relationship, and phone number, but this is optional.

Health Centre Staff and Service Units

The Health and Wellness Centre employs staff such as doctors, nurses, counsellors, physiotherapists, and administrative personnel. Staff details include staff ID, name, phone number, date of birth, gender, position, specialisations, employment type, and office location.

The centre is organized into service units such as the Medical Clinic, Counselling Unit, Physiotherapy Unit, and Health Education Unit. Each unit has a unique ID, name, location, phone number, and operating hours. Every service unit is managed by a senior staff member, and some staff may oversee more than one unit.

Appointments

Students book appointments to receive consultations or treatments. Each appointment has a unique number, date, time, type (medical consultation, counselling,

physiotherapy), and status (scheduled, completed, cancelled, or missed).

Each appointment involves a student, a staff member, and a service unit. Students may have multiple appointments over time, and staff may conduct multiple appointments.

Appointments may include consultation notes, and some appointments generate invoices for payment. Not all appointments generate invoices.

Medical Records, Prescriptions, and Referrals

Some appointments generate a medical record, but not all. Each appointment that does so is associated with exactly one medical record, which includes diagnosis, treatment, follow-up instructions, and additional notes.

Medical records may include prescriptions if medication is recommended. Each prescription records the medicine, dosage, frequency, duration, and special instructions. A medical record may also result in referrals to other units within the centre or to external specialists. Each referral records the date, destination, reason, and status.

Billing and Payments

Chargeable appointments may generate invoices. Each invoice contains the appointment number, service type, invoice date, due date, total amount, and payment
status. Invoices may be paid in full or in parts, and multiple payments can be recorded against an invoice.

Wellness Programs and Enrolment

The centre offers a range of wellness programs, including fitness courses, stress management workshops, nutrition seminars, and mental health awareness sessions.

Each program has a unique ID, name, description, start and end dates, location, and can accommodate up to 20 participants. Students may enrol in up to three programs.

Task 1: ERD Design (25 Marks)

Create an Entity-Relationship Diagram (ERD) based on the scenario above. Your ERD must follow Crow’s Foot notation. All marks will be awarded based on the completeness, accuracy, and clarity of your ERD. Written notes or explanations may support your diagram, but the ERD itself is the assessed work. Document any reasonable assumptions made during the modelling process. Follow the instructions below:
1. Identify entities
• Identify all strong entities
• Identify weak entities
• Identify associative entities if needed
2. Determine attributes and keys
• List relevant attributes for each entity
• Identify the primary key for each entity
• Identify foreign keys for each entity
3. Identify relationships
• Identify relationships between entities and label them with verbs
• Decide whether relationships are one-to-one, one-to-many, or many-to-many.
4. Determine Cardinality and Optionality
• Decide the minimum and maximum number of occurrences for each relationship.
• Clearly indicate optionality on both sides of each relationship.
5. Draw the ERD
• Ensure all relationships are connected to the correct entities.
• Label relationships clearly.
• Use Crow’s Foot notation consistently.
Note: Make sure that naming conventions for entities, attributes, and relationships are consistently followed. Use a data modelling tool to construct the diagram.

Task 2: ERD Validation (10 Marks)

Use normalisation techniques to validate the ERD you created in Task 1. Explain and show how each table (entity) in the ERD satisfies the criteria for Third Normal Form (3NF).

Redraw the final version of the ERD to incorporate any necessary changes, if any, identified during the validation process, making sure that the entire model fully meets the requirements of 3NF. Document the changes made and provide explanations for the reasons each change was required.

Task 3: Data Dictionary (10 Marks)

Write a Data Dictionary that provides a detailed description of all tables (entities) in the finalised ERD.

For each table, list all attributes along with their content descriptions, data types, field lengths, formats, value ranges, required or optional status, primary and foreign keys, foreign key reference tables, and any other relevant details about the attributes that support the database implementation.

Document any decisions made on attribute characteristics, providing clear explanations for the rationale behind each decision.

Task 4: SQL Table Creation (10 Marks)

Write a Structured Query Language (SQL) script to create the table structures for the finalised database design, following the details in the data dictionary from Task 3.

Make sure that all table attributes and necessary constraints (entity integrity, referential integrity, and relationships) are defined correctly.

Task 5: SQL Data Population (10 Marks)

Write a SQL script to populate the database tables with at least five (5) rows of test data for each table. Some tables may require more rows to properly reflect the design. The test data should align with the database design and not violate any constraints defined during the database creation in Task 4. Pay close attention to referential integrity constraints when inserting data.

Note: Make sure SQL files have descriptive names (e.g., name the table creation script createTables.sql) and use clear, self-explanatory names for tables and attributes. Annotate the SQL code from Tasks 4 and 5 with comments to improve readability. Verify that all scripts execute without errors using MySQL Workbench.

PART B

You are required to write a series of SQL queries to extract information from a relational banking database named AuroraBankDB maintained by Aurora Bank, a New Zealand– based financial institution. The database contains tables for customers, branches, accounts, transactions, loans, and loan payments.

Your queries should demonstrate the ability to retrieve, filter, and aggregate data to answer questions about customer activity, account balances, transactions, loan details, and branch performance. Use SQL concepts such as joins, grouping, aggregation functions, subqueries, and conditional logic as needed to complete the tasks.

Download the PARTB.zip folder from LEARN, which includes the BankLoan.sql file to set up the database on your local machine. Refer to the Entity-Relationship Diagram (ERD) shown in Figure 1, which will guide you in understanding the relationships between different entities in the database.

Figure 1- Entity-Relationship Diagram for AuroraBankDB

Task 6: SQL Queries (35 marks)

Write a SQL script containing the following queries for the AuroraBankDB database.
1. Display the account id, account type and current balance for all accounts where the balance is greater than $10,000. Order the results by balance in descending order. (2 marks)
2. Display the total amount of deposits and the total amount of withdrawals for each account. (3 marks)
3. Display the customer id, customer full name and the total number of loans for each customer. Sort the results by customer full name in ascending order. Hint:
Concatenate first name and last name to get the full name. (4 marks)
4. Display the customer id, customer first name and customer last name for all customers who have taken a “Home” loan. Ensure that each customer appears only once in the results. (3 marks)
5. Display the customer first name, customer last name and date of birth for all customers who are 45 years old or older. (2 marks)
6. Display the customer id, customer first name, customer last name and account balance for all customers whose risk category “High”. (3 marks)
7. Display the customer id, customer first name and customer last name who have never taken a loan. (3 marks)
8. Display the account id, month, total withdrawals and total deposits for all accounts that had any month in which the total withdrawals exceeded the total deposits. (4 marks)
9. Display the customer id, customer first name, customer last name, loan id and loan end date for all customers who have overdue loans. A loan is considered overdue if its end date is earlier than the current date and its status is still “Active”. (4 marks)
10.Display the customer id, customer first name, customer last name, loan id and the number of days taken to fully repay the loan for all customers who paid off their loans within 12 months. (4 marks)
11.Display the loan id, customer id and loan principal amount for loans that have never received any payments. (3 marks)
Note: Make sure to annotate all SQL queries with comments to clearly identify which query each part of the script belongs to. Verify that all SQL queries execute without errors using MySQL Workbench on the database.

What to Submit

A single compressed folder (zipped) containing the following files:
Report:
• A PDF file detailing your work for Tasks 1 to 3. The report should be well-organised and clearly explain your approach and results.
SQL Files:
• SQL script for creating the database tables (Task 4).
• SQL script for inserting test data into the database (Task 5).
• SQL script for the queries (Task 6).COMP643 | Assignment 1 - Database Design and Implementation | Page 8

Marking Criteria

Criteria
Marks (out of 100)
Mark Range
Task 1: ERD Design
25

All entities, attributes, keys, relationships, and constraints are accurately represented using Crow’s Foot. Assumptions are clearly documented, and naming conventions are consistently followed. The diagram is neat, well-organized, and fully understandable without additional explanation.(21-25).

Most entities and relationships are accurately represented, with some missing details or errors. Diagrams are generally understandable but may require further clarification. (16-20).

Significant errors or omissions in the diagram, including incorrect relationships or missing keys. Some assumptions or decisions made during modelling are not well-explained. (1–15).

Task 2: ERD Validation
10

Each table is fully normalised and meets 3NF criteria, with clear explanations and supporting examples. Attribute dependencies are well-documented. (9–10).

Most tables meet 3NF, but some normalisation steps lack clarity or contain minor issues.Dependencies are mostly correct. (6–8).

Tables are not fully normalised or contain major issues, with missing or unclear explanations of dependencies. (1–5).

Task 3: Data Dictionary
10

Detailed and comprehensive data dictionary that fully describes all attributes and their characteristics (9–10).

Data dictionary is mostly complete but with minor omissions in attribute descriptions, data types, or other relevant details (6–8).

Data dictionary is incomplete or contains major inaccuracies (1–5).

Task 4: SQL Table Creation
10

SQL scripts are well-written, tables are created correctly, and all necessary constraints (entity integrity, referential integrity) are defined as per the data dictionary (9-10).

SQL scripts are mostly correct but with minor issues in table creation or constraints (6-8).

SQL scripts are poorly written or contain significant errors in table creation or constraints (1–5).

Task 5: SQL Data Population
10

Data is populated correctly with at least 5 test records per table, ensuring referential integrity and alignment with design (9-10).

Data population is mostly correct, with minor issues such as a few missing records or constraints violations (6-8).

Data population has major issues, such as missing or incorrectly referenced data (1–5).

Task 6: SQL Queries
35

All SQL queries are well-written, meet the specified requirements, and correctly extract insights. Queries are optimised and logically sound (31-35).

Most queries meet the requirements, but some may be inefficient or have minor logical issues (24-30).

Queries are not fully correct or do not meet the requirements (1–23).

Total
100

发表评论

电子邮件地址不会被公开。 必填项已用*标注