Assignment 1
Due: 11:59 pm 9/3/2025
For the first 5 questions, submit a text file called yourlastname.txt with the data. All answers pertain to the baseball database for the class.
- List three attributes in the franchises table
- List an attribute in the franchises table that can hold a string of more than 5 characters.
- List an attribute which cannot be null in the franchsises table.
- List an attribute from any table (include the table name) that can hold a real number.
- List a table and an attribute such that the attribute is in the franchsises table and the other table
For the next 5 questions, submit a second text file following the format after the questions. All of your SQL submissions will be in this format.
- Find the teamid and yearid of teams who have over 110 for team_W in one row. There are 5.
- Find the yearids when the Detroit Tigers (team name) won the World Series (WSWin = 'Y'). There are 4.
- Find the distinct yearids when the winner of the World Series for the American League is unknown (i.e., WSWIN is NULL and lgID is 'AL'). There are 4.
- Find the yearid and team name of the team that won the World Series in 2024 and 2025. You should have 2 rows.
- Find the teamid, team_W and team_L from teams in 1984 where the team played .500 (the number of losses (team_L) equals the number of wins (team_W)). There are 3.
Your assignment should be a text file meeting the following criteria
- It must be executable with "\. fname" in MySQL (where fname is the name of your file)
- It must be named yourlastname.sql1
- It must contain your name on the first line (commented out)
- It must contain the assignment name (Assignment 1) on the second line (commented out)
- It must contain the question before each sql statement (commented out)
Upload your files in canvas.
Each question will be graded on a scale of 0-1. A score of 0 indicates the question was incorrect. A score
of 0.5 indicates a partially correct answer. A score of 1 indicates a correct answer.