0% found this document useful (0 votes)
4 views

SQL COMMANDS

Uploaded by

suraviarjun
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

SQL COMMANDS

Uploaded by

suraviarjun
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Select * from Emp

Select Sum(Salary) from Emp

Select Avg(Salary) from Emp

Select Min(Salary) from Emp

Select Max(Salary) from Emp

Select Count(Salary) from Emp

Select * from Emp Order By “Ename” DESC

Select * from Emp Order By “Ename” ASC

Select Prod_Name,Price-Discount As Total from Product

Select Prod_Name,Price-Discount As Sales_Price from Product

1. select sum(Age) from demo;


2. select sum(No1) from function;
3. select sum(No1), sum(No2) from function;
4. Select count(No1), count(No2) from function;
5. select Avg (No1), sum(No2) from function;
6. select Max (No1), Min(No2) from function;
7. Select Sum(Salary) from Emp
Group by Designation;
8. Select * from Emp
order by Designation;

9. Create table student("Roll" Integer, "Name" Varchar(30), Primary key("Roll"));

10. Create table first ("roll" Integer, "name" varchar(30));

11. insert into first values(1, 'AA');

12. update THREE


set "name"='Anuradha'
where "name" like 'Anupama';

13. alter table THREE


add "salary" Integer;

14. insert into THREE ("age", "salary")


values (23, 25000);
15. update first
set "age"=25
where "name" like 'adarsh';

16. update first


set "roll"=3
where "name" is null;

17. create table demo


("roll" Integer, "name" varchar(30), primary key("roll"));

18. delete from first


where "name" like 'Babitha';

19. alter table prime


drop "salary";

You might also like