#sql #MySQL #table

00:00:00 Intro
00:00:36 CREATE TABLE
00:03:00 SELECT * FROM TABLE
00:03:21 RENAME TABLE
00:03:54 DROP TABLE
00:04:11 Add a column
00:05:13 Rename a column
00:05:50 Modify a column
00:06:34 Change column position AFTER
00:07:32 Change column position FIRST
00:07:52 Drop a column
00:08:09 Conclusion

CREATE TABLE employees (
employee_id int PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
hourly_pay DECIMAL(5, 2),
hire_date DATE
);

RENAME TABLE employees TO workers;

DROP TABLE employees;

ALTER TABLE employees
ADD phone_number VARCHAR(15);

ALTER TABLE employees
RENAME COLUMN phone_number TO email;

ALTER TABLE employees
MODIFY COLUMN email VARCHAR(15);

ALTER TABLE employees
MODIFY email VARCHAR(100)
AFTER last_name;

ALTER TABLE employees
MODIFY email VARCHAR(100)
FIRST;

ALTER TABLE employees
DROP COLUMN email;