Create New Post

MYSQL MCQs - 1

  1. Which statement is used to create a new table in MySQL?

    • A) CREATE
    • B) INSERT
    • C) UPDATE
    • D) SELECT

    Answer: A) CREATE

  2. 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;

  3. 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

  4. 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()

  5. Which statement is used to update data in a MySQL table?

    • A) ALTER
    • B) MODIFY
    • C) UPDATE
    • D) SET

    Answer: C) UPDATE

  6. 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

  7. 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

  8. 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

  9. Which keyword is used to retrieve distinct values from a MySQL table?

    • A) UNIQUE
    • B) DISTINCT
    • C) DIFFERENT
    • D) SEPARATE

    Answer: B) DISTINCT

  10. 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

Leave a Reply

Your email address will not be published. Required fields are marked *

55866