Write 2 to 3pages
Using a data dictionary, you will write an SQL command to satisfy a data retrieval request. To view the sample dictionary and data retrieval request, click here (Links to an external site.)Links to an external site.. You can also obtain a copy of the document in Files. The details for this assignment are provided in the Course Project for Week 7 in Introduction & Resources.
Submit your lab.
Week 7
Written Assignment: Data Evaluation
Your system has been implemented at the Medical Center of DeVry and you have been requested to produce a report of data from the system.
Using a data dictionary, you will write an SQL command to satisfy a data retrieval request. The sample dictionary and data request are as follows.
Data Dictionary
Patient Table
Element |
Definition |
Typr |
Length |
Default |
Constraints |
MR# |
Unique identification number |
Numeric |
9 |
None |
100000000-999999999 |
LName |
Individual’s last name |
Alpha |
25 |
None |
None |
FName |
Individual’s first name |
Alpha |
20 |
None |
None |
Gender |
Individual’s gender |
Alpha |
1 |
None |
“F” or “M” |
Bdate |
Individual’s birth date |
Date |
8 |
None |
None |
Data Retrieval Request
List all patients with the last name of “Johnson”.
List all patients who are female.
List all patient last names and the medical record number of each.
Important Instruction
For guidance on using SQL commands, refer to the Course Resources, SQL webpages provided, Week lesson area, and other reliable resources of your choice.
SQL
11 hours ago
o SQL and free tutorials
Free SQL tutorials
o Free SQL Tutorials
Free SQL tutorials
Expert Solution Preview
Introduction:
In order to finish the assignment, we will follow the given instructions to write SQL commands based on the data dictionary provided. We will write SQL commands to retrieve data requested in the data retrieval request.
Answer:
1) List all patients with the last name of “Johnson”.
Based on the given data dictionary, we will write an SQL command to retrieve all patients with the last name of “Johnson”.
SELECT * FROM Patient WHERE LName = ‘Johnson’;
This SQL command will retrieve all the patients with the last name of “Johnson” from the Patient table.
2) List all patients who are female.
Similarly, using the data dictionary provided, we will write an SQL command to retrieve all patients who are female.
SELECT * FROM Patient WHERE Gender = ‘F’;
This SQL command will retrieve all the female patients from the Patient table.
3) List all patient last names and the medical record number of each.
Lastly, we will write an SQL command to retrieve all the patient last names and the medical record number of each.
SELECT LName, MR# FROM Patient;
This SQL command will retrieve all the patient last names and the medical record number of each from the Patient table.