InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
The locking statements LOCK TABLES and UNLOCK TABLES are not permitted in stored routines.(a) True(b) FalseThe question was posed to me in a national level competition.My question is based upon Security for Stored Programs and Views in section Stored Programs of MySQL |
|
Answer» Right answer is (a) True |
|
| 2. |
Which privilege is enabled to create of alter a stored function?(a) SUPER(b) PRIOR(c) TOP(d) SUPERIORI got this question in a job interview.My question is based upon Security for Stored Programs and Views topic in division Stored Programs of MySQL |
|
Answer» The CORRECT answer is (a) SUPER |
|
| 3. |
What produces result sets?(a) View(b) SELECT(c) Stored function(d) TriggerThe question was posed to me by my school teacher while I was bunking the class.I'm obligated to ask this question of Security for Stored Programs and Views in portion Stored Programs of MySQL |
|
Answer» Correct option is (a) View |
|
| 4. |
A stored procedure is invoked using the statement __________(a) INVOKE(b) SEE(c) CALL(d) RETURNI had been asked this question in semester exam.I'm obligated to ask this question of Security for Stored Programs and Views topic in section Stored Programs of MySQL |
|
Answer» CORRECT ANSWER is (c) CALL To explain: In MySQL, a stored procedure is invoked using the CALL statement. A stored procedure does not have a return VALUE but can MODIFY its PARAMETERS. It also returns some result sets. |
|
| 5. |
Triggers and events are invoked automatically by the server.(a) True(b) FalseThis question was posed to me in final exam.My question is taken from Security for Stored Programs and Views topic in chapter Stored Programs of MySQL |
|
Answer» RIGHT answer is (a) True Easy explanation: The triggers and events are invoked AUTOMATICALLY by the server, so the concept of invoking user is not applied. THUS, they have no SQL SECURITY characteristic and always execute with definer PRIVILEGES. |
|
| 6. |
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 __________(a) good(b) bad(c) illegal(d) fareThe question was asked in an internship interview.Asked question is from Security for Stored Programs and Views in division Stored Programs of MySQL |
|
Answer» The correct answer is (b) bad |
|
| 7. |
When the security context enables carefully written stored programs to be set up that provide controlled access to tables for users, it is called __________(a) good(b) bad(c) illegal(d) fareI have been asked this question during an interview.Query is from Security for Stored Programs and Views in division Stored Programs of MySQL |
|
Answer» CORRECT choice is (a) good Explanation: The security context is good if it enables carefully WRITTEN stored PROGRAMS to be SET up that provide CONTROLLED access to tables for users who are not able to access them directly. |
|
| 8. |
The creation of a stored program is similar to the definition of a _______________(a) Trigger(b) Event(c) View(d) TableThe question was asked in an interview.I need to ask this question from Security for Stored Programs and Views in chapter Stored Programs of MySQL |
|
Answer» Correct choice is (c) VIEW |
|
| 9. |
The default definer of an event is the user who _______________(a) created the database(b) created the event(c) created the table(d) created the columnI have been asked this question by my college director while I was bunking the class.Asked question is from Events in portion Stored Programs of MySQL |
|
Answer» The correct answer is (B) created the event |
|
| 10. |
To create or drop events for a database, which privilege should be granted?(a) CREATE(b) DROP(c) PRIVILEGE(d) EVENTI had been asked this question in final exam.Query is from Events in division Stored Programs of MySQL |
|
Answer» Right choice is (d) EVENT |
|
| 11. |
Which clause specifies periodic execution at fixed intervals?(a) EVERY(b) ALL(c) AT(d) ALTERNATEI have been asked this question during an online interview.This question is from Events topic in section Stored Programs of MySQL |
|
Answer» Correct choice is (a) EVERY |
|
| 12. |
Which log does the event scheduler log to?(a) error(b) record(c) library(d) updateI have been asked this question by my college director while I was bunking the class.This intriguing question originated from Events topic in division Stored Programs of MySQL |
|
Answer» Right choice is (a) error |
|
| 13. |
If the scheduler is stopped, no events run.(a) True(b) FalseI have been asked this question in final exam.My enquiry is from Events topic in division Stored Programs of MySQL |
|
Answer» The correct choice is (a) True |
|
| 14. |
Which value of event_scheduler enables checking status but not changing it at runtime?(a) ON(b) OFF(c) DISABLED(d) ENABLEDThis question was posed to me in unit test.My question is taken from Events topic in division Stored Programs of MySQL |
|
Answer» Correct answer is (c) DISABLED |
|
| 15. |
Which statement is used to check the status of the event scheduler at runtime?(a) SHOW STATUS OF ‘event_scheduler’(b) SHOW VARIABLES OF ‘event_scheduler’(c) SHOW STATUS LIKE ‘event_scheduler’(d) SHOW VARIABLES LIKE ‘event_scheduler’I had been asked this question in examination.Asked question is from Events in chapter Stored Programs of MySQL |
|
Answer» RIGHT choice is (d) SHOW VARIABLES LIKE ‘event_scheduler’ Best explanation: In MySQL, in order to check the status of the event scheduler at runtime, the statement: SHOW VARIABLES LIKE ‘event_scheduler’; is USED. The event_scheduler is a system variable. |
|
| 16. |
Which of the following lines is used to turn on the event scheduler?(a) event_scheduler = ON(b) eventscheduler = ON(c) event_scheduler_ON(d) events_scheduler_ONThis question was posed to me in a job interview.This intriguing question originated from Events in division Stored Programs of MySQL |
|
Answer» Correct option is (a) event_scheduler = ON |
|
| 17. |
The event scheduler does not run by default.(a) True(b) FalseThis question was posed to me in exam.This intriguing question comes from Events topic in division Stored Programs of MySQL |
|
Answer» Right choice is (a) True |
|
| 18. |
Which of these is a stored program associated with a schedule?(a) Trigger(b) Event(c) Stored function(d) Stored procedureThis question was addressed to me in an online interview.My doubt stems from Events in division Stored Programs of MySQL |
|
Answer» Correct choice is (b) EVENT |
|
| 19. |
The TRIGGER privilege is used for the table to be able to create and drop triggers for it.(a) True(b) FalseThis question was posed to me in unit test.The above asked question is from Triggers topic in division Stored Programs of MySQL |
|
Answer» The correct choice is (a) True |
|
| 20. |
Before MySQL 5.1.6 which privilege was required to create and drop triggers?(a) PRIVILEGE(b) TRIGGER(c) SUPER(d) MACROI had been asked this question during an interview.This key question is from Triggers in division Stored Programs of MySQL |
|
Answer» RIGHT option is (c) SUPER Best explanation: The privilege to create and DROP triggers is VERSION SPECIFIC in MySQL. Before MySQL 5.1.6, the SUPER privilege was needed. Access control is more CORRECTLY handled post this version. |
|
| 21. |
Which statement is used to remove a trigger?(a) REMOVE(b) DELETE(c) DROP(d) CLEARThis question was posed to me by my college director while I was bunking the class.Query is from Triggers topic in division Stored Programs of MySQL |
|
Answer» Correct choice is (c) DROP |
|
| 22. |
For which of the following are triggers not supported?(a) delete(b) update(c) insert(d) viewsI had been asked this question by my school teacher while I was bunking the class.My question is based upon Triggers in chapter Stored Programs of MySQL |
|
Answer» Right option is (d) VIEWS |
|
| 23. |
Which statement is used to create a trigger?(a) CREATE TRIGGER(b) CREATE TRIGGERS(c) PRODUCE TRIGGER(d) PRODUCE TRIGGERSI had been asked this question by my college director while I was bunking the class.This question is from Triggers in section Stored Programs of MySQL |
|
Answer» The correct option is (a) CREATE TRIGGER |
|
| 24. |
Triggers enable to enforce data integrity constraints.(a) True(b) FalseI got this question by my school principal while I was bunking the class.The above asked question is from Triggers topic in section Stored Programs of MySQL |
|
Answer» Right OPTION is (a) True |
|
| 25. |
For the same input parameters, if the stored function returns the same result, it is called _____________(a) deterministic(b) non deterministic(c) regular(d) monotonousThe question was posed to me during an online interview.Asked question is from Stored Functions and Procedures topic in division Stored Programs of MySQL |
|
Answer» RIGHT answer is (a) deterministic Explanation: For the same input PARAMETERS, if the STORED function returns the same RESULT, it is CALLED a deterministic function. Otherwise, the stored function is called not deterministic. |
|
| 26. |
The IN, OUT and INOUT keywords do not apply to stored functions.(a) True(b) FalseThe question was asked during an online exam.My question is from Stored Functions and Procedures in portion Stored Programs of MySQL |
|
Answer» RIGHT answer is (a) True The explanation is: The IN, OUT and INOUT KEYWORDS do not apply to stored FUNCTIONS, TRIGGERS and events. Triggers and events do not have parameters at all. For the stored functions, all parameters are like IN parameters. |
|
| 27. |
Which procedure parameter enables the caller to pass in a value and get back a value?(a) IN(b) OUT(c) INOUT(d) GETINOUTThe question was posed to me during an interview for a job.The doubt is from Stored Functions and Procedures in chapter Stored Programs of MySQL |
|
Answer» Right choice is (C) INOUT |
|
| 28. |
Which variable is set to zero when automatic privilege granting is not needed?(a) automatic_sp_privileges(b) automatic_ps_privileges(c) automatic_pg_privileges(d) automatic_gp_privilegesThe question was asked in an interview.Enquiry is from Stored Functions and Procedures in portion Stored Programs of MySQL |
|
Answer» The CORRECT ANSWER is (a) automatic_sp_privileges |
|
| 29. |
Which privilege must be given to the database to create a stored function or procedure?(a) CREATE ROUTINE(b) CREATE METHOD(c) CREATE FUNCTION(d) CREATE PROCEDUREThe question was posed to me in examination.This key question is from Stored Functions and Procedures topic in division Stored Programs of MySQL |
|
Answer» CORRECT answer is (a) CREATE ROUTINE To explain: The ‘CREATE ROUTINE’ privilege must be GIVEN for the database in ORDER to create a stored function or procedure. Stored FUNCTIONS and procedures always belong to a particular database. |
|
| 30. |
Suppose a stored function named PI() is written in the database ‘sampdb’. How would it be called?(a) PI()(b) sampdb.PI()(c) MySQL.PI()(d) db.PI()I have been asked this question during a job interview.This interesting question is from Stored Functions and Procedures topic in section Stored Programs of MySQL |
|
Answer» Right OPTION is (b) sampdb.PI() |
|
| 31. |
How many values can be returned from a stored procedure?(a) 0(b) 1(c) 2(d) 3I have been asked this question in an online quiz.Asked question is from Stored Functions and Procedures topic in division Stored Programs of MySQL |
|
Answer» RIGHT option is (a) 0 For explanation I would SAY: In MYSQL, unlike the stored functions, the stored procedures cannot return VALUES. They can be used to perform calculations or produce the result SETS passed back to the clients. |
|
| 32. |
How many values can be returned from a given stored function?(a) 0(b) 1(c) 2(d) 3This question was posed to me by my college professor while I was bunking the class.Asked question is from Stored Functions and Procedures topic in chapter Stored Programs of MySQL |
|
Answer» The CORRECT answer is (b) 1 |
|
| 33. |
To produce a stored function, which statement is used?(a) PRODUCE FUNCTION(b) CREATE FUNCTION(c) PRODUCE PROCEDURE(d) CREATE PROCEDUREThe question was asked in an interview for job.I want to ask this question from Stored Functions and Procedures in chapter Stored Programs of MySQL |
|
Answer» RIGHT OPTION is (b) CREATE FUNCTION The best explanation: The ‘CREATE FUNCTION’ statement is used to create a stored function in MySQL. The ‘CREATE PROCEDURE’ statement is used to create a stored procedure instead, from which values are not RETURNED. |
|
| 34. |
Which of the following statements does not modify the table?(a) INSERT(b) UPDATE(c) DELETE(d) SELECTThis question was posed to me in an interview.My question comes from Compound Statements and Statement Delimiters in division Stored Programs of MySQL |
|
Answer» CORRECT option is (d) SELECT Easy explanation: In MySQL, the ‘SELECT’ STATEMENT is USED to display the tables or their components according to some SPECIFIED conditions and clauses. It does not modify the table unlike the others. |
|
| 35. |
Stored routines refers to stored functions and procedures.(a) True(b) FalseI got this question in a job interview.The above asked question is from Compound Statements and Statement Delimiters in section Stored Programs of MySQL |
|
Answer» Right choice is (a) True |
|
| 36. |
Which of the following characters cannot be used as a delimiter?(a) ,(b) .(c) ;(d) \This question was addressed to me in a national level competition.Asked question is from Compound Statements and Statement Delimiters topic in portion Stored Programs of MySQL |
|
Answer» RIGHT option is (d) \ For explanation: In MySQL, the CHARACTER backslash character is reserved for specifying escape sequences. For EXAMPLE, the escape sequence ‘\t’ specifies a TAB space character. It cannot be used as a DELIMITER. |
|
| 37. |
Which command is used to redefined the mysql delimiter?(a) redefine_delim(b) delim_redefine(c) delimiter(d) redefineThis question was addressed to me in an online interview.My query is from Compound Statements and Statement Delimiters topic in portion Stored Programs of MySQL |
|
Answer» Right answer is (C) DELIMITER |
|
| 38. |
Which character does the mysql client program recognize as a statement delimiter?(a) :(b) .(c) ;(d) ,I have been asked this question in an interview for job.The origin of the question is Compound Statements and Statement Delimiters topic in chapter Stored Programs of MySQL |
|
Answer» Right option is (c) ; |
|
| 39. |
Stored programs improve database security.(a) True(b) FalseI had been asked this question in examination.The query is from Compound Statements and Statement Delimiters topic in division Stored Programs of MySQL |
|
Answer» Correct CHOICE is (a) True |
|
| 40. |
What executes on a time activated basis according to a schedule?(a) Stored program(b) Events(c) Triggers(d) Stored proceduresI got this question during an online interview.Question is from Compound Statements and Statement Delimiters topic in division Stored Programs of MySQL |
|
Answer» The correct option is (b) Events |
|
| 41. |
Which of these is defined to execute when the table is modified only?(a) Stored functions(b) Stored procedures(c) Triggers(d) EventsI had been asked this question in an online quiz.Asked question is from Compound Statements and Statement Delimiters topic in division Stored Programs of MySQL |
|
Answer» CORRECT choice is (c) TRIGGERS For explanation I would say: In MYSQL, triggers are ASSOCIATED with a table. They are defined to execute when the table is modified via INSERT, DELETE or UPDATE statements. MySQL supports objects to be stored on server side. |
|
| 42. |
Which of these return a result to the client?(a) Stored functions(b) Stored procedures(c) Triggers(d) EventsI had been asked this question in unit test.Enquiry is from Compound Statements and Statement Delimiters topic in chapter Stored Programs of MySQL |
|
Answer» Correct option is (a) Stored FUNCTIONS |
|