Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Teaching and Learning Activity Suggested Solutions

Module: Praxis S2 (HPXS200-1)


Week number (Date): 8 (24 September 2020)
Unit covered: Microsoft Access : Module 2

1. Your friend Bevan is a books lover, and has his own library. He would like to run a book rental
business and asked you to assist with creating a database.

• Create a blank database named Bookshelf foro your friend


• Create the following tables with the given attributes:
o Author (ID, AName, ACountry, BookTitle)
o Publisher(ID, PName, PCountry, BookTitle)
o Book(ID, BookTitle, ISBN, AName, PName)

Using the guidelines from the study guide

1 HPXS200-1-July-Dec2020-T&L-Memo-CMu-15092020
2. 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

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

2 HPXS200-1-July-Dec2020-T&L-Memo-CMu-15092020

You might also like