Escolar Documentos
Profissional Documentos
Cultura Documentos
SD 2520
Lab 5.1
Go through this modules lesson, which describes how queries are run
in MySQL.
MySQL
Recommended Procedure:
Note: For the steps that require you to paste screen shots or answer a
question, document your response in a Microsoft Word worksheet titled
SD2520_Module 5_Lab5_1.docx. Make sure to assign a corresponding task
number against each response or screen shot.
Task 1: Executing SELECT Queries
1
Launch ITT-Lab.
Select mydb.
Alexander Nazario
SD 2520
Lab 5.1
Type and execute a query that returns all rows and columns of the
Patients table.
_____________________________________________________________
8
_____________________________________________________________
9
Execute a query that returns the LastName of only the patients that
have a DoctorKey column of 123.
Alexander Nazario
SD 2520
Lab 5.1
_____________________________________________________________
10 Execute the following query:
SELECT Count(*) FROM Patients WHERE DoctorKey = 123
You can use IS NULL and IS NOT NULL to check whether a column that
allows null contains a value or null.
Task 2: Executing DML Statements
1. Execute the following query:
INSERT INTO Patients
(PatientKey, DoctorKey, FirstName, MiddleName, LastName,
PhoneNumber)VALUES ('2-3','22222','Susan',NULL,'Michaels','5554444')
Alexander Nazario
SD 2520
Lab 5.1
_____________________________________________________________
4. Execute the following statement:
UPDATE Patients
SET DoctorKey = 123
WHERE PatientKey = 2
Alexander Nazario
SD 2520
Lab 5.1
Alexander Nazario
SD 2520
Lab 5.1
Question 10: How did the results differ from the query you ran in step
1? Explain why.
_____________________________________________________________
5
Alexander Nazario
SD 2520
Lab 5.1
Alexander Nazario
SD 2520
Lab 5.1
Submission Requirements:
For this lab, you need to submit the Microsoft Word document titled
SD2520_Module 5_Lab5-1.docx to your instructor.
Evaluation Criteria:
The lab rubric will be used to evaluate this assessment. In addition, your
submission will be evaluated against the following points:
Did you include all the screen shots in the Word document?
Alexander Nazario
SD 2520
Lab 5.1