Create a table called Employee that contain attributes EMPNO,ENAME,JOB, MGR,SAL & execute the following.
1. Add a column commission with domain to the Employee table.
2. Insert any five records into the table.
3. Update the column details of job
4. Rename the column of Employ table using alter command.
5. Delete the employee whose Empno is 105.
CREATE DATABASE CMPNY;
USE CMPNY;
CREATE TABLE Employee (
EMPNO INT,
ENAME VARCHAR(50),
JOB VARCHAR(50),
MGR INT,
SAL DECIMAL(10, 2));
SHOW TABLES;
ALTER TABLE Employee
ADD COLUMN COMMISSION DECIMAL(10, 2);
DESC Employee;
INSERT INTO Employee VALUES( 101, 'Geeta', 'Manager', NULL,45000.00,1000.00);
INSERT INTO Employee VALUES(102, 'Krishna', 'Developer',101,80000.00, NULL );
INSERT INTO Employee VALUES(103,'Abdul', 'Sales person',102,30000.00,500.00);
INSERT INTO Employee VALUES(104,'Rita','Accountant', 101,45000.00, NULL );
INSERT INTO Employee VALUES(105, 'Amart','HR Manager',101,58000.00,800.00 );
SELECT * FROM Employee;
UPDATE Employee
SET JOB = 'Senior Developer'
WHERE EMPNO = 102;
SELECT * FROM Employee;
ALTER TABLE Employee CHANGE COLUMN MGR MANAGER_ID INT;
DESC Employee;
DELETE FROM Employee
WHERE EMPNO = 105;
SELECT * FROM Employee;