-2

Can you please tell me why c and d are the right answers here ? Thank you

Select the statements that can be used to complete the following SQL code block

BEGIN TRANSACTION
SELECT COUNT(*) FROM Enrollments WHERE Accepted = 1
UPDATE Enrollments SET Accepted = 1 WHERE CourseTitle = ’Data Base’

(a) END TRANSACTION (b) END (c) COMMIT (d) ROLLBACK TRANSACTION

Lelio Faieta
  • 6,457
  • 7
  • 40
  • 74
  • `END` does not tell the database what you want to do with the transaction: You can either **commit** the changes, which means that you want to keep them or discard them by **rolling** them **back**. Having defined `END` in the sense of one of the two former would you to require which semantics it now carries, while the other two are clear by themselves – and that's why it simply hasn't ever been defined alike in SQL... – Aconcagua Jul 12 '21 at 15:14

1 Answers1

0

Because those are the SQL key words that can be used to end a transaction

COMMIT will submit your transaction and end it.

While ROLLBACK will, as its name suggests roll the database back to how it was before the transaction was started.

DevWithZachary
  • 3,545
  • 11
  • 49
  • 101