panaewboi

lab3

Aug 27th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. select * from propertyforrent; --l
  2.  
  3. select * from propertyforrent where type='House'; --2
  4.  
  5. select * from client;
  6. select clientno as "client number",
  7. fname as "first name",
  8. lname as "last name",
  9. telno as "telephone number"
  10. from client where preftype='Flat'; --3
  11.  
  12. select * from viewing;
  13. select clientno, viewdate from viewing where propertyno = 'PG21' and comments is not null; --4
  14.  
  15. select distinct * from propertyforrent where ownerno is null; --5
  16.  
  17. select * from staff;
  18. select staffno as "staff number",
  19. fname as "first name",
  20. lname as "last name",
  21. salary as "salary"
  22. from staff where sex='M'and salary>10000 ; --6
  23.  
  24. select * from staff;
  25. select staffno as "staff number",
  26. fname as "first name",
  27. lname as "last name",
  28. dob as "birth date"
  29. from staff where dob>'1-JAN-1960' order by dob; --7
  30.  
  31. select * from privateowner;
  32. select ownerno as "owner number",
  33. fname||lname as "name",
  34. address as "address"
  35. from privateowner where address not like '%Glasgow%'; --8
  36.  
  37. select * from branch;
  38. select street,city,postcode
  39. from branch where city in ('Aberdeen','Bristol'); --9
  40.  
  41. select * from staff;
  42. select branchno as "branch no",
  43. salary as "salary"
  44. from staff order by branchno, salary desc; --10
Add Comment
Please, Sign In to add comment