Advertisement
UKTC162

Danov

Mar 17th, 2020
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.93 KB | None | 0 0
  1. select * from sportGroups
  2. where location = 'Sofia-Mladost 1';
  3.  
  4. select * from students
  5. where id = 2;
  6.  
  7. select * from sportGroups
  8. where location = 'Sofia-Mladost 1' or location = 'Sofia-Liylin 7';
  9.  
  10. select * from sports
  11. order by name;
  12.  
  13. select * from coaches
  14. where egn = '7509041245';
  15.  
  16. select * from students
  17. where id >= 1 and id <= 3;
  18.  
  19. select students.name, sports.name
  20. from students join sports
  21. on students.id in(
  22. select student_id
  23. from student_sport
  24. where student_sport.student_id = sports.id
  25. );
  26.  
  27. select students.name, students.class, sportgroups.id
  28. from students join sportgroups
  29. on students.id in(
  30. select student_id
  31. from student_sport
  32. where student_sport.student_id = sportgroups.id
  33. )
  34. where sportgroups.dayOfWeek = 'Sunday';
  35.  
  36. select coaches.name, sports.name
  37. from coaches join sports
  38. on coaches.id in(
  39. select coach_id
  40. from sportgroups
  41. where sportgroups.sport_id = sports.id
  42. )
  43. where sports.name = 'football';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement