Group 9 B - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Group 9 B

Description:

Now write and test some queries that will work using sample data. ... Brad Pitt 1234. Ben Affleck 1235. Kenny Chesney 1236. Steven Segall 1237. Tim McGraw 1238 ... – PowerPoint PPT presentation

Number of Views:71
Avg rating:3.0/5.0
Slides: 13
Provided by: mglo
Category:
Tags: brad | group | pitt

less

Transcript and Presenter's Notes

Title: Group 9 B


1
Group 9 B
  • Michael Glover
  • Justin Neff
  • Amanda Cooper

2
Exercise 4-A
  • Now write and test some queries that will work
    using sample data.
  • A. Select information only from one of the tables.

3
Exercise 4-A answer
  • select physician_name, physician_id
  • from PHYSICIAN_T50000
  • SQL Select physician_Name, physician_id
  • 2 from physician_t50000
  • PHYSICIAN_NAME PHYSICIAN_ID
  • -------------- ------------
  • Brad Pitt 1234
  • Ben Affleck 1235
  • Kenny Chesney 1236
  • Steven Segall 1237
  • Tim McGraw 1238
  • Faith Hill 1239
  • 6 rows selected.

4
Exercise 4-B
  • Aggregate information from one attribute in a
    table.

5
Exercise 4-B answer
  • select count() from patient_t50000
  • where physician_id '1235'
  • SQL select count() from patient_t50000
  • 2 where physician_id '1235'
  • COUNT()
  • --------
  • 2

6
Exercise 4-C
  • Try out any of the various functions such as MIN,
    MAX, and AVG.

7
Exercise 4-C answer
  • select Min(unit_cost)
  • from item_t50000
  • SQL select MIN(unit_cost)
  • 2 from item_t50000
  • MIN(UNIT_COST)
  • ---------------
  • 1.50

8
Exercise 4-C answer
  • select MAX(unit_cost)
  • from item_t50000
  • SQL select MAX(unit_cost)
  • 2 from item_t50000
  • MAX(UNIT_COST)
  • ---------------
  • 87.50

9
Exercise 4-C answer
  • select AVG(unit_cost)
  • from item_t50000
  • SQL select AVG(unit_cost)
  • 2 from item_t50000
  • AVG(UNIT_COST)
  • ---------------
  • 18.316667

10
Justin Question
Write the SQL statement that will tell MVCH the
name and patient number of the patient in bed
number 5.
11
Michael Question
  • Write the statement for MVCH that would tell them
    how many services where performed in the month of
    April.

12
Amandas Question
  • Write the SQL statement for MVCH that would give
    them query on who is staying in the hospital and
    what bed.
Write a Comment
User Comments (0)
About PowerShow.com