Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. --- 2.3
  2. select distinct w.*
  3. from WYKLADOWCA w, ZAJECIA z, OCENA o
  4. where w.id_wykladowca = z.id_wykladowca
  5. and o.id_zajecia = z.id_zajecia
  6. and data>add_months (sysdate, -5)
  7.  
  8. --- 2.4
  9. select min(ocena) as "MINIMALNA OCENA", max(ocena) as "MAKSYMALNA OCENA", avg(ocena) as "ŚREDNIA OCENA"
  10. from OCENA
  11.  
  12. --- 2.5
  13. select max(OCENA.data)-min(OCENA.data) as "RÓŻNICA DAT"
  14. from OCENA
  15.  
  16. ---2.7
  17. select nazwa, ects
  18. from PRZEDMIOT
  19. order by ects desc --- sortowanie od największego do najmniejszego
  20. fetch first row only --- "first" => "next 2" + "row" -> "rows" || odcina wiersze poza wskazana iloscia pierwszych wierszy
  21.  
  22. --- 2.8
  23. select distinct Z.DZIENTYG, P.NAZWA
  24. from ZAJECIA Z, PRZEDMIOT P
  25. where Z.ID_PRZEDMIOT = P.ID_PRZEDMIOT
  26. and P.NAZWA like 'Algorytmy%' or P.NAZWA like 'Statystyka%'
  27.  
  28. --- 2.9
  29. select distinct GRUPA.NAZWA
  30. from GRUPA G, ZAJECIA Z, SALA S, BUDYNEK B
  31. where (B.NAZWA like 'WFMiI' or B.NAZWA 'WIL')
  32. and Z.ID_GRUPA = G.ID_GRUPA
  33. and B.ID_BUDYNEK = S.ID_BUDYNEK
  34.  
  35. --- 2.10
  36. select P.NAZWA
  37. from PRZEDMIOT P, TYTULNAUKOWY T, WYKLADOWCA W, ZAJECIA Z
  38. where T.NAZWA like 'mgr in%'
  39. and T.ID_TYTUL = W.ID_TYTULNAUKOWY
  40. and W.ID_WYKLADOWCA = Z.ID_WYKLADOWCA
  41. and Z.ID_PRZEDMIOT = P.ID_PRZEDMIOT
  42.  
  43. --- 2.11
  44. select W.NAZWISKO, W.IMIE
  45. from WYKLADOWCA W, TYTULNAUKOWY T, ZAJECIA Z, PRZEDMIOT P
  46. where T.NAZWA like 'Prof%'
  47. and T.ID_TYTUL = W.ID_TYTULNAUKOWY
  48. and W.ID_WYKLADOWCA = Z.ID_WYKLADOWCA
  49. and Z.ID_PRZEDMIOT = P.ID_PRZEDMIOT
  50.  
  51. --- 2.12
  52. select W.NAZWISKO, W.IMIE, Z.DZIENTYG
  53. from ZAJECIA Z, WYKLADOWCA W, SALA S
  54. where S.KODSALI like 'Si_ownia'
  55. and S.ID_SALA = Z.ID_SALA
  56. and Z.ID_WYKLADOWCA = W.ID_WYKLADOWCA
  57.  
  58. --- 2.13
  59. select BUDYNEK.NAZWA, count (ID.ZAJECIA) ile
  60. from SALA, ZAJECIA
  61. where ZAJECIA.ID_SALA = SALA.ID_SALA
  62. and BUDYNEK.ID_BUDYNEK = SALA.ID_BUDYNEK
  63. group by BUDYNEK.NAZWA
  64. order by ile
  65.  
  66. --- 2.14
  67. select imie, case when nazwisko like '%sk%' then 'BRAK PRZEDMIOTU' else nazwisko end nazwisko
  68. from wykladowca
  69.  
  70. --- 2.15
  71. select replace(NRALBUMU, '909', '000')
  72. from STUDENT
  73.  
  74. --- 2.16
  75. select distinct W.*
  76. from WYKLADOWCA W, ZAJECIA Z, SALA S
  77. where W.ID_WYKLADOWCA = Z.ID_WYKLADOWCA
  78. and S.ID_SALA = Z. ID_SALA
  79. and KODSALI like 'K%'
  80. and (DZIENTYG not like 'PON' and DZIENTYG not like 'CZW')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement