/* Basketball */
DELETE FROM schools_officials_associations WHERE activity IN ('BBX', 'GBX');

INSERT INTO schools_officials_associations (school,officials_association,activity) VALUES

/* Blue Mountain Basketball */
(182,46,'BBX'),
(123,46,'BBX'),
(252,46,'BBX'),
(61,46,'BBX'),
(73,46,'BBX'),
(60,46,'BBX'),
(404,46,'BBX'),
(124,46,'BBX'),
(242,46,'BBX'),
(21,46,'BBX'),
(234,46,'BBX'),
(241,46,'BBX'),
(62,46,'BBX'),
(405,46,'BBX'),
(102,46,'BBX'),
(330,46,'BBX'),
(182,46,'GBX'),
(123,46,'GBX'),
(252,46,'GBX'),
(61,46,'GBX'),
(73,46,'GBX'),
(60,46,'GBX'),
(404,46,'GBX'),
(124,46,'GBX'),
(242,46,'GBX'),
(21,46,'GBX'),
(234,46,'GBX'),
(241,46,'GBX'),
(62,46,'GBX'),
(405,46,'GBX'),
(102,46,'GBX'),
(330,46,'GBX'),

/* Central Oregon Basketball */
(46,47,'BBX'),
(48,47,'BBX'),
(260,47,'BBX'),
(522,47,'BBX'),
(368,47,'BBX'),
(100,47,'BBX'),
(186,47,'BBX'),
(135,47,'BBX'),
(47,47,'BBX'),
(106,47,'BBX'),
(142,47,'BBX'),
(237,47,'BBX'),
(32,47,'BBX'),
(25,47,'BBX'),
(259,47,'BBX'),
(432,47,'BBX'),
(46,47,'GBX'),
(48,47,'GBX'),
(260,47,'GBX'),
(522,47,'GBX'),
(368,47,'GBX'),
(100,47,'GBX'),
(186,47,'GBX'),
(135,47,'GBX'),
(47,47,'GBX'),
(106,47,'GBX'),
(142,47,'GBX'),
(237,47,'GBX'),
(32,47,'GBX'),
(25,47,'GBX'),
(259,47,'GBX'),
(432,47,'GBX'),

/* Douglas County Basketball */
(72,48,'BBX'),
(3,48,'BBX'),
(165,48,'BBX'),
(9,48,'BBX'),
(174,48,'BBX'),
(201,48,'BBX'),
(258,48,'BBX'),
(22,48,'BBX'),
(70,48,'BBX'),
(137,48,'BBX'),
(28,48,'BBX'),
(189,48,'BBX'),
(72,48,'GBX'),
(3,48,'GBX'),
(165,48,'GBX'),
(9,48,'GBX'),
(174,48,'GBX'),
(201,48,'GBX'),
(258,48,'GBX'),
(22,48,'GBX'),
(70,48,'GBX'),
(137,48,'GBX'),
(28,48,'GBX'),
(189,48,'GBX'),

/* Grants Pass Basketball */
(224,49,'BBX'),
(34,49,'BBX'),
(33,49,'BBX'),
(35,49,'BBX'),
(118,49,'BBX'),
(120,49,'BBX'),
(240,49,'BBX'),
(88,49,'BBX'),
(208,49,'BBX'),
(224,49,'GBX'),
(34,49,'GBX'),
(33,49,'GBX'),
(35,49,'GBX'),
(118,49,'GBX'),
(120,49,'GBX'),
(240,49,'GBX'),
(88,49,'GBX'),
(208,49,'GBX'),

/* Klamath County Basketball */
(245,50,'BBX'),
(116,50,'BBX'),
(115,50,'BBX'),
(181,50,'BBX'),
(223,50,'BBX'),
(197,50,'BBX'),
(198,50,'BBX'),
(169,50,'BBX'),
(282,50,'BBX'),
(245,50,'GBX'),
(116,50,'GBX'),
(115,50,'GBX'),
(181,50,'GBX'),
(223,50,'GBX'),
(197,50,'GBX'),
(198,50,'GBX'),
(169,50,'GBX'),
(282,50,'GBX'),

