Implementation of the database and manipulation of data

Assignment Help Basic Computer Science
Reference no: EM13341999

Objectives: 

To analyse and comprehend a provided ER diagram and Database Schema 

To implement a database based on the provided ER diagram and Database Schema 

To manipulate the data in the database 

To write required SQL statements to query the database 

Project Specification 

The Case Study: Zen Chiropractic Clinic (ZC2) 

After reviewing all the designs, defining the scope and long deliberations with Dr Zen Fuller, the design of the database has been finalised. In this assignment you will use a ‘simplified’ database model as depicted by the ERD in Figure 1. 

For this assignment you will populate these tables with appropriate test data and write the SQL queries below. Penalties will apply to queries that use subqueries and views unnecessarily. The schema file for creating this model is available in the archive ZEN-ass2-schm1509.zip - this file creates the above tables, their keys (primary and foreign) and populates the studio, rating and genre tables - you should read this schema carefully so that you are aware of the meaning of the various attributes. You must not alter the schema file in any manner, it must be used as supplied. Use the data supplied in the INSURANCE, PATIENT, PRODUCT and CLASSIFICATION tables as loaded by this file, do not add further rows. 

You may need to rerun the schema, especially when you have been experimenting with your solutions and may have corrupted the database unintentionally. If you suspect that there might be such problems, rerun the schema. 

Implementation of the Database and Manipulation of Data 

1. Using the supplied schema file create the tables for ZC2 and insert values into the all non-populated tables. 

Load the non-populated tables with test data. You should create a single script which will insert, as a minimum, the following sample data - 

• 8 services. 

• 15 records for the remaining non-populated tables. 

The script should contain a single COMMIT statement as the last line of the script, i.e. all inserts should be treated as a single transaction. The data should be structured in such a way that once it has been inserted and the -commit- SQL command run, that the database is in a consistent state. Design the test data so that you get output for the SQL queries specified below. Queries that are correct and do not produce output using your test data will lose 50% of the marks allocated so you should carefully check your test data and ensure it thoroughly validates your SQL queries. 

For the Tasks 2-5, the SQL scripts must correctly manage transactions. You should also ensure that any related data impacted by your script actions are correctly managed. 

2. A new patient Cecilia Green of 26 Wellington Rd Clayton Victoria 3168, phone 041299032123 has made an appointment for consultation on 28 May 2014; Scheduled start time: 10 am. 

Include this new patient and her appointment into the ZC2 database.You can assume that patient number for this new patient is the increment of the largest patient number in the patient table by 1. 

3. On the day of the consultation, Cecilia receives her consultation on the scheduled time. Zen gives Cecilia a spinal adjustment after diagnosing that her back pain as a result of improper sitting posture. Zen also recommends 2 new products - OzBee Royal Jelly (code: P007) and Organic Relax Massage Oil (code: P004) to Cecilia. She is happy to buy 2 bottles of each product. 

Include the details of this consultation in the database. If the service described above does not exist in the service table, you will need to include it. 

4. Just before Cecilia consultation is completed, Zen receives a call from his clerk telling him the supplier has just called back product P004 and the clerk will be removing this product from the database. Zen decides cancel Cecilia’s order from the database. 

Include the above changes in the database. 

5. Record that Cecilia’s consultation is completed at 11 am. 

Querying of Database using SQL Statements 

6. Display the full details for all patients - the name details (firstname and surname) should be shown in one column called 'Patient Name' and the address details (street, suburb, state and postcode) in one column called -Member Address'. 

7. Display the full details for all patients who have a VIC or a QLD address. 

8. Display the full details for all products in the ZC2 product table which have the word 'Nature' in their product name. 

9. Zen is considering to increase the price of all the products by 2.5%. Display the code, name and the increased price of all products in ZC2. 

10. Display the full details for the cheapest service(s) provided by ZC2.  

11. Display the code, name, classification number and classification description of services which are classified 1 or 3, and are cheaper than $100 per unit. Order the list such that the services which are more expensive are listed first. 

12. Display the details of all consultations which products have been recommended to the patients but not purchased by them. Include the product code in the list and display in patient number order within consultation number order. 

NB’ 

Assignment 2: Question 12 

Below is the Modified Question to make it more simple 

12. Display the details of all consultations which products have been recommended to the 

patients but not purchased by them. Display in patient number order within 

consultation number order 

13. Report the average number of patients Zen sees per day. 

14. Provide a list of all patients which are scheduled for tomorrow’s consultations. 

15. For all patients currently in the ZC2 system, display details about the patients covered by insurance(s) and patients not covered by any insurances: 

• for each patient covered by insurance(s): display the string 'With insurance', the patient number, patient name, and the total number of insurances he/she is covered by, and 

• for each patient covered by no insurance: display the string 'Without insurance', the patient number, patient name, and the total number of insurances he/she is covered by (as string ‘Not applicable’). 

Note that that the results from this listing should be displayed in a single result output. Hint: Make use of the “UNION” relational operator as part of your SQL statement. (6 marks) 

Note: There are some general requirements when defining your select queries: 

You are required to adhere to the following output formatting conventions: 

• All monetary values should be printed with a dollar symbol ($), two digits after the decimal point, and with space for 7 digits before the decimal point 

• You must use consistent and legible formatting in laying out your SQL queries. Include (brief) comments for any query or procedure that uses an -unusual- approach. 

What to submit 

An electronic copy of your assignment should be submitted through Moodle and should include a copy of your report, completed according to the Federation University Australia General Guide for the Presentation of Academic Work and the three files described in Insert (Q1), Manipulate (Q2-5) and Query (Q6-15) statements above. 

Your document should include: 

• A copy of the SQL statements required to: 

o create the database and tables; 

o insert sufficient sample data into each table to demonstrate that your queries work. 

o a report of the results from running the SQL queries by using Copy/paste of their output. 

• A bibliography containing a list of all resources used to complete the assignment. If no resources, apart from the course materials, have been used please indicate this

Reference no: EM13341999

Questions Cloud

Evaluate the molarity of the ag+ ion : In a concentration cell established using 0.150 M Ag+ solution and a saturated AgCN solution, the measured Ecell is 0.8520 V. Calculate the molarity of the Ag+ ion in the saturated solution.
Find the magnitude of the net electrostatic force experience : The charges are fixed to the corners of a 0.44-m square, one to a corner, in such a way that the net force on any charge is directed toward the center of the square.
Calculate the fast neutron flux needed to produce the injury : Calculate the fast neutron flux needed to produce the same injury as 0.50 mSv/hr of thermal neutrons, and then, as 6,000 thermal neutrons per sq. cm per sec.
Compute the potential at a platinum electrode : Calculate the potential at a platinum electrode in the titration of 50.0 mL of 0.100 M FeSO4 after addition of 7.00 mL of 0.0500 M KMnO4.
Implementation of the database and manipulation of data : After reviewing all the designs, defining the scope and long deliberations with Dr Zen Fuller, the design of the database has been finalised. In this assignment you will use a ‘simplified’ database model as depicted by the ERD in Figure 1.
Explain mass of silica needed to produce one aspirin tablet : The mass of silica needed to produce one- 325mg of aspirin tablet. the formulae is C4H6O3 + C7H6O3 --> C9H8O4 + C2H4O2
What is the total dose equivalent of 1 rem of fast neutrons : What is the total dose equivalent of 1 rem of fast neutrons, 0.5 rad of low energy betas, 25 ergs per gram of thermal neutrons, and 150 mR of diagnostic x-rays
Calculate the absorbed dose in gy to the skin of a person : Calculate the absorbed dose in Gy to the skin of a person which receives 1500 ergs/gm of beta radiation from a cloud of radioactive krypton-85 gas.
What is the length of the rod at the freezing point of water : An aluminum-alloy rod has a length of 10.008 cm at 16.400°C and a length of 10.020 cm at the boiling point of water. (a) What is the length of the rod at the freezing point of water

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Write a program to randomly select the numbers of 4 finalist

You have four identical prizes to give away and a pool of 25 finalists. The finalists are assigned numbers from 1 to 25. Write a program to randomly select the numbers of 4 finalists to receive a prize.

  Write assembly language program that prints your first name

Write an assembly language program that prints your first name on the screen. Use the .ASCII pseudo-op to store characters at the bottom of your program. Use the CHARO instruction to output characters.

  The basic solutions of the simplex method.

Solve the following problem by inspection, and justify the method of solution in terms of the basic solutions of the simplex method.

  Is it possible free internet content might one day replace

Is it possible that free Internet content might one day replace textbooks

  Write the function xsort which takes in a list of strings

Write the function Xsort wich takes in a list of strings and returns sorted list with all words beginning wih "X" first in the list. f.ex: xsort (['kex', 'xylofonn', 'epli', 'xenos', 'asni']) returns ['xenos', 'xylofonn', 'asni', 'epli', 'kex'] th..

  Create the digital building block adder in verilog

Create the digital building block adder in Verilog. Give baseline design (of minimum cost) and improved design (of higher performance). Compile, simulate, and synthesis your Verilog codes.

  Develop the logic for a program that allows a user

The exact number of household records has not yet been determined, but you know that Marengo has 7 households. Develop the logic for a program that allows a user to enter each household size and determine the mean and median household size in Mare..

  Explaining paper on reconnaissance planning

Write a paper on reconnaissance planning. The paper is explaining the network and reconnaissance plan.

  Write the code of the main part of the program

Write the code of the main part of the program so that the code only uses the operations enqueue, dequeue, size, and isEmpty. Then, show that your program works with both types of queue implementation { as a linked list and as an array.

  Write a program to simulate the operation of a simple robot

Write a program to simulate the operation of a simple robot . the robot moves in fourdirections :forward , right , left. the job of the robot is to move items and place it in the right slots in each station. there are 8 stations plus the pick up stat..

  Which classs constructor is called last

A class called DerivedClass is a subclass of a class called BaseClass. DerivedClass also has a member field that is an object of class ComposedClass.

  Develop a training schedule for hoosier burgers end users

Develop a training schedule for Hoosier Burger's end users, develop a hardware and software installation schedule for Hoosier Burger and develop User Documentation for the Delivery Customer Order Form.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd