165k views
3 votes
Which of the following SQL statements can be used to update a transactions table, to set a flag on the table from Y to N?

a) MODIFY transactions SET active_flag = 'N' WHERE active_flag = 'Y'
b) MERGE transactions SET active_flag = 'N' WHERE active_flag = 'Y'
c) UPDATE transactions SET active_flag = 'N' WHERE active_flag = 'Y'
d) REPLACE transactions SET active_flag = 'N' WHERE active_flag = 'Y'

User Jepio
by
8.0k points

1 Answer

4 votes

Final answer:

The correct SQL statement to update a transactions table to change a flag from 'Y' to 'N' is 'UPDATE transactions SET active_flag = 'N' WHERE active_flag = 'Y'.

Step-by-step explanation:

The correct SQL statement to update a transactions table and set a flag from 'Y' to 'N' is:

c) UPDATE transactions SET active_flag = 'N' WHERE active_flag = 'Y'

This update statement specifically changes the value of the active_flag column to 'N' for all records where the current value of the active_flag is 'Y'. The other options such as MODIFY, MERGE, and REPLACE are not standard SQL commands for updating existing records in a table.

User Brad West
by
7.8k points