Solutions

EspaƱol

T02.001- Get all the information of users.

select * from uuser;


T02.002- List the emails and name and surnames of the users.

select email,name,surnames from uuser


T02.003- List the emails and name and surnames of the users, sorted by email.

select email,name,surnames 
from uuser 
order by email;


T02.004- List the emails and name and surnames of the users, sorted by surnames and name

select email,name,surnames 
from uuser 
order by surnames,name;


T02.005- List the emails and name and surnames of the users, ascending sorted by surnames and descending by name

select email,name,surnames 
from uuser 
order by surnames,name desc;


T02.006- List the emails, name and surnames of users, descending sorted by surnames and name

select email,name,surnames 
from uuser 
order by surnames desc, name desc;


T02.011- Brands

select * from brand;


T02.016- Code and retail price of the articles requested in order number 1.

select article,price
from linorder
where numOrder=1


T02.023- Panel of the televisions of 21 inches or less, avoiding duplicates

select distinct panel
from tv
where screen <= 21;


T02.024- Code, name, brand and retail price of the articles that have the rrp between 350 and 450.

select cod, name, brand, rrp
from article
where rrp >=350 and rrp <= 450;


T02.025- Code, name and retail price of the articles with no brand.

select cod,name,rrp from article where brand is null;


T02.026- Code, name and retail price of the articles with no rpp but brand is Sigma.

select cod,name,rrp
from article 
where rrp is null and brand='Sigma';


T02.027- Email, name, surnames and telephone of users with name Santiago, Wencesalo or Sergio.

select email,name,surnames,telephone 
from uuser 
where name = 'SANTIAGO' OR name = 'WENCESLAO' OR name = 'SERGIO';


T02.028- Email, name, surnames and telephone of users with name Santiago, Wencesalo or Sergio, and they have telephone number.

select email,name,surnames,telephone 
from uuser 
where (name = 'SANTIAGO' OR name = 'WENCESLAO' OR name = 'SERGIO') 
      and telephone is not null;