/* Lane County Basketball */
(263,51,'BBX'),
(85,51,'BBX'),
(269,51,'BBX'),
(344,51,'BBX'),
(227,51,'BBX'),
(251,51,'BBX'),
(257,51,'BBX'),
(265,51,'BBX'),
(232,51,'BBX'),
(113,51,'BBX'),
(214,51,'BBX'),
(31,51,'BBX'),
(215,51,'BBX'),
(164,51,'BBX'),
(183,51,'BBX'),
(163,51,'BBX'),
(101,51,'BBX'),
(41,51,'BBX'),
(44,51,'BBX'),
(64,51,'BBX'),
(39,51,'BBX'),
(138,51,'BBX'),
(91,51,'BBX'),
(167,51,'BBX'),
(263,51,'GBX'),
(85,51,'GBX'),
(269,51,'GBX'),
(344,51,'GBX'),
(227,51,'GBX'),
(251,51,'GBX'),
(257,51,'GBX'),
(265,51,'GBX'),
(232,51,'GBX'),
(113,51,'GBX'),
(214,51,'GBX'),
(31,51,'GBX'),
(215,51,'GBX'),
(164,51,'GBX'),
(183,51,'GBX'),
(163,51,'GBX'),
(101,51,'GBX'),
(41,51,'GBX'),
(44,51,'GBX'),
(64,51,'GBX'),
(39,51,'GBX'),
(138,51,'GBX'),
(91,51,'GBX'),
(167,51,'GBX'),

/* Lower Columbia Basketball */
(103,52,'BBX'),
(110,52,'BBX'),
(103,52,'GBX'),
(110,52,'GBX'),

/* Malheur County Basketball */
(66,53,'BBX'),
(136,53,'BBX'),
(190,53,'BBX'),
(347,53,'BBX'),
(179,53,'BBX'),
(171,53,'BBX'),
(66,53,'GBX'),
(136,53,'GBX'),
(190,53,'GBX'),
(347,53,'GBX'),
(179,53,'GBX'),
(171,53,'GBX'),

/* Mid-Columbia Basketball */
(81,54,'BBX'),
(409,54,'BBX'),
(211,54,'BBX'),
(199,54,'BBX'),
(272,54,'BBX'),
(220,54,'BBX'),
(196,54,'BBX'),
(2,54,'BBX'),
(134,54,'BBX'),
(81,54,'GBX'),
(409,54,'GBX'),
(211,54,'GBX'),
(199,54,'GBX'),
(272,54,'GBX'),
(220,54,'GBX'),
(196,54,'GBX'),
(2,54,'GBX'),
(134,54,'GBX'),

/* Mid-Valley Basketball */
(173,55,'BBX'),
(12,55,'BBX'),
(13,55,'BBX'),
(250,55,'BBX'),
(172,55,'BBX'),
(256,55,'BBX'),
(177,55,'BBX'),
(185,55,'BBX'),
(170,55,'BBX'),
(63,55,'BBX'),
(268,55,'BBX'),
(133,55,'BBX'),
(16,55,'BBX'),
(254,55,'BBX'),
(228,55,'BBX'),
(271,55,'BBX'),
(200,55,'BBX'),
(398,55,'BBX'),
(419,55,'BBX'),
(173,55,'GBX'),
(12,55,'GBX'),
(13,55,'GBX'),
(250,55,'GBX'),
(172,55,'GBX'),
(256,55,'GBX'),
(177,55,'GBX'),
(185,55,'GBX'),
(170,55,'GBX'),
(63,55,'GBX'),
(268,55,'GBX'),
(133,55,'GBX'),
(16,55,'GBX'),
(254,55,'GBX'),
(228,55,'GBX'),
(271,55,'GBX'),
(200,55,'GBX'),
(398,55,'GBX'),
(419,55,'GBX'),

/* North Coast Basketball */
(53,56,'BBX'),
(99,56,'BBX'),
(117,56,'BBX'),
(104,56,'BBX'),
(255,56,'BBX'),
(15,56,'BBX'),
(53,56,'GBX'),
(99,56,'GBX'),
(117,56,'GBX'),
(104,56,'GBX'),
(255,56,'GBX'),
(15,56,'GBX'),

/* Northeast Oregon Basketball */
(17,57,'BBX'),
(248,57,'BBX'),
(11,57,'BBX'),
(19,57,'BBX'),
(236,57,'BBX'),
(184,57,'BBX'),
(114,57,'BBX'),
(69,57,'BBX'),
(243,57,'BBX'),
(67,57,'BBX'),
(213,57,'BBX'),
(105,57,'BBX'),
(192,57,'BBX'),
(17,57,'GBX'),
(248,57,'GBX'),
(11,57,'GBX'),
(19,57,'GBX'),
(236,57,'GBX'),
(184,57,'GBX'),
(114,57,'GBX'),
(69,57,'GBX'),
(243,57,'GBX'),
(67,57,'GBX'),
(213,57,'GBX'),
(105,57,'GBX'),
(192,57,'GBX'),

