Databricks Certified Data Engineer Associate — Question 59
A data engineer has been given a new record of data:
id STRING = 'a1'
rank INTEGER = 6
rating FLOAT = 9.4
Which SQL commands can be used to append the new record to an existing Delta table my_table?
Answer options
- A. INSERT INTO my_table VALUES ('a1', 6, 9.4)
- B. INSERT VALUES ('a1', 6, 9.4) INTO my_table
- C. UPDATE my_table VALUES ('a1', 6, 9.4)
- D. UPDATE VALUES ('a1', 6, 9.4) my_table
Correct answer: A
Explanation
The correct answer is A because the SQL command 'INSERT INTO my_table VALUES ('a1', 6, 9.4)' is the proper syntax for appending records to a table. Option B is incorrect due to its syntax, while options C and D are inappropriate because they attempt to use the UPDATE command, which is meant for modifying existing records rather than adding new ones.