-- create
-- create
Create Table Department(dno int Primary Key,dname char(15) Not Null,noofemployees int,location varchar(20));
Insert into  Department values(1111,'Accounting',50,'Hyderabad');
Insert into  Department values(1112,'Marketing',30,'Mumbai');
Insert into  Department values(1114,'Human resource',80,'bangalore');
Insert into  Department values(1115,'Executive',75,'Goa');
select * from  Department;
Create Table Emp(Eno int Primary Key,Ename char(10) Not Null,Gender char(20) Not Null,Salary float,doj date);
Insert into Emp values(121,'Chintuuu','Male',55000.00,'2020-01-07');
Insert into Emp values(122,'Chanduuu','Female',60000.75,'2016-11-05');
Insert into Emp values(123,'Bittuuuu','Male',80000.65,'2019-12-07');
Insert into Emp values(124,'Mintuuuu','Female',90000.90,'2016-06-07');
Insert into Emp values(125,'Abbhiiii','Male',50000.00,'2017-11-22');
select * from Emp;
alter table Department drop noofemployees;
select * from Department;
alter table Emp add column email_id varchar(20)Not Null;
update Emp set email_id='[email protected]' where Eno=121;
update Emp set email_id='[email protected]' where Eno=122;
update Emp set email_id='[email protected]' where Eno=123;
update Emp set email_id='[email protected]' where Eno=124;
update Emp set email_id='[email protected]' where Eno=125;
select * from Emp;
delete from Emp where Eno=121;
select * from Emp;
alter table Emp add column Deptno int;
alter table Emp add  FOREIGN KEY (Deptno) REFERENCES Department(dno);
select * from Emp;
 
by