Advertisement
regzarr

Untitled

Mar 14th, 2023
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. --L4.EX1
  2. SELECT p.nume , f.nume as facultate
  3. FROM Profesor p, Facultate f
  4. WHERE p.fid = f.fid;
  5.  
  6. --L4.EX2
  7. SELECT cu.titlu, s.nr_locuri
  8. FROM Sala s INNER JOIN Curs cu
  9. ON s.cods = cu.sala
  10. WHERE cu.ora >= 12;
  11.  
  12. --L4.EX3
  13. SELECT cu.titlu, s.etaj
  14. FROM Sala s INNER JOIN Curs cu
  15. ON s.cods = cu.sala
  16. WHERE s.etaj = 1;
  17.  
  18. --L4.EX4
  19. SELECT cu.titlu, p.nume
  20. FROM curs cu INNER JOIN profesor p
  21. ON cu.pid = p.pid
  22. -- where (...)
  23.  
  24. --L4.EX5
  25. SELECT stu.nume, cu.titlu, cu.sala
  26. FROM student stu INNER JOIN (
  27. contract con INNER JOIN curs cu
  28. ON con.cid = cu.cid
  29. )
  30. ON stu.sid = con.sid
  31.  
  32. --L4.EX6
  33. SELECT stu.sid, stu.nume
  34. FROM student stu FULL OUTER JOIN contract con
  35. ON stu.sid = con.sid
  36. WHERE con.sid IS NULL
  37. ORDER BY stu.nume, stu.an
  38.  
  39. --L4.EX7
  40. SELECT stu.sid, stu.nume
  41. FROM student stu FULL OUTER JOIN contract con
  42. ON stu.sid = con.sid
  43. WHERE con.sid IS NULL
  44. ORDER BY stu.nume, stu.an
  45.  
  46. --L4.EX8
  47. SELECT stu.nume, cu.zi
  48. FROM student stu INNER JOIN (
  49. contract con INNER JOIN curs cu
  50. ON con.cid = cu.cid
  51. )
  52. ON stu.sid = con.sid
  53. WHERE cu.zi = 'Luni'
  54.  
  55. --L4.EX9
  56. SELECT stu.nume
  57. FROM (( student stu INNER JOIN contract con ON stu.sid = con.sid) INNER JOIN curs cu ON cu.cid = con.cid) INNER JOIN sala s ON cu.sala = s.cods
  58. WHERE s.nr_locuri<200
  59. ORDER BY stu.an,
  60. SUBSTR( NUME, 1, INSTR( NUME, ' ', 1, 1 ) ),
  61. SUBSTR( NUME, INSTR( NUME, ' ', 1, 1 ) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement