Lab Week 5
Lab Week 5
Week 6
1. Using the table (students) provided in the next page, provide SQL queries that retrieve
the following:
h. Colleges with eliminating duplicates (hint: use distinct keyword, result should
include four colleges)
--Answer
--2a
Select name, gender
From students;
--2b
Select name
From students
Where gender='Female';
--2c
Select *
From students
Where college='Nursing';
IT244 Introduction to Database
--2d
Select name
From students
Where name like 'A%';
--2e
Select *
From students
Order by name
--2f
Select *
From students
Order by id desc;
--g
Select *
From students
Where id>3;
--h
Select distinct college
From students;
--3a
Insert into students values(8,'Talal','Male','Science');
--3b
Update students
Set college='Nursing'
Where name='Talal';
--3c
Delete from students
Where name='Talal';