Database Manipulation Using SQL
Create a table:
CREATE TABLE employees (
id INT PRIMARY KEY,
name VARCHAR(50),
department VARCHAR(50),
salary DECIMAL(10, 2)
);
2. Insert a record into the table:
INSERT INTO employees (id, name, department, salary)
VALUES (1, ‘John Doe’, ‘IT’, 50000.00);
3. Update a record in the table:
UPDATE employees
SET salary = 55000.00
WHERE id = 1;
4. Delete a record from the table:
DELETE FROM employees
WHERE id = 1;
5. Alter table to add a new column:
ALTER TABLE employees
ADD COLUMN hire_date DATE;
6. Drop a table:
DROP TABLE employees;
