Zbiór zadań z SQL Serwer poziom I

Ćwiczenie 1. Wyświetl nazwę i cenę produktów, których cena jest wyższa niż średnia cena.

 

select  ProductName, UnitPrice from Products where UnitPrice >(select avg(unitPrice) from Products) ;

 

Ćwiczenie 2. Wyświetl nazwę produktu i średnią cenę dla każdego produktu.

select  ProductName, UnitPrice , (select avg(unitPrice) from Products)  as Average from Products ;

 

Przewijanie do góry