wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

FDBS - Final Examination

Total questions: 60

Worksheet time: 30hrs 0mins

Name
Class
Date
1.

SQL stands for:

a)

Structured Query List

b)

Sequential Query Language

c)

Structured Query Language

d)

Standard Question Logic

2.

Which SQL command is used to extract data from a database?

a)

UPDATE

b)

SELECT

c)

INSERT INTO

d)

DELETE

3.

The WHERE clause in SQL is used to:

a)

Sort data

b)

Filter records based on conditions

c)

Change table structure

d)

Insert multiple rows

4.

Which operator returns records only when all conditions are TRUE?

a)

OR

b)

NOT

c)

AND

d)

LIKE

5.

Which aggregate function returns the number of rows in a result set?

a)

SUM()

b)

AVG()

c)

COUNT()

d)

MAX()

6.

What type of JOIN returns all records where there is a match in both tables?

a)

FULL OUTER JOIN

b)

CROSS JOIN

c)

LEFT JOIN

d)

INNER JOIN

7.

A subquery that returns only one value is called:

a)

Multi-row subquery

b)

Correlated subquery

c)

Single-row subquery

d)

Nested multi-query

8.

phpMyAdmin is mainly used to manage:

a)

HTML webpages

b)

MySQL/MariaDB databases

c)

Web server logs

d)

Java applications

9.

Which SQL constraint ensures no duplicate values are allowed in a column?

a)

PRIMARY KEY

b)

NOT NULL

c)

UNIQUE

d)

DEFAULT

10.

The GRANT statement in MySQL is used to:

a)

Delete databases

b)

Give users specific permissions

c)

Remove all privileges

d)

Modify table structures

11.

Which command inserts new data?

a)

ADD

b)

INSERT

c)

INPUT

d)

INCLUDE

12.

Which function finds the average score?

a)

MID

b)

COUNT

c)

AVG

d)

MEAN

13.

You want to list students whose score is greater than 85. Which SQL statement correctly applies the condition?

a)

SELECT * FROM students HAVING score > 85;

b)

SELECT * FROM students WHERE score > 85;

c)

SELECT score > 85 FROM students;

d)

FILTER score > 85 IN students;

14.

A database requires removing all employees who belong to the “Inactive” department. Which SQL command is appropriate?

a)

DELETE * FROM employees WHERE department = 'Inactive';

b)

DELETE FROM employees WHERE department = 'Inactive';

c)

REMOVE FROM employees ('Inactive');

d)

DROP employees WHERE department = 'Inactive';

15.

A teacher wants to know the highest grade from the “grades” table. What function should be applied?

a)

AVG()

b)

SUM()

c)

MAX()

d)

COUNT()

16.

You want to calculate the total sales in the “orders” table. Which query applies the correct function?

a)

SELECT COUNT(sales) FROM orders;

b)

SELECT SUM(sales) FROM orders;

c)

SELECT FULL(sales) FROM orders;

d)

SELECT TOTAL(sales) FROM orders;

17.

Which query displays students sorted by last name in descending order?

a)

SELECT * FROM students ORDER BY lastname DESC;

b)

SELECT * FROM students ORDER lastname DOWN;

c)

SELECT * FROM students SORT lastname DESC;

d)

SELECT * FROM students ORDER BY lastname DOWN;

18.

A query must find employees whose salary is between 20,000 and 30,000. Which is correct?

a)

WHERE salary = 20000 OR 30000

b)

WHERE salary BETWEEN 20000 AND 30000

c)

WHERE salary IN (20000, 30000)

d)

WHERE salary RANGE 20000 TO 30000

19.

You want to retrieve all records where the address field is NOT empty. Which operator applies?

a)

address != NULL

b)

address NOT 0

c)

address IS NOT NULL

d)

address IS NOT EMPTY

20.

A bank needs to combine customer info from two tables using matching IDs. Which JOIN applies?

a)

FULL OUTER JOIN

b)

CROSS JOIN

c)

INNER JOIN

d)

RIGHT JOIN

21.

Given two tables, "orders" and "customers", a manager wants to show all customers even if they have no orders. Which join should be used?

a)

INNER

b)

LEFT JOIN

c)

RIGHT JOIN

d)

FULL JOIN

22.

A query returns an error because it expects only one result from the subquery but receives multiple. Which type of subquery is causing this?

a)

Single-row subquery

b)

Multi-row subquery

c)

Correlated subquery

d)

Scalar subquery

23.

A query in your system is running slowly because one part of the SQL statement is executed again for every row returned by the main query. Which type of subquery is causing this behavior?

