MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
sql> insert into dept values(10.’sales’);sql>insert into dept values(20.’admin’);sql>drop table emp;sql>rollback;what will be the output if “select * from dept” is used.
A
10, ‘sales’20, ‘admin’
B
10, ‘sales’
C
20, ‘admin’
D
” no rows selected “
Explanation: 

Detailed explanation-1: -You just have to write the statement ROLLBACK TRANSACTION, followed by the name of the transaction that you want to rollback.

Detailed explanation-2: -If you? ve the Full database backup available, you can try recovering deleted records using the transaction log with Log Sequence Number (LSN). If the backup is corrupted, use Stellar Repair for MS SQL to recover the deleted data in SQL Server or in other formats like Comma Separated Value (CSV) files, HTML, or XLS.

Detailed explanation-3: -What will be the output of the below query, given an Employee table having 10 records? This query will return 10 records as TRUNCATE was executed in the transaction.

There is 1 question to complete.