SQL

SQL

Test your SQL knowledge with free quizzes on MyCodeSkills covering core concepts.


  1. What does SQL stand for?

    • Structured Query List
    • Simple Query Language
    • Structured Query Language
    • Sample Query Language
  2. Which SQL statement is used to retrieve data from a database?

    • GET
    • SELECT
    • FETCH
    • SHOW
  3. What keyword is used to insert new data into a table?

    • ADD
    • UPDATE
    • INSERT
    • INPUT
  4. Which clause is used to filter records?

    • ORDER BY
    • SELECT
    • GROUP BY
    • WHERE
  5. What is used to sort the result-set in SQL?

    • SORT BY
    • FILTER BY
    • ORDER BY
    • ALIGN BY
  6. What type of join returns only matching rows from both tables?

    • LEFT JOIN
    • RIGHT JOIN
    • FULL JOIN
    • INNER JOIN
  7. Which aggregate function returns the number of rows?

    • TOTAL()
    • COUNT()
    • SUM()
    • AVG()
  8. What clause is used with GROUP BY to filter grouped records?

    • WHERE
    • ORDER BY
    • HAVING
    • FILTER
  9. Which keyword combines the result of two SELECT statements and removes duplicates?

    • UNION
    • JOIN
    • MERGE
    • INTERSECT
  10. Which function returns the average of numeric values?

    • MEAN()
    • AVG()
    • AVERAGE()
    • SUM()/COUNT()
  11. What does the `START TRANSACTION` command do?

    • Begins a stored procedure
    • Begins a transaction block
    • Creates a user session
    • Starts a trigger
  12. What is the purpose of the `COMMIT` statement?

    • Save changes permanently
    • Undo changes
    • Validate user
    • Rollback transaction
  13. What does the `ROLLBACK` command do?

    • Saves a query result
    • Restores data to a savepoint
    • Undoes uncommitted changes
    • Archives a table
  14. Which MySQL object executes automatically in response to events on a table?

    • Procedure
    • Trigger
    • Event
    • Function
  15. Which clause is used to define a trigger’s execution time?

    • ON
    • BEFORE/AFTER
    • WHEN
    • FOR EACH