0% found this document useful (0 votes)
5 views2 pages

SQL

Uploaded by

Rajib Ali bhutto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

SQL

Uploaded by

Rajib Ali bhutto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Create table employes (ID int, E Name varchar, Fname varchar, CNIC int, Cell int);

Insert into employee (ID, E_Name, Fname,CNIC,Cell) Values (01, ‘Aslam’ , ‘Abid’ , 43202, 03322);

Alter table employee add column address varchar;

Alter table employee drop column address;

Alter table employee modify column CNIC varchar;

Alter table employee Rename column Fname to FathersName;

Select Name from employee;

Select Name, CNIC from employee;

Select * from employee;

Select * from employees where name= ‘Aslam’

Select * from employees where salary>5000;

Select Name, FathersName, Salary, Cell, Address from employee where Adress = ‘LRK’ and Salary>
100000 and country = ‘Pakistan’;

Selct *from employee where Address= ‘LRK’ and Salary > 100000 and country = ’Pakistan’ or =’IND’;

Drop table employee;


And

Or

Between

Select * from employee where salary between 4000 and 10000;

Aggregate function (Sum, avg, count)

Select sum(salary) from emp;

Select count(name) from emp where address= ‘LRK’;

Select salary from emp;

Select name from emp where salary> (Select avg(salary) from emp;);

Add

Drop

Modify

You might also like