My issue
/*Write a query to set the Department as ‘HR’, for the employee with employee_id 2 to the existing table employee. */
– Update the Department to ‘HR’ for the employee with employee_id = 2
– Update the Department to ‘HR’ for the employee with employee_id = 2
UPDATE employee
SET Department = ‘HR’
WHERE employee_id = 2;
– Output the entire table to verify the update
SELECT * FROM employee;
ALTER TABLE employee
ADD COLUMN Department TEXT;
Runtime Error
SIGHUP
Error
Parse error near line 27: duplicate column name: Department
My code
/*Write a query to set the Department as 'HR', for the employee with employee_id 2 to the existing table employee. */
-- Update the Department to 'HR' for the employee with employee_id = 2
-- Update the Department to 'HR' for the employee with employee_id = 2
UPDATE employee
SET Department = 'HR'
WHERE employee_id = 2;
-- Output the entire table to verify the update
SELECT * FROM employee;
ALTER TABLE employee
ADD COLUMN Department TEXT;
Learning course: Database management systems
Problem Link: update table in Database management systems