A county must refresh a reference fee table from the latest validated extract while replacing prior contents cleanly. Which SQL approach fits?
Select an answer to reveal the explanation.
Short Explanation
CREATE OR REPLACE TABLE is swapping in this week's validated fee sheet—old rates out, current extract in, clean and whole. You'll pile up duplicates with INSERT INTO TABLE to refresh, you'll leave the table itself untouched with CREATE OR REPLACE VIEW, and you'll let removed fees linger with MERGE INTO TABLE.
Full Explanation
A county refreshing a reference fee table from the latest validated extract should use CREATE OR REPLACE TABLE from that extract. CREATE OR REPLACE replaces prior contents cleanly with the new validated snapshot, which fits municipal reference fees that must reflect the current authorized schedule without leaving stale fee rows mixed in for permit and citation consumers. Clean replace is the right semantics for full-refresh reference data when history is not required in the same table. Using INSERT INTO TABLE from the latest validated extract to refresh the reference fee table leaves outdated fee rows in place and creates duplicate or conflicting rates, so consumers cannot tell which value is current. Using CREATE OR REPLACE VIEW from the latest validated extract to refresh the reference fee table does not replace prior table contents, so stale rows remain and the reference table itself is not refreshed. Using MERGE INTO TABLE from the latest validated extract to refresh the reference fee table does not cleanly replace all prior contents, so outdated or removed fee rows can linger. Exam caveat: CREATE OR REPLACE is a full refresh pattern—use MERGE or a temporal history table when you must preserve prior fee versions for audit or appeals; here the requirement is clean replacement from the latest validated extract. Operational check: land the validated fee extract, run CREATE OR REPLACE TABLE as the refresh, confirm row count and rate values match the extract, smoke-test dependent permit fee joins, and document whether assessment history is out of scope or handled in a separate history table.
Prefer to study offline? Printable PDF study book + test engine ($7.50, unofficial). These questions stay free here.