a)

Multi-row

b)

Single-row

c)

Correlated

d)

Nested

24.

A company needs to insert two new products at the same time. Which statement applies?

a)

INSERT BOTH

b)

INSERT MULTIPLE

c)

INSERT INTO products VALUES (...), (...);

d)

INSERT rows INTO products;

25.

You must update only one student's grade in the table. Which is correct?

a)

UPDATE students SET grade=90 WHERE id=10;

b)

UPDATE grade=90 IN students;

c)

CHANGE students TO grade=90;

d)

UPDATE students grade=90 IF id=10;

26.

A query needs to show total salary for each department. Which clause analyzes data by grouping?

a)

ORDER BY

b)

GROUP BY

c)

HAVING

d)

SORT BY

27.

You want to filter grouped data so only departments with total salary above 1M appear. Which clause applies?

a)

WHERE

b)

LIMIT

c)

HAVING

d)

FILTER

28.

You must find employees whose job title has the letters “dev”. Which operator is appropriate?

a)

WHERE job = "%dev%"

b)

WHERE job CONTAINS dev

c)

WHERE job LIKE '%dev%'

d)

WHERE job MATCHES dev

29.

After running a query, you see duplicate entries. Which keyword removes duplicates?

a)

CLEAN

b)

DISTINCT

c)

UNIQUE

d)

FILTER

30.

A student needs to import a database file into phpMyAdmin. Which tab should be used?

a)

Export

b)

SQL

c)

Import

d)

Insert

31.

A table must prevent NULL values in the “email” field. Which constraint applies?

a)

UNIQUE

b)

DEFAULT

c)

PRIMARY KEY

d)

NOT NULL

32.

A user must be allowed to insert and update records but not delete them. Which GRANT statement applies?

a)

GRANT ALL ON table TO user;

b)

GRANT INSERT, UPDATE ON table TO user;

c)

GRANT DELETE ON table TO user;

d)

GRANT LIMITED ON table TO user;

33.

A database requires linking “student_id” in a grades table to the students table. Which constraint should be applied?

a)

UNIQUE

b)

FOREIGN KEY

c)

CHECK

d)

DEFAULT

34.

A company wants to ensure age values entered are 18 or above. Which constraint applies?

a)

PRIMARY KEY

b)

NOT NULL

c)

CHECK (age >= 18)

d)

DEFAULT 18

35.

A user accidentally deleted records. To restore, which phpMyAdmin feature should be used?

a)

Export

b)

Backup / Import

c)

SQL Query

d)

Repair Table

36.

A database administrator wants to revoke all permissions from a user. Which statement applies?

a)

REVOKE EVERYTHING FROM user;

b)

REMOVE PRIVILEGES user;

c)

REVOKE ALL ON database FROM user;

d)

DROP USER user;

37.

Which situation best demonstrates ethical data handling under RA 10173?

a)

Storing all data permanently

b)

Collecting only necessary data

c)

Sharing data without consent

d)

Keeping passwords unencrypted

38.

A school needs to show the permissions assigned to a user in MySQL. Which command is used?

a)

SHOW ACCESS OF user;

b)

VIEW PRIVILEGES user;

c)

SHOW GRANTS FOR user;

d)

LIST PRIVILEGES user;

39.

When creating a database in phpMyAdmin, what is the correct first action?

a)

Click Export

b)

Start the Apache/MySQL services

c)

Create a new SQL file

d)

Open the Privileges tab

40.

Which feature makes phpMyAdmin useful for web developers?

a)

Cannot execute SQL queries

b)

Only supports one database

c)

Allows GUI-based CRUD operations

d)

Runs without a browser

41.

A teacher wants to ensure that student names in a table are not duplicated. Which constraint ensures this?

a)

DEFAULT

b)

CHECK

c)

UNIQUE

d)

NOT NULL

42.

A hospital wants to protect sensitive patient information. Which RA 10173 principle ensures that only authorized staff access data?

a)

Transparency

b)

Proportionality

c)

Data Minimization

d)

Security

43.

A school system wants to generate a summary report showing each class and the average grade, arranged from highest to lowest. Which SQL combination best synthesizes these requirements?

a)

SELECT class, AVG(grade) FROM records ORDER BY grade DESC;

b)

SELECT class, AVG(grade) FROM records GROUP BY class ORDER BY AVG(grade) DESC;

c)

SELECT AVG(grade) GROUP BY class IN records DESC;

d)

SELECT class, grade FROM records HAVING AVG(grade);

44.

You are tasked to redesign a query to make it more efficient. Which solution shows better optimization?

a)

