Select productid, productname, unitprice
from Products order by unitprice desc
Select productid, productname,categoryid, unitprice
from Products order by categoryid, unitprice desc
Zad 1 nazwy i kraje wsz
Select Companyname, customerid, country
from Customers order by country, companyname desc;
Zad 2
select categoryid, productname, unitprice
from Products order by categoryid, unitprice desc;
Zad 3
select companyname, country from Customers
where country='Japan' or country='Italy'
order by country, companyname desc
select distinct country from Suppliers order by country
ALIASY
select firstname as Imię, lastname as Nazwisko, employeeid as 'Nr prac'
from Employees;
select orderid, unitprice, unitprice*1,05 as newunitprice from Order_Details
select firstname as Imię, lastname as Nazwisko, employeeid as 'Nr prac'
from Employees;
select orderid, unitprice, unitprice*1,05 as newunitprice from Order_Details;
select firstname, lastname, concat(substring(lower(firstname),1,1),substring(lower(lastname),1,8),'@nortwind.com')
from Employees
Email
select lower(concat(substring(firstname,1,1), substring(lastname,1,8),'@northwind')) email
from Employees
select orderid, productid, quantity from Order_Details
order by quantity desc
limit 5
select avg(unitprice)
from Products;
select sum(quantity)
from Order_Details
select count(*)
from Products where unitprice>10 and unitprice<20;
select max(unitprice)
from Products where unitprice<20;
select max(unitprice), min(unitprice), avg (unitprice)
from Products where quantityperunit like "%bottle%";
select sum(unitprice*quantity*(1-discount)) from Order_Details where orderid=10250
Wyszukiwarka
Podobne podstrony:
lab 4 systemy wspomaganiaLab cpplab 2T2 Skrypt do lab OU Rozdział 6 Wiercenie 3IE RS lab 9 overviewlab pkm 3lab chemia korozjalab tsp 3LabOsik Wspomaganie uczniów ze specjalnymi potrzebami edukacyjnymiKonsp Lab TK ZiIP sem3d 1stlab Projektowanie filtrowMysle wiec jestemP lamiglowek wspomagajacych obiektywne myslenie my5obiwięcej podobnych podstron