Advertisement
Guest User

--Task 10

a guest
Jul 14th, 2015
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  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.
  3.  
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement