1. Homepage
  2. Programming
  3. COMP643 Advanced Database Management Assignment 1: Prescription Management System

COMP643 Advanced Database Management Assignment 1: Prescription Management System

Engage in a Conversation
Lincoln UniversityCOMP643Advanced Database ManagementPrescription Management SystemERSQL

COMP643 Advanced Database Management Assignment 1 CourseNana.COM

40%
Friday, 26
th April 2024 @ 5:00pm CourseNana.COM

Work not received by the due time attracts an immediate penalty of up to 25% of the marks available. No work will be accepted after Sun 28th April 2024 5:00pm CourseNana.COM

via COMP643 on LEARN CourseNana.COM

Worth:
Due:
Late Penalty:
CourseNana.COM

Submission: CourseNana.COM

IMPORTANT CourseNana.COM

The use of Artificial Intelligence (AI) tools, such as ChatGPT, to complete this assessment is prohibited. Assessment answers will be analysed for evidence of the use of AI and penalties may be administered. CourseNana.COM

The University policy on Academic Integrity can be found here. PART 1 – ER DIAGRAM (100 POINTS) CourseNana.COM

South Island Scenic Tours (SIST) is a company in Christchurch that provides guided tours to groups of visitors to Christchurch area. Over the years, the number of tourists coming to Christchurch has grown and SIST has found it difficult to manage various information related to the tours. The company’s operations are as follows: CourseNana.COM

  • SIST offers many different tours. For each tour, the tour name, the description, approximate length (in hours) and fee charged is needed. A tour can have many different qualified guides. Guides are identified by an employee ID. Additional information for guides include guide’s name, home address and date of hire. Guides take a test to be qualified to lead specific tours. As the company enforces that each tour must be led by a qualified guide, it is important to know which guides are qualified to lead which tours and the date that they completed the qualification test for each tour. A guide may be qualified to lead many different tours as long as the guide has completed the qualification test for those tours. New guides (who have not completed any qualification test) are not qualified to lead any tours. New tours may or may not have any qualified guides. CourseNana.COM

  • Every tour is designed to visit at least three locations. For each location, a name, a type and official description are kept. All locations are visited by at least one tour. The order in which the tour visits each location should be tracked as well. CourseNana.COM

  • When a tour is actually given, this is referred to as an “outing”. SIST schedules outings well in advance so they can be advertised and so employees can understand their upcoming work schedules. A tour can have many scheduled outings. Each outing is for a single tour and is scheduled for a particular date and time. All outings must be associated with a tour. All tours CourseNana.COM

at SIST are guided tours, so a qualified guide must be assigned to each outing. Each outing has one and only one qualified guide. CourseNana.COM

Tourists pay to join a scheduled outing. For each tourist, the name and telephone number are recorded. A tourist may sign up to join many different outings. Each outing can have at least one or up to 30 tourists. Information is kept only on tourists who have signed up for at least one outing. CourseNana.COM

The owner, Laura Kendall has approached you to design the database for the web application that they are developing to help run the business. Based on the information provided, create the Crow’s Foot notation ERD to support SIST’s business operation. CourseNana.COM

Marking Information CourseNana.COM

Identification of main entities 30 Identification of the relationship types 40 between the entities in including the
relationship types and cardinality
CourseNana.COM

Each entity is named sensibly. Relationship types are labelled; cardinality of each relationship is shown. CourseNana.COM

Criteria CourseNana.COM

Identify the attributes for each entity including primary key and foreign key. CourseNana.COM

All relevant attributes are identified for each; primary key is identified; foreign keys identified. CourseNana.COM

PART 2 CREATING DATABASE, TABLES WITH INTEGRITY CONSTRAINTS (50 POINTS) CourseNana.COM

The ERD for Prescription Management System is shown in Figure 1. Drugs are sold in pharmacies. Each pharmacy has a unique identification. Every pharmacy sells one or more drugs, but some pharmacies do not sell every drug. Drug sales must be recorded by prescription, which are kept as a record by the pharmacy. A prescription clearly identifies the drug, doctor and patient as well as the date it is filled. Doctors prescribes drugs for patients. A doctor can prescribe one or more drugs for a patient and a patient can get one or more prescriptions. However, a prescription is written by only one doctor. CourseNana.COM

Figure 1: ERD for Prescription Management System CourseNana.COM

  1. Write an SQL script to create a database and the accompanying tables. Ensure that all the integrity constraints are defined. CourseNana.COM

  2. Write another SQL script to populate the database that you have created in Part 1. Create 10 rows for each table. CourseNana.COM

Marking Information CourseNana.COM

All entities identified in Part 1 are converted 10 to table.
All attributes have sensible types with 20 constraints.
CourseNana.COM

All tables are populated with 10 rows of data 20 CourseNana.COM

Database and tables are created.
Data types are sensible, and constraints are implemented. Database is ready to use.
CourseNana.COM

Criteria CourseNana.COM

PART 3 – SQL QUERIES (50 POINTS) CourseNana.COM

Use the ERD for the SaleCo Online Order system shown in Figure 2 to answer the following queries. You can download the SQL script (“SaleCoDBMySQL.sql”) to create the database in your local machine. CourseNana.COM

Figure 2: ERD for the SaleCo Online Order System CourseNana.COM

  1. Display the total number of invoices. (2 points) CourseNana.COM

  2. Display the number of customers with a balance of more than $500. (3 points) CourseNana.COM

  3. Display all purchases made by the customers. The list should include customer code, invoice CourseNana.COM

    number, invoice date, product description, line units and line price. Sort the results by customer CourseNana.COM

    code, invoice number and product description. (3 points) CourseNana.COM

  4. Display a list of all customer purchases. The list should include customer code, invoice number, CourseNana.COM

    product description, units bought, unit price and subtotal for each of the invoice line numbers. The subtotal is a derived attribute calculated by multiplying line_units by line_price. Sort the output by customer code, invoice number and product description. (4 points) CourseNana.COM

  5. Display the customer code, balance and total purchases for each customer. Total purchase is calculated by summing the line subtotals for each customer. Sort the result by customer code. (3 points) CourseNana.COM

  6. Display the customer code, balance, total purchases and number of individual product purchases made by each customer. For example, if the customer’s invoice is based on three products, one per line_number, then you count the three product purchases. Sort the result by customer code. (4 points) CourseNana.COM

  7. Display the customer code, customer balance, total of all purchases, the number of purchases, and the average purchase amount made by each customer. Sort the results by customer code. (5 points) CourseNana.COM

  1. Display the invoice number and total purchase per invoice. The total purchase is the sum of the product purchases in Line table that corresponds to the invoice. Sort the results by invoice number. (3 points) CourseNana.COM

  2. Display customer code, invoice number and invoice totals. Sort the results by customer code and then by invoice number. Note that there may be more than one invoice per customer. (3 points) CourseNana.COM

  3. Display the customer code, number of invoices and the total purchases by the customer. Sort the results by customer order. (5 points) CourseNana.COM

  4. Display the total number of invoices, the invoice total for all the invoices, the smallest of the invoice amounts, the largest of the invoice amounts and the average of the invoice amounts. (5 points) CourseNana.COM

  5. Display the customer code and the customer balance for all customers who appear in the Invoice table. Sort the results by customer code. (2 points) CourseNana.COM

  6. Display the minimum balance, maximum balance and average balance for those customers who made purchases. (3 points) CourseNana.COM

  7. Display the total balance, minimum balance, maximum balance and average balance for all customers. (2 points) CourseNana.COM

  8. Display the customer code and customer balance for all customers who did not make any purchases (3 points) CourseNana.COM

CourseNana.COM

PART 4 – NORMALISATION (50 POINTS) CourseNana.COM

CoverServ supplies part-time/temporary staff to hotels throughout the South Island. Table 1 shows the time spent by agency staff working at two hotels. The EMP_ID is unique for employee. CourseNana.COM

Table 1: Sample data of time spent by agency staff working at two hotels CourseNana.COM

Attribute Name CourseNana.COM

Sample Value CourseNana.COM

Sample Value CourseNana.COM

Sample Value CourseNana.COM

Sample Value CourseNana.COM

EMP_ID 10001 CONTRACT_NO C1024 HOURS_PER_WEEK 16 EMP_NAME John Smith HOTEL_NO H25 HOTEL_LOCATION Christchurch CourseNana.COM

Based on the information provided in Table CourseNana.COM

  1. Provide examples of insertion, deletion CourseNana.COM

  2. Normalise the table to 3NF. Show your CourseNana.COM

10005 C1024 24 Diane Gray H25 Christchurch CourseNana.COM

11003 C1025 28 Sandy Wu H4 Queenstown CourseNana.COM

10001 C1025 16 John Smith H4 Queenstown CourseNana.COM

shown in Table 1. (30 points)
3.
Draw the Crow’s Foot ERD of the normalised relations. (10 points) CourseNana.COM

and modification anomalies. (10 points)
work. State any assumptions you make about the data
CourseNana.COM

6|Page  CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
Lincoln University代写,COMP643代写,Advanced Database Management代写,Prescription Management System代写,ER代写,SQL代写,Lincoln University代编,COMP643代编,Advanced Database Management代编,Prescription Management System代编,ER代编,SQL代编,Lincoln University代考,COMP643代考,Advanced Database Management代考,Prescription Management System代考,ER代考,SQL代考,Lincoln Universityhelp,COMP643help,Advanced Database Managementhelp,Prescription Management Systemhelp,ERhelp,SQLhelp,Lincoln University作业代写,COMP643作业代写,Advanced Database Management作业代写,Prescription Management System作业代写,ER作业代写,SQL作业代写,Lincoln University编程代写,COMP643编程代写,Advanced Database Management编程代写,Prescription Management System编程代写,ER编程代写,SQL编程代写,Lincoln Universityprogramming help,COMP643programming help,Advanced Database Managementprogramming help,Prescription Management Systemprogramming help,ERprogramming help,SQLprogramming help,Lincoln Universityassignment help,COMP643assignment help,Advanced Database Managementassignment help,Prescription Management Systemassignment help,ERassignment help,SQLassignment help,Lincoln Universitysolution,COMP643solution,Advanced Database Managementsolution,Prescription Management Systemsolution,ERsolution,SQLsolution,