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

  Determine impacts on revenue resulting

If you need to determine impacts on revenue resulting from an increase or decrease in prices and/or sales, the best option to use is a

  Advantages and disadvantages on all the methods

What are the advantages and disadvantages on all the methods available for creating a databaseg a database manually other than it's more complex than using the DBCA tool. Looking through

  An academic department record point

An academic department record points earned by individual students in their classes

  Binary 1-n relationship-optional-to-optional relationship

Give examples of binary 1:N relationships, for (a) an optional-to-optional relationship, (b) an optional-to-mandatory relationship,

  Front-end and back-end validation

What are the advantages and disadvantages of front-end and back-end validation and in which specific situations would one technique of validation be preferred over the other?

  Assume that you have an array of baseball scores type

suppose that you have an array of baseball scores type integer called scores. the values in the array are ordered from

  Define health care database systems

Define health care database systems. Describe how databases are used across the health care industry. Explain the different database architectures including the relational architecture.

  Your supervisors and customers are very impressed with the

your supervisors and customers are very impressed with the database you have put together. however there is still that

  Systems analysis and database design

Based on the information in the Bike Mania case study, use a suitable CASE tool or drawing package to draw up a set of diagrams showing the current physical view of the systemusing the unified modeling language (UML 2.0) notation

  Imagine that you have been hired as the database

imagine that you have been hired as the database administrator for a local department store. the department store has

  What factors will influence how you design the database

The small publishing company you work for wants to create a new database for storing information about all of its author contracts. What factors will influence how you design the database?

  Provision of organization data

Provision of organization data and access on an organizational website.

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