Q: Which DML statement is used to update a column by decrementing its value in MySQL?
A. UPDATE DECREMENT
B. DECREMENT COLUMN
C. ALTER DECREMENT
D. UPDATE SET
Correct Option: DExplanation:
The UPDATE SET statement in MySQL is used to update a column by decrementing its value. It allows you to specify the column to be updated and the new value using mathematical expressions.
Q: Which DML statement is used to combine the results of two or more SELECT statements in MySQL?
A. UNION
B. COMBINE
C. MERGE
D. JOIN
Correct Option: AExplanation:
The UNION statement in MySQL is used to combine the results of two or more SELECT statements into a single result set. It removes duplicate rows by default.
Q: Which DML statement is used to retrieve a subset of records from a table based on a specified condition in MySQL?
A. FILTER
B. SELECT WHERE
C. SEARCH
D. WHERE
Correct Option: DExplanation:
The WHERE statement in MySQL is used to retrieve a subset of records from a table based on a specified condition. It allows you to filter rows based on specific criteria.
Q: Which DML statement is used to delete all rows from a table in MySQL?
A. DELETE TABLE
B. DROP TABLE
C. TRUNCATE TABLE
D. REMOVE TABLE
Correct Option: CExplanation:
The TRUNCATE TABLE statement in MySQL is used to delete all rows from a table. It removes all data, but the table structure remains intact.
Q: Which DML statement is used to perform case-sensitive pattern matching in MySQL?
A. LIKE
B. MATCH
C. COMPARE
D. CASE
Correct Option: AExplanation:
The LIKE statement in MySQL is used to perform case-sensitive pattern matching. It allows you to search for patterns within strings with optional wildcard characters.
Q: Which DML statement is used to update a column by incrementing its value in MySQL?
A. UPDATE INCREMENT
B. INCREMENT COLUMN
C. ALTER INCREMENT
D. UPDATE SET
Correct Option: DExplanation:
The UPDATE SET statement in MySQL is used to update a column by incrementing its value. It allows you to specify the column to be updated and the new value using mathematical expressions.
Q: Which DML statement is used to sort data in ascending or descending order in MySQL?
A. SORT BY
B. ORDER BY
C. ARRANGE BY
D. GROUP BY
Correct Option: BExplanation:
The ORDER BY statement in MySQL is used to sort data in ascending or descending order based on one or more columns. It allows you to specify the sorting order for each column.
Q: Which DML statement is used to update a column by concatenating its value with another string in MySQL?
A. CONCATENATE
B. CONCAT
C. JOIN
D. MERGE
Correct Option: BExplanation:
The CONCAT statement in MySQL is used to update a column by concatenating its value with another string. It allows you to combine existing values with additional text.
Q: Which DML statement is used to delete specific rows from a table based on a condition in MySQL?
A. DELETE
B. REMOVE
C. ERASE
D. ELIMINATE
Correct Option: AExplanation:
The DELETE statement in MySQL is used to delete specific rows from a table based on a condition. It allows you to selectively remove rows that meet the specified criteria.
Q: Which DML statement is used to insert new rows into a table in MySQL?
A. INSERT INTO
B. UPDATE TABLE
C. ADD ROW
D. MODIFY ROW
Correct Option: AExplanation:
The INSERT INTO statement in MySQL is used to insert new rows into a table. It allows you to specify the table name and the values to be inserted into the respective columns.