Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Task 10
- 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.
- select
- i.Name, i.Price, i.MinLevel,
- s.Strength, s.Defence, s.Speed, s.Luck,s.Mind
- from Items i
- join [Statistics] s
- on i.StatisticId = s.Id
- WHERE
- Mind > (SELECT AVG(Mind) FROM [Statistics])
- and Luck > (SELECT AVG(Luck) FROM [Statistics])
- and Speed > (SELECT AVG(Speed) FROM [Statistics])
- order by i.Name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement