Find out what actual operations were performed by surgeon

Assignment Help Database Management System
Reference no: EM13840097

Create and query databases using SQL

Task

Part A - SQL Queries

Use the hospital database (hosp2010.sql) from the Interact Resources site. Answer the following queries from that database.

You are required to submit:

1. The appropriate SQL statements for each query, which should be copied from your SQL code in MySQL and pasted into your submission file

2. Screenshots of the resultant tables which are to be pasted into your submission file immediately after the SQL code for that query.
Typing or manually drawing the results is NOT acceptable.

Question 1

Find out what actual operations were performed by the surgeon 103. List the surgeon code, the code of the actual operation and the date the operation was performed. Show the operation date by the day of the week, the day of the month, the month and the year (ie: Tuesday, 7 October, 2014). Sort the list in most recent date of operation.

Question 2

Find out which patients have not been discharged yet, listing their last name and the date they were admitted. Show the admission date by the day of the month, month and the full year (ie: 6/12/2001).

Question 3

List all the persons who were admitted to the Flemming Ward prior to 1995. Show the persons first and last name, ward name and the date of their admission. Show the admission date by the day of the month, month and the full year (ie: 6/12/2001).

Question 4

For the patients who have been discharged, show the number of days that they stayed at a ward. Also show the patients ID and last name, ward code and the date of admission. Show the admission date by the day of the week, the day of the month, the month and the year (ie: Tuesday, 7 October, 2014). Sort the list in most recent date of admission.

Question 5

A. List the first name and surname of male patients from NSW or ACT (i.e. the postcode is in the 2000's), who have had an operation and recovered in either the Pasteur or the Fleming ward. Mention them only once if they recovered in the same ward more than once. (4 marks)
B. After executing your query, explain the logic of your SQL statement/s (for example, why/how you joined tables and for what reason, etc.), and do this for each part of this query.

Part B - DDL

Question 1

Add a new attribute (field) ‘FullName' to the STAFF table with appropriate data type and realistic number of characters.

Question 2

Add the following staff names into the new field you have added above:

103 Dean Matthews

114 Ray Bones

115 Francess Martinez

116 Tammy Son

Question 3

Delete the Nurse Francess Martinez from the staff table

Question 4

Write the SQL DDL to create the database that contains each of the relations shown in the ERD below:

Make sure to add the necessary data type and size for each of the attributes used.

You will need to provide:

• Your DDL code for each table that you create;

• A screenshot showing each table that is created.

Reference no: EM13840097

Questions Cloud

Which statements best defines a concurrent condition : Which of the following statements best defines a concurrent condition? Which of the following terms refers to a future event that terminates the obligations of the parties to a contract when it occurs
How do the following affect the sensitivity of profits : The price of imported oil fell dramatically in late 2008. What sort of macroeconomic shock would this be considered? How do each of the following affect the sensitivity of profits to the business cycle? Financial leverage Operating leverage
Compute the physical units of production : Compute the physical units of production and compute equivalent units of production for materials and for conversion costs.
The present value of a firms projected cash flows : The present value of a firm’s projected cash flows are $15 million. The break-up value of the firm if you were to sell the major assets and divisions separately would be $20 million. This is an example of what Peter Lynch would call a(n): Stalwart Sl..
Find out what actual operations were performed by surgeon : Find out what actual operations were performed by the surgeon 103. List the surgeon code, the code of the actual operation and the date the operation was performed.
Define each of them in the context of a business cycle : Define each of the following in the context of a business cycle. Peak Contraction Trough Expansion
Consistent with a steeply upwardly sloping yield curve : Which of the following is consistent with a steeply upwardly sloping yield curve? Monetary policy is expansive and fiscal policy is expansive. Monetary policy is expansive while fiscal policy is restrictive. Monetary policy is restrictive and fiscal ..
Most common mythological themes across different cultures : most common mythological themes across different cultures
General hospital, a not-for-profit acute care facility : General Hospital, a not-for-profit acute care facility, has estimated the following costs for its inpatient services: Fixed Costs: $10,000,000 Variable cost per inpatient day $200

Reviews

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