Sunteți pe pagina 1din 2

DEPARTMENT OF COMPUTER ENGINEERING

CO 71003: Database Engineering


ASSIGNMENT 3

Patient(patientid, Fname, Lname, Dob, Gender, ph_no, Address, City, State, Zipcode)
Visits(visitid, patienid, visitdate, insurancecompany, insurancegroupcode, insurancecelmembercode,
patientamountpaid, datebillsubmission, dateinsurancepaid, amountinsurancepaid)
patientDiagonises(visitid, ICD9Diagosis, comments)
ICD9DiagonosisCodes( ICD9Diagosis, shortDescription)
VisitProcedures(visitid, ICD9Procedure, Eid, Amountcharged)
Emp(Eid, FN, LM, Employeecategory, Datehired, Dateleft, Emergencyph_no)

1. List the physicians and their emergency phone numbers sorted by name.
2. List the patients and their phone numbers who visited the clinic between July 1, 2007 and July 7,
2007.
3. List the male patients under 30 years old who were treated by Nurse Cameron in June 2007. Hint:
Use a function to subtract dates by years.
4. List all of the patients who were diagnosed with a “dog bite” in 2007.
5. List all of the procedure codes that refer to the uvula.
6. List all of the potential diagnoses involving swimming.
7. List the patients who did not have insurance coverage for a visit in May 2007.
8. List all of the employees and procedures they performed for Debra Santini in 2007.
9. List all of the employees who have performed a procedure in the 51xx category (any procedure
beginning with 51) in the second half of 2007.
10. List the patients who had Medicare coverage for at least one visit in 2007. List each person only
once if there were multiple visits.
11. How many patient visits occurred in May 2007?
12. Which patient had the most visits in 2007?
13. What is the total amount of revenue generated (not necessarily paid) in June 2007?
14. How much money was received from each insurance company in the first quarter of 2007?
15. Diagnostic codes are grouped by the initial letters or numbers of the code. The top-level group is the
first character of the code. Count the number of patients diagnosed with each of the top-level codes.
Hint: Use a function to return just the first character of the code.
16. On average, how many days did it take to receive money from each insurance company in 2007?
17. Which employee billed the most revenue charges for 2007?
18. What is the most number of days it took our company to submit a bill to an insurance company in
2007?
19. What is the most number of employees who treated a patient in one visit in 2007?
20. What is the most number of patients seen in one day in August 2007?List the visits/cases where the
company needs to reimburse the patient for overpayment where the insurance company payment
plus the patient payment exceeds the amount charged.
21. What was the average number of visits per patient in 2007?
22. What percent of the visits resulted in more then $1000 in charges?
23. List the percentage of revenue generated by each physician in 2007. Use separate queries.
24. What percentage of the patient visits were not covered by insurance in 2007?
25. Which patients did not have visits in 2007? Use an outer join.
26. Which insurance company paid the lowest percentage of the total amount charged?
27. In 2007, how many visits involved three or more procedures?
28. For 2007, what was the average number of patients per month seen by each employee?
29. Which patients with an ICD9 diagnosis code beginning with E8 have had a procedure starting with a
9 code at the time of the diagnosis or later?
30. Use SQL to create a table (InsuranceDelay) that can be used to categorize insurance company
payment delays.
Category MinDays MaxDays
Month 30 60
Late 60 90
TooLong 90 1000

Use the categories defined by the table to count the number of items in each category for each of the
insurance companies—based on the number of days between submitting the bill and receiving
payment. Write the final query as a cross tab to show the number of bills that fall into each category
for each insurance company.

S-ar putea să vă placă și