MySQL Access Control and Security
- How is a stored procedure invoked?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
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.
- Triggers and events are not invoked automatically by the server.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
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.
- Triggers are not supported for _____________.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
In MySQL, the triggers are run only after the table modifications like insert, update and delete are run. Triggers are not supported for views. In order to create a trigger, the CREATE TRIGGER statement is used.
- What does LAST_INSERT_ID() return when no AUTO_INCREMENT value has been generated during the current connection?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The ‘LAST_INSERT_ID()’ function returns zero when no ‘AUTO_INCREMENT’ value has been generated during the current connection with the server. It is tied to the current connection.
- How can the value of recently generated sequence number be obtained?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
The value of most recently generated sequence number can be obtained by calling the LAST_INSERT_ID() function. This enables to reference the AUTO_INCREMENT value in the subsequent statement.