Data Manipulation and Querying With SQL Assignment Instructions

  

Log onto http://sqlfiddle.com/ and execute the SQL commands listed in the order provided in this document. Reference the Provider Table below and use its information to build the database. Refer to the “Data Manipulation and Querying With SQL Resource” document for assistance in completing this assignment.

Copy and paste a screenshot of each executed command and the populated data onto a document and submit for grading.

Provider Table: 

ProviderID FirstName LastName HireDate

———- ———- ———- ———-

123456 Ben Spock

123457 Albert Schweitzer 1990-05-09

123458 Derek Shepherd 2005-03-27

123459 Mark Sloan 2005-03-27

 
 

  1. Command      CREATE TABLE 
  2. Command that      ALTER table by adding column 
  3. Command      INSERT values for populating table 
  4. Perform six      (6) queries to the Provider Table: 

a. Command SELECT from Provider Table querying Last Name, Hire Date 

b. Command SELECT from Provider Table querying Hire Date 

c. Command SELECT from Provider Table querying specific Provider by Last Name and First Name 

d. Command SELECT FROM Provider Table querying specific Provider by ID and Last Name 

e. Command SELECT FROM Provider Table querying Hire Dates 

f. Command SELECT FROM Provider Table querying Provider Hire Date is NULL 

  1. Command ALTER      TABLE and UPDATE to add a new Salary column to the Provider table 
  2. Perform three      (3) column function queries on the Provider Table: 

a. SELECT SUM 

b. SELECT AVG 

c. SELECT MIN, SELECT AVG, and SELECT MAX 

  1. Perform three      (3) COUNT queries on the Provider table 

a. SELECT COUNT FROM Provider 

b. SELECT COUNT from HIRE DATE 

c. SELECT COUNT DISTINCT  

  1. Command      INSERT INTO Provider table adding a new row  
  2. Perform two      (2) aggregation queries on the Provider table 

a. SELECT HireDate from Provider table 

b. SELECT HireDate COUNT FROM PROVIDER GROUP BY HireDate HAVING COUNT (*)>1; 

  1. CREATE      PATIENT TABLE with the data values provided in the assignment. 
  2. Perform      query command SELECT FROM Patient table 
  3. Perform      three (3) multi-table queries of PROVIDER and PATIENT tables 
  4. Modify      the database by adding an additional column (“Deleted_Date”) to      a table. Justify your rationale in a short paragraph by explaining what      the tradeoffs are in using a marker-column for deletion, as opposed      to deleting a row from a table?