-
What is the purpose of the JOIN keyword in MySQL?
- A) To perform aggregate functions on grouped data
- B) To filter rows based on a specified condition
- C) To specify the columns to retrieve in the result set
- D) To combine rows from two or more tables based on a related column
Answer: D) To combine rows from two or more tables based on a related column
-
Which SQL command is used to add a new column to an existing table in MySQL?
- A) ADD COLUMN
- B) ALTER COLUMN
- C) MODIFY COLUMN
- D) CHANGE COLUMN
Answer: A) ADD COLUMN
-
What is the purpose of the LIKE operator in MySQL?
- A) To perform pattern matching in string comparisons
- B) To perform arithmetic calculations
- C) To combine rows from two or more tables
- D) To specify the number of rows to retrieve in the result set
Answer: A) To perform pattern matching in string comparisons
-
Which SQL function is used to concatenate two or more strings in MySQL?
- A) CONCAT()
- B) JOIN()
- C) MERGE()
- D) COMBINE()
Answer: A) CONCAT()
-
What is the purpose of the IN operator in MySQL?
- A) To check if a value exists in a specified range
- B) To specify the columns to retrieve in the result set
- C) To filter rows based on a specified condition
- D) To specify multiple values for a column in a WHERE clause
Answer: D) To specify multiple values for a column in a WHERE clause
-
Which SQL command is used to create an index on a table in MySQL?
- A) CREATE INDEX
- B) ADD INDEX
- C) INDEX TABLE
- D) ALTER INDEX
Answer: A) CREATE INDEX
-
What is the purpose of the UNION operator in MySQL?
- A) To combine the result sets of two or more SELECT statements
- B) To filter rows based on a specified condition
- C) To perform aggregate functions on grouped data
- D) To sort the result set by a specified column
Answer: A) To combine the result sets of two or more SELECT statements
-
Which SQL function is used to find the minimum value of a column in MySQL?
- A) MIN()
- B) SMALLEST()
- C) LOWEST()
- D) BOTTOM()
Answer: A) MIN()
-
What is the purpose of the BETWEEN operator in MySQL?
- A) To specify the columns to retrieve in the result set
- B) To filter rows based on a specified condition
- C) To check if a value exists in a specified range
- D) To combine rows from two or more tables
Answer: C) To check if a value exists in a specified range
-
Which SQL command is used to grant privileges to a user in MySQL?
- A) ALLOW
- B) GRANT
- C) PERMIT
- D) AUTHORIZE
Answer: B) GRANT
Comments