write a SQL statements to perform the following:
Select all years a World Series game was played
Select all losing teams that played in a World Series game
Select all winning and losing teams that played in a World Series
game
Select all cities of a winning or losing team that played in a
World Series game
Select all winning and losing teams that played in a World Series
game, and provide aliases of "Winning Team" and "Losing Team"
Select all cities of a winning or losing team that played in a
World Series game and provide aliases of "Winning City" and "Losing
City"
Select all winning teams that played in a World Series game and
provide an alias of "Winning Team"; list each only once
Select all losing teams that played in a World Series game; provide
an alias of "Losing Team"; list each only once
Select all winning teams that played in a World Series; list each
team and city combination once
Select all losing teams that played in a World Series game; list
each team and city combination once
DROP TABLE Wins_S001;
This command demonstrates how to drop a table. Do not drop the
table and then try to add records.
CREATE TABLE Wins_S001(Team CHAR(20),
City
CHAR(20),
Year_T
INT NOT NULL PRIMARY KEY,
LoserTeam
CHAR(20),
LoserCity
CHAR(20));
DESCRIBE Wins_S001;
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam, LoserCity)VALUES('Red Sox', 'Boston', 1903, 'Pirates', 'Pittsburgh');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Giants', 'New York', 1905, 'Athletics',
'Philadelphia');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('White Sox', 'Chicago', 1906, 'Cubs',
'Chicago');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Cubs', 'Chicago', 1907, 'Tigers',
'Detroit');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Cubs', 'Chicago', 1908, 'Tigers',
'Detroit');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Pirates', 'Pittsburgh', 1909, 'Tigers',
'Detroit');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Athletics', 'Philadelphia', 1910, 'Cubs',
'Chicago');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Athletics', 'Philadelphia', 1911, 'Giants', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Red Sox', 'Boston', 1912, 'Giants', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Athletics', 'Philadelphia', 1913, 'Giants', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Braves', 'Boston', 1914, 'Athletics',
'Philadelphia');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Red Sox', 'Boston', 1915, 'Phillies',
'Philadelphia');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Red Sox', 'Boston', 1916, 'Robins',
'Brooklyn');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('White Sox', 'Chicago', 1917, 'Giants', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Red Sox', 'Boston', 1918, 'Cubs',
'Chicago');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Reds', 'Cincinnati', 1919, 'White Sox',
'Chicago');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Indians', 'Cleveland', 1920, 'Robins',
'Brooklyn');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Giants', 'New York', 1921, 'Yankees', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Giants', 'New York', 1922, 'Yankees', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1923, 'Giants', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Senators', 'Washington', 1924, 'Giants', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Pirates', 'Pittsburgh', 1925, 'Nationals',
'Wasnington');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Cardinals', 'St. Louis', 1926, 'Yankees', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1927, 'Pirates',
'Pittsburgh');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1928, 'Cardinals', 'St.
Louis');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Athletics', 'Philadelphia', 1929, 'Cubs',
'Chicago');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Athletics', 'Philadelphia', 1930, 'Cardinals',
'St. Louis');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Cardinals', 'St. Louis', 1931, 'Athletics',
'Philadelphia');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1932, 'Cubs',
'Chicago');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Giants', 'New York', 1933, 'Nationals',
'Wasnington');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Cardinals', 'St. Louis', 1934, 'Tigers',
'Detroit');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Tigers', 'Detroit', 1935, 'Cubs',
'Chicago');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1936, 'Giants', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1937, 'Giants', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1938, 'Cubs',
'Chicago');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1939, 'Reds',
'Cincinnati');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Reds', 'Cincinnati', 1940, 'Tigers',
'Detroit');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1941, 'Dodgers',
'Brooklyn');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Cardinals', 'St. Louis', 1942, 'Yankees', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1943, 'Cardinals', 'St.
Louis');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Cardinals', 'St. Louis', 1944, 'Browns', 'St.
Louis');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Tigers', 'Detroit', 1945, 'Cubs',
'Chicago');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Cardinals', 'St. Louis', 1946, 'Red Sox',
'Boston');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1947, 'Dodgers',
'Brooklyn');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Indians', 'Cleveland', 1948, 'Braves',
'Boston');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1949, 'Dodgers',
'Brooklyn');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1950, 'Phillies',
'Philadelphia');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1951, 'Giants', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1952, 'Dodgers',
'Brooklyn');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1953, 'Dodgers',
'Brooklyn');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Giants', 'New York', 1954, 'Indians',
'Cleveland');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Dodgers', 'Brooklyn', 1955, 'Yankees', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1956, 'Dodgers',
'Brooklyn');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Braves', 'Milwaukee', 1957, 'Yankees', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1958, 'Braves',
'Milwaukee');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Dodgers', 'Los Angeles', 1959, 'White Sox',
'Chicago');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Pirates', 'Pittsburgh', 1960, 'Yankees', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1961, 'Reds',
'Cincinnati');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1962, 'Giants', 'San
Francisco');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Dodgers', 'Los Angeles', 1963, 'Yankees', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Cardinals', 'St. Louis', 1964, 'Yankees', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Dodgers', 'Los Angeles', 1965, 'Twins',
'Minnesota');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Orioles', 'Baltimore', 1966, 'Dodgers', 'Los
Angeles');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Cardinals', 'St. Louis', 1967, 'Red Sox',
'Boston');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Tigers', 'Detroit', 1968, 'Cardinals', 'St.
Louis');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Mets', 'New York', 1969, 'Orioles',
'Baltimore');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Orioles', 'Baltimore', 1970, 'Reds',
'Cincinnati');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Pirates', 'Pittsburgh', 1971, 'Orioles',
'Baltimore');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Athletics', 'Oakland', 1972, 'Reds',
'Cincinnati');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Athletics', 'Oakland', 1973, 'Mets', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Athletics', 'Oakland', 1974, 'Dodgers', 'Los
Angeles');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Reds', 'Cincinnati', 1975, 'Red Sox',
'Boston');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Reds', 'Cincinnati', 1976, 'Yankees', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1977, 'Dodgers', 'Los
Angeles');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1978, 'Dodgers', 'Los
Angeles');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Pirates', 'Pittsburgh', 1979, 'Orioles',
'Baltimore');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Phillies', 'Philadelphia', 1980, 'Royals',
'Kansas City');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Dodgers', 'Los Angeles', 1981, 'Yankees', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Cardinals', 'St. Louis', 1982, 'Brewers',
'Milwaukee');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Orioles', 'Baltimore', 1983, 'Phillies',
'Philadelphia');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Tigers', 'Detroit', 1984, 'Padres', 'San
Diego');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Royals', 'Kansas City', 1985, 'Cardinals', 'St.
Louis');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Mets', 'New York', 1986, 'Red Sox',
'Boston');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Twins', 'Minnesota', 1987, 'Cardinals', 'St.
Louis');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Dodgers', 'Los Angeles', 1988, 'Athletics',
'Oakland');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Athletics', 'Oakland', 1989, 'Giants', 'San
Francisco');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Reds', 'Cincinnati', 1990, 'Athletics',
'Oakland');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Twins', 'Minnesota', 1991, 'Braves',
'Atlanta');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Blue Jays', 'Toronto', 1992, 'Braves',
'Atlanta');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Blue Jays', 'Toronto', 1993, 'Phillies',
'Philadelphia');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Braves', 'Atlanta', 1995, 'Indians',
'Cleveland');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1996, 'Braves',
'Atlanta');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Marlins', 'Florida', 1997, 'Indians',
'Cleveland');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1998, 'Padres', 'San
Diego');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 1999, 'Braves',
'Atlanta');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 2000, 'Mets', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Diamondbacks', 'Arizona', 2001, 'Yankees', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Angels', 'Anaheim', 2002, 'Giants', 'San
Francisco');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Marlins', 'Florida', 2003, 'Yankees', 'New
York');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Red Sox', 'Boston', 2004, 'Cardinals', 'St.
Louis');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('White Sox', 'Chicago', 2005, 'Astros',
'Houston');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Cardinals', 'St. Louis', 2006, 'Tigers',
'Detroit');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Red Sox', 'Boston', 2007, 'Rockies',
'Colorado');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Phillies', 'Philadelphia', 2008, 'Rays', 'Tampa
Bay');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Yankees', 'New York', 2009, 'Phillies',
'Philadelphia');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Cardinals', 'St. Louis', 2010, 'Rangers',
'Texas');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Giants', 'San Franciso', 2011, 'Tigers',
'Detroit');
INSERT INTO Wins_S001(Team, City, Year_T, LoserTeam,
LoserCity)VALUES('Cardinals', 'St. Louis', 2012, 'Yankees', 'New
York');
COMMIT;
// Select all columns of a table
SELECT * from Wins_S001;
// Select to view one columns of a table
SELECT Team from Wins_S001;
// Select to view multiple columns of a table
SELECT Team, City from Wins_S001;
// Assign an Alias to a column of a table
SELECT Team "Baseball Team", City "Home City" from
Wins_S001;
// Command to eliminate duplicate in output
SELECT DISTINCT Team "Baseball Team", City "Home City" from
Wins_S001;
SELECT UNIQUE Team "Baseball Team", City "Home City" from
Wins_S001;
// Command to concatenation of column content
SELECT DISTINCT Team || City from Wins_S001;
SELECT DISTINCT Team || City "Team / City" from
Wins_S001;
// Command to concatenation of column content
SELECT DISTINCT Team || City from Wins_S001;
SELECT DISTINCT Team || City "Team / City" from
Wins_S001;
// Restricting Rows
SELECT Team, City, Year_T
FROM Wins_S001
WHERE Year_T > 1995;
// Restricting Rows
SELECT Team, City, Year_T
FROM Wins_S001
WHERE Year_T = 1998;
// Finds all Cardianls
SELECT Team, City, Year_T
FROM Wins_S001
WHERE Team = 'Cardinals';
// No matches found
SELECT Team, City, Year_T
FROM Wins_S001
WHERE Team = 'cardinals';
// Restricting Rows
SELECT Team, City, Year_T
FROM Wins_S001
WHERE Team <= 'Cardinals';
// Restricting Rows
SELECT Team, City, Year_T
FROM Wins_S001
WHERE Team != 'Cubs';
// Restricting Rows
// All 1990 - 2000 Years
// Include 1990 and 2000
SELECT Team, City, Year_T
FROM Wins_S001
WHERE Year_T BETWEEN 1990 AND 2000;
// Restricting Rows
// All 1990 - 2000 Years
// Include 1990 and 2000
SELECT Team, City, Year_T
FROM Wins_S001
WHERE Year_T IN (1990, 1995, 1999);
// Restricting Rows
// All years except 1990, 1995, and 1999
SELECT Team, City, Year_T
FROM Wins_S001
WHERE Year_T NOT IN (1990, 1995, 1999);
// Restricting Rows
// All games played in the 90s
SELECT Team, LoserTeam, Year_T
FROM Wins_S001
WHERE Year_T LIKE '196_';
// Restricting Rows
// All games where the winning team name starts with C
SELECT Team, LoserTeam, Year_T
FROM Wins_S001
WHERE Team LIKE 'C%';
// Restricting Rows
// All games where the winning team name or losing team name starts
with C
SELECT Team, LoserTeam, Year_T
FROM Wins_S001
WHERE Team LIKE 'C%' OR LoserTeam LIKE 'C%';
// Restricting Rows
// All games where the winning team name or losing team name starts
with C
// Order by year
SELECT Team, LoserTeam, Year_T
FROM Wins_S001
WHERE Team LIKE 'C%' OR LoserTeam LIKE 'C%'
ORDER BY Year_T;
// Restricting Rows
// All games where the winning team name or losing team name starts
with C
// Order by year in descending order
SELECT Team, LoserTeam, Year_T
FROM Wins_S001
WHERE Team LIKE 'C%' OR LoserTeam LIKE 'C%'
ORDER BY Year_T DESC;
// Restricting Rows
// All games where the winning team name or losing team name starts
with C
// Order by winning team name
SELECT Team, LoserTeam, Year_T
FROM Wins_S001
WHERE Team LIKE 'C%' OR LoserTeam LIKE 'C%'
ORDER BY Team, LoserTeam;
1. Select year_t from Wins_S001;
This query will retrieves all the years game was played.
2. Select LoserTeam from Wins_S001;
This will retrieve the loser teams when the game played.
3. Select Team,LoserTeam from Wins_S001;
This will retrieve all the winning and losing teams.
4. Select City,LoserCity from Wins_S001;
This will retrieve the cities of teams.
5. Select Team as Winning_Team, LoserTeam as Loser_Team from Wins_S001;
This will retrieve all the teams with the required aliases.
write a SQL statements to perform the following: Select all years a World Series game was...
PYTHON Text file Seriesworld attached below and it is a list of teams that won from 1903-2018. First time mentioned won in 1903 and last team mentioned won in 2018. World series wasn’t played in 1904 and 1994 and the file has entries that shows it. Write a python program which will read this file and create 2 dictionaries. The first key of the dictionary should show name of the teams and each keys value that is associated is the...
Python 3.1 - 3.5 Certain machine parts are assigned serial numbers. Valid serial numbers are of the form: SN/nnnn-nnn where ‘n’ represents a digit. Write a function valid_sn that takes a string as a parameter and returns True if the serial number is valid and False otherwise. For example, the input "SN/5467-231" returns True "SN5467-231" returns False "SN/5467-2231" returns False Using this function, write and test another function valid-sn-file that takes three file handles as input parameters. The first handle...
Java : I keep getting something wrong in my loadfile method, how do I fix my code? Thank you. here is what is contained in the text file (WorldSeriesWinners.txt) 112 1903 Boston Americans 1904 No World Series 1905 New York Giants 1906 Chicago White Sox 1907 Chicago Cubs 1908 Chicago Cubs 1909 Pittsburgh Pirates 1910 Philadelphia Athletics 1911 Philadelphia Athletics 1912 Boston Red Sox 1913 Philadelphia Athletics 1914 Boston Braves 1915 Boston Red Sox 1916 Boston Red Sox 1917 Chicago...
5. You and your friends want to select a few Major League Baseball (MLB) teams to create a fantasy league. You write a code to select teams at random. (Divisions and teams are listed below.) (12pts.) AL East AL West AL Central HAstros Orioles White Sox B C Red Sox Indians Angels Tigers Yankees Athletics KC Rays Royals Mariners T Twins Blue Jays Rangers NL East NL Central NL West C A Diamondbacks Braves Cubs Marlins Reds Rockies Mets Brewers...
To be done on excel: Team Revenue ($ millions) Value ($ millions) Arizona Diamondbacks 195 584 Atlanta Braves 225 629 Baltimore Orioles 206 618 Boston Red Sox 336 1,312 Chicago Cubs 274 1,000 Chicago White Sox 216 692 Cincinnati Reds 202 546 Cleveland Indians 186 559 Colorado Rockies 199 537 Detroit Tigers 238 643 Houston Astros 196 626 Kansas City Royals 169 457 Los Angeles Angels of Anaheim 239 718 Los Angeles Dodgers 245 1,615 Miami Marlins 195 520 Milwaukee...
3) American League baseball teams play their games with the designated hitter rule, meaning that pitchers do not bat. The league believes that replacing the pitcher, typically a weak hitter, with another player in the batting order produces more runs. Using a significance level of a = 0.05, determine if the average number of runs is higher for the American League Following are the average number of runs scored by each team in the 2016 season: American League National League...
Tampa Texas Toront 4-30 In 2012, the total payroll for the New York Yankees was almost $200 million, while the total payroll for the Oakland Athletics (a team known for using baseball analytics or sabermetrics) was about $55 million, less than one-third of the Yankees' payroll. In the following table, you will see the payrolls (in millions) and the total number of victories for the baseball teams in the American League in the 2012 season. Develop a regression model to...
Team League Wins ERA BA HR SB Errors Built Size Attendance Payroll Pittsburgh Pirates NL 57 5.00 0.242 126 87 127 2001 38496 1.61 34.9 San Diego Padres NL 90 3.39 0.246 132 124 72 2004 42445 2.13 37.8 Oakland Athletics AL 81 3.56 0.256 109 156 99 1966 34077 1.42 51.7 Texas Rangers AL 90 3.93 0.276 162 123 105 1994 49115 2.51 55.3 Florida Marlins NL 80 4.08 0.254 152 92 123 1987 36331 1.54 55.6 Arizona Diamondbacks...
The average number of minutes Americans commute to work is 27.7 minutes (Sterling's Best Places, April 13, 2012). The average commute time in minutes for 48 cities are as follows: Click on the datafile logo to reference the data. DATA file Albuquerque Atlanta Austin Baltimore Boston Charlotte Chicago Cincinnati Cleveland Columbus Dallas Denver Detroit El Paso Fresno Indianapolis 23.3 28.3 24.6 32.1 31.7 25.8 38.1 24.9 26.8 23.4 28.5 28.1 29.3 24.4 23.0 24.8 Jacksonville Kansas City Las Vegas Little...
How does cellphone service compare between different cities? The data stored in CellService represent the rating of Verizon and AT&T in 22 different cities. (Data extracted from "Best Phones and Service," Consumer Reports, January 2012, p. 28, 37.) At the 0.05 level of significance, is there evidence of a difference in the mean cellphone service rating between Verizon and AT&T? You need to download "CellService” data file. End of document Le L show Queries ILS Prope Prope Refresh File Home...