SHARE
TWEET

Untitled

a guest Oct 21st, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --SQL FIRST QUERY
  2.  
  3. SELECT DISTINCT items.name,sellers.name
  4. FROM items INNER JOIN sellers ON items.sellerid=sellers.id
  5. WHERE sellers.rating>4;
  6.  
  7. --SECOND QUERY
  8. SELECT sellers.name
  9. FROM items INNER JOIN sellers ON items.sellerid=sellers.id
  10. WHERE (SELECT AVG(price)
  11.             FROM items
  12.             WHERE items.sellerid=sellers.id)>10
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top