🧪 SQL MCQ Quiz Hub

SQL MCQ SET 1

Choose a topic to test your knowledge and improve your SQL skills

1. The expression 12 DIV 5 evaluates to ____________




2. If the PIPES_AS_CONCAT is disabled, 'abc' || 'xyz' results in ____________




3. 'abc' || 'xyz', when PIPES_AS_CONCAT is enabled, results in ____________




4. The expression 2 BETWEEN 2 AND 5 results in ____________




5. The expression HI LIKE NULL results in _____________




6. Which of the following is the correct order of precedence (high to low)?




7. 0x61 + 0 results in _____________




8. The AUTO_INCREMENT column attribute is best used with which type?




9. Which datatype is best suited to store currency values?




10. If a column is expected to store values up to 2 million, the best datatype for it is _____________




11. Which of these types store the longest length of strings?




12. Which of these values is not valid as an AUTO_INCREMENT value?




13. If an integer column is used for the values in range 1 to 99999, the best suitable datatype is ____________




14. INT2 maps to MySQL type _____________




15. INT3 maps to MySQL type _____________




16. Which of these return a result to the client?




17. Which of these is defined to execute when the table is modified only?




18. What executes on a time activated basis according to a schedule?




19. Which character does the mysql client program recognize as a statement delimiter?




20. Which command is used to redefined the mysql delimiter?




21. Which of the following statements does not modify the table?




22. To produce a stored function, which statement is used?




23. How many values can be returned from a given stored function?




24. How many values can be returned from a stored procedure?




25. Suppose a stored function named PI() is written in the database sampdb. How would it be called?




26. Which privilege must be given to the database to create a stored function or procedure?




27. Which variable is set to zero when automatic privilege granting is not needed?




28. Which procedure parameter enables the caller to pass in a value and get back a value?




29. For the same input parameters, if the stored function returns the same result, it is called _____________




30. What is abc in the following MySQL statement?




31. Which statement is used to create a trigger?




32. For which of the following are triggers not supported?




33. Which statement is used to remove a trigger?




34. Before MySQL 5.1.6 which privilege was required to create and drop triggers?




35. What is abc in the following MySQL statement?




36. Which of these is a stored program associated with a schedule?




37. Which of the following lines is used to turn on the event scheduler?




38. Which statement is used to check the status of the event scheduler at runtime?




39. Which value of event_scheduler enables checking status but not changing it at runtime?




40. Which log does the event scheduler log to?




41. Which clause specifies periodic execution at fixed intervals?




42. To create or drop events for a database, which privilege should be granted?




43. The default definer of an event is the user who _______________




44. The creation of a stored program is similar to the definition of a _______________




45. When the security context enables carefully written stored programs to be set up that provide controlled access to tables for users, it is called __________




46. When a user creates a stored program that accesses sensitive data but forgets that other people who can invoke the object have the same access, the security context is __________




47. A stored procedure is invoked using the statement __________




48. What produces result sets?




49. Which privilege is enabled to create of alter a stored function?