/* Portland Basketball */
(92,58,'BBX'),
(30,58,'BBX'),
(95,58,'BBX'),
(145,58,'BBX'),
(76,58,'BBX'),
(126,58,'BBX'),
(226,58,'BBX'),
(279,58,'BBX'),
(6,58,'BBX'),
(144,58,'BBX'),
(233,58,'BBX'),
(98,58,'BBX'),
(153,58,'BBX'),
(239,58,'BBX'),
(152,58,'BBX'),
(29,58,'BBX'),
(337,58,'BBX'),
(247,58,'BBX'),
(37,58,'BBX'),
(38,58,'BBX'),
(150,58,'BBX'),
(151,58,'BBX'),
(4,58,'BBX'),
(68,58,'BBX'),
(52,58,'BBX'),
(149,58,'BBX'),
(125,58,'BBX'),
(326,58,'BBX'),
(266,58,'BBX'),
(93,58,'BBX'),
(27,58,'BBX'),
(205,58,'BBX'),
(111,58,'BBX'),
(94,58,'BBX'),
(146,58,'BBX'),
(246,58,'BBX'),
(249,58,'BBX'),
(387,58,'BBX'),
(7,58,'BBX'),
(89,58,'BBX'),
(8,58,'BBX'),
(55,58,'BBX'),
(156,58,'BBX'),
(210,58,'BBX'),
(209,58,'BBX'),
(26,58,'BBX'),
(238,58,'BBX'),
(231,58,'BBX'),
(79,58,'BBX'),
(270,58,'BBX'),
(225,58,'BBX'),
(370,58,'BBX'),
(417,58,'BBX'),
(108,58,'BBX'),
(119,58,'BBX'),
(212,58,'BBX'),
(277,58,'BBX'),
(194,58,'BBX'),
(23,58,'BBX'),
(321,58,'BBX'),
(157,58,'BBX'),
(191,58,'BBX'),
(287,58,'BBX'),
(75,58,'BBX'),
(112,58,'BBX'),
(338,58,'BBX'),
(90,58,'BBX'),
(366,58,'BBX'),
(356,58,'BBX'),
(339,58,'BBX'),
(92,58,'GBX'),
(30,58,'GBX'),
(95,58,'GBX'),
(145,58,'GBX'),
(76,58,'GBX'),
(126,58,'GBX'),
(226,58,'GBX'),
(279,58,'GBX'),
(6,58,'GBX'),
(144,58,'GBX'),
(233,58,'GBX'),
(98,58,'GBX'),
(153,58,'GBX'),
(239,58,'GBX'),
(152,58,'GBX'),
(29,58,'GBX'),
(337,58,'GBX'),
(247,58,'GBX'),
(37,58,'GBX'),
(38,58,'GBX'),
(150,58,'GBX'),
(151,58,'GBX'),
(4,58,'GBX'),
(68,58,'GBX'),
(52,58,'GBX'),
(149,58,'GBX'),
(125,58,'GBX'),
(326,58,'GBX'),
(266,58,'GBX'),
(93,58,'GBX'),
(27,58,'GBX'),
(205,58,'GBX'),
(111,58,'GBX'),
(94,58,'GBX'),
(146,58,'GBX'),
(246,58,'GBX'),
(249,58,'GBX'),
(387,58,'GBX'),
(7,58,'GBX'),
(89,58,'GBX'),
(8,58,'GBX'),
(55,58,'GBX'),
(156,58,'GBX'),
(210,58,'GBX'),
(209,58,'GBX'),
(26,58,'GBX'),
(238,58,'GBX'),
(231,58,'GBX'),
(79,58,'GBX'),
(270,58,'GBX'),
(225,58,'GBX'),
(370,58,'GBX'),
(417,58,'GBX'),
(108,58,'GBX'),
(119,58,'GBX'),
(212,58,'GBX'),
(277,58,'GBX'),
(194,58,'GBX'),
(23,58,'GBX'),
(321,58,'GBX'),
(157,58,'GBX'),
(191,58,'GBX'),
(287,58,'GBX'),
(75,58,'GBX'),
(112,58,'GBX'),
(338,58,'GBX'),
(90,58,'GBX'),
(366,58,'GBX'),
(356,58,'GBX'),
(339,58,'GBX'),