Replacing COUNT(*) with COUNT(column)

b)

Using DISTINCT when not needed

c)

Using WHERE before GROUP BY to reduce rows

d)

Using multiple subqueries inside each SELECT clause

45.

A manager wants to evaluate which employees have salaries above the average salary for their department. Which query demonstrates this analysis?

a)

WHERE salary > AVG(salary)

b)

SELECT * FROM employees WHERE salary > ALL employees;

c)

SELECT * FROM employees e WHERE salary > (SELECT AVG(salary) FROM employees WHERE department=e.department);

d)

SELECT salary FROM employees HAVING salary > AVG(salary);

46.

A database must determine which products have not been ordered at all. Which solution synthesizes JOIN logic effectively?

a)

INNER JOIN to display matching records

b)

LEFT JOIN and filter NULL values on the order side

c)

RIGHT JOIN and filter NULL values on the product side

d)

FULL JOIN to show all missing relationships

47.

You need to evaluate which SQL aggregation approach provides the most accurate performance analysis across multiple months.

a)

Using SUM() without grouping

b)

Grouping by month and using SUM(), AVG(), MIN(), MAX()

c)

Sorting by date only

d)

Filtering dates using LIKE '%2023%'

48.

A company faces incorrect totals when using SUM(). After reviewing the data, you see NULL values in the column. Which action provides the best correction?

a)

Replace NULL with 0 using COALESCE()

b)

Ignore the values

c)

Convert NULL to empty strings

d)

Drop the rows

49.

A query using a correlated subquery runs slowly on a large dataset. What is the best evaluated optimization approach?

a)

Increase subquery depth

b)

Replace correlated subquery with JOIN + GROUP BY

c)

Add more OR operators

d)

Use SELECT * everywhere

50.

You must design a query that identifies top-performing stores by comparing each store’s sales with the total national sales. Which approach is most accurate?

a)

Compare each sale individually

b)

Use a single-row subquery returning national total

c)

Insert all totals manually

d)

Group stores without aggregating

51.

To determine which employees belong to departments that have more than 10 employees, which evaluated solution is correct?

a)

Use WHERE COUNT(employees) > 10

b)

Use GROUP BY department HAVING COUNT(*) > 10

c)

Use DISTINCT

d)

Use CASE statements

52.

You want to generate a new table combining students, courses, and grades. Which SQL tool best synthesizes data from multiple sources?

a)

A. UNION to merge matching rows

b)

B. JOINS to integrate related tables

c)

C. DELETE to clean tables

d)

D. Subqueries to isolate only one table

53.

A school wants to redesign its database structure to improve security. Which evaluated practice is best?

a)

Allow all users full access

b)

Assign privileges based on roles (role-based access)

c)

Share passwords among staff

d)

Disable backups to avoid data leaks

54.

You must choose the best constraint to ensure the most secure and accurate student records. Which is best?

a)

Allow NULL for ID numbers

b)

Use PRIMARY KEY + FOREIGN KEY relationships

c)

Remove all constraints

d)

Use DEFAULT values for all fields

55.

A company wants to ensure their phpMyAdmin database can be recovered quickly after corruption. Which evaluated strategy is superior?

a)

Rely on browser history

b)

Use regular automated backups + export to secure storage

c)

Delete old backups to save space

d)

Skip exporting data

56.

A user account in MySQL has too many privileges and poses risk. Evaluating the options, which is best?

a)

Delete the account without review

b)

REVOKE unnecessary privileges and apply least-privilege principle

c)

Grant even more privileges

d)

Ignore the issue

57.

In evaluating ethical data practices, which action shows the highest compliance with RA 10173?

a)

Collecting all data just in case

b)

Collecting only necessary data for a valid purpose

c)

Sharing data for convenience

d)

Keeping unsecured copies on USB

58.

A hospital needs to improve security for phpMyAdmin logins. Which evaluated option is best?

a)

Use weak passwords but update often

b)

Use strong passwords, enable 2FA, and restrict access by IP

c)

Allow guest access

d)

Share accounts

59.

A data analyst needs to decide the best way to import a large dataset into phpMyAdmin. Which solution is most efficient?

a)

Manually typing all entries

b)

Using the Import tool: CSV or SQL format with optimized settings

c)

Uploading images instead

d)

Using INSERT statements one by one

60.

A company wants to evaluate user access to ensure no one has unauthorized privileges. Which phpMyAdmin action achieves this?

a)

SORT DATABASES

b)

VIEW ALL USER GRANTS

c)

EXPORT STRUCTURE ONLY

d)

DELETE ALL USERS