SQL_Revision (2)
SQL_Revision (2)
Create Database:
create database company;
Open database company:
use company;
Create table Employee:
create table employee(EmpID integer primary
key not null,Name varchar(30),DOB date, DeptID
varchar(10), Desig varchar(30),Salary integer);
Insert values in table employee:
insert into employee values(120,”Alisha”,’1978-
01-23’,”D001”,”Manager”,75000);
SQL commands:
(i)modify the salary of empid 120 with 80000
Ans.
update employee set salary=80000 where
empID=120;
(ii)delete the record with empID 130
Ans.
delete from employee where empId=130;
(iii)to display the contents of the table employee
Ans.
select * from employee;
(iv)to display the contents of employees whose
salary is more than 50000.
Ans.
select * from employee where salary>50000;
(v)to display empId and salary of manager
Ans.