Advertisement
Maks140888

Untitled

Jun 7th, 2022
1,388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.66 KB | None | 0 0
  1. select count(s.name) from sheldule h, subjects s, days_week d, corps c, audiences a
  2. where s.id = h.subject_id
  3. and a.id = h.audience_id
  4. and a.corp_id = c.id
  5. and d.id = h.day_id
  6. and c.name = 'Центральний'
  7. and d.name = 'Середа'
  8.  
  9.  
  10. select distinct d.name from sheldule h, subjects s, days_week d,  audiences a
  11.     where s.id = h.subject_id
  12.         and a.id = h.audience_id
  13.         and d.id = h.day_id
  14.         and d.name not in
  15.             (select D.name from sheldule H, days_week D, audiences A  
  16.                 where A.id = H.audience_id
  17.                     and D.id = H.day_id
  18.                     and A.name = '410'
  19.              );  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement