Advertisement
PieInlaw

Untitled

May 15th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.30 KB | None | 0 0
  1. CREATE OR REPLACE VIEW view_7 AS
  2.  
  3.  
  4.     SELECT   DISTINCT s.s_name, sh.sh_name, COUNT(sl.*)
  5.  
  6.     FROM     system s, shops sh, sale sl, employees e, departs d
  7.  
  8.     WHERE    sl.sl_employee = e.e_id   AND
  9.  
  10.              e.e_depart     = d.d_id   AND
  11.  
  12.              d.d_shop       = sh.sh_id AND
  13.  
  14.              sh.sh_id       = s.sh_id
  15.  
  16. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement