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

  The principles of database design and management

Complete the 8- to 10-slide Microsoft® PowerPoint® presentation in which you explain the principles of database design and management. Include the following

  Build a sql server database in your visual studio project

build a sql server database in your visual studio project. add a table in the database using the properties of the

  Create an initial erd for the new system

Create an initial ERD for the new system that contains at least eight entities. Analyze each relationship to determine if it is 1:1, 1:M, or M:N

  Write the functional dependencies in the table

Write the functional dependencies in the table which concerns invoicing (an application Premiere Products is considering adding to its database), subject to the specified conditions.

  Write the relational schema

Write the relational schema, draw its dependency diagram, and identify all dependencies, including all partial and transitive dependencies.

  Object-oriented client database assignment

Imagine that a customer has come to your team and has requested a simple application that will allow the customer to store client names, addresses, and telephone numbers. The application will be written as a console app

  Normalized erd-memo or and database file

Normalized ERD, Memo, and Database File

  Define the digital divide and the impact of the olpc

The Digital Divide and the impact of the OLPC initiative. Write a 1 page summary for each article and include the proper citations.

  Create a relational schema

There are errors in the Company Schema. Identify all of the errors. Using ER Diagramming notation, diagram a relational model that is capable of modeling a e-commerce-based company. It should include the following information

  Which does not apply to the following relationship image

A primary key  can be computer generated. consists of one field only that uniquely identifies each record in a table. is a relationship between two or more tables. All of the above.

  Dsign document 1write a four to sixnbsp page design

this assignment consists of two sections a design document and a revised project plan. you must submit both sections

  Define calculations and format the table

internship at Mountain View Realty, a real estate firm that focuses in the North Utah County area. The previous intern developed a spreadsheet listing houses listed and sold during the last several months. She included addresses, location, list pr..

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