· 5 years ago · Oct 29, 2020, 08:32 AM
1create database if not exists Office;
2
3use database Office;
4
5drop table if exists Employee;
6
7create table Employee ( Emp_no int primary key,E_name varchar(30),E_address varchar(30),E_ph_no long,Dept_no int,Dept_name varchar(20),Job_id int,salary int);
8
9insert into Employee (E_no, E_name, E_address, E_ph_no, Dept_no, Dept_name, Job_id, Salary, Hiredate) values
10(1, "Rahul", "Kurnool", 8493025849, 25, "HR", "12", 25000, '2020-02-04'),
11(2, "Kim", "Kurnool", 8493042349, 25, "HR", "13", 25000, '2020-03-06'),
12(3, "Jae", "Hyderabad", 4583042349, 25, "HR", "14", 25000, '2020-05-06'),
13(4, "Jong", "Chennai", 849656349, 25, "HR", "15", 25000, '2020-05-09'),
14(5, "Kumar", "Seoul", 8494582349, 26, "CS", "16", 25000, '2019-03-06'),
15(6, "Paurush", "Srinagar", 4833042349, 26, "CS", "17", 30000, '2018-05-06'),
16(7, "Dani", "Ulanbatar", 1969656349, 26, "CS", "17", 45000, '2010-05-09');
17
18select * from Employee;
19
20select * from Employee where Dept_no = 25;
21
22update Employee set E_address = "Nagpur" where E_no = 2;
23
24select * from Employee where Dept_name = "HR";
25
26select * from Employee where Dept_name = "CS";