Create New Post

MYSQL MCQs - 3

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

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

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

  4. Which SQL function is used to concatenate two or more strings in MySQL?

    • A) CONCAT()
    • B) JOIN()
    • C) MERGE()
    • D) COMBINE()

    Answer: A) CONCAT()

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

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

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

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

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

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

Leave a Reply

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

30466