Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. /* Question 1
  2. select distinct noCage
  3. from LesAnimaux
  4. where type_an = 'lion' or type_an = 'leopard'; */
  5.  
  6. /*Question 2
  7. select distinct nomE
  8. from LesAnimaux natural join LesGardiens
  9. where type_an = 'leopard';*/
  10.  
  11. /*Question 3
  12. select nomE
  13. from LesGardiens natural join LesAnimaux
  14. where type_an = 'leopard'
  15. INTERSECT
  16. select nomE
  17. from LesGardiens natural join LesAnimaux
  18. where type_an = 'lion';*/
  19.  
  20. /*Question 4
  21. select distinct nomE
  22. from LesMaladies natural join LesAnimaux natural join LesGardiens;*/
  23.  
  24. /*Question 5
  25. select distinct nomE
  26. from LesMaladies natural join LesAnimaux natural join LesCages natural join LesResponsables;*/
  27.  
  28. /*Question 6
  29. select distinct nomE
  30. from LesGardiens natural join LesAnimaux
  31. minus(select distinct nomE
  32. from LesGardiens
  33. natural join LesAnimaux where type_an <>'leopard');*/
  34.  
  35. /* Question 7
  36. select nomE
  37. from LesGardiens natural join LesAnimaux
  38. where type_an = 'leopard'
  39. minus
  40. (select nomE
  41. from LesAnimaux natural join LesGardiens
  42. where type_an <> 'leopard');*/
  43.  
  44. /*Question 8
  45. select count(distinct nomA)
  46. from LesMaladies;*/
  47.  
  48. /*Question 9
  49. select nomM,count(nomA) as NombreDeMalades
  50. from LesMaladies
  51. group by nomM;*/
  52.  
  53. /*Question 10
  54. select nomA,count(nomM)
  55. from LesMaladies
  56. group by nomA
  57. having count(nomM) >= 2;*/
  58.  
  59. /*Question 11
  60. select nomE,count(fonction_cage)
  61. from LesAnimaux natural join LesGardiens
  62. where fonction_cage = 'fauve'
  63. group by nomE
  64. having count(fonction_cage) > 2;*/
  65.  
  66. /*Question 12
  67. select nomE
  68. from LesResponsables natural join (select noAllee,count(noCage) as NombreDeCages
  69. from LesCages
  70. group by noAllee)
  71. where NombreDeCages = (select max(NombreDeCages)
  72. from(select noAllee,count(noCage) as NombreDeCages
  73. from LesCages
  74. group by noAllee));*/
  75.  
  76. /*Question 13
  77. select nomE
  78. from LesResponsables natural join (select noAllee,count(noCage) as NombreDeCages
  79. from LesCages natural join (select noCage
  80. from LesAnimaux natural join LesMaladies)
  81. group by noAllee)
  82. where NombreDeCages = (select max(NombreDeCages)
  83. from (select noAllee,count(noCage) as NombreDeCages
  84. from LesCages natural join (select noCage
  85. from LesAnimaux natural join LesMaladies)
  86. group by noAllee));*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement