I’ve provided 2 discussions about SQL statements that need to be responded.
1-)
|
Patient |
|
Pk Pat_ID |
|
Pat_First |
|
Pat_Last |
|
Adm_Date |
|
Adm_Time |
|
Fk NU_Loc |
|
Pat_DOB |
|
Disc_Time |
|
Disc_Date |
I’ve chosen the Create View statement for my post.
CREATE VIEW V_Admissions AS
SELECT Pat_First Pat_Last Adm_Date Adm_Time
FROM Patient
WHERE NU_Loc=’West-wing’;
2-)Select one of the following SQL statements. You need to identify the statement and the syntax. Provide an example of the SQL statement using a table and attributes from the database, you are designing for your data management project.
|
Medication |
|
Med_ID |
|
Med_Name |
|
Med_Qty |
|
Med_Create_Time |
|
Med_Date |
|
Med_Creator |
|
Pat_ID |
|
NU_Location |
Select with Where clause
- Find medication with quantities less than 3
SELECT Med_Name, Med_Qty
FROM Medication
WHERE Med_Qty <3;
- Find medication Amoxicillin or Penicillin with medication date of 02/01/2019.
SELECT Med_Name, Med_Date
FROM Medication;
WHERE (Med_Name LIKE ‘%Amoxicillin’
OR Med_Name LIKE ‘%Penicillin’)
AND Med_Date = 02/01/2019;


0 comments