SQL Queries
use sql_store;
select * from orders;
select *
from orders
where shipper_id is null;
select *
from orders
where shipper_id and comments is null;
select *
from orders
order by status;
select *
from orders
order by shipper_id and status;
select *
from orders
order by shipper_id,status;
select *
from orders
order by shipper_id,order_date;
select * from customers;
select *
from customers
order by 2;
select *
from customers
order by 4;
select first_name, 10 as points
from customers
order by points;
select *
from order_items;
select *
from order_items
where order_id=2;
select *
from order_items
where order_id=2
order by quantity*unit_price desc;
select *,quantity* unit_price as totalprice
from order_items
where order_id=2
order by quantity*unit_price desc;
select *
from customers;
select *
from customers
order by points desc;
select *
from customers
order by points
limit 5;
select *
from customers
limit 2,3;
select *
from customers
limit 5,3;
Comments
Post a Comment