This document contains a final examination with 13 multiple choice questions testing students' ability to write SQL queries to retrieve information from a MySQL database. The questions require students to query the database tables to select records that match certain criteria like province, course of study, hometown, name, age, and student number. The students are asked to write the full SQL queries for each question and provide the answer.
1. FINAL EXAMINATION 2
Name: ________________________________ Date: __________________
Course/Year/Section: __________________ Instructor: ______________
Score & %: _____ & _____
INSTRUCTIONS:
Open the MySQL database (education database-group table) located at the database server
(192.168.100.93). Make a query of the following statements. Write the SQL statements to
display the output.
1 Make a query of the students whose province is Quezon. Display the firstname, middle,
surname and province.
SELECT firstname,middle,surname,province FROM `Group No.` WHERE
ANSWER
province='Quezon'
2 Make a query of the BEED Students.
SELECT * FROM `Group No.` WHERE course='BEED'
ANSWER
3 Make a query of the students whose from Famy. Select all the data of the records whose from
Famy.
SELECT * FROM `Group No.` WHERE town='Famy'
ANSWER
4 Make a query of the BSED Students.
SELECT * FROM `Group No.` WHERE course='BSED'
ANSWER
5 Make a query of the students whose from Mabitac. Display the student no., firstname,
middle, and surname.
SELECT studno,firstname,middle,surname FROM `Group No.` WHERE town='Mabitac'
ANSWER
6 Make a query whose firstname is Harlene.
2. SELECT * FROM `Group No.` WHERE firstname='Harlene'
ANSWER
7 Make a query of the students whose from Pangil. Display the firstname, middle, surname,
town and province.
SELECT firstname,middle,surname,town,province FROM `Group No.` WHERE
ANSWER
town='Pangil'
8 Make a query of the students whose age is 16.
SELECT * FROM `Group No.` WHERE age=16
ANSWER
9 Make a query of the students whose from Sta. Maria. Display the student no., firstname,
middle, surname and town.
SELECT studno,firstname,middle,surname,town FROM `Group No.` WHERE town='Sta.
ANSWER
Maria'
10 Make a query of the students whose age is 17.
SELECT * FROM `Group No.` WHERE age=17
ANSWER
11 Make a query whose surname is Bautista and whose age is 17.
SELECT * FROM `Group No.` WHERE surname='Bautista' AND age=17
ANSWER
12 Make a query of the student number is M09-1-12369.
SELECT *
ANSWER
FROM `Group No.`
WHERE studno = 'M09-1-12369'
13 Make a query of the students whose from Sta. Maria. Display the student no., firstname,
middle, surname and town.