NEW
Font size
WorksheetsFDBS - Final Examination
Total questions: 60
Worksheet time: 30hrs 0mins
SQL stands for:
Structured Query List
Sequential Query Language
Structured Query Language
Standard Question Logic
Which SQL command is used to extract data from a database?
UPDATE
SELECT
INSERT INTO
DELETE
The WHERE clause in SQL is used to:
Sort data
Filter records based on conditions
Change table structure
Insert multiple rows
Which operator returns records only when all conditions are TRUE?
OR
NOT
AND
LIKE
Which aggregate function returns the number of rows in a result set?
SUM()
AVG()
COUNT()
MAX()
What type of JOIN returns all records where there is a match in both tables?
FULL OUTER JOIN
CROSS JOIN
LEFT JOIN
INNER JOIN
A subquery that returns only one value is called:
Multi-row subquery
Correlated subquery
Single-row subquery
Nested multi-query
phpMyAdmin is mainly used to manage:
HTML webpages
MySQL/MariaDB databases
Web server logs
Java applications
Which SQL constraint ensures no duplicate values are allowed in a column?
PRIMARY KEY
NOT NULL
UNIQUE
DEFAULT
The GRANT statement in MySQL is used to:
Delete databases
Give users specific permissions
Remove all privileges
Modify table structures
Which command inserts new data?
ADD
INSERT
INPUT
INCLUDE
Which function finds the average score?
MID
COUNT
AVG
MEAN
You want to list students whose score is greater than 85. Which SQL statement correctly applies the condition?
SELECT * FROM students HAVING score > 85;
SELECT * FROM students WHERE score > 85;
SELECT score > 85 FROM students;
FILTER score > 85 IN students;
A database requires removing all employees who belong to the “Inactive” department. Which SQL command is appropriate?
DELETE * FROM employees WHERE department = 'Inactive';
DELETE FROM employees WHERE department = 'Inactive';
REMOVE FROM employees ('Inactive');
DROP employees WHERE department = 'Inactive';
A teacher wants to know the highest grade from the “grades” table. What function should be applied?
AVG()
SUM()
MAX()
COUNT()
You want to calculate the total sales in the “orders” table. Which query applies the correct function?
SELECT COUNT(sales) FROM orders;
SELECT SUM(sales) FROM orders;
SELECT FULL(sales) FROM orders;
SELECT TOTAL(sales) FROM orders;
Which query displays students sorted by last name in descending order?
SELECT * FROM students ORDER BY lastname DESC;
SELECT * FROM students ORDER lastname DOWN;
SELECT * FROM students SORT lastname DESC;
SELECT * FROM students ORDER BY lastname DOWN;
A query must find employees whose salary is between 20,000 and 30,000. Which is correct?
WHERE salary = 20000 OR 30000
WHERE salary BETWEEN 20000 AND 30000
WHERE salary IN (20000, 30000)
WHERE salary RANGE 20000 TO 30000
You want to retrieve all records where the address field is NOT empty. Which operator applies?
address != NULL
address NOT 0
address IS NOT NULL
address IS NOT EMPTY
A bank needs to combine customer info from two tables using matching IDs. Which JOIN applies?
FULL OUTER JOIN
CROSS JOIN
INNER JOIN
RIGHT JOIN
Given two tables, "orders" and "customers", a manager wants to show all customers even if they have no orders. Which join should be used?
INNER
LEFT JOIN
RIGHT JOIN
FULL JOIN
A query returns an error because it expects only one result from the subquery but receives multiple. Which type of subquery is causing this?
Single-row subquery
Multi-row subquery
Correlated subquery
Scalar subquery
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?
Multi-row
Single-row
Correlated
Nested
A company needs to insert two new products at the same time. Which statement applies?
INSERT BOTH
INSERT MULTIPLE
INSERT INTO products VALUES (...), (...);
INSERT rows INTO products;
You must update only one student's grade in the table. Which is correct?
UPDATE students SET grade=90 WHERE id=10;
UPDATE grade=90 IN students;
CHANGE students TO grade=90;
UPDATE students grade=90 IF id=10;
A query needs to show total salary for each department. Which clause analyzes data by grouping?
ORDER BY
GROUP BY
HAVING
SORT BY
You want to filter grouped data so only departments with total salary above 1M appear. Which clause applies?
WHERE
LIMIT
HAVING
FILTER
You must find employees whose job title has the letters “dev”. Which operator is appropriate?
WHERE job = "%dev%"
WHERE job CONTAINS dev
WHERE job LIKE '%dev%'
WHERE job MATCHES dev
After running a query, you see duplicate entries. Which keyword removes duplicates?
CLEAN
DISTINCT
UNIQUE
FILTER
A student needs to import a database file into phpMyAdmin. Which tab should be used?
Export
SQL
Import
Insert
A table must prevent NULL values in the “email” field. Which constraint applies?
UNIQUE
DEFAULT
PRIMARY KEY
NOT NULL
A user must be allowed to insert and update records but not delete them. Which GRANT statement applies?
GRANT ALL ON table TO user;
GRANT INSERT, UPDATE ON table TO user;
GRANT DELETE ON table TO user;
GRANT LIMITED ON table TO user;
A database requires linking “student_id” in a grades table to the students table. Which constraint should be applied?
UNIQUE
FOREIGN KEY
CHECK
DEFAULT
A company wants to ensure age values entered are 18 or above. Which constraint applies?
PRIMARY KEY
NOT NULL
CHECK (age >= 18)
DEFAULT 18
A user accidentally deleted records. To restore, which phpMyAdmin feature should be used?
Export
Backup / Import
SQL Query
Repair Table
A database administrator wants to revoke all permissions from a user. Which statement applies?
REVOKE EVERYTHING FROM user;
REMOVE PRIVILEGES user;
REVOKE ALL ON database FROM user;
DROP USER user;
Which situation best demonstrates ethical data handling under RA 10173?
Storing all data permanently
Collecting only necessary data
Sharing data without consent
Keeping passwords unencrypted
A school needs to show the permissions assigned to a user in MySQL. Which command is used?
SHOW ACCESS OF user;
VIEW PRIVILEGES user;
SHOW GRANTS FOR user;
LIST PRIVILEGES user;
When creating a database in phpMyAdmin, what is the correct first action?
Click Export
Start the Apache/MySQL services
Create a new SQL file
Open the Privileges tab
Which feature makes phpMyAdmin useful for web developers?
Cannot execute SQL queries
Only supports one database
Allows GUI-based CRUD operations
Runs without a browser
A teacher wants to ensure that student names in a table are not duplicated. Which constraint ensures this?
DEFAULT
CHECK
UNIQUE
NOT NULL
A hospital wants to protect sensitive patient information. Which RA 10173 principle ensures that only authorized staff access data?
Transparency
Proportionality
Data Minimization
Security
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?
SELECT class, AVG(grade) FROM records ORDER BY grade DESC;
SELECT class, AVG(grade) FROM records GROUP BY class ORDER BY AVG(grade) DESC;
SELECT AVG(grade) GROUP BY class IN records DESC;
SELECT class, grade FROM records HAVING AVG(grade);
You are tasked to redesign a query to make it more efficient. Which solution shows better optimization?
Replacing COUNT(*) with COUNT(column)
Using DISTINCT when not needed
Using WHERE before GROUP BY to reduce rows
Using multiple subqueries inside each SELECT clause
A manager wants to evaluate which employees have salaries above the average salary for their department. Which query demonstrates this analysis?
WHERE salary > AVG(salary)
SELECT * FROM employees WHERE salary > ALL employees;
SELECT * FROM employees e WHERE salary > (SELECT AVG(salary) FROM employees WHERE department=e.department);
SELECT salary FROM employees HAVING salary > AVG(salary);
A database must determine which products have not been ordered at all. Which solution synthesizes JOIN logic effectively?
INNER JOIN to display matching records
LEFT JOIN and filter NULL values on the order side
RIGHT JOIN and filter NULL values on the product side
FULL JOIN to show all missing relationships
You need to evaluate which SQL aggregation approach provides the most accurate performance analysis across multiple months.
Using SUM() without grouping
Grouping by month and using SUM(), AVG(), MIN(), MAX()
Sorting by date only
Filtering dates using LIKE '%2023%'
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?
Replace NULL with 0 using COALESCE()
Ignore the values
Convert NULL to empty strings
Drop the rows
A query using a correlated subquery runs slowly on a large dataset. What is the best evaluated optimization approach?
Increase subquery depth
Replace correlated subquery with JOIN + GROUP BY
Add more OR operators
Use SELECT * everywhere
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?
Compare each sale individually
Use a single-row subquery returning national total
Insert all totals manually
Group stores without aggregating
To determine which employees belong to departments that have more than 10 employees, which evaluated solution is correct?
Use WHERE COUNT(employees) > 10
Use GROUP BY department HAVING COUNT(*) > 10
Use DISTINCT
Use CASE statements
You want to generate a new table combining students, courses, and grades. Which SQL tool best synthesizes data from multiple sources?
A. UNION to merge matching rows
B. JOINS to integrate related tables
C. DELETE to clean tables
D. Subqueries to isolate only one table
A school wants to redesign its database structure to improve security. Which evaluated practice is best?
Allow all users full access
Assign privileges based on roles (role-based access)
Share passwords among staff
Disable backups to avoid data leaks
You must choose the best constraint to ensure the most secure and accurate student records. Which is best?
Allow NULL for ID numbers
Use PRIMARY KEY + FOREIGN KEY relationships
Remove all constraints
Use DEFAULT values for all fields
A company wants to ensure their phpMyAdmin database can be recovered quickly after corruption. Which evaluated strategy is superior?
Rely on browser history
Use regular automated backups + export to secure storage
Delete old backups to save space
Skip exporting data
A user account in MySQL has too many privileges and poses risk. Evaluating the options, which is best?
Delete the account without review
REVOKE unnecessary privileges and apply least-privilege principle
Grant even more privileges
Ignore the issue
In evaluating ethical data practices, which action shows the highest compliance with RA 10173?
Collecting all data just in case
Collecting only necessary data for a valid purpose
Sharing data for convenience
Keeping unsecured copies on USB
A hospital needs to improve security for phpMyAdmin logins. Which evaluated option is best?
Use weak passwords but update often
Use strong passwords, enable 2FA, and restrict access by IP
Allow guest access
Share accounts
A data analyst needs to decide the best way to import a large dataset into phpMyAdmin. Which solution is most efficient?
Manually typing all entries
Using the Import tool: CSV or SQL format with optimized settings
Uploading images instead
Using INSERT statements one by one
A company wants to evaluate user access to ensure no one has unauthorized privileges. Which phpMyAdmin action achieves this?
SORT DATABASES
VIEW ALL USER GRANTS
EXPORT STRUCTURE ONLY
DELETE ALL USERS
