-
Which statement is used to create a new table in MySQL?
- A) CREATE
- B) INSERT
- C) UPDATE
- D) SELECT
Answer: A) CREATE
-
What is the command to retrieve all records from a table named "customers" in MySQL?
- A) FETCH * FROM customers;
- B) SELECT * FROM customers;
- C) GET * FROM customers;
- D) RETRIEVE * FROM customers;
Answer: B) SELECT * FROM customers;
-
Which keyword is used to sort the result set in descending order in MySQL?
- A) ASC
- B) DESC
- C) SORT DESC
- D) ORDER BY DESC
Answer: B) DESC
-
Which function is used to find the number of rows in a MySQL table?
- A) ROWS()
- B) COUNT()
- C) TOTAL_ROWS()
- D) NUM_ROWS()
Answer: B) COUNT()
-
Which statement is used to update data in a MySQL table?
- A) ALTER
- B) MODIFY
- C) UPDATE
- D) SET
Answer: C) UPDATE
-
Which keyword is used to add new rows of data to a MySQL table?
- A) INSERT
- B) ADD
- C) CREATE
- D) UPDATE
Answer: A) INSERT
-
What is the purpose of the GROUP BY clause in MySQL?
- A) To order the result set by a specified column
- B) To filter rows based on a specified condition
- C) To perform aggregate functions on grouped data
- D) To join multiple tables together
Answer: C) To perform aggregate functions on grouped data
-
Which function is used to delete a table from a MySQL database?
- A) DELETE TABLE
- B) REMOVE TABLE
- C) DROP TABLE
- D) ERASE TABLE
Answer: C) DROP TABLE
-
Which keyword is used to retrieve distinct values from a MySQL table?
- A) UNIQUE
- B) DISTINCT
- C) DIFFERENT
- D) SEPARATE
Answer: B) DISTINCT
-
What is the purpose of the WHERE clause in MySQL?
- A) To specify the columns to retrieve in the result set
- B) To specify the table to perform the operation on
- C) To filter rows based on a specified condition
- D) To group rows together based on a specified column
Answer: C) To filter rows based on a specified condition
Comments