You are on page 1of 1

Teaching and Learning Solution

Module: Praxis S2 (HPXS200-1)


Week number (Date): 9 (01 October 2020)
Unit covered: Microsoft Access: Module 3

Suppose there is a Boston students’ table called tblStudents with the following columns:
• FirstName VarChar
• Surname VarChar
• Gender number where 0 = Male, 1 = Female, 2 = Not Provided
• SupportCentre VarChar
• Age number
• Course VarChar

Determine the queries for fetching the following data

a) All students from the database that are from the Johannesburg support centres (“Randburg”,
“Braamfontein”)
b) All students that are studying “Accounting”
c) Students whose age is between 20 and 30 years
d) Students in the order of their age from the youngest to the oldest
e) Students with surname that starts with letter “M”
f) Only the support centre and the course of the students who are female

SOLUTION
a. SELECT * FROM tblStudents where SupportCentre IN (“Randburg”, “Braamfontein”)
b. SELECT * FROM tblStudents where Course = “Accounting”
c. SELECT * FROM tblStudents where Age BETWEEN 20 and 30
d. SELECT * FROM tblStudents ORDER BY Age
e. SELECT * FROM tblStudents WHERE Surname LIKE “M*”
f. SELECT SupportCentre, Course FROM tblStudents WHERE Gender = 1

1 HPXS200-1-July-Dec2020-T&L-Memo-W9-CMu-23092020

You might also like