-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOrder_By
12 lines (10 loc) · 862 Bytes
/
Order_By
1
2
3
4
5
6
7
8
9
10
11
12
create table Employee(id int, name varchar(20), salary int(20), state varchar(20), city varchar(20));
insert into Employee values(1, "Jhon", 500000, "Uttar Pradesh", "Gurgao");
insert into Employee values(2, "Smith", 540000, "Rajasthan", "Jaipur");
insert into Employee values(3, "Mark", 60000, "Delhi", "Noida");
insert into Employee values(4, "Sarthak", 500000, "Uttar Pradesh", "Gonda");
insert into Employee values(5, "Juned", 50000, "Rajasthan", "Bikaner");
insert into Employee values(6, "Juned1", 650000, "Delhi", "Chor Bazar");
//-----------------------------------------------ORDER BY------------------------------------------//
select * from Employee order by salary desc; //DESC for Descending Order
select * from Employee order by name asc; //ASC for Ascending Order