--Task 10

a guest Jul 14th, 2015 177 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Task 10
  2. Find all items with statistics larger than average. Display only items that have Mind, Luck and Speed greater than average Items mind, luck and speed. Sort the results by item names in alphabetical order.
  4. select
  5.         i.Name, i.Price, i.MinLevel,
  6.         s.Strength, s.Defence, s.Speed, s.Luck,s.Mind
  7. from Items i
  8. join [Statistics] s
  9. on  i.StatisticId = s.Id
  10. WHERE
  11. Mind > (SELECT AVG(Mind) FROM [Statistics])
  12. and Luck > (SELECT AVG(Luck) FROM [Statistics])
  13. and Speed > (SELECT AVG(Speed) FROM [Statistics])
  14. order by i.Name
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