/* Rogue Valley Basketball */
(51,59,'BBX'),
(50,59,'BBX'),
(222,59,'BBX'),
(204,59,'BBX'),
(154,59,'BBX'),
(178,59,'BBX'),
(78,59,'BBX'),
(349,59,'BBX'),
(77,59,'BBX'),
(408,59,'BBX'),
(51,59,'GBX'),
(50,59,'GBX'),
(222,59,'GBX'),
(204,59,'GBX'),
(154,59,'GBX'),
(178,59,'GBX'),
(78,59,'GBX'),
(349,59,'GBX'),
(77,59,'GBX'),
(408,59,'GBX'),

/* Salem Basketball */
(129,60,'BBX'),
(24,60,'BBX'),
(131,60,'BBX'),
(130,60,'BBX'),
(128,60,'BBX'),
(127,60,'BBX'),
(372,60,'BBX'),
(155,60,'BBX'),
(202,60,'BBX'),
(139,60,'BBX'),
(244,60,'BBX'),
(121,60,'BBX'),
(253,60,'BBX'),
(57,60,'BBX'),
(42,60,'BBX'),
(188,60,'BBX'),
(83,60,'BBX'),
(36,60,'BBX'),
(273,60,'BBX'),
(5,60,'BBX'),
(229,60,'BBX'),
(54,60,'BBX'),
(158,60,'BBX'),
(262,60,'BBX'),
(122,60,'BBX'),
(264,60,'BBX'),
(140,60,'BBX'),
(141,60,'BBX'),
(175,60,'BBX'),
(207,60,'BBX'),
(97,60,'BBX'),
(261,60,'BBX'),
(40,60,'BBX'),
(20,60,'BBX'),
(193,60,'BBX'),
(168,60,'BBX'),
(441,60,'BBX'),
(80,60,'BBX'),
(363,60,'BBX'),
(216,60,'BBX'),
(195,60,'BBX'),
(129,60,'GBX'),
(24,60,'GBX'),
(131,60,'GBX'),
(130,60,'GBX'),
(128,60,'GBX'),
(127,60,'GBX'),
(372,60,'GBX'),
(155,60,'GBX'),
(202,60,'GBX'),
(139,60,'GBX'),
(244,60,'GBX'),
(121,60,'GBX'),
(253,60,'GBX'),
(57,60,'GBX'),
(42,60,'GBX'),
(188,60,'GBX'),
(83,60,'GBX'),
(36,60,'GBX'),
(273,60,'GBX'),
(5,60,'GBX'),
(229,60,'GBX'),
(54,60,'GBX'),
(158,60,'GBX'),
(262,60,'GBX'),
(122,60,'GBX'),
(264,60,'GBX'),
(140,60,'GBX'),
(141,60,'GBX'),
(175,60,'GBX'),
(207,60,'GBX'),
(97,60,'GBX'),
(261,60,'GBX'),
(40,60,'GBX'),
(20,60,'GBX'),
(193,60,'GBX'),
(168,60,'GBX'),
(441,60,'GBX'),
(80,60,'GBX'),
(363,60,'GBX'),
(216,60,'GBX'),
(195,60,'GBX'),

/* Southwest Oregon Basketball */
(159,62,'BBX'),
(65,62,'BBX'),
(132,62,'BBX'),
(230,62,'BBX'),
(18,62,'BBX'),
(176,62,'BBX'),
(49,62,'BBX'),
(221,62,'BBX'),
(71,62,'BBX'),
(218,62,'BBX'),
(159,62,'GBX'),
(65,62,'GBX'),
(132,62,'GBX'),
(230,62,'GBX'),
(18,62,'GBX'),
(176,62,'GBX'),
(49,62,'GBX'),
(221,62,'GBX'),
(71,62,'GBX'),
(218,62,'GBX'),

/* Strawberry Basketball */
(59,61,'BBX'),
(162,61,'BBX'),
(96,61,'BBX'),
(180,61,'BBX'),
(74,61,'BBX'),
(109,61,'BBX'),
(107,61,'BBX'),
(59,61,'GBX'),
(162,61,'GBX'),
(96,61,'GBX'),
(180,61,'GBX'),
(74,61,'GBX'),
(109,61,'GBX'),
(107,61,'GBX');


/* Get confirmation of the entries */
SELECT 
	DISTINCT(S.short_name),
	CS.classification,
	OA.short_name

FROM
	schools AS S,
	officials_associations AS OA,
	schools_officials_associations AS SOA,
	classification_schools AS CS

WHERE
	SOA.school = S.id AND
	SOA.officials_association = OA.id AND
	SOA.activity IN ('BBX', 'GBX') AND
	CS.school = S.id AND
	CS.school_year = 2015

ORDER BY
	OA.short_name,
	CS.classification DESC,
	S.short_name


