Puzzle-2017-01-17-BarChart

DECLARE @TeamScore TABLE
(
Team Varchar(20),
Game Int,
Score Int
)

–Round 1
INSERT INTO @TeamScore VALUES (‘Red’, 1, 800);
INSERT INTO @TeamScore VALUES (‘Blue’, 1, 900);
INSERT INTO @TeamScore VALUES (‘Green’, 1, 650);
INSERT INTO @TeamScore VALUES (‘Orange’, 1, 800);
INSERT INTO @TeamScore VALUES (‘Yellow’, 1, 1000);
INSERT INTO @TeamScore VALUES (‘White’, 1, 850);
INSERT INTO @TeamScore VALUES (‘Black’, 1, 450);

–Round 2
INSERT INTO @TeamScore VALUES (‘Red’, 2, 850);
INSERT INTO @TeamScore VALUES (‘Blue’, 2, 1000);
INSERT INTO @TeamScore VALUES (‘Green’, 2, 700);
INSERT INTO @TeamScore VALUES (‘Orange’, 2, 800);
INSERT INTO @TeamScore VALUES (‘Yellow’, 2, 950);
INSERT INTO @TeamScore VALUES (‘White’, 2, 450);
INSERT INTO @TeamScore VALUES (‘Black’, 2, 650);

–Round 3
INSERT INTO @TeamScore VALUES (‘Red’, 3, 750);
INSERT INTO @TeamScore VALUES (‘Blue’, 3, 800);
INSERT INTO @TeamScore VALUES (‘Green’, 3, 780);
INSERT INTO @TeamScore VALUES (‘Orange’, 3, 880);
INSERT INTO @TeamScore VALUES (‘Yellow’, 3, 550);
INSERT INTO @TeamScore VALUES (‘White’, 3, 800);
INSERT INTO @TeamScore VALUES (‘Black’, 3, 400);

–Round 4
INSERT INTO @TeamScore VALUES (‘Red’, 4, 800);
INSERT INTO @TeamScore VALUES (‘Blue’, 4, 950);
INSERT INTO @TeamScore VALUES (‘Green’, 4, 400);
INSERT INTO @TeamScore VALUES (‘Orange’, 4, 850);
INSERT INTO @TeamScore VALUES (‘Yellow’, 4, 700);
INSERT INTO @TeamScore VALUES (‘White’, 4, 850);
INSERT INTO @TeamScore VALUES (‘Black’, 4, 850);

–Round 5
INSERT INTO @TeamScore VALUES (‘Red’, 5, 550);
INSERT INTO @TeamScore VALUES (‘Blue’, 5, 1000);
INSERT INTO @TeamScore VALUES (‘Green’, 5, 700);
INSERT INTO @TeamScore VALUES (‘Orange’, 5, 800);
INSERT INTO @TeamScore VALUES (‘Yellow’, 5, 950);
INSERT INTO @TeamScore VALUES (‘White’, 5, 450);
INSERT INTO @TeamScore VALUES (‘Black’, 5, 350);

Are you ready to learn SQL Server, but don't know where to start?

>