-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlab-3-3.sql
More file actions
24 lines (20 loc) · 890 Bytes
/
lab-3-3.sql
File metadata and controls
24 lines (20 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- What were the winningest teams in each season of the
-- modern era (from 1960-present), listed by winningest teams first?
SELECT year, name, MAX(wins)
FROM teams
WHERE year >= 1960
group by year
order by MAX(wins) DESC;
-- Expected result: 61 rows, starting with
--
-- +------+-------------------------------+-----------+
-- | 2001 | Seattle Mariners | 116 |
-- | 1998 | New York Yankees | 114 |
-- | 1969 | Baltimore Orioles | 109 |
-- | 1961 | New York Yankees | 109 |
-- | 2018 | Boston Red Sox | 108 |
-- | 1986 | New York Mets | 108 |
-- | 1975 | Cincinnati Reds | 108 |
-- | 1970 | Baltimore Orioles | 108 |
-- | 2019 | Houston Astros | 107 |
-- | 2004 | St. Louis Cardinals | 105 |