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?
ORDER BY
WHERE
HAVING
FILTER
Question 2
What is the purpose of the EXPLAIN statement in MySQL?
To execute a query and show results
To display the execution plan of a query
To create an index
To explain the syntax of a query
Question 3
Which join returns all rows when there is a match in one of the tables?
RIGHT JOIN
FULL OUTER JOIN
INNER JOIN
LEFT JOIN
Question 4
Which of the following is used to avoid duplicate rows in a SELECT result?
DIFFERENT
DISTINCT
EXCLUSIVE
UNIQUE
Question 5
What does the following SQL do? CREATE INDEX idx_name ON table (column);
Creates an index for faster searches
Creates a primary key
Creates a foreign key
Creates a unique constraint
Question 6
Which of the following is the correct order of clauses in a SELECT statement?
SELECT, FROM, WHERE, HAVING, GROUP BY, ORDER BY
FROM, SELECT, WHERE, GROUP BY, HAVING, ORDER BY
SELECT, FROM, GROUP BY, WHERE, 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
InnoDB
Archive
MyISAM
Question 8
Which SQL function returns the number of characters in a string?
SIZE()
LENGTH()
CHAR_LENGTH()
COUNT()
Question 9
What is the difference between CHAR and VARCHAR data types?
Both are fixed-length
Both are variable-length
CHAR is fixed-length, VARCHAR is 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?
UPDATE TABLE ... ADD COLUMN
ALTER TABLE ... ADD COLUMN
MODIFY TABLE ... ADD COLUMN
INSERT TABLE ... ADD COLUMN
Question 11
What does the following query return? SELECT COUNT(*) FROM table;
Total number of rows in the table
Sum of all values 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?
DROP TABLE table;
DELETE FROM table;
TRUNCATE TABLE table;
Both A and B are correct
Question 13
What is the purpose of the ON DELETE CASCADE constraint?
It prevents deletion of parent rows
It updates child rows when parent is deleted
It deletes the parent row when a child row is deleted
It deletes child rows when the parent row is deleted
Question 14
Which SQL statement is used to create a new database?
ADD DATABASE
MAKE DATABASE
CREATE DATABASE
NEW DATABASE
Question 15
What does the IN operator do?
Checks if a value is NULL
Checks if a value matches any value in a list
Checks if a value is within a range
Checks if a value exists in a subquery
Question 16
Which clause is used to sort the result set?
SORT BY
ORDER BY
ARRANGE BY
GROUP BY
Question 17
What is a subquery?
A query nested inside another query
A query that uses the UNION operator
A query that is executed before the main query
A query that returns multiple rows
Question 18
Which of the following is true about indexes in MySQL?
They can speed up search queries but slow down writes
They speed up INSERT operations
They are automatically created on all columns
They slow down SELECT queries
Question 19
What is the result of SELECT NULL = NULL?
FALSE
NULL
Error
TRUE
Question 20
Which of the following SQL commands is used to change data in an existing row?
CHANGE
MODIFY
UPDATE
ALTER
✅ Answered:
0
⬜ Unanswered:
8
📊
20%
done
Submit Answers →