Edu
Hub
Courses
AI Tools
Leaderboard
Login/Register
AR
Abdullah Rashid
abdullah@example.com
Navigation
📚
Courses
🏆
Leaderboard
✨
AI Tools
←
MySQL Mastery: Medium Level
⏱
15:00
Quit
0 / 20 answered
0%
MySQL Mastery: Medium Level
10 questions · Medium difficulty · 00:20:00 min
🔥 In Progress
Question 1
Which SQL clause is used to filter rows after aggregation in a GROUP BY query?
WHERE
ORDER BY
FILTER
HAVING
Question 2
What is the purpose of the EXPLAIN statement in MySQL?
To explain the syntax of a query
To execute a query and show results
To create an index
To display the execution plan of a query
Question 3
Which join returns all rows when there is a match in one of the tables?
FULL OUTER JOIN
INNER JOIN
LEFT JOIN
RIGHT JOIN
Question 4
Which of the following is used to avoid duplicate rows in a SELECT result?
UNIQUE
DISTINCT
DIFFERENT
EXCLUSIVE
Question 5
What does the following SQL do? CREATE INDEX idx_name ON table (column);
Creates an index for faster searches
Creates a foreign key
Creates a unique constraint
Creates a primary key
Question 6
Which of the following is the correct order of clauses in a SELECT statement?
SELECT, FROM, GROUP BY, WHERE, HAVING, ORDER BY
SELECT, FROM, WHERE, HAVING, GROUP BY, ORDER BY
FROM, SELECT, WHERE, GROUP BY, HAVING, ORDER BY
SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY
Question 7
What is the default storage engine in MySQL (as of version 8.0)?
Memory
Archive
MyISAM
InnoDB
Question 8
Which SQL function returns the number of characters in a string?
SIZE()
CHAR_LENGTH()
COUNT()
LENGTH()
Question 9
What is the difference between CHAR and VARCHAR data types?
Both are fixed-length
CHAR is fixed-length, VARCHAR is variable-length
Both are variable-length
CHAR is variable-length, VARCHAR is fixed-length
Question 10
Which of the following is used to add a new column to an existing table?
INSERT TABLE ... ADD COLUMN
UPDATE TABLE ... ADD COLUMN
MODIFY TABLE ... ADD COLUMN
ALTER TABLE ... ADD COLUMN
Question 11
What does the following query return? SELECT COUNT(*) FROM table;
Sum of all values in the table
Total number of rows in the table
Average of all values
Number of non-null values in all columns
Question 12
Which of the following is a valid way to delete all rows from a table without removing the table structure?
DELETE FROM table;
TRUNCATE TABLE table;
DROP TABLE table;
Both A and B are correct
Question 13
What is the purpose of the ON DELETE CASCADE constraint?
It deletes the parent row when a child row is deleted
It updates child rows when parent is deleted
It prevents deletion of parent rows
It deletes child rows when the parent row is deleted
Question 14
Which SQL statement is used to create a new database?
ADD DATABASE
NEW DATABASE
CREATE DATABASE
MAKE DATABASE
Question 15
What does the IN operator do?
Checks if a value is within a range
Checks if a value is NULL
Checks if a value matches any value in a list
Checks if a value exists in a subquery
Question 16
Which clause is used to sort the result set?
ARRANGE BY
GROUP BY
SORT BY
ORDER BY
Question 17
What is a subquery?
A query that returns multiple rows
A query that is executed before the main query
A query nested inside another query
A query that uses the UNION operator
Question 18
Which of the following is true about indexes in MySQL?
They are automatically created on all columns
They speed up INSERT operations
They slow down SELECT queries
They can speed up search queries but slow down writes
Question 19
What is the result of SELECT NULL = NULL?
NULL
Error
TRUE
FALSE
Question 20
Which of the following SQL commands is used to change data in an existing row?
CHANGE
UPDATE
MODIFY
ALTER
✅ Answered:
0
⬜ Unanswered:
8
📊
20%
done
Submit Answers →