I am trying to create data for a Superbowl sheet, and I want to create a table in SQL, which shows the number of wins per team with two columns, wins, and team. I need to use CASE. I hope someone will teach me this as I am an amateur and just started coding. I ASSURE YOU THIS IS NOT SPAM AND IT IS THE LIST OF SUPER BOWLS FROM THE 1ST TO THE 54TH AND I AM NOT A BOT This is what I have so far:
/* Put your data in here and query it! */ CREATE TABLE superbowls( Date TEXT , SB TEXT, Winner TEXT, Winner_Pts INTEGER, Loser TEXT, Loser_Pts INTEGER, MVP TEXT, Stadium TEXT, City TEXT, State TEXT ); /* https://justpaste.it/99c41 */ select * from superbowls where winner_pts > 10 and loser_pts< 10;
Advertisement
Answer
Something like this maybe?
create table YourNewTable as select Winner as Team, count(*) as Wins from superbowls group by Winner