MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The following statements were executed in sequence:DELETE FROM employees;SELECT * FROM employees;What will happen after you execute the given SELECT statement?
A
All records will be displayed.
B
No records will be displayed.
C
An error message will be displayed.
D
Table does not exist.
Explanation: 

Detailed explanation-1: -Without WHERE clauses, DELETE drops all the data from the table, and UPDATE overwrites values for all the table rows.

Detailed explanation-2: -SQL RollBack. ROLLBACK is the SQL command that is used for reverting changes performed by a transaction.

Detailed explanation-3: -A COMMIT statement is used to save the changes on the current transaction is permanent. A Rollback statement is used to undo all the changes made on the current transaction. Once the current transaction is completely executed using the COMMIT command, it can’t undo its previous state.

Detailed explanation-4: -Which of the following statements best describes what will happen to the student table in this SQL statement? UPDATE studentsSET lunch number =(SELECT lunch numberFROM studentWHERE student id = 17)WHERE student id = 19; Inserts a new row into the students table.

There is 1 question to complete.