CSE4DBF Database Fundamentals Assignment Problem

Assignment Help Database Management System
Reference no: EM132390425 , Length: 6 Pages

CSE4DBF Database Fundamentals Assignment - 2019 Semester 2, La Trobe University, Australia

AIMS AND OBJECTIVES -

  • To perform queries on a relational database system using SQL;
  • To demonstrate an advanced knowledge of stored procedures, stored functions and triggers.

Implement the following tasks using ORACLE SQL*Plus.

Task 1 -

Download the file NATURALTHERAPY.sql from the LMS site and run it on ORACLE SQL*Plus. This file contains all the CREATE and INSERT statements you will need for this assignment.

NOTE: YOU DO NOT NEED TO INSERT MORE DATA INTO THE TABLES.

The list of tables available for this assignment is the following:

MetabolicCategory (categoryNo, name)

FamilyDoc (GPNo, name, contactNo )

MedicalPractitioner (PractionerNo, name, contactNo, speciality)

Naturopath (NaturopathNo, name, contactNo, officeStartTime, officeEndTime, emailAddress)

RelevantCondition(conditionId, name)

MedicalCondition(conditionId, name)

Habits(conditionId, name)

Patient(patientId, name, gender, DoB, address, state,postcode, homePhone, businessPhone, maritalStatus, occupation, duration,unit, race, registrationDate , GPNo, NaturopathNo)

MetabolicFunction (functionNo, name, categoryNo)

Visit (visitNo, visitDate, time, amountPaid, receiptNo, service, medication, chiefComplaints, patientId)

PatientMetabolic (functionNo, patientId, score)

PatientPractitioner (patientId, practionerNo)

PatientRelCon (patientId, conditionId, notes)

PatientHabit (patientId, conditionId, year, average, unit, notes)

PatientMedCon (patientId, conditionId, notes)

RelevantConDetail (patientid, conditionId, specify)

NOTE: PK is printed bold and underlined, FK is printed italic, PK that is also FK is printed bold, italic, and underlined.

Using the tables provided above, provide SQL statements for the following queries.

(a) Display the number of patients referred to by each medical practitioner in the database.

(b) Find out which occupation has the greatest number of patients with high blood pressure.

(c) Display the area postcodes that have at least two patients under the age of 84 years old suffering from asthma.

(d) Display the details of the patient (i.e. Name, Gender, Address, Postcode, DOB) who smokes and has the highest (most severe) total of metabolic functions.

(e) Display the details of patients (i.e. Name, Gender, Address, Postcode, DOB) who haven't visited the naturopath in the last 6 months and who are suffering from a severe heart problem (the total score > 9 for Heart in metabolic screening questionnaire).

(f) Display the details of patients (i.e. Name, Gender, Address, Postcode, DOB) who smoke, have diabetes and high blood pressure. List these patients in an increasing order of their age.

(g) For each patient who has at least an allergy, display the patient's name together with his/her metabolic functions that have the total score >3.

(h) Display the details of all patients in the database (i.e. Name, Gender, Address, Postcode, DOB) together with the referring family doctor of that patient (if any).

(i) Display the average number of patients registered into the database each month.

(j) Display the most popular naturopath that has been visited by the patients.

Task 2 -

Provide the implementation of the following stored procedures and function. For submission, please include both the PL/SQL code and an execute procedure/SQL statement to demonstrate the functionality.

(a) Write a stored procedure that receives a date as input and displays as the output the list of patients who visited the naturopath on that day.

(b) Write a stored procedure that accepts as input a particular medical problem (from the past medical history), and as the output displays the number of patients suffering from that problem, grouped by the 3 age groups (children 0 - 12 years, teenagers over 12 - 20 years, and adult >20 years).

(c) Write a stored function that uses a patient's id as input and calculates the total amount paid to date by that patient. You also need to show an SQL statement to display the total amount paid by all of the patients in the database.

Task 3 -

Provide the implementation of the following triggers. For submission, please include both the PL/SQL code and an insert statement to demonstrate the trigger functionality.

(a) A trigger that is activated if the combination of a patient's name, DOB and living address (including address, state, postcode) already exists in the database.

(b) A trigger that is activated whenever a new medication given to a patient matches any one of the patient's allergy list.

Attachment:- Database Fundamentals Assignment Files.rar

Reference no: EM132390425

Questions Cloud

Organization from an organizational behavior standpoint : What are some challenges technology brings to an organization from an organizational behavior standpoint?
Describe how you will educate your patient to better care : Do a discussion on "Anorexia" to research. Describe how you will educate your patient to better care for themselves. This will require that you do research.
Are non-profits organizations sustainable : Are non-profits organizations sustainable? Will they exist in the future or will they work themselves out of a job?
Should either unions or managements be concerned : Should either unions or managements be concerned with the apparently small effect of higher economic outcomes on overall union member satisfaction?
CSE4DBF Database Fundamentals Assignment Problem : CSE4DBF Database Fundamentals Assignment - Semester 2, Assessment Help and Solution - La Trobe University, Australia - Write a stored procedure
Differenciate resulting alterations of hormonal regulation : Describe the differences and similarities between resulting alterations of hormonal regulation. Explain how the AGE might impact the diagnosis and prescription.
CHCDIV002 Promote Aboriginal and Torres Strait Islander : CHCDIV002 Promote Aboriginal and/or Torres Strait Islander cultural safety Assignment Help and Solutions-Victoria University, Australia-Diploma of Nursing-
NSG3029 Foundations of Nursing Research Assignment Problem : NSG3029 Foundations of Nursing Research assignment help and solutions, South University, assessment help - Identify the nursing framework or theoretical.
What effect aldosterone has on the distal convoluted tubule : What is the effect aldosterone has on the distal convoluted tubule? Why would the actions of aldosterone be useful to Rivka in her situation?

Reviews

len2390425

10/21/2019 11:42:19 PM

No Of Pages/Words: 5-6. I need this assignment done. It's DBF entry level consists of queries, triggers and procedures. Data file is also attached which will be used to populate the database. Task 1 sample solution is given, I have other sample solution which will be provided if needed. SUBMISSION GUIDELINES: Task 1, Task 2 and Task 3 should be saved to a file named task1.txt, task2.txt and task3.txt using the SPOOL command. Note an example of using the SPOOL command is given in the lab book. In the SPOOL file, you need to provide the query/procedure/function/trigger execution and the sample output. For the trigger, you need to show a sample test that demonstrates the successful execution of the trigger. CHECKLIST: The relevant SQL queries for the ‘Natural Therapy Centre’ Database System; The required stored procedures, stored function, and triggers.

Write a Review

Database Management System Questions & Answers

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

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