InterviewSolution
Saved Bookmarks
| 1. |
What is the importance of UPSERT command in Teradata? |
|
Answer» Teradata enables update and insert operations to be PERFORMED simultaneously on a table from another table using UPSERT Command. UPDATES are made if the update condition matches in another table and unmatched rows are inserted into the table if the update condition does not match. UPDATE-ELSE-INSERT syntax: UPDATE department SET budget_amount = 60000 WHERE department_number = 600 ELSE INSERT INTO department(department_number, department_name, budget_amount, manager_employee_number) VALUES(600, 'Test Dept', 60000, NULL);This statement updates the ROW where department_number matches 600 to set budget_amount to 60000. In the EVENT that no match is found, a new row will be inserted. |
|