blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
133
path
stringlengths
3
276
src_encoding
stringclasses
33 values
length_bytes
int64
23
9.61M
score
float64
2.52
5.28
int_score
int64
3
5
detected_licenses
listlengths
0
44
license_type
stringclasses
2 values
text
stringlengths
23
9.43M
download_success
bool
1 class
349a046fa1bbc59ada898aa92e706387cf7794ec
SQL
cloud4yourdata/CommunityEvents
/SQLDay/SQLDay2022/src/SynapseServerless/SQLDay2022DemoCETAS.sql
UTF-8
1,025
3.09375
3
[]
no_license
SELECT * FROM vwFactSalesOrderDetail ----------- DROP EXTERNAL TABLE FactSalesOrderDetail; CREATE EXTERNAL TABLE FactSalesOrderDetail WITH ( LOCATION = '/analytics_zone/DWHS/DWHDLTDemo/tables/ExtFactSalesOrderDetail/Version=1', DATA_SOURCE = DataLake, FILE_FORMAT = PARQUET_FORMAT ) AS SELECT * FROM vwFactSalesOrderDetail ; --REFRESH DROP EXTERNAL TABLE FactSalesOrderDetail; CREATE EXTERNAL TABLE FactSalesOrderDetail WITH ( LOCATION = '/analytics_zone/DWHS/DWHDLTDemo/tables/ExtFactSalesOrderDetail/Version=2', DATA_SOURCE = DataLake, FILE_FORMAT = PARQUET_FORMAT ) AS SELECT * FROM vwFactSalesOrderDetail; --------SHOW RESULTS SELECT * FROM FactSalesOrderDetail --QPI Recommendation SELECT * FROM qpi.recommendations --QPI QUERY HISTORY SELECT TOP 10 * FROM qpi.query_history WHERE query_text LIKE '%FactSalesOrderDetail%' ORDER BY start_time DESC --COMPARE QUERIES SELECT * FROM qpi.cmp_queries('{EF727ABD-3CDD-439F-B853-23C22E5AD5CD}', '{4D63F5A6-C864-443F-A284-38642DAE6F4D}')
true
73b3e45fb595aa7a77a7b321633a9cf2ff5f4e14
SQL
k13jolai/COEN-178-Intro-to-Databases
/labs_and_finalproject/lab3/part5.sql
UTF-8
144
3.125
3
[]
no_license
SELECT empname, deptname FROM l_dept NATURAL JOIN l_emp; SELECT empname, deptname FROM l_dept LEFT JOIN l_emp ON l_dept.deptid=l_emp.deptid;
true
7b3ee63a9a74b85934db4450889af453468cb620
SQL
nataliegroeneboom/mysql
/bowl.sql
UTF-8
2,418
4.28125
4
[]
no_license
CREATE TABLE bowl (Primary_key int not null auto_increment , Fname varchar(100) ,Lname varchar(100) ,Game1 int null ,Game2 int null ,Game3 int null ,Game4 int null , primary key (Primary_key)); INSERT INTO bowl (Fname, Lname, Game1, Game2, Game3, Game4) VALUES ('Natalie', 'Groeneboom', 10, 3, 4, 6) ,('Christina', 'Holme', 4, 10, 8, 7) ,('Annelies', 'Macintosh', 7, 9, 10, 3) ,('Jan Paul', 'Groeneboom', 8, 8, 10, 5); /* Create BowlResults table */ CREATE TABLE bowlResults (BowlResultID INT NOT NULL AUTO_INCREMENT ,FNAME varchar(50) DEFAULT NULL ,LNAME varchar(50) DEFAULT NULL ,Game_Num int DEFAULT NULL ,Game_Score int DEFAULT NULL ,PRIMARY KEY (BowlResultID)); SELECT CONCAT(SUBSTRING(Fname,1,1), SUBSTRING(Lname,1,1)) AS INITIALS ,CONCAT(Lname, ', ', Fname) AS "Name" ,Game1 AS "First Game" ,Game2 AS "Second Game" ,Game3 AS "Third Game" ,Game4 AS "Fourth Game" ,(Game1+Game2+Game3+Game4) AS "Total" , (Game1+Game2+Game3+Game4)/4 AS "Average Score" FROM bowl; INSERT INTO bowlResults (FNAME, LNAME, Game_Num, Game_Score) VALUES ('Mashrur', 'Hossain', 1,121) ,('Mashrur', 'Hossain', 2,87) ,('Mashrur', 'Hossain', 3,115) ,('Mashrur', 'Hossain', 4,124) ,('Matt', 'Berstein', 1,111) ,('Matt', 'Berstein', 2,99) ,('Matt', 'Berstein', 3,135) ,('Matt', 'Berstein', 4,105) ,('Anastasia', 'Ivanov', 1,75) ,('Anastasia', 'Ivanov', 2,99) ,('Anastasia', 'Ivanov', 3,125) ,('Anastasia', 'Ivanov', 4,141) ,('Mark', 'Futre', 1,115) ,('Mark', 'Futre', 2,128) ,('Mark', 'Futre', 3,101) ,('Mark', 'Futre', 4,84); /* Write a select statement listing the top 3 players and their tournament total, tournament average in order best to worst */ SELECT CONCAT(FNAME, ' ', LNAME) AS Player ,SUM(Game_Score) AS "Tournament Total" ,SUM(Game_Score)/COUNT(*) AS "Tournament Average" FROM bowlResults GROUP BY FNAME, LNAME ORDER BY SUM(Game_Score)/COUNT(*) DESC LIMIT 3; /* Write another select statement with each player's best game score, ordered by best to worse*/ SELECT CONCAT(FNAME, ' ', LNAME) AS Player ,MAX(Game_Score) AS "Best Game" FROM bowlResults GROUP BY FNAME, LNAME ORDER BY MAX(Game_Score) DESC; /* Write a third select statement listing the players names, one row per player */ SELECT DISTINCT FNAME AS "First Name" ,LNAME AS "Last Name" FROM bowlResults; END AS "birthday reminder" FRO
true
b211e3b971a56eb2eb398ae6957cfe568e90ab55
SQL
ValerieRobateau/Ed-Fi-Analytics-Middle-Tier
/src/EdFi.AnalyticsMiddleTier.DataStandard31/Base/MSSQL/0007-View-DateDim-Create.sql
UTF-8
1,175
3.578125
4
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
-- SPDX-License-Identifier: Apache-2.0 -- Licensed to the Ed-Fi Alliance under one or more agreements. -- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. -- See the LICENSE and NOTICES files in the project root for more information. CREATE VIEW [analytics].[DateDim] AS WITH dates as ( SELECT DISTINCT [Date], CAST(SchoolYear AS VARCHAR) as SchoolYear FROM [edfi].[CalendarDateCalendarEvent] ) SELECT CONVERT(varchar, [Date], 112) as [DateKey], CAST(CONVERT(varchar, [Date], 1) as DATETIME) as [Date], DAY([Date]) as [Day], MONTH([Date]) as [Month], DATENAME(month, [Date]) as [MonthName], CASE WHEN MONTH([Date]) BETWEEN 1 AND 3 THEN 1 WHEN MONTH([Date]) BETWEEN 4 AND 6 THEN 2 WHEN MONTH([Date]) BETWEEN 7 AND 9 THEN 3 WHEN MONTH([Date]) BETWEEN 10 AND 12 THEN 4 END as [CalendarQuarter], CASE WHEN MONTH([Date]) BETWEEN 1 AND 3 THEN 'First' WHEN MONTH([Date]) BETWEEN 4 AND 6 THEN 'Second' WHEN MONTH([Date]) BETWEEN 7 AND 9 THEN 'Third' WHEN MONTH([Date]) BETWEEN 10 AND 12 THEN 'Fourth' END as [CalendarQuarterName], YEAR([Date]) as [CalendarYear], SchoolYear FROM dates
true
c9a469f784544597ae50ccd390074333cd5d164b
SQL
everlyn-borges/banco-de-dados-lanchonete
/insercao_e_consulta_pedido_somativa1_Everlyn.sql
UTF-8
2,451
2.890625
3
[]
no_license
-- Cadastrando cardápio insert into lanchonete.cardapio (`nome`) values ("Eve Burguers"); -- Listando cardápio select * from lanchonete.cardapio; -- Cadastrando sanduíches insert into lanchonete.sanduiche (`nome`, `preco`, `codigo_cardapio`) values ("Burguer Blumenau", 18.0, 1); insert into lanchonete.sanduiche (`nome`, `preco`, `codigo_cardapio`) values ("Burguer Bacon & Cheddar", 22.0, 1); insert into lanchonete.sanduiche (`nome`, `preco`, `codigo_cardapio`) values ("Burguer Calabresa & Cheddar", 21.0, 1); insert into lanchonete.sanduiche (`nome`, `preco`, `codigo_cardapio`) values ("Burguer Frango & Cream Cheese", 22.0, 1); insert into lanchonete.sanduiche (`nome`, `preco`, `codigo_cardapio`) values ("Burguer Fit", 17.0, 1); -- Listando sanduíches select * from lanchonete.sanduiche; -- Cadastrando clientes insert into lanchonete.cliente (`cpf`, `nome`, `telefone`, `endereco_cep`, `endereco_logradouro`, `endereco_numero`, `endereco_complemento`) values ("487.582.410-60", "Euclides", "(41) 98888-2028", "81.000-200", "Rua Pedro dos Santos", 128, "Casa 2"); insert into lanchonete.cliente (`cpf`, `nome`, `telefone`, `endereco_cep`, `endereco_logradouro`, `endereco_numero`) values ("123.456.789-20", "Catarina", "(41) 99825-7845", "81.230-140", "Rua Sonia Braga", 628); -- Listando clientes select * from lanchonete.cliente; -- Cadastrar entregador insert into lanchonete.entregador (`nome`, `telefone_celular`) values ("Rita", "(41) 99227-4545"); insert into lanchonete.entregador (`nome`, `telefone_celular`) values ("Gabriel", "(42) 98887-0129"); -- Listando entregadores select * from lanchonete.entregador; -- Cadastrar pedido insert into lanchonete.pedido (`status`, `data_emissao`, `codigo_cliente`) values (0, "2021-08-28", 1); -- Listando pedidos select * from lanchonete.pedido; -- Inserindo itens do pedido insert into lanchonete.itens_pedido (`codigo_pedido`, `codigo_sanduiche`) values (1, 3); insert into lanchonete.itens_pedido (`codigo_pedido`, `codigo_sanduiche`) values (1, 1); -- Listando itens do pedido select * from lanchonete.itens_pedido; -- Enviando pedido para entrega insert into lanchonete.entregas (`codigo_entregador`, `codigo_pedido_entrega`) values (1, 1); update lanchonete.pedido set status = 1 where codigo = 1; -- Listando entregas select * from lanchonete.entregas; -- Concluindo a entrega update lanchonete.pedido set status = 2 where codigo = 1; -- Confirmando pedidos entregues select * from lanchonete.pedido;
true
6a660ef3450b94b11e8a51a694f7ff77143298a2
SQL
jinniaflyer450/Jins-Unit-22.2-Exercises
/queries_products.sql
UTF-8
1,323
3.96875
4
[]
no_license
-- Comments in SQL Start with dash-dash -- --1, 2, and 3: Inserts chair, stool, and table into products table in products_db INSERT INTO products (name, price, can_be_returned) VALUES ('chair', 44.00, false), ('stool', 25.99, true), ('table', 124.00, false); --4: Display all rows and columns in table. SELECT * FROM products; --5 Display all names of products. SELECT name FROM products; --6 Display all names and prices of products. SELECT name, price FROM products; --7 Add a new product (I added a end table for 35.00 that can be returned.) INSERT INTO products (name, price, can_be_returned) VALUES ('end table', 35.00, true); --8 Display only the products that can be returned. SELECT * FROM products WHERE can_be_returned = true; --9 Display only the products that have a price less than 44.00. SELECT * FROM products WHERE price < 44.00; --10 Display only the products that have a price between 22.50 and 99.99. SELECT * FROM products WHERE price BETWEEN 22.50 AND 99.99; --11 Everything is $20 off! UPDATE products SET price = price - 20; --12 Remove everything that costs less than 25. DELETE FROM products WHERE price < 25; --13 Sale over; increase price of remaining items by 20. UPDATE products SET price = price + 20; --14 Everything is now returnable! UPDATE products SET can_be_returned = true;
true
14eb7bea54d70733a77b0b6420e161f0d9f7a578
SQL
bvez/kardexPucp
/ModeloBD/Dump20180522/a20151258_alm_producto_almacen.sql
UTF-8
2,535
3.015625
3
[]
no_license
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64) -- -- Host: 127.0.0.1 Database: a20151258 -- ------------------------------------------------------ -- Server version 5.5.5-10.1.31-MariaDB /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `alm_producto_almacen` -- DROP TABLE IF EXISTS `alm_producto_almacen`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `alm_producto_almacen` ( `Almacen_idAlmacen` int(11) NOT NULL, `Producto_idProducto` int(11) NOT NULL, `cantidadAlmacenada` int(11) NOT NULL, PRIMARY KEY (`Producto_idProducto`,`Almacen_idAlmacen`), KEY `fk_ProductoAlmacen_Producto1_idx` (`Producto_idProducto`), KEY `fk_ProductoAlmacen_Almacen` (`Almacen_idAlmacen`), CONSTRAINT `fk_ProductoAlmacen_Almacen` FOREIGN KEY (`Almacen_idAlmacen`) REFERENCES `alm_almacen` (`idAlmacen`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_ProductoAlmacen_Producto1` FOREIGN KEY (`Producto_idProducto`) REFERENCES `producto` (`idProducto`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `alm_producto_almacen` -- LOCK TABLES `alm_producto_almacen` WRITE; /*!40000 ALTER TABLE `alm_producto_almacen` DISABLE KEYS */; INSERT INTO `alm_producto_almacen` VALUES (1,1,10),(1,4,40),(4,4,44); /*!40000 ALTER TABLE `alm_producto_almacen` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2018-05-22 0:09:13
true
c301a4bcbaa22af1c5835478e4b07dedf7504add
SQL
msvarovsky/PDMSCore
/SQL-StoredProcedures.sql
UTF-8
1,384
3.8125
4
[]
no_license
 ----------------------------------------------------- GetPanelFromID 1, 1, 'cs' ALTER PROCEDURE GetPanelFromID @PanelID int, @CompanyID int, @LanguageID varchar(5) AS BEGIN SELECT distinct pg.PageID, pg.URL, lb.Label, lb.CompanyID FROM Pages pg LEFT outer join Labels lb ON pg.LabelID = lb.LabelID WHERE 1=1 AND pg.PageID = @PanelID AND lb.LanguageID = @LanguageID AND ( lb.CompanyID = @CompanyID OR lb.CompanyID IS NULL ) END; SELECT distinct pg.PageID, pg.URL, lb.Label, lb.CompanyID FROM Pages pg LEFT outer join Labels lb ON pg.LabelID = lb.LabelID WHERE 1=1 AND pg.PageID = 1 AND lb.LanguageID = 'en' AND ( lb.CompanyID = 1 OR lb.CompanyID IS NULL ) ---------------------------------------------------------------- GetPanelFields 1, 1, 'en' ALTER PROCEDURE GetPanelFields @PanelID int, @CompanyID int, @LanguageID varchar(5) AS BEGIN SELECT f.FieldID, f.FieldType, l.Label, pj.StringValue, pj.IntValue, pj.DateValue, pj.FileValue, pj.OtherRef FROM PanelsFields pf, Fields f, Labels l, Panels p, Projects pj WHERE 1 = 1 AND pf.FieldID = f.FieldID AND f.FieldID = l.LabelID AND p.PanelID = pf.PanelID AND pj.FieldID = f.FieldID AND pj.RetailerID = p.CompanyID AND p.CompanyID = @CompanyID AND pf.PanelID = @PanelID AND l.LanguageID = @LanguageID ORDER BY [PredecessorFieldID] END;
true
abeec13309f15ad0195a273436b8894c3ee6cd14
SQL
school-days/pandora
/scripts/create-table.sql
UTF-8
2,508
3.3125
3
[ "Apache-2.0" ]
permissive
CREATE EXTERNAL TABLE IF NOT EXISTS default.qun_info ( qunnum bigint, mastqq bigint, createdate string, title string, quntext string ) PARTITIONED BY ( class string ) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' LOCATION '/QUN_INFO' TBLPROPERTIES ( 'capturetime'='2', 'class'='4', 'pattern'='^QUN_INFO\\d*.txt$', 'ttl'='-1' ); CREATE EXTERNAL TABLE IF NOT EXISTS default.qun_group ( qqnum bigint, nick string, age int, gender int, auth int, qunnum bigint ) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' LOCATION '/QUN_GROUP' TBLPROPERTIES ( 'capturetime'='-1', 'pattern'='^QUN_GROUP\d*.txt$', 'ttl'='-1' ); CREATE EXTERNAL TABLE IF NOT EXISTS default.qun_group ( qqnum bigint, nick string, age int, gender int, auth int, qunnum bigint ) row format serde 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' with serdeproperties('field.delim'='\t', 'serialization.encoding'='GBK') STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' LOCATION '/QUN_GROUP_TMP' TBLPROPERTIES ( 'pattern'='^QUN_GROUP\d*.txt$' ); CREATE EXTERNAL TABLE `qun_info`( `qunnum` bigint, `mastqq` bigint, `createdate` string, `title` string, `class` int, `quntext` string) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' WITH SERDEPROPERTIES ( 'serialization.encoding'='GBK') STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' LOCATION 'hdfs://localhost:9000/QUN_INFO_TMP' TBLPROPERTIES ( 'COLUMN_STATS_ACCURATE'='false', 'numFiles'='0', 'numRows'='-1', 'rawDataSize'='-1', 'totalSize'='0', 'transient_lastDdlTime'='1536505726') CREATE TABLE parquet.qun_info ( qunnum bigint, mastqq bigint, createdate string, title string, class int, quntext string ) STORED AS parquet LOCATION '/PARQUET/QUN_INFO' CREATE EXTERNAL TABLE IF NOT EXISTS parquet.qun_group ( qqnum bigint, nick string, age int, gender int, auth int, qunnum bigint ) STORED AS parquet LOCATION '/PARQUET/QUN_GROUP' TBLPROPERTIES ( 'pattern'='^QUN_GROUP\d*.txt$' );
true
ffeee31301f86576a63fb26734fb36760a5c82ad
SQL
jackofdiamond5/Software-University
/C# DB Fundamentals/DB Basics - T-SQL/6. Joins, Subqueries, CTE and Indices/15. Continents and Currencies.sql
UTF-8
575
4.53125
5
[ "MIT" ]
permissive
WITH CTE_CountriesAndCurrencies AS ( SELECT ContinentCode, CurrencyCode, COUNT(CountryCode) AS CurrencyUsage FROM Countries GROUP BY ContinentCode, CurrencyCode HAVING COUNT(CountryCode) > 1 ) SELECT cac.ContinentCode, cac.CurrencyCode, MaxCurUsage AS CurrencyUsage FROM ( SELECT ContinentCode, MAX(CurrencyUsage) AS MaxCurUsage FROM CTE_CountriesAndCurrencies GROUP BY ContinentCode ) AS mupc JOIN CTE_CountriesAndCurrencies AS cac ON cac.ContinentCode = mupc.ContinentCode AND cac.CurrencyUsage = mupc.MaxCurUsage ORDER BY cac.ContinentCode
true
467c2b198cbf04feff254146c0d16f381ba4155c
SQL
ywjno/lineage-cn-jrwz
/db/l1jdb/character_teleport.sql
WINDOWS-1252
816
2.703125
3
[]
no_license
/* MySQL Data Transfer Source Host: localhost Source Database: l1jdb Target Host: localhost Target Database: l1jdb Date: 2011-12-19 06:28:11 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for character_teleport -- ---------------------------- CREATE TABLE `character_teleport` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `char_id` int(10) unsigned NOT NULL DEFAULT '0', `name` varchar(45) NOT NULL DEFAULT '', `locx` int(10) unsigned NOT NULL DEFAULT '0', `locy` int(10) unsigned NOT NULL DEFAULT '0', `mapid` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `key_id` (`char_id`) ) ENGINE=MyISAM AUTO_INCREMENT=268842605 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records -- ----------------------------
true
fec6e8c5b556461ceb42b60d7a7de93fb0b6e943
SQL
ChristopherConnolly/Databases-Practical-Project
/census16prelim.sql
ISO-8859-1
298,374
2.71875
3
[]
no_license
DROP DATABASE IF EXISTS census16prelim; CREATE DATABASE IF NOT EXISTS census16prelim; USE census16prelim; DROP TABLE IF EXISTS population; CREATE TABLE population ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY, electoraldistrict VARCHAR(128) NOT NULL, county VARCHAR(32) NOT NULL, pop2002 INTEGER NOT NULL, pop2006 INTEGER NOT NULL, pop2011 INTEGER NOT NULL, pop2016 INTEGER NOT NULL ); SELECT 'Entering information into database' as 'NOW'; INSERT INTO population VALUES ( null, 'Carlow Urban', 'Carlow', 4963, 4605, 4181, 4573 ); INSERT INTO population VALUES ( null, 'Graigue Urban', 'Carlow', 1702, 1524, 1272, 1432 ); INSERT INTO population VALUES ( null, 'Clonmore', 'Carlow', 461, 530, 560, 527 ); INSERT INTO population VALUES ( null, 'Hacketstown', 'Carlow', 1026, 1065, 1091, 1116 ); INSERT INTO population VALUES ( null, 'Haroldstown', 'Carlow', 239, 267, 259, 291 ); INSERT INTO population VALUES ( null, 'Kineagh', 'Carlow', 287, 309, 327, 350 ); INSERT INTO population VALUES ( null, 'Rahill', 'Carlow', 393, 585, 662, 727 ); INSERT INTO population VALUES ( null, 'Rathvilly', 'Carlow', 700, 802, 838, 876 ); INSERT INTO population VALUES ( null, 'Tiknock', 'Carlow', 271, 331, 338, 331 ); INSERT INTO population VALUES ( null, 'Williamstown', 'Carlow', 256, 273, 297, 283 ); INSERT INTO population VALUES ( null, 'Agha', 'Carlow', 266, 322, 382, 394 ); INSERT INTO population VALUES ( null, 'Ballinacarrig', 'Carlow', 847, 937, 1005, 1048 ); INSERT INTO population VALUES ( null, 'Ballintemple', 'Carlow', 423, 480, 559, 566 ); INSERT INTO population VALUES ( null, 'Ballon', 'Carlow', 466, 646, 710, 714 ); INSERT INTO population VALUES ( null, 'Ballyellin', 'Carlow', 352, 375, 427, 425 ); INSERT INTO population VALUES ( null, 'Ballymoon', 'Carlow', 258, 260, 329, 343 ); INSERT INTO population VALUES ( null, 'Borris', 'Carlow', 959, 1008, 1041, 1048 ); INSERT INTO population VALUES ( null, 'Burton Hall', 'Carlow', 281, 368, 465, 526 ); INSERT INTO population VALUES ( null, 'Carlow Rural', 'Carlow', 11238, 12548, 13947, 14544 ); INSERT INTO population VALUES ( null, 'Clogrenan', 'Carlow', 687, 796, 996, 1042 ); INSERT INTO population VALUES ( null, 'Clonegall', 'Carlow', 808, 905, 978, 998 ); INSERT INTO population VALUES ( null, 'Corries', 'Carlow', 482, 504, 532, 539 ); INSERT INTO population VALUES ( null, 'Cranemore', 'Carlow', 724, 893, 1067, 1094 ); INSERT INTO population VALUES ( null, 'Fennagh', 'Carlow', 473, 516, 736, 783 ); INSERT INTO population VALUES ( null, 'Garryhill', 'Carlow', 594, 578, 589, 580 ); INSERT INTO population VALUES ( null, 'Grangeford', 'Carlow', 283, 324, 424, 464 ); INSERT INTO population VALUES ( null, 'Johnstown', 'Carlow', 499, 532, 569, 588 ); INSERT INTO population VALUES ( null, 'Kellistown', 'Carlow', 864, 1035, 1001, 974 ); INSERT INTO population VALUES ( null, 'Kilbride', 'Carlow', 354, 385, 449, 439 ); INSERT INTO population VALUES ( null, 'Killedmond', 'Carlow', 367, 409, 424, 408 ); INSERT INTO population VALUES ( null, 'Killerrig', 'Carlow', 263, 336, 359, 370 ); INSERT INTO population VALUES ( null, 'Leighlinbridge', 'Carlow', 1316, 1497, 1558, 1641 ); INSERT INTO population VALUES ( null, 'Muinebeag (Bagenalstown) Rural', 'Carlow', 649, 659, 646, 653 ); INSERT INTO population VALUES ( null, 'Muinebeag (Bagenalstown) Urban', 'Carlow', 2540, 2532, 2775, 2749 ); INSERT INTO population VALUES ( null, 'Myshall', 'Carlow', 394, 465, 606, 589 ); INSERT INTO population VALUES ( null, 'Nurney', 'Carlow', 818, 866, 867, 853 ); INSERT INTO population VALUES ( null, 'Oldleighlin', 'Carlow', 406, 445, 569, 568 ); INSERT INTO population VALUES ( null, 'Rathanna', 'Carlow', 111, 126, 114, 111 ); INSERT INTO population VALUES ( null, 'Rathornan', 'Carlow', 325, 365, 432, 446 ); INSERT INTO population VALUES ( null, 'Rathrush', 'Carlow', 606, 983, 1101, 1098 ); INSERT INTO population VALUES ( null, 'Ridge', 'Carlow', 186, 227, 273, 300 ); INSERT INTO population VALUES ( null, 'Shangarry', 'Carlow', 490, 472, 525, 515 ); INSERT INTO population VALUES ( null, 'Sliguff', 'Carlow', 468, 495, 527, 506 ); INSERT INTO population VALUES ( null, 'Tankardstown', 'Carlow', 368, 434, 438, 433 ); INSERT INTO population VALUES ( null, 'Templepeter', 'Carlow', 342, 409, 434, 419 ); INSERT INTO population VALUES ( null, 'Tullowbeg', 'Carlow', 411, 473, 582, 622 ); INSERT INTO population VALUES ( null, 'Tullow Rural', 'Carlow', 503, 500, 702, 847 ); INSERT INTO population VALUES ( null, 'Tullow Urban', 'Carlow', 2316, 2881, 3414, 3899 ); INSERT INTO population VALUES ( null, 'Ballymurphy', 'Carlow', 222, 249, 279, 275 ); INSERT INTO population VALUES ( null, 'Coonogue', 'Carlow', 187, 195, 206, 209 ); INSERT INTO population VALUES ( null, 'Glynn', 'Carlow', 343, 347, 365, 379 ); INSERT INTO population VALUES ( null, 'Kyle', 'Carlow', 270, 295, 341, 322 ); INSERT INTO population VALUES ( null, 'Marley', 'Carlow', 289, 309, 367, 401 ); INSERT INTO population VALUES ( null, 'Tinnahinch', 'Carlow', 668, 677, 677, 647 ); INSERT INTO population VALUES ( null, 'Arran Quay A', 'Dublin City', 1390, 1502, 1555, 1773 ); INSERT INTO population VALUES ( null, 'Arran Quay B', 'Dublin City', 3089, 3692, 3861, 4155 ); INSERT INTO population VALUES ( null, 'Arran Quay C', 'Dublin City', 2375, 3714, 4170, 4449 ); INSERT INTO population VALUES ( null, 'Arran Quay D', 'Dublin City', 3675, 3600, 3218, 3888 ); INSERT INTO population VALUES ( null, 'Arran Quay E', 'Dublin City', 2902, 2889, 3037, 3289 ); INSERT INTO population VALUES ( null, 'Ashtown A', 'Dublin City', 6817, 7715, 10227, 10545 ); INSERT INTO population VALUES ( null, 'Ashtown B', 'Dublin City', 2607, 2537, 2560, 2640 ); INSERT INTO population VALUES ( null, 'Ayrfield', 'Dublin City', 5426, 5344, 5395, 5617 ); INSERT INTO population VALUES ( null, 'Ballybough A', 'Dublin City', 3368, 3624, 3482, 3672 ); INSERT INTO population VALUES ( null, 'Ballybough B', 'Dublin City', 3009, 3215, 3349, 3709 ); INSERT INTO population VALUES ( null, 'Ballygall A', 'Dublin City', 2843, 3342, 3442, 3621 ); INSERT INTO population VALUES ( null, 'Ballygall B', 'Dublin City', 1747, 1809, 1805, 1871 ); INSERT INTO population VALUES ( null, 'Ballygall C', 'Dublin City', 3787, 3575, 3419, 3502 ); INSERT INTO population VALUES ( null, 'Ballygall D', 'Dublin City', 2412, 2488, 2494, 2515 ); INSERT INTO population VALUES ( null, 'Ballymun A', 'Dublin City', 1575, 2101, 3678, 4720 ); INSERT INTO population VALUES ( null, 'Ballymun B', 'Dublin City', 4050, 3949, 4012, 4340 ); INSERT INTO population VALUES ( null, 'Ballymun C', 'Dublin City', 5896, 5921, 5585, 6092 ); INSERT INTO population VALUES ( null, 'Ballymun D', 'Dublin City', 3712, 3522, 2961, 2423 ); INSERT INTO population VALUES ( null, 'Ballymun E', 'Dublin City', 1602, 1550, 1582, 1573 ); INSERT INTO population VALUES ( null, 'Ballymun F', 'Dublin City', 2652, 2474, 2323, 2355 ); INSERT INTO population VALUES ( null, 'Beaumont A', 'Dublin City', 2667, 2617, 2467, 2438 ); INSERT INTO population VALUES ( null, 'Beaumont B', 'Dublin City', 5173, 5062, 4805, 4962 ); INSERT INTO population VALUES ( null, 'Beaumont C', 'Dublin City', 3050, 3044, 3106, 3238 ); INSERT INTO population VALUES ( null, 'Beaumont D', 'Dublin City', 2605, 2375, 2149, 2130 ); INSERT INTO population VALUES ( null, 'Beaumont E', 'Dublin City', 2289, 2099, 2001, 2033 ); INSERT INTO population VALUES ( null, 'Beaumont F', 'Dublin City', 3748, 3597, 3437, 3590 ); INSERT INTO population VALUES ( null, 'Botanic A', 'Dublin City', 2914, 3091, 3084, 3125 ); INSERT INTO population VALUES ( null, 'Botanic B', 'Dublin City', 3449, 3214, 3264, 3526 ); INSERT INTO population VALUES ( null, 'Botanic C', 'Dublin City', 2195, 2098, 1967, 2196 ); INSERT INTO population VALUES ( null, 'Cabra East A', 'Dublin City', 5396, 5366, 5163, 5477 ); INSERT INTO population VALUES ( null, 'Cabra East B', 'Dublin City', 3661, 3542, 3512, 3725 ); INSERT INTO population VALUES ( null, 'Cabra East C', 'Dublin City', 3638, 3352, 3631, 4131 ); INSERT INTO population VALUES ( null, 'Cabra West A', 'Dublin City', 1700, 1564, 1478, 1483 ); INSERT INTO population VALUES ( null, 'Cabra West B', 'Dublin City', 2645, 2644, 2513, 2466 ); INSERT INTO population VALUES ( null, 'Cabra West C', 'Dublin City', 2937, 2865, 2699, 2958 ); INSERT INTO population VALUES ( null, 'Cabra West D', 'Dublin City', 2865, 2815, 2725, 2849 ); INSERT INTO population VALUES ( null, 'Clontarf East A', 'Dublin City', 3279, 3237, 3301, 3436 ); INSERT INTO population VALUES ( null, 'Clontarf East B', 'Dublin City', 6458, 6637, 6759, 7115 ); INSERT INTO population VALUES ( null, 'Clontarf East C', 'Dublin City', 3029, 2993, 3113, 3187 ); INSERT INTO population VALUES ( null, 'Clontarf East D', 'Dublin City', 2772, 2720, 2673, 2710 ); INSERT INTO population VALUES ( null, 'Clontarf East E', 'Dublin City', 1643, 1634, 1675, 1792 ); INSERT INTO population VALUES ( null, 'Clontarf West A', 'Dublin City', 3487, 3446, 3436, 3742 ); INSERT INTO population VALUES ( null, 'Clontarf West B', 'Dublin City', 2602, 2398, 2316, 2421 ); INSERT INTO population VALUES ( null, 'Clontarf West C', 'Dublin City', 3372, 3503, 3366, 3637 ); INSERT INTO population VALUES ( null, 'Clontarf West D', 'Dublin City', 2140, 2087, 2066, 2303 ); INSERT INTO population VALUES ( null, 'Clontarf West E', 'Dublin City', 2394, 2336, 2324, 2470 ); INSERT INTO population VALUES ( null, 'Drumcondra South A', 'Dublin City', 3857, 3945, 4571, 5100 ); INSERT INTO population VALUES ( null, 'Drumcondra South B', 'Dublin City', 1377, 1369, 1526, 1694 ); INSERT INTO population VALUES ( null, 'Drumcondra South C', 'Dublin City', 3504, 3323, 3191, 3533 ); INSERT INTO population VALUES ( null, 'Edenmore', 'Dublin City', 2890, 2758, 2725, 2838 ); INSERT INTO population VALUES ( null, 'Finglas North A', 'Dublin City', 3540, 3472, 3227, 3324 ); INSERT INTO population VALUES ( null, 'Finglas North B', 'Dublin City', 2938, 2955, 2809, 2867 ); INSERT INTO population VALUES ( null, 'Finglas North C', 'Dublin City', 3129, 3057, 3247, 3445 ); INSERT INTO population VALUES ( null, 'Finglas South A', 'Dublin City', 2607, 2634, 2783, 2878 ); INSERT INTO population VALUES ( null, 'Finglas South B', 'Dublin City', 3309, 3322, 3868, 4205 ); INSERT INTO population VALUES ( null, 'Finglas South C', 'Dublin City', 2768, 2600, 2507, 2674 ); INSERT INTO population VALUES ( null, 'Finglas South D', 'Dublin City', 2138, 2186, 2311, 2430 ); INSERT INTO population VALUES ( null, 'Grace Park', 'Dublin City', 5986, 5927, 5670, 5801 ); INSERT INTO population VALUES ( null, 'Grange A', 'Dublin City', 7301, 7050, 8948, 9673 ); INSERT INTO population VALUES ( null, 'Grange B', 'Dublin City', 2138, 2870, 4565, 5336 ); INSERT INTO population VALUES ( null, 'Grange C', 'Dublin City', 3673, 3305, 3048, 3084 ); INSERT INTO population VALUES ( null, 'Grange D', 'Dublin City', 4330, 4214, 4105, 4008 ); INSERT INTO population VALUES ( null, 'Grange E', 'Dublin City', 2930, 2662, 2580, 2677 ); INSERT INTO population VALUES ( null, 'Harmonstown A', 'Dublin City', 3070, 2823, 2722, 2811 ); INSERT INTO population VALUES ( null, 'Harmonstown B', 'Dublin City', 2585, 2636, 2684, 2760 ); INSERT INTO population VALUES ( null, 'Inns Quay A', 'Dublin City', 3373, 3715, 3951, 3920 ); INSERT INTO population VALUES ( null, 'Inns Quay B', 'Dublin City', 2953, 3113, 3368, 3638 ); INSERT INTO population VALUES ( null, 'Inns Quay C', 'Dublin City', 2359, 2672, 2709, 2715 ); INSERT INTO population VALUES ( null, 'Kilmore A', 'Dublin City', 2943, 3502, 3505, 3656 ); INSERT INTO population VALUES ( null, 'Kilmore B', 'Dublin City', 3006, 2801, 2600, 2636 ); INSERT INTO population VALUES ( null, 'Kilmore C', 'Dublin City', 1676, 1458, 1415, 1490 ); INSERT INTO population VALUES ( null, 'Kilmore D', 'Dublin City', 2337, 2258, 2082, 2034 ); INSERT INTO population VALUES ( null, 'Mountjoy A', 'Dublin City', 3242, 3760, 5326, 5313 ); INSERT INTO population VALUES ( null, 'Mountjoy B', 'Dublin City', 2725, 3446, 2732, 3954 ); INSERT INTO population VALUES ( null, 'North City', 'Dublin City', 3942, 3867, 5345, 5441 ); INSERT INTO population VALUES ( null, 'North Dock A', 'Dublin City', 1287, 1200, 1303, 1356 ); INSERT INTO population VALUES ( null, 'North Dock B', 'Dublin City', 3628, 3690, 6895, 7768 ); INSERT INTO population VALUES ( null, 'North Dock C', 'Dublin City', 3568, 4179, 4345, 4162 ); INSERT INTO population VALUES ( null, 'Phoenix Park', 'Dublin City', 1468, 1568, 1538, 1528 ); INSERT INTO population VALUES ( null, 'Priorswood A', 'Dublin City', 1564, 1581, 1562, 1604 ); INSERT INTO population VALUES ( null, 'Priorswood B', 'Dublin City', 3298, 2882, 2673, 2670 ); INSERT INTO population VALUES ( null, 'Priorswood C', 'Dublin City', 3633, 3557, 4491, 4863 ); INSERT INTO population VALUES ( null, 'Priorswood D', 'Dublin City', 2846, 2760, 2729, 2760 ); INSERT INTO population VALUES ( null, 'Priorswood E', 'Dublin City', 2883, 2731, 2821, 2871 ); INSERT INTO population VALUES ( null, 'Raheny-Foxfield', 'Dublin City', 2712, 2547, 2517, 2492 ); INSERT INTO population VALUES ( null, 'Raheny-Greendale', 'Dublin City', 2478, 2283, 2161, 2175 ); INSERT INTO population VALUES ( null, 'Raheny-St. Assam', 'Dublin City', 3488, 3301, 3501, 3621 ); INSERT INTO population VALUES ( null, 'Rotunda A', 'Dublin City', 4199, 4672, 4698, 5629 ); INSERT INTO population VALUES ( null, 'Rotunda B', 'Dublin City', 1752, 2137, 2439, 2434 ); INSERT INTO population VALUES ( null, 'Whitehall A', 'Dublin City', 3542, 3959, 3545, 3445 ); INSERT INTO population VALUES ( null, 'Whitehall B', 'Dublin City', 3902, 4120, 3892, 4215 ); INSERT INTO population VALUES ( null, 'Whitehall C', 'Dublin City', 2252, 2179, 2195, 2143 ); INSERT INTO population VALUES ( null, 'Whitehall D', 'Dublin City', 2353, 2584, 2885, 3442 ); INSERT INTO population VALUES ( null, 'Chapelizod', 'Dublin City', 2351, 3034, 3047, 3047 ); INSERT INTO population VALUES ( null, 'Cherry Orchard A', 'Dublin City', 2161, 2861, 3414, 3267 ); INSERT INTO population VALUES ( null, 'Carna', 'Dublin City', 2918, 2694, 2801, 2808 ); INSERT INTO population VALUES ( null, 'Cherry Orchard C', 'Dublin City', 3728, 3794, 4551, 4531 ); INSERT INTO population VALUES ( null, 'Crumlin A', 'Dublin City', 3862, 3784, 3617, 3713 ); INSERT INTO population VALUES ( null, 'Crumlin B', 'Dublin City', 3197, 3130, 2953, 2952 ); INSERT INTO population VALUES ( null, 'Crumlin C', 'Dublin City', 2338, 2403, 2264, 2328 ); INSERT INTO population VALUES ( null, 'Crumlin D', 'Dublin City', 4119, 3994, 3992, 4217 ); INSERT INTO population VALUES ( null, 'Crumlin E', 'Dublin City', 2970, 2806, 2730, 2808 ); INSERT INTO population VALUES ( null, 'Crumlin F', 'Dublin City', 2982, 3102, 3025, 2985 ); INSERT INTO population VALUES ( null, 'Decies', 'Dublin City', 2933, 2840, 2716, 2624 ); INSERT INTO population VALUES ( null, 'Drumfinn', 'Dublin City', 3799, 3538, 3508, 3577 ); INSERT INTO population VALUES ( null, 'Inchicore A', 'Dublin City', 2041, 1977, 2196, 2388 ); INSERT INTO population VALUES ( null, 'Inchicore B', 'Dublin City', 1849, 1831, 1992, 2208 ); INSERT INTO population VALUES ( null, 'Kilmainham A', 'Dublin City', 2355, 2422, 2511, 2535 ); INSERT INTO population VALUES ( null, 'Kilmainham B', 'Dublin City', 1159, 1682, 2233, 2384 ); INSERT INTO population VALUES ( null, 'Kilmainham C', 'Dublin City', 3844, 4250, 4358, 5166 ); INSERT INTO population VALUES ( null, 'Kimmage A', 'Dublin City', 2089, 2024, 1834, 1941 ); INSERT INTO population VALUES ( null, 'Kimmage B', 'Dublin City', 3791, 3680, 3485, 3578 ); INSERT INTO population VALUES ( null, 'Kimmage C', 'Dublin City', 3013, 2898, 2944, 3038 ); INSERT INTO population VALUES ( null, 'Kimmage D', 'Dublin City', 2630, 2599, 2374, 2430 ); INSERT INTO population VALUES ( null, 'Kimmage E', 'Dublin City', 3502, 3399, 3236, 3372 ); INSERT INTO population VALUES ( null, 'Kylemore', 'Dublin City', 2805, 2687, 2566, 2655 ); INSERT INTO population VALUES ( null, 'Mansion House A', 'Dublin City', 4269, 4462, 4347, 4544 ); INSERT INTO population VALUES ( null, 'Mansion House B', 'Dublin City', 990, 869, 1069, 1278 ); INSERT INTO population VALUES ( null, 'Merchants Quay A', 'Dublin City', 1824, 2062, 2275, 2492 ); INSERT INTO population VALUES ( null, 'Merchants Quay B', 'Dublin City', 3449, 3901, 3822, 3855 ); INSERT INTO population VALUES ( null, 'Merchants Quay C', 'Dublin City', 2639, 2850, 3480, 3601 ); INSERT INTO population VALUES ( null, 'Merchants Quay D', 'Dublin City', 2084, 2059, 2024, 2161 ); INSERT INTO population VALUES ( null, 'Merchants Quay E', 'Dublin City', 1660, 2369, 2353, 2488 ); INSERT INTO population VALUES ( null, 'Merchants Quay F', 'Dublin City', 2264, 2459, 2405, 2138 ); INSERT INTO population VALUES ( null, 'Pembroke East A', 'Dublin City', 4304, 4754, 4929, 5063 ); INSERT INTO population VALUES ( null, 'Pembroke East B', 'Dublin City', 3595, 3480, 3608, 3597 ); INSERT INTO population VALUES ( null, 'Pembroke East C', 'Dublin City', 3900, 3761, 4004, 3921 ); INSERT INTO population VALUES ( null, 'Pembroke East D', 'Dublin City', 4471, 4369, 4680, 5302 ); INSERT INTO population VALUES ( null, 'Pembroke East E', 'Dublin City', 3337, 3619, 3603, 3870 ); INSERT INTO population VALUES ( null, 'Pembroke West A', 'Dublin City', 3241, 4262, 4673, 5011 ); INSERT INTO population VALUES ( null, 'Pembroke West B', 'Dublin City', 3140, 3306, 3174, 2887 ); INSERT INTO population VALUES ( null, 'Pembroke West C', 'Dublin City', 4188, 4279, 4355, 4773 ); INSERT INTO population VALUES ( null, 'Rathfarnham', 'Dublin City', 4446, 4847, 4546, 4654 ); INSERT INTO population VALUES ( null, 'Rathmines East A', 'Dublin City', 4541, 4241, 4634, 4836 ); INSERT INTO population VALUES ( null, 'Rathmines East B', 'Dublin City', 5020, 5376, 5533, 6044 ); INSERT INTO population VALUES ( null, 'Rathmines East C', 'Dublin City', 3695, 3400, 3347, 3321 ); INSERT INTO population VALUES ( null, 'Rathmines East D', 'Dublin City', 2962, 2738, 2723, 2749 ); INSERT INTO population VALUES ( null, 'Rathmines West A', 'Dublin City', 4749, 5080, 5013, 5541 ); INSERT INTO population VALUES ( null, 'Rathmines West B', 'Dublin City', 3526, 3275, 3380, 3725 ); INSERT INTO population VALUES ( null, 'Rathmines West C', 'Dublin City', 2675, 2633, 2583, 2672 ); INSERT INTO population VALUES ( null, 'Rathmines West D', 'Dublin City', 3275, 3231, 2953, 3076 ); INSERT INTO population VALUES ( null, 'Rathmines West E', 'Dublin City', 3569, 3273, 3342, 3372 ); INSERT INTO population VALUES ( null, 'Rathmines West F', 'Dublin City', 2929, 2849, 2752, 2822 ); INSERT INTO population VALUES ( null, 'Royal Exchange A', 'Dublin City', 3569, 3602, 4481, 4550 ); INSERT INTO population VALUES ( null, 'Royal Exchange B', 'Dublin City', 1936, 2020, 1914, 2041 ); INSERT INTO population VALUES ( null, 'St. Kevins', 'Dublin City', 4601, 5206, 4910, 5085 ); INSERT INTO population VALUES ( null, 'South Dock', 'Dublin City', 3764, 5123, 7129, 6940 ); INSERT INTO population VALUES ( null, 'Terenure A', 'Dublin City', 3494, 3357, 3549, 3721 ); INSERT INTO population VALUES ( null, 'Terenure B', 'Dublin City', 3445, 3293, 3411, 3481 ); INSERT INTO population VALUES ( null, 'Terenure C', 'Dublin City', 1773, 1780, 1880, 1836 ); INSERT INTO population VALUES ( null, 'Terenure D', 'Dublin City', 872, 807, 779, 790 ); INSERT INTO population VALUES ( null, 'Ushers A', 'Dublin City', 1679, 1928, 3089, 3902 ); INSERT INTO population VALUES ( null, 'Ushers B', 'Dublin City', 1072, 1255, 1292, 1311 ); INSERT INTO population VALUES ( null, 'Ushers C', 'Dublin City', 2708, 3089, 3730, 3958 ); INSERT INTO population VALUES ( null, 'Ushers D', 'Dublin City', 1752, 1658, 2075, 2122 ); INSERT INTO population VALUES ( null, 'Ushers E', 'Dublin City', 1935, 1934, 1830, 1799 ); INSERT INTO population VALUES ( null, 'Ushers F', 'Dublin City', 3064, 3237, 3381, 3460 ); INSERT INTO population VALUES ( null, 'Walkinstown A', 'Dublin City', 1893, 1968, 2619, 2756 ); INSERT INTO population VALUES ( null, 'Walkinstown B', 'Dublin City', 1858, 1804, 1830, 1874 ); INSERT INTO population VALUES ( null, 'Walkinstown C', 'Dublin City', 2263, 2138, 2113, 2170 ); INSERT INTO population VALUES ( null, 'Wood Quay A', 'Dublin City', 2866, 2743, 2669, 2598 ); INSERT INTO population VALUES ( null, 'Wood Quay B', 'Dublin City', 3538, 3507, 3482, 3424 ); INSERT INTO population VALUES ( null, 'Ballinascorney', 'South Dublin', 657, 742, 804, 931 ); INSERT INTO population VALUES ( null, 'Ballyboden', 'South Dublin', 5285, 5200, 5085, 4959 ); INSERT INTO population VALUES ( null, 'Bohernabreena', 'South Dublin', 3936, 4272, 4592, 4552 ); INSERT INTO population VALUES ( null, 'Clondalkin-Ballymount', 'South Dublin', 2011, 2047, 1915, 2036 ); INSERT INTO population VALUES ( null, 'Clondalkin-Cappaghmore', 'South Dublin', 1609, 1925, 2605, 2558 ); INSERT INTO population VALUES ( null, 'Clondalkin-Dunawley', 'South Dublin', 10710, 10873, 10877, 11358 ); INSERT INTO population VALUES ( null, 'Clondalkin-Monastery', 'South Dublin', 9363, 10362, 10904, 11322 ); INSERT INTO population VALUES ( null, 'Clondalkin-Moorfield', 'South Dublin', 6246, 5966, 6251, 6313 ); INSERT INTO population VALUES ( null, 'Clondalkin-Rowlagh', 'South Dublin', 4504, 4187, 4058, 4073 ); INSERT INTO population VALUES ( null, 'Clondalkin Village', 'South Dublin', 8595, 8718, 8492, 9153 ); INSERT INTO population VALUES ( null, 'Edmondstown', 'South Dublin', 5846, 5656, 5712, 5764 ); INSERT INTO population VALUES ( null, 'Firhouse-Ballycullen', 'South Dublin', 6594, 6610, 7773, 8280 ); INSERT INTO population VALUES ( null, 'Firhouse-Knocklyon', 'South Dublin', 4331, 4014, 3602, 3514 ); INSERT INTO population VALUES ( null, 'Firhouse Village', 'South Dublin', 9024, 10751, 11648, 12199 ); INSERT INTO population VALUES ( null, 'Lucan-Esker', 'South Dublin', 20807, 25828, 29820, 32134 ); INSERT INTO population VALUES ( null, 'Lucan Heights', 'South Dublin', 5719, 5260, 5217, 5294 ); INSERT INTO population VALUES ( null, 'Lucan-St. Helens', 'South Dublin', 7045, 6592, 9450, 10372 ); INSERT INTO population VALUES ( null, 'Newcastle', 'South Dublin', 2355, 2631, 3749, 4258 ); INSERT INTO population VALUES ( null, 'Palmerston Village', 'South Dublin', 3929, 3775, 3623, 3638 ); INSERT INTO population VALUES ( null, 'Palmerston West', 'South Dublin', 8130, 7719, 7593, 7492 ); INSERT INTO population VALUES ( null, 'Rathcoole', 'South Dublin', 3204, 3614, 4740, 5520 ); INSERT INTO population VALUES ( null, 'Rathfarnham-Ballyroan', 'South Dublin', 2679, 2494, 2493, 2678 ); INSERT INTO population VALUES ( null, 'Rathfarnham-Butterfield', 'South Dublin', 3222, 3286, 3206, 3296 ); INSERT INTO population VALUES ( null, 'Rathfarnham-Hermitage', 'South Dublin', 4468, 4610, 4604, 4610 ); INSERT INTO population VALUES ( null, 'Rathfarnham-St. Endas', 'South Dublin', 4234, 3924, 3843, 3865 ); INSERT INTO population VALUES ( null, 'Rathfarnham Village', 'South Dublin', 3114, 3038, 2993, 3098 ); INSERT INTO population VALUES ( null, 'Saggart', 'South Dublin', 1588, 2020, 3060, 4113 ); INSERT INTO population VALUES ( null, 'Tallaght-Avonbeg', 'South Dublin', 1645, 1566, 1613, 1643 ); INSERT INTO population VALUES ( null, 'Tallaght-Belgard', 'South Dublin', 1970, 1850, 1694, 1687 ); INSERT INTO population VALUES ( null, 'Tallaght-Fettercairn', 'South Dublin', 6488, 6600, 7607, 8318 ); INSERT INTO population VALUES ( null, 'Tallaght-Glenview', 'South Dublin', 1496, 1242, 1723, 1929 ); INSERT INTO population VALUES ( null, 'Tallaght-Jobstown', 'South Dublin', 9838, 13517, 16630, 17788 ); INSERT INTO population VALUES ( null, 'Tallaght-Killinardan', 'South Dublin', 4700, 4135, 3915, 3987 ); INSERT INTO population VALUES ( null, 'Tallaght-Kilnamanagh', 'South Dublin', 5323, 4945, 4452, 4325 ); INSERT INTO population VALUES ( null, 'Tallaght-Kiltipper', 'South Dublin', 5333, 6426, 8068, 8562 ); INSERT INTO population VALUES ( null, 'Tallaght-Kingswood', 'South Dublin', 4250, 3959, 3974, 4060 ); INSERT INTO population VALUES ( null, 'Tallaght-Millbrook', 'South Dublin', 3917, 3551, 3290, 3297 ); INSERT INTO population VALUES ( null, 'Tallaght-Oldbawn', 'South Dublin', 4580, 4367, 4527, 4595 ); INSERT INTO population VALUES ( null, 'Tallaght-Springfield', 'South Dublin', 7787, 7876, 9123, 11068 ); INSERT INTO population VALUES ( null, 'Tallaght-Tymon', 'South Dublin', 5604, 5133, 4888, 4967 ); INSERT INTO population VALUES ( null, 'Templeogue-Cypress', 'South Dublin', 3079, 2949, 2800, 2717 ); INSERT INTO population VALUES ( null, 'Templeogue-Kimmage Manor', 'South Dublin', 4396, 4267, 4637, 4844 ); INSERT INTO population VALUES ( null, 'Templeogue-Limekiln', 'South Dublin', 3874, 3658, 3501, 3542 ); INSERT INTO population VALUES ( null, 'Templeogue-Orwell', 'South Dublin', 2629, 2308, 2138, 2056 ); INSERT INTO population VALUES ( null, 'Templeogue-Osprey', 'South Dublin', 2798, 2560, 2334, 2262 ); INSERT INTO population VALUES ( null, 'Templeogue Village', 'South Dublin', 1607, 1957, 1994, 2067 ); INSERT INTO population VALUES ( null, 'Terenure-Cherryfield', 'South Dublin', 2228, 2247, 2174, 2157 ); INSERT INTO population VALUES ( null, 'Terenure-Greentrees', 'South Dublin', 2980, 2886, 2791, 2927 ); INSERT INTO population VALUES ( null, 'Terenure-St. James', 'South Dublin', 3108, 2822, 2623, 2571 ); INSERT INTO population VALUES ( null, 'Airport', 'Fingal', 441, 1611, 4032, 4976 ); INSERT INTO population VALUES ( null, 'Balbriggan Rural', 'Fingal', 4501, 9615, 15140, 16479 ); INSERT INTO population VALUES ( null, 'Balbriggan Urban', 'Fingal', 6631, 6731, 7555, 8114 ); INSERT INTO population VALUES ( null, 'Baldoyle', 'Fingal', 6374, 5942, 7050, 7549 ); INSERT INTO population VALUES ( null, 'Balgriffin', 'Fingal', 590, 911, 1966, 3131 ); INSERT INTO population VALUES ( null, 'Ballyboghil', 'Fingal', 859, 950, 1011, 1153 ); INSERT INTO population VALUES ( null, 'Balscadden', 'Fingal', 577, 653, 667, 720 ); INSERT INTO population VALUES ( null, 'Blanchardstown-Abbotstown', 'Fingal', 2537, 4122, 4870, 6204 ); INSERT INTO population VALUES ( null, 'Blanchardstown-Blakestown', 'Fingal', 24404, 32288, 36057, 38924 ); INSERT INTO population VALUES ( null, 'Blanchardstown-Coolmine', 'Fingal', 9202, 10774, 10819, 11343 ); INSERT INTO population VALUES ( null, 'Blanchardstown-Corduff', 'Fingal', 4346, 4806, 3788, 3850 ); INSERT INTO population VALUES ( null, 'Blanchardstown-Delwood', 'Fingal', 4589, 4955, 5044, 5126 ); INSERT INTO population VALUES ( null, 'Blanchardstown-Mulhuddart', 'Fingal', 1833, 2785, 3866, 4126 ); INSERT INTO population VALUES ( null, 'Blanchardstown-Roselawn', 'Fingal', 2043, 1831, 1682, 1676 ); INSERT INTO population VALUES ( null, 'Blanchardstown-Tyrrelstown', 'Fingal', 1653, 1559, 2112, 3229 ); INSERT INTO population VALUES ( null, 'Castleknock-Knockmaroon', 'Fingal', 14859, 17115, 18071, 18795 ); INSERT INTO population VALUES ( null, 'Castleknock-Park', 'Fingal', 4561, 4395, 5124, 5310 ); INSERT INTO population VALUES ( null, 'Clonmethan', 'Fingal', 605, 625, 790, 832 ); INSERT INTO population VALUES ( null, 'Donabate', 'Fingal', 6141, 7600, 8733, 9426 ); INSERT INTO population VALUES ( null, 'Dubber', 'Fingal', 838, 3747, 6359, 7309 ); INSERT INTO population VALUES ( null, 'Garristown', 'Fingal', 1162, 1182, 1438, 1618 ); INSERT INTO population VALUES ( null, 'Hollywood', 'Fingal', 952, 998, 1259, 1374 ); INSERT INTO population VALUES ( null, 'Holmpatrick', 'Fingal', 3328, 3154, 3224, 3452 ); INSERT INTO population VALUES ( null, 'Howth', 'Fingal', 8706, 8196, 8256, 8277 ); INSERT INTO population VALUES ( null, 'Kilsallaghan', 'Fingal', 2032, 2081, 2205, 2261 ); INSERT INTO population VALUES ( null, 'Kinsaley', 'Fingal', 3528, 5526, 8475, 9592 ); INSERT INTO population VALUES ( null, 'Lucan North', 'Fingal', 338, 1163, 1358, 1479 ); INSERT INTO population VALUES ( null, 'Lusk', 'Fingal', 4131, 7048, 8814, 9621 ); INSERT INTO population VALUES ( null, 'Malahide East', 'Fingal', 5281, 6213, 6879, 7272 ); INSERT INTO population VALUES ( null, 'Malahide West', 'Fingal', 6315, 6271, 6273, 6360 ); INSERT INTO population VALUES ( null, 'Portmarnock North', 'Fingal', 5071, 4588, 4118, 4121 ); INSERT INTO population VALUES ( null, 'Portmarnock South', 'Fingal', 3338, 3522, 3465, 3606 ); INSERT INTO population VALUES ( null, 'Rush', 'Fingal', 6759, 8280, 9196, 9827 ); INSERT INTO population VALUES ( null, 'Skerries', 'Fingal', 7612, 8175, 8333, 8480 ); INSERT INTO population VALUES ( null, 'Sutton', 'Fingal', 6203, 5914, 5609, 5661 ); INSERT INTO population VALUES ( null, 'Swords-Forrest', 'Fingal', 9797, 12443, 13894, 15173 ); INSERT INTO population VALUES ( null, 'Swords-Glasmore', 'Fingal', 7679, 7799, 7748, 7684 ); INSERT INTO population VALUES ( null, 'Swords-Lissenhall', 'Fingal', 6081, 9072, 9667, 10429 ); INSERT INTO population VALUES ( null, 'Swords-Seatown', 'Fingal', 4919, 5934, 6539, 6808 ); INSERT INTO population VALUES ( null, 'Swords Village', 'Fingal', 2572, 2514, 2581, 2682 ); INSERT INTO population VALUES ( null, 'The Ward', 'Fingal', 1308, 5181, 8241, 10470 ); INSERT INTO population VALUES ( null, 'Turnapin', 'Fingal', 1717, 1723, 1683, 1695 ); INSERT INTO population VALUES ( null, 'Ballinteer-Broadford', 'Dn Laoghaire - Rathdown', 3213, 3152, 2657, 2536 ); INSERT INTO population VALUES ( null, 'Ballinteer-Ludford', 'Dn Laoghaire - Rathdown', 2355, 2118, 2032, 2023 ); INSERT INTO population VALUES ( null, 'Ballinteer-Marley', 'Dn Laoghaire - Rathdown', 2602, 2443, 2338, 2246 ); INSERT INTO population VALUES ( null, 'Ballinteer-Meadowbroads', 'Dn Laoghaire - Rathdown', 1729, 1587, 1530, 1635 ); INSERT INTO population VALUES ( null, 'Ballinteer-Meadowmount', 'Dn Laoghaire - Rathdown', 1908, 1984, 1802, 1848 ); INSERT INTO population VALUES ( null, 'Ballinteer-Woodpark', 'Dn Laoghaire - Rathdown', 4312, 4305, 5292, 5406 ); INSERT INTO population VALUES ( null, 'Ballybrack', 'Dn Laoghaire - Rathdown', 3433, 3190, 2851, 2821 ); INSERT INTO population VALUES ( null, 'Blackrock-Booterstown', 'Dn Laoghaire - Rathdown', 2888, 2975, 3328, 3440 ); INSERT INTO population VALUES ( null, 'Blackrock-Carysfort', 'Dn Laoghaire - Rathdown', 5555, 5577, 6160, 6283 ); INSERT INTO population VALUES ( null, 'Blackrock-Central', 'Dn Laoghaire - Rathdown', 3648, 3637, 3841, 3731 ); INSERT INTO population VALUES ( null, 'Blackrock-Glenomena', 'Dn Laoghaire - Rathdown', 1839, 1877, 1795, 2047 ); INSERT INTO population VALUES ( null, 'Blackrock-Monkstown', 'Dn Laoghaire - Rathdown', 3146, 3062, 3073, 3215 ); INSERT INTO population VALUES ( null, 'Blackrock-Newpark', 'Dn Laoghaire - Rathdown', 2272, 2121, 2164, 2303 ); INSERT INTO population VALUES ( null, 'Blackrock-Seapoint', 'Dn Laoghaire - Rathdown', 1403, 1332, 1438, 1449 ); INSERT INTO population VALUES ( null, 'Blackrock-Stradbrook', 'Dn Laoghaire - Rathdown', 2383, 2360, 2299, 2466 ); INSERT INTO population VALUES ( null, 'Blackrock-Templehill', 'Dn Laoghaire - Rathdown', 2700, 2675, 2687, 2645 ); INSERT INTO population VALUES ( null, 'Blackrock-Williamstown', 'Dn Laoghaire - Rathdown', 2723, 2454, 2676, 2946 ); INSERT INTO population VALUES ( null, 'Cabinteely-Granitefield', 'Dn Laoghaire - Rathdown', 2407, 2432, 2481, 2809 ); INSERT INTO population VALUES ( null, 'Cabinteely-Kilbogget', 'Dn Laoghaire - Rathdown', 3258, 2977, 2723, 2681 ); INSERT INTO population VALUES ( null, 'Cabinteely-Loughlinstown', 'Dn Laoghaire - Rathdown', 1510, 2546, 3806, 4254 ); INSERT INTO population VALUES ( null, 'Cabinteely-Pottery', 'Dn Laoghaire - Rathdown', 4946, 4860, 4833, 4988 ); INSERT INTO population VALUES ( null, 'Churchtown-Castle', 'Dn Laoghaire - Rathdown', 1248, 1244, 1287, 1482 ); INSERT INTO population VALUES ( null, 'Churchtown-Landscape', 'Dn Laoghaire - Rathdown', 1224, 1198, 1308, 1409 ); INSERT INTO population VALUES ( null, 'Churchtown-Nutgrove', 'Dn Laoghaire - Rathdown', 3375, 3100, 3079, 3154 ); INSERT INTO population VALUES ( null, 'Churchtown-Orwell', 'Dn Laoghaire - Rathdown', 1957, 1871, 1794, 1859 ); INSERT INTO population VALUES ( null, 'Churchtown-Woodlawn', 'Dn Laoghaire - Rathdown', 1288, 1323, 1384, 1457 ); INSERT INTO population VALUES ( null, 'Clonskeagh-Belfield', 'Dn Laoghaire - Rathdown', 2138, 2442, 2740, 3111 ); INSERT INTO population VALUES ( null, 'Clonskeagh-Farranboley', 'Dn Laoghaire - Rathdown', 1485, 1483, 1501, 1612 ); INSERT INTO population VALUES ( null, 'Clonskeagh-Milltown', 'Dn Laoghaire - Rathdown', 1845, 1915, 1975, 2050 ); INSERT INTO population VALUES ( null, 'Clonskeagh-Roebuck', 'Dn Laoghaire - Rathdown', 1791, 2037, 2556, 2707 ); INSERT INTO population VALUES ( null, 'Clonskeagh-Windy Arbour', 'Dn Laoghaire - Rathdown', 2394, 2510, 2521, 2731 ); INSERT INTO population VALUES ( null, 'Dalkey-Avondale', 'Dn Laoghaire - Rathdown', 1446, 1411, 1350, 1359 ); INSERT INTO population VALUES ( null, 'Dalkey-Bullock', 'Dn Laoghaire - Rathdown', 1762, 1694, 1701, 1771 ); INSERT INTO population VALUES ( null, 'Dalkey-Coliemore', 'Dn Laoghaire - Rathdown', 1445, 1403, 1361, 1301 ); INSERT INTO population VALUES ( null, 'Dalkey Hill', 'Dn Laoghaire - Rathdown', 1584, 1439, 1523, 1546 ); INSERT INTO population VALUES ( null, 'Dalkey Upper', 'Dn Laoghaire - Rathdown', 2168, 2136, 2117, 2117 ); INSERT INTO population VALUES ( null, 'Dundrum-Balally', 'Dn Laoghaire - Rathdown', 5086, 4894, 7049, 8014 ); INSERT INTO population VALUES ( null, 'Dundrum-Kilmacud', 'Dn Laoghaire - Rathdown', 2411, 2981, 3196, 3271 ); INSERT INTO population VALUES ( null, 'Dundrum-Sandyford', 'Dn Laoghaire - Rathdown', 4862, 5844, 6952, 7652 ); INSERT INTO population VALUES ( null, 'Dundrum-Sweetmount', 'Dn Laoghaire - Rathdown', 1993, 1890, 2089, 2166 ); INSERT INTO population VALUES ( null, 'Dundrum-Taney', 'Dn Laoghaire - Rathdown', 2785, 2583, 2449, 2502 ); INSERT INTO population VALUES ( null, 'Dn Laoghaire-East Central', 'Dn Laoghaire - Rathdown', 2144, 1855, 2234, 2495 ); INSERT INTO population VALUES ( null, 'Dn Laoghaire-Glasthule', 'Dn Laoghaire - Rathdown', 2665, 2634, 2760, 2790 ); INSERT INTO population VALUES ( null, 'Dn Laoghaire-Glenageary', 'Dn Laoghaire - Rathdown', 1951, 1992, 1922, 1920 ); INSERT INTO population VALUES ( null, 'Dn Laoghaire-Monkstown Farm', 'Dn Laoghaire - Rathdown', 2115, 1975, 2095, 2278 ); INSERT INTO population VALUES ( null, 'Dn Laoghaire-Mount Town', 'Dn Laoghaire - Rathdown', 1619, 1608, 1734, 1775 ); INSERT INTO population VALUES ( null, 'Dn Laoghaire-Sallynoggin East', 'Dn Laoghaire - Rathdown', 3078, 2917, 2866, 2863 ); INSERT INTO population VALUES ( null, 'Dn Laoghaire-Sallynoggin South', 'Dn Laoghaire - Rathdown', 1388, 1384, 1354, 1437 ); INSERT INTO population VALUES ( null, 'Dn Laoghaire-Sallynoggin West', 'Dn Laoghaire - Rathdown', 2130, 1982, 1884, 2870 ); INSERT INTO population VALUES ( null, 'Dn Laoghaire-Sandycove', 'Dn Laoghaire - Rathdown', 3761, 3734, 3690, 3688 ); INSERT INTO population VALUES ( null, 'Dn Laoghaire-Salthill', 'Dn Laoghaire - Rathdown', 1593, 1708, 1623, 1727 ); INSERT INTO population VALUES ( null, 'Dn Laoghaire-West Central', 'Dn Laoghaire - Rathdown', 2003, 2029, 2368, 2673 ); INSERT INTO population VALUES ( null, 'Foxrock-Beechpark', 'Dn Laoghaire - Rathdown', 1787, 1711, 1653, 1674 ); INSERT INTO population VALUES ( null, 'Foxrock-Carrickmines', 'Dn Laoghaire - Rathdown', 6050, 5982, 6088, 5950 ); INSERT INTO population VALUES ( null, 'Foxrock-Deans Grange', 'Dn Laoghaire - Rathdown', 2609, 2470, 2434, 2446 ); INSERT INTO population VALUES ( null, 'Foxrock-Torquay', 'Dn Laoghaire - Rathdown', 1310, 1379, 1439, 1446 ); INSERT INTO population VALUES ( null, 'Glencullen', 'Dn Laoghaire - Rathdown', 10266, 13925, 17381, 19743 ); INSERT INTO population VALUES ( null, 'Killiney North', 'Dn Laoghaire - Rathdown', 3558, 3237, 3367, 3323 ); INSERT INTO population VALUES ( null, 'Killiney South', 'Dn Laoghaire - Rathdown', 7042, 6351, 6478, 6392 ); INSERT INTO population VALUES ( null, 'Shankill-Rathmichael', 'Dn Laoghaire - Rathdown', 4435, 4601, 5353, 5617 ); INSERT INTO population VALUES ( null, 'Shankill-Rathsallagh', 'Dn Laoghaire - Rathdown', 3485, 3362, 3250, 3255 ); INSERT INTO population VALUES ( null, 'Shankill-Shanganagh', 'Dn Laoghaire - Rathdown', 5322, 5295, 5334, 5479 ); INSERT INTO population VALUES ( null, 'Stillorgan-Deerpark', 'Dn Laoghaire - Rathdown', 2915, 2828, 2793, 2864 ); INSERT INTO population VALUES ( null, 'Stillorgan-Kilmacud', 'Dn Laoghaire - Rathdown', 4003, 3842, 3828, 3970 ); INSERT INTO population VALUES ( null, 'Stillorgan-Leopardstown', 'Dn Laoghaire - Rathdown', 2173, 2067, 2429, 2642 ); INSERT INTO population VALUES ( null, 'Stillorgan-Merville', 'Dn Laoghaire - Rathdown', 2847, 2859, 2744, 3214 ); INSERT INTO population VALUES ( null, 'Stillorgan-Mount Merrion', 'Dn Laoghaire - Rathdown', 2446, 2386, 2407, 2354 ); INSERT INTO population VALUES ( null, 'Stillorgan-Priory', 'Dn Laoghaire - Rathdown', 1869, 2036, 2229, 2237 ); INSERT INTO population VALUES ( null, 'Tibradden', 'Dn Laoghaire - Rathdown', 711, 827, 786, 1109 ); INSERT INTO population VALUES ( null, 'Athy East Urban', 'Kildare', 2862, 3242, 3867, 3907 ); INSERT INTO population VALUES ( null, 'Athy West Urban', 'Kildare', 2399, 3046, 2944, 3065 ); INSERT INTO population VALUES ( null, 'Naas Urban', 'Kildare', 18288, 20044, 20713, 21493 ); INSERT INTO population VALUES ( null, 'Athy Rural', 'Kildare', 1692, 2495, 3671, 3821 ); INSERT INTO population VALUES ( null, 'Ballaghmoon', 'Kildare', 222, 217, 193, 203 ); INSERT INTO population VALUES ( null, 'Ballitore', 'Kildare', 716, 780, 1026, 1141 ); INSERT INTO population VALUES ( null, 'Ballybrackan', 'Kildare', 475, 468, 548, 615 ); INSERT INTO population VALUES ( null, 'Ballyshannon', 'Kildare', 994, 1626, 1752, 1787 ); INSERT INTO population VALUES ( null, 'Belan', 'Kildare', 188, 219, 270, 272 ); INSERT INTO population VALUES ( null, 'Bert', 'Kildare', 159, 154, 156, 159 ); INSERT INTO population VALUES ( null, 'Burtown', 'Kildare', 296, 319, 361, 415 ); INSERT INTO population VALUES ( null, 'Carrigeen', 'Kildare', 543, 583, 624, 624 ); INSERT INTO population VALUES ( null, 'Castledermot', 'Kildare', 1123, 1300, 1609, 1637 ); INSERT INTO population VALUES ( null, 'Churchtown', 'Kildare', 472, 482, 527, 533 ); INSERT INTO population VALUES ( null, 'Dunmanoge', 'Kildare', 468, 460, 478, 478 ); INSERT INTO population VALUES ( null, 'Fontstown', 'Kildare', 400, 383, 413, 441 ); INSERT INTO population VALUES ( null, 'Graney', 'Kildare', 544, 620, 735, 771 ); INSERT INTO population VALUES ( null, 'Grangemellon', 'Kildare', 547, 571, 598, 619 ); INSERT INTO population VALUES ( null, 'Harristown', 'Kildare', 343, 382, 452, 476 ); INSERT INTO population VALUES ( null, 'Inchaquire', 'Kildare', 186, 185, 205, 233 ); INSERT INTO population VALUES ( null, 'Johnstown', 'Kildare', 157, 167, 179, 173 ); INSERT INTO population VALUES ( null, 'Kilberry', 'Kildare', 589, 580, 619, 633 ); INSERT INTO population VALUES ( null, 'Kildangan', 'Kildare', 370, 535, 693, 740 ); INSERT INTO population VALUES ( null, 'Kilkea', 'Kildare', 369, 332, 388, 392 ); INSERT INTO population VALUES ( null, 'Kilrush', 'Kildare', 425, 584, 655, 682 ); INSERT INTO population VALUES ( null, 'Lackagh', 'Kildare', 582, 683, 790, 863 ); INSERT INTO population VALUES ( null, 'Monasterevin', 'Kildare', 3152, 3649, 4347, 4896 ); INSERT INTO population VALUES ( null, 'Moone', 'Kildare', 372, 429, 471, 487 ); INSERT INTO population VALUES ( null, 'Narraghmore', 'Kildare', 481, 713, 784, 821 ); INSERT INTO population VALUES ( null, 'Nurney', 'Kildare', 672, 894, 959, 1072 ); INSERT INTO population VALUES ( null, 'Quinsborough', 'Kildare', 115, 137, 145, 162 ); INSERT INTO population VALUES ( null, 'Skerries', 'Kildare', 443, 483, 658, 630 ); INSERT INTO population VALUES ( null, 'Balraheen', 'Kildare', 1884, 1655, 2245, 2411 ); INSERT INTO population VALUES ( null, 'Celbridge', 'Kildare', 14333, 14933, 15323, 15630 ); INSERT INTO population VALUES ( null, 'Cloncurry', 'Kildare', 1174, 1393, 1495, 1571 ); INSERT INTO population VALUES ( null, 'Donadea', 'Kildare', 573, 679, 750, 794 ); INSERT INTO population VALUES ( null, 'Donaghcumper', 'Kildare', 3118, 4233, 5710, 6227 ); INSERT INTO population VALUES ( null, 'Kilcock', 'Kildare', 3243, 4697, 6234, 6927 ); INSERT INTO population VALUES ( null, 'Leixlip', 'Kildare', 15154, 14833, 15597, 15550 ); INSERT INTO population VALUES ( null, 'Maynooth', 'Kildare', 10837, 11500, 13617, 15905 ); INSERT INTO population VALUES ( null, 'Straffan', 'Kildare', 1306, 1449, 1706, 2034 ); INSERT INTO population VALUES ( null, 'Ballynadrumny', 'Kildare', 575, 531, 584, 570 ); INSERT INTO population VALUES ( null, 'Cadamstown', 'Kildare', 763, 1108, 1265, 1425 ); INSERT INTO population VALUES ( null, 'Carbury', 'Kildare', 1650, 1721, 1850, 1914 ); INSERT INTO population VALUES ( null, 'Carrick', 'Kildare', 212, 246, 265, 290 ); INSERT INTO population VALUES ( null, 'Cloncurry', 'Kildare', 328, 351, 388, 398 ); INSERT INTO population VALUES ( null, 'Drehid', 'Kildare', 197, 228, 258, 266 ); INSERT INTO population VALUES ( null, 'Dunfierth', 'Kildare', 610, 690, 751, 725 ); INSERT INTO population VALUES ( null, 'Killinthomas', 'Kildare', 406, 441, 321, 332 ); INSERT INTO population VALUES ( null, 'Kilpatrick', 'Kildare', 788, 841, 866, 871 ); INSERT INTO population VALUES ( null, 'Kilrainy', 'Kildare', 501, 626, 740, 753 ); INSERT INTO population VALUES ( null, 'Lullymore', 'Kildare', 163, 181, 191, 187 ); INSERT INTO population VALUES ( null, 'Rathangan', 'Kildare', 1533, 1490, 2272, 2511 ); INSERT INTO population VALUES ( null, 'Thomastown', 'Kildare', 649, 723, 868, 931 ); INSERT INTO population VALUES ( null, 'Windmill Cross', 'Kildare', 663, 882, 1137, 1186 ); INSERT INTO population VALUES ( null, 'Ballymore Eustace', 'Kildare', 1584, 1524, 1475, 1534 ); INSERT INTO population VALUES ( null, 'Ballysax East', 'Kildare', 2315, 2123, 1937, 1938 ); INSERT INTO population VALUES ( null, 'Ballysax West', 'Kildare', 1026, 1042, 1071, 1066 ); INSERT INTO population VALUES ( null, 'Bodenstown', 'Kildare', 3193, 3734, 4643, 4959 ); INSERT INTO population VALUES ( null, 'Carnalway', 'Kildare', 1399, 1703, 1914, 1980 ); INSERT INTO population VALUES ( null, 'Carragh', 'Kildare', 901, 1487, 1725, 1819 ); INSERT INTO population VALUES ( null, 'Clane', 'Kildare', 5179, 6106, 7527, 7935 ); INSERT INTO population VALUES ( null, 'Donore', 'Kildare', 641, 756, 793, 784 ); INSERT INTO population VALUES ( null, 'Downings', 'Kildare', 2090, 2573, 2886, 2958 ); INSERT INTO population VALUES ( null, 'Droichead Nua (Newbridge) Rural', 'Kildare', 1168, 1848, 2528, 2708 ); INSERT INTO population VALUES ( null, 'Droichead Nua (Newbridge) Urban', 'Kildare', 7684, 7888, 7563, 7682 ); INSERT INTO population VALUES ( null, 'Dunmurry', 'Kildare', 356, 401, 440, 469 ); INSERT INTO population VALUES ( null, 'Feighcullen', 'Kildare', 549, 526, 586, 618 ); INSERT INTO population VALUES ( null, 'Gilltown', 'Kildare', 803, 896, 944, 946 ); INSERT INTO population VALUES ( null, 'Kilcullen', 'Kildare', 1782, 3022, 3296, 3505 ); INSERT INTO population VALUES ( null, 'Kildare', 'Kildare', 6867, 8791, 9325, 9859 ); INSERT INTO population VALUES ( null, 'Kill', 'Kildare', 2993, 3734, 4449, 4675 ); INSERT INTO population VALUES ( null, 'Killashee', 'Kildare', 258, 295, 309, 265 ); INSERT INTO population VALUES ( null, 'Kilmeage North', 'Kildare', 1394, 1781, 2080, 2250 ); INSERT INTO population VALUES ( null, 'Kilmeage South', 'Kildare', 1121, 1668, 2003, 2110 ); INSERT INTO population VALUES ( null, 'Kilteel', 'Kildare', 483, 552, 577, 571 ); INSERT INTO population VALUES ( null, 'Ladytown', 'Kildare', 778, 862, 941, 963 ); INSERT INTO population VALUES ( null, 'Morristownbiller', 'Kildare', 9693, 11127, 13852, 14861 ); INSERT INTO population VALUES ( null, 'Naas Rural', 'Kildare', 1134, 1717, 2353, 2736 ); INSERT INTO population VALUES ( null, 'Newtown', 'Kildare', 420, 473, 840, 923 ); INSERT INTO population VALUES ( null, 'Oldconnell', 'Kildare', 786, 864, 904, 1109 ); INSERT INTO population VALUES ( null, 'Oughterard', 'Kildare', 668, 690, 726, 702 ); INSERT INTO population VALUES ( null, 'Pollardstown', 'Kildare', 286, 340, 305, 313 ); INSERT INTO population VALUES ( null, 'Rathernan', 'Kildare', 423, 505, 614, 597 ); INSERT INTO population VALUES ( null, 'Rathmore', 'Kildare', 1045, 1025, 1157, 1141 ); INSERT INTO population VALUES ( null, 'Robertstown', 'Kildare', 1760, 1897, 1923, 1982 ); INSERT INTO population VALUES ( null, 'Timahoe North', 'Kildare', 868, 988, 1089, 1163 ); INSERT INTO population VALUES ( null, 'Timahoe South', 'Kildare', 533, 722, 772, 845 ); INSERT INTO population VALUES ( null, 'Usk', 'Kildare', 460, 482, 502, 515 ); INSERT INTO population VALUES ( null, 'Kilkenny No. 1 Urban', 'Kilkenny', 4857, 5154, 5211, 5764 ); INSERT INTO population VALUES ( null, 'Kilkenny No. 2 Urban', 'Kilkenny', 3734, 3507, 3500, 4043 ); INSERT INTO population VALUES ( null, 'Burnchurch', 'Kilkenny', 403, 468, 555, 598 ); INSERT INTO population VALUES ( null, 'Callan Rural', 'Kilkenny', 1038, 1321, 1557, 1641 ); INSERT INTO population VALUES ( null, 'Callan Urban', 'Kilkenny', 1325, 1489, 1692, 1790 ); INSERT INTO population VALUES ( null, 'Coolaghmore', 'Kilkenny', 325, 387, 412, 495 ); INSERT INTO population VALUES ( null, 'Dunamaggan', 'Kilkenny', 313, 358, 394, 399 ); INSERT INTO population VALUES ( null, 'Earlstown', 'Kilkenny', 188, 205, 221, 217 ); INSERT INTO population VALUES ( null, 'Kells', 'Kilkenny', 506, 612, 645, 645 ); INSERT INTO population VALUES ( null, 'Killamery', 'Kilkenny', 203, 209, 214, 210 ); INSERT INTO population VALUES ( null, 'Kilmaganny', 'Kilkenny', 669, 688, 673, 716 ); INSERT INTO population VALUES ( null, 'Kilmanagh', 'Kilkenny', 462, 459, 496, 518 ); INSERT INTO population VALUES ( null, 'Mallardstown', 'Kilkenny', 268, 229, 247, 252 ); INSERT INTO population VALUES ( null, 'Scotsborough', 'Kilkenny', 146, 156, 166, 165 ); INSERT INTO population VALUES ( null, 'Tullaghanbrogue', 'Kilkenny', 425, 420, 484, 465 ); INSERT INTO population VALUES ( null, 'Boolyglass', 'Kilkenny', 135, 136, 124, 135 ); INSERT INTO population VALUES ( null, 'Fiddown', 'Kilkenny', 684, 769, 972, 977 ); INSERT INTO population VALUES ( null, 'Muckalee', 'Kilkenny', 148, 163, 183, 170 ); INSERT INTO population VALUES ( null, 'Pilltown', 'Kilkenny', 1354, 1574, 1792, 1832 ); INSERT INTO population VALUES ( null, 'Templeorum', 'Kilkenny', 347, 407, 434, 448 ); INSERT INTO population VALUES ( null, 'Tubbrid', 'Kilkenny', 349, 372, 415, 432 ); INSERT INTO population VALUES ( null, 'Tullahought', 'Kilkenny', 162, 164, 189, 194 ); INSERT INTO population VALUES ( null, 'Whitechurch', 'Kilkenny', 399, 442, 458, 416 ); INSERT INTO population VALUES ( null, 'Attanagh', 'Kilkenny', 350, 368, 395, 385 ); INSERT INTO population VALUES ( null, 'Ballyragget', 'Kilkenny', 1272, 1451, 1532, 1511 ); INSERT INTO population VALUES ( null, 'Castlecomer', 'Kilkenny', 2314, 2407, 2293, 2291 ); INSERT INTO population VALUES ( null, 'Clogh', 'Kilkenny', 1249, 1255, 1276, 1219 ); INSERT INTO population VALUES ( null, 'Clogharinka', 'Kilkenny', 254, 224, 237, 246 ); INSERT INTO population VALUES ( null, 'Kilmacar', 'Kilkenny', 412, 426, 452, 444 ); INSERT INTO population VALUES ( null, 'Moneenroe', 'Kilkenny', 1204, 1263, 1316, 1271 ); INSERT INTO population VALUES ( null, 'Mothell', 'Kilkenny', 387, 430, 454, 446 ); INSERT INTO population VALUES ( null, 'Muckalee', 'Kilkenny', 414, 456, 523, 563 ); INSERT INTO population VALUES ( null, 'Brownsford', 'Kilkenny', 120, 122, 133, 150 ); INSERT INTO population VALUES ( null, 'Dysartmoon', 'Kilkenny', 237, 255, 268, 299 ); INSERT INTO population VALUES ( null, 'Jerpoint West', 'Kilkenny', 122, 186, 259, 290 ); INSERT INTO population VALUES ( null, 'Listerlin', 'Kilkenny', 298, 312, 371, 373 ); INSERT INTO population VALUES ( null, 'Rosbercon Rural', 'Kilkenny', 569, 562, 663, 664 ); INSERT INTO population VALUES ( null, 'Shanbogh', 'Kilkenny', 421, 475, 461, 487 ); INSERT INTO population VALUES ( null, 'The Rower', 'Kilkenny', 726, 754, 798, 817 ); INSERT INTO population VALUES ( null, 'Ballinamara', 'Kilkenny', 266, 328, 366, 340 ); INSERT INTO population VALUES ( null, 'Ballybeagh', 'Kilkenny', 252, 277, 286, 296 ); INSERT INTO population VALUES ( null, 'Ballycallan', 'Kilkenny', 395, 440, 453, 431 ); INSERT INTO population VALUES ( null, 'Clara', 'Kilkenny', 547, 613, 624, 656 ); INSERT INTO population VALUES ( null, 'Coolcraheen', 'Kilkenny', 508, 499, 521, 518 ); INSERT INTO population VALUES ( null, 'Dunbell', 'Kilkenny', 483, 518, 524, 521 ); INSERT INTO population VALUES ( null, 'Dunmore', 'Kilkenny', 472, 458, 561, 645 ); INSERT INTO population VALUES ( null, 'Freshford', 'Kilkenny', 1058, 1088, 1021, 1009 ); INSERT INTO population VALUES ( null, 'Gowran', 'Kilkenny', 990, 1115, 1451, 1450 ); INSERT INTO population VALUES ( null, 'Grange', 'Kilkenny', 811, 810, 833, 869 ); INSERT INTO population VALUES ( null, 'Kilkenny Rural', 'Kilkenny', 13542, 15272, 16833, 17944 ); INSERT INTO population VALUES ( null, 'Kilkieran', 'Kilkenny', 484, 568, 688, 670 ); INSERT INTO population VALUES ( null, 'Odagh', 'Kilkenny', 440, 447, 462, 455 ); INSERT INTO population VALUES ( null, 'Outrath', 'Kilkenny', 739, 736, 715, 690 ); INSERT INTO population VALUES ( null, 'Paulstown', 'Kilkenny', 500, 873, 975, 1018 ); INSERT INTO population VALUES ( null, 'Rathcoole', 'Kilkenny', 378, 421, 506, 519 ); INSERT INTO population VALUES ( null, 'Rathealy', 'Kilkenny', 164, 166, 214, 202 ); INSERT INTO population VALUES ( null, 'St. Canice', 'Kilkenny', 473, 564, 576, 595 ); INSERT INTO population VALUES ( null, 'Shankill', 'Kilkenny', 672, 643, 751, 844 ); INSERT INTO population VALUES ( null, 'Tiscoffin', 'Kilkenny', 260, 362, 456, 498 ); INSERT INTO population VALUES ( null, 'Tullaroan', 'Kilkenny', 333, 307, 305, 298 ); INSERT INTO population VALUES ( null, 'Aghaviller', 'Kilkenny', 351, 393, 403, 423 ); INSERT INTO population VALUES ( null, 'Ballyhale', 'Kilkenny', 335, 329, 368, 424 ); INSERT INTO population VALUES ( null, 'Ballyvool', 'Kilkenny', 179, 167, 174, 189 ); INSERT INTO population VALUES ( null, 'Bennettsbridge', 'Kilkenny', 931, 914, 1041, 1101 ); INSERT INTO population VALUES ( null, 'Bramblestown', 'Kilkenny', 161, 214, 257, 271 ); INSERT INTO population VALUES ( null, 'Castlebanny', 'Kilkenny', 144, 154, 127, 148 ); INSERT INTO population VALUES ( null, 'Castlegannon', 'Kilkenny', 113, 115, 124, 114 ); INSERT INTO population VALUES ( null, 'Coolhill', 'Kilkenny', 261, 278, 288, 268 ); INSERT INTO population VALUES ( null, 'Danesfort', 'Kilkenny', 453, 491, 468, 469 ); INSERT INTO population VALUES ( null, 'Ennisnag', 'Kilkenny', 498, 568, 545, 521 ); INSERT INTO population VALUES ( null, 'Famma', 'Kilkenny', 267, 288, 318, 298 ); INSERT INTO population VALUES ( null, 'Freaghana', 'Kilkenny', 196, 194, 243, 245 ); INSERT INTO population VALUES ( null, 'Goresbridge', 'Kilkenny', 599, 597, 589, 567 ); INSERT INTO population VALUES ( null, 'Graiguenamanagh', 'Kilkenny', 1636, 1586, 1834, 1811 ); INSERT INTO population VALUES ( null, 'Inistioge', 'Kilkenny', 709, 753, 780, 817 ); INSERT INTO population VALUES ( null, 'Jerpoint Church', 'Kilkenny', 714, 793, 885, 933 ); INSERT INTO population VALUES ( null, 'Kilfane', 'Kilkenny', 273, 252, 267, 274 ); INSERT INTO population VALUES ( null, 'Kilkeasy', 'Kilkenny', 290, 303, 359, 334 ); INSERT INTO population VALUES ( null, 'Kiltorcan', 'Kilkenny', 141, 151, 159, 179 ); INSERT INTO population VALUES ( null, 'Knocktopher', 'Kilkenny', 399, 446, 521, 544 ); INSERT INTO population VALUES ( null, 'Pleberstown', 'Kilkenny', 167, 171, 178, 197 ); INSERT INTO population VALUES ( null, 'Powerstown', 'Kilkenny', 442, 476, 473, 476 ); INSERT INTO population VALUES ( null, 'Stonyford', 'Kilkenny', 487, 537, 602, 658 ); INSERT INTO population VALUES ( null, 'Thomastown', 'Kilkenny', 1702, 1910, 2201, 2333 ); INSERT INTO population VALUES ( null, 'Tullaherin', 'Kilkenny', 187, 189, 217, 226 ); INSERT INTO population VALUES ( null, 'Ullard', 'Kilkenny', 208, 256, 301, 287 ); INSERT INTO population VALUES ( null, 'Woolengrange', 'Kilkenny', 274, 267, 304, 322 ); INSERT INTO population VALUES ( null, 'Balleen', 'Kilkenny', 400, 404, 446, 450 ); INSERT INTO population VALUES ( null, 'Ballyconra', 'Kilkenny', 265, 267, 255, 238 ); INSERT INTO population VALUES ( null, 'Baunmore', 'Kilkenny', 155, 150, 153, 136 ); INSERT INTO population VALUES ( null, 'Clomantagh', 'Kilkenny', 291, 277, 290, 327 ); INSERT INTO population VALUES ( null, 'Galmoy', 'Kilkenny', 283, 286, 304, 312 ); INSERT INTO population VALUES ( null, 'Glashare', 'Kilkenny', 287, 301, 328, 332 ); INSERT INTO population VALUES ( null, 'Johnstown', 'Kilkenny', 921, 871, 894, 853 ); INSERT INTO population VALUES ( null, 'Lisdowney', 'Kilkenny', 187, 214, 213, 250 ); INSERT INTO population VALUES ( null, 'Rathbeagh', 'Kilkenny', 222, 233, 262, 283 ); INSERT INTO population VALUES ( null, 'Tubbridbrittain', 'Kilkenny', 271, 278, 305, 312 ); INSERT INTO population VALUES ( null, 'Urlingford', 'Kilkenny', 929, 1096, 1208, 1292 ); INSERT INTO population VALUES ( null, 'Aglish', 'Kilkenny', 886, 920, 871, 881 ); INSERT INTO population VALUES ( null, 'Ballincrea', 'Kilkenny', 274, 309, 310, 316 ); INSERT INTO population VALUES ( null, 'Dunkitt', 'Kilkenny', 935, 1011, 1058, 1011 ); INSERT INTO population VALUES ( null, 'Farnoge', 'Kilkenny', 281, 279, 297, 307 ); INSERT INTO population VALUES ( null, 'Kilbeacon', 'Kilkenny', 177, 180, 194, 202 ); INSERT INTO population VALUES ( null, 'Kilbride', 'Kilkenny', 332, 348, 427, 401 ); INSERT INTO population VALUES ( null, 'Kilcolumb', 'Kilkenny', 547, 545, 579, 585 ); INSERT INTO population VALUES ( null, 'Kilculliheen (part)', 'Kilkenny', 2145, 3493, 4811, 5239 ); INSERT INTO population VALUES ( null, 'Killahy', 'Kilkenny', 696, 703, 708, 655 ); INSERT INTO population VALUES ( null, 'Kilmakevoge', 'Kilkenny', 391, 425, 430, 433 ); INSERT INTO population VALUES ( null, 'Pollrone', 'Kilkenny', 1021, 1179, 1406, 1453 ); INSERT INTO population VALUES ( null, 'Portnascully', 'Kilkenny', 951, 1035, 1128, 1114 ); INSERT INTO population VALUES ( null, 'Rathpatrick', 'Kilkenny', 1204, 1173, 1140, 1099 ); INSERT INTO population VALUES ( null, 'Rossinan', 'Kilkenny', 709, 731, 776, 743 ); INSERT INTO population VALUES ( null, 'Ullid', 'Kilkenny', 906, 918, 1014, 1019 ); INSERT INTO population VALUES ( null, 'Abbeyleix', 'Laoighis', 2379, 2569, 2837, 2779 ); INSERT INTO population VALUES ( null, 'Aghmacart', 'Laoighis', 257, 300, 361, 375 ); INSERT INTO population VALUES ( null, 'Ballinakill', 'Laoighis', 682, 782, 792, 825 ); INSERT INTO population VALUES ( null, 'Ballyroan', 'Laoighis', 631, 700, 969, 1072 ); INSERT INTO population VALUES ( null, 'Blandsfort', 'Laoighis', 319, 281, 318, 309 ); INSERT INTO population VALUES ( null, 'Caher', 'Laoighis', 82, 83, 105, 100 ); INSERT INTO population VALUES ( null, 'Castletown', 'Laoighis', 610, 635, 741, 772 ); INSERT INTO population VALUES ( null, 'Clash', 'Laoighis', 279, 310, 366, 365 ); INSERT INTO population VALUES ( null, 'Clonkeen', 'Laoighis', 619, 641, 686, 673 ); INSERT INTO population VALUES ( null, 'Colt', 'Laoighis', 205, 210, 187, 174 ); INSERT INTO population VALUES ( null, 'Cuffsborough', 'Laoighis', 245, 236, 297, 334 ); INSERT INTO population VALUES ( null, 'Cullahill', 'Laoighis', 341, 341, 359, 357 ); INSERT INTO population VALUES ( null, 'Cullenagh', 'Laoighis', 92, 112, 141, 142 ); INSERT INTO population VALUES ( null, 'Donaghmore', 'Laoighis', 248, 250, 255, 260 ); INSERT INTO population VALUES ( null, 'Donore', 'Laoighis', 394, 416, 486, 457 ); INSERT INTO population VALUES ( null, 'Dunmore', 'Laoighis', 209, 220, 238, 275 ); INSERT INTO population VALUES ( null, 'Durrow', 'Laoighis', 1164, 1262, 1278, 1260 ); INSERT INTO population VALUES ( null, 'Dysartgallen', 'Laoighis', 219, 243, 266, 255 ); INSERT INTO population VALUES ( null, 'Fossy', 'Laoighis', 94, 130, 146, 167 ); INSERT INTO population VALUES ( null, 'Grantstown', 'Laoighis', 318, 314, 358, 367 ); INSERT INTO population VALUES ( null, 'Kilcoke', 'Laoighis', 143, 156, 139, 134 ); INSERT INTO population VALUES ( null, 'Kildellig', 'Laoighis', 197, 233, 259, 283 ); INSERT INTO population VALUES ( null, 'Killermogh', 'Laoighis', 386, 338, 341, 346 ); INSERT INTO population VALUES ( null, 'Kilnaseer', 'Laoighis', 304, 311, 312, 310 ); INSERT INTO population VALUES ( null, 'Raheen', 'Laoighis', 350, 394, 422, 467 ); INSERT INTO population VALUES ( null, 'Rathdowney', 'Laoighis', 1285, 1292, 1161, 1207 ); INSERT INTO population VALUES ( null, 'Timahoe', 'Laoighis', 517, 527, 569, 589 ); INSERT INTO population VALUES ( null, 'Ballyadams', 'Laoighis', 291, 356, 412, 426 ); INSERT INTO population VALUES ( null, 'Ballylynan', 'Laoighis', 780, 1099, 1456, 1457 ); INSERT INTO population VALUES ( null, 'Barrowhouse', 'Laoighis', 435, 445, 449, 485 ); INSERT INTO population VALUES ( null, 'Curraclone', 'Laoighis', 182, 206, 229, 266 ); INSERT INTO population VALUES ( null, 'Killabban', 'Laoighis', 305, 302, 420, 434 ); INSERT INTO population VALUES ( null, 'Luggacurren', 'Laoighis', 298, 327, 324, 300 ); INSERT INTO population VALUES ( null, 'Moyanna', 'Laoighis', 261, 272, 347, 380 ); INSERT INTO population VALUES ( null, 'Rathaspick', 'Laoighis', 229, 231, 256, 239 ); INSERT INTO population VALUES ( null, 'Stradbally', 'Laoighis', 1634, 1554, 1626, 1807 ); INSERT INTO population VALUES ( null, 'Tankardstown', 'Laoighis', 268, 316, 347, 368 ); INSERT INTO population VALUES ( null, 'Timogue', 'Laoighis', 346, 343, 343, 357 ); INSERT INTO population VALUES ( null, 'Vicarstown', 'Laoighis', 168, 185, 206, 194 ); INSERT INTO population VALUES ( null, 'Arderin', 'Laoighis', 198, 212, 232, 280 ); INSERT INTO population VALUES ( null, 'Ballybrittas', 'Laoighis', 676, 768, 1205, 1279 ); INSERT INTO population VALUES ( null, 'Ballycarroll', 'Laoighis', 286, 243, 300, 341 ); INSERT INTO population VALUES ( null, 'Ballyfin', 'Laoighis', 547, 583, 633, 659 ); INSERT INTO population VALUES ( null, 'Borris', 'Laoighis', 384, 887, 1533, 1683 ); INSERT INTO population VALUES ( null, '045/046 Brisha/Cappard', 'Laoighis', 271, 309, 311, 322 ); INSERT INTO population VALUES ( null, 'Cappalough', 'Laoighis', 316, 320, 343, 348 ); INSERT INTO population VALUES ( null, 'Cardtown', 'Laoighis', 157, 162, 176, 171 ); INSERT INTO population VALUES ( null, 'Castlecuffe', 'Laoighis', 376, 389, 393, 399 ); INSERT INTO population VALUES ( null, 'Clonaslee', 'Laoighis', 883, 862, 895, 940 ); INSERT INTO population VALUES ( null, 'Clondarrig', 'Laoighis', 502, 531, 1503, 1867 ); INSERT INTO population VALUES ( null, 'Clonin', 'Laoighis', 177, 203, 233, 227 ); INSERT INTO population VALUES ( null, 'Coolrain', 'Laoighis', 262, 271, 308, 302 ); INSERT INTO population VALUES ( null, 'Dangans', 'Laoighis', 689, 1012, 1553, 1659 ); INSERT INTO population VALUES ( null, 'Emo', 'Laoighis', 985, 1038, 1269, 1243 ); INSERT INTO population VALUES ( null, 'Garrymore', 'Laoighis', 142, 180, 250, 227 ); INSERT INTO population VALUES ( null, 'Graigue', 'Laoighis', 200, 206, 182, 183 ); INSERT INTO population VALUES ( null, 'Jamestown', 'Laoighis', 409, 418, 440, 462 ); INSERT INTO population VALUES ( null, 'Kilcolmanbane', 'Laoighis', 513, 560, 661, 659 ); INSERT INTO population VALUES ( null, 'Kilmullen', 'Laoighis', 509, 521, 556, 563 ); INSERT INTO population VALUES ( null, 'Kilmurry', 'Laoighis', 174, 211, 256, 267 ); INSERT INTO population VALUES ( null, 'Lacka', 'Laoighis', 273, 279, 261, 256 ); INSERT INTO population VALUES ( null, 'Marymount', 'Laoighis', 98, 129, 137, 139 ); INSERT INTO population VALUES ( null, 'Meelick', 'Laoighis', 297, 294, 379, 418 ); INSERT INTO population VALUES ( null, 'Mountmellick Rural', 'Laoighis', 968, 997, 982, 970 ); INSERT INTO population VALUES ( null, 'Mountmellick Urban', 'Laoighis', 2525, 2872, 2998, 2981 ); INSERT INTO population VALUES ( null, 'Mountrath', 'Laoighis', 1896, 1885, 2260, 2376 ); INSERT INTO population VALUES ( null, 'Nealstown', 'Laoighis', 83, 79, 90, 92 ); INSERT INTO population VALUES ( null, 'OMores Forest', 'Laoighis', 420, 436, 463, 498 ); INSERT INTO population VALUES ( null, 'Portarlington South', 'Laoighis', 3260, 5049, 6547, 7142 ); INSERT INTO population VALUES ( null, 'Portlaoighise (Maryborough) Rural', 'Laoighis', 8934, 11075, 14676, 16058 ); INSERT INTO population VALUES ( null, 'Portlaoighise (Maryborough) Urban', 'Laoighis', 3482, 3281, 3639, 3951 ); INSERT INTO population VALUES ( null, 'Rearymore', 'Laoighis', 257, 259, 287, 287 ); INSERT INTO population VALUES ( null, 'Rosenallis', 'Laoighis', 440, 428, 469, 426 ); INSERT INTO population VALUES ( null, 'Sallyford', 'Laoighis', 464, 507, 577, 565 ); INSERT INTO population VALUES ( null, 'Shaen', 'Laoighis', 831, 875, 894, 927 ); INSERT INTO population VALUES ( null, 'Tinnahinch', 'Laoighis', 158, 151, 175, 165 ); INSERT INTO population VALUES ( null, 'Trumra', 'Laoighis', 221, 249, 229, 230 ); INSERT INTO population VALUES ( null, 'Ballybrophy', 'Laoighis', 145, 162, 200, 192 ); INSERT INTO population VALUES ( null, 'Borris-in-Ossory', 'Laoighis', 731, 800, 805, 833 ); INSERT INTO population VALUES ( null, 'Clonmore', 'Laoighis', 202, 199, 208, 211 ); INSERT INTO population VALUES ( null, 'Errill', 'Laoighis', 365, 377, 405, 407 ); INSERT INTO population VALUES ( null, 'Kyle', 'Laoighis', 255, 248, 244, 234 ); INSERT INTO population VALUES ( null, 'Kyle South', 'Laoighis', 287, 282, 281, 287 ); INSERT INTO population VALUES ( null, 'Moneenalassa', 'Laoighis', 126, 141, 141, 148 ); INSERT INTO population VALUES ( null, 'Moneymore', 'Laoighis', 123, 122, 134, 136 ); INSERT INTO population VALUES ( null, 'Rathsaran', 'Laoighis', 390, 493, 559, 592 ); INSERT INTO population VALUES ( null, 'Ardough', 'Laoighis', 305, 295, 343, 346 ); INSERT INTO population VALUES ( null, 'Arless', 'Laoighis', 282, 366, 421, 418 ); INSERT INTO population VALUES ( null, 'Ballickmoyler', 'Laoighis', 548, 544, 615, 650 ); INSERT INTO population VALUES ( null, 'Ballylehane', 'Laoighis', 177, 172, 174, 166 ); INSERT INTO population VALUES ( null, 'Doonane', 'Laoighis', 570, 550, 751, 770 ); INSERT INTO population VALUES ( null, 'Farnans', 'Laoighis', 168, 163, 179, 186 ); INSERT INTO population VALUES ( null, 'Graigue Rural', 'Laoighis', 1819, 3120, 4543, 4793 ); INSERT INTO population VALUES ( null, 'Newtown', 'Laoighis', 275, 311, 319, 307 ); INSERT INTO population VALUES ( null, 'Rossmore', 'Laoighis', 397, 423, 460, 463 ); INSERT INTO population VALUES ( null, 'Shrule', 'Laoighis', 277, 290, 308, 304 ); INSERT INTO population VALUES ( null, 'Turra', 'Laoighis', 303, 348, 370, 360 ); INSERT INTO population VALUES ( null, 'Longford No. 1 Urban', 'Longford', 2841, 3134, 3163, 3584 ); INSERT INTO population VALUES ( null, 'Longford No. 2 Urban', 'Longford', 711, 794, 943, 1022 ); INSERT INTO population VALUES ( null, 'Agharra', 'Longford', 331, 357, 456, 443 ); INSERT INTO population VALUES ( null, 'Ballymahon', 'Longford', 1548, 1802, 2327, 2661 ); INSERT INTO population VALUES ( null, 'Cashel East', 'Longford', 324, 312, 323, 302 ); INSERT INTO population VALUES ( null, 'Cashel West', 'Longford', 538, 547, 572, 588 ); INSERT INTO population VALUES ( null, 'Doory', 'Longford', 358, 416, 457, 423 ); INSERT INTO population VALUES ( null, 'Forgney', 'Longford', 393, 446, 497, 491 ); INSERT INTO population VALUES ( null, 'Foxhall', 'Longford', 431, 510, 525, 528 ); INSERT INTO population VALUES ( null, 'Kilcommock', 'Longford', 581, 595, 953, 1060 ); INSERT INTO population VALUES ( null, 'Kilglass', 'Longford', 588, 617, 707, 706 ); INSERT INTO population VALUES ( null, 'Ledwithstown', 'Longford', 258, 285, 356, 368 ); INSERT INTO population VALUES ( null, 'Abbeylara', 'Longford', 245, 314, 340, 300 ); INSERT INTO population VALUES ( null, 'Ballinalee', 'Longford', 376, 453, 598, 632 ); INSERT INTO population VALUES ( null, 'Ballymuigh', 'Longford', 255, 246, 252, 249 ); INSERT INTO population VALUES ( null, 'Bunlahy', 'Longford', 167, 167, 188, 195 ); INSERT INTO population VALUES ( null, 'Columbkille', 'Longford', 596, 605, 597, 586 ); INSERT INTO population VALUES ( null, 'Coolamber', 'Longford', 263, 321, 371, 380 ); INSERT INTO population VALUES ( null, 'Creevy', 'Longford', 289, 344, 313, 301 ); INSERT INTO population VALUES ( null, 'Crosagstown', 'Longford', 226, 217, 241, 247 ); INSERT INTO population VALUES ( null, 'Currygrane', 'Longford', 126, 125, 128, 141 ); INSERT INTO population VALUES ( null, 'Dalystown', 'Longford', 170, 175, 188, 195 ); INSERT INTO population VALUES ( null, 'Drummeel', 'Longford', 127, 127, 138, 116 ); INSERT INTO population VALUES ( null, '024/035 Firry/Newgrove', 'Longford', 209, 221, 217, 195 ); INSERT INTO population VALUES ( null, 'Gelshagh', 'Longford', 322, 319, 338, 354 ); INSERT INTO population VALUES ( null, 'Granard Rural', 'Longford', 256, 300, 296, 301 ); INSERT INTO population VALUES ( null, 'Granard Urban', 'Longford', 1013, 933, 1021, 1070 ); INSERT INTO population VALUES ( null, 'Knockanbaun', 'Longford', 132, 146, 151, 169 ); INSERT INTO population VALUES ( null, 'Lislea', 'Longford', 142, 152, 139, 145 ); INSERT INTO population VALUES ( null, 'Meathas Truim', 'Longford', 1098, 1544, 2008, 2339 ); INSERT INTO population VALUES ( null, 'Milltown', 'Longford', 323, 351, 377, 346 ); INSERT INTO population VALUES ( null, 'Moatfarrell', 'Longford', 158, 187, 218, 216 ); INSERT INTO population VALUES ( null, 'Moyne', 'Longford', 321, 305, 315, 326 ); INSERT INTO population VALUES ( null, 'Mullanalaghta', 'Longford', 292, 295, 299, 305 ); INSERT INTO population VALUES ( null, 'Sonnagh', 'Longford', 281, 286, 285, 236 ); INSERT INTO population VALUES ( null, 'Aghaboy', 'Longford', 509, 596, 684, 682 ); INSERT INTO population VALUES ( null, 'Ardagh East', 'Longford', 529, 568, 613, 683 ); INSERT INTO population VALUES ( null, 'Ardagh West', 'Longford', 397, 439, 460, 450 ); INSERT INTO population VALUES ( null, 'Ballinamuck East', 'Longford', 464, 474, 546, 598 ); INSERT INTO population VALUES ( null, 'Ballinamuck West', 'Longford', 459, 441, 501, 438 ); INSERT INTO population VALUES ( null, 'Breanrisk', 'Longford', 642, 711, 816, 840 ); INSERT INTO population VALUES ( null, 'Caldragh', 'Longford', 1269, 1596, 2061, 2163 ); INSERT INTO population VALUES ( null, 'Cloondara', 'Longford', 549, 575, 616, 680 ); INSERT INTO population VALUES ( null, 'Cloonee', 'Longford', 618, 679, 727, 736 ); INSERT INTO population VALUES ( null, 'Corboy', 'Longford', 395, 381, 399, 387 ); INSERT INTO population VALUES ( null, 'Drumgort', 'Longford', 416, 435, 428, 422 ); INSERT INTO population VALUES ( null, 'Drumlish', 'Longford', 828, 935, 1387, 1468 ); INSERT INTO population VALUES ( null, 'Killashee', 'Longford', 234, 284, 432, 437 ); INSERT INTO population VALUES ( null, 'Killoe', 'Longford', 284, 302, 293, 277 ); INSERT INTO population VALUES ( null, 'Longford Rural', 'Longford', 4317, 5053, 5492, 5704 ); INSERT INTO population VALUES ( null, 'Mountdavis', 'Longford', 197, 204, 250, 252 ); INSERT INTO population VALUES ( null, 'Moydow', 'Longford', 557, 589, 668, 734 ); INSERT INTO population VALUES ( null, 'Newtown Forbes', 'Longford', 847, 892, 902, 897 ); INSERT INTO population VALUES ( null, 'Rathcline', 'Longford', 1268, 1289, 1428, 1442 ); INSERT INTO population VALUES ( null, 'Fair Gate', 'Louth', 10852, 9783, 9806, 10317 ); INSERT INTO population VALUES ( null, 'St. Laurence Gate', 'Louth', 3566, 3801, 4004, 4075 ); INSERT INTO population VALUES ( null, 'West Gate', 'Louth', 6412, 5899, 6042, 6284 ); INSERT INTO population VALUES ( null, 'Dundalk Urban No. 1', 'Louth', 2490, 2190, 2148, 2169 ); INSERT INTO population VALUES ( null, 'Dundalk Urban No. 2', 'Louth', 1064, 1211, 1169, 1140 ); INSERT INTO population VALUES ( null, 'Dundalk Urban No. 3', 'Louth', 1430, 1347, 1449, 1710 ); INSERT INTO population VALUES ( null, 'Dundalk Urban No. 4', 'Louth', 6527, 6677, 6039, 5970 ); INSERT INTO population VALUES ( null, 'Ardee Rural', 'Louth', 2500, 2626, 2875, 2952 ); INSERT INTO population VALUES ( null, 'Ardee Urban', 'Louth', 3564, 4301, 4554, 4917 ); INSERT INTO population VALUES ( null, 'Castlebellingham', 'Louth', 1338, 1371, 1617, 1688 ); INSERT INTO population VALUES ( null, 'Clonkeen', 'Louth', 438, 545, 648, 675 ); INSERT INTO population VALUES ( null, 'Collon', 'Louth', 1188, 1380, 1770, 1859 ); INSERT INTO population VALUES ( null, 'Dromin', 'Louth', 461, 535, 610, 629 ); INSERT INTO population VALUES ( null, 'Dromiskin', 'Louth', 1956, 1935, 2187, 2226 ); INSERT INTO population VALUES ( null, 'Drumcar', 'Louth', 1372, 1385, 1526, 1451 ); INSERT INTO population VALUES ( null, 'Dunleer', 'Louth', 1787, 2340, 2796, 2868 ); INSERT INTO population VALUES ( null, 'Stabannan', 'Louth', 526, 590, 620, 619 ); INSERT INTO population VALUES ( null, 'Tallanstown', 'Louth', 925, 968, 1059, 1040 ); INSERT INTO population VALUES ( null, 'Ballymascanlan', 'Louth', 2088, 2016, 2213, 2206 ); INSERT INTO population VALUES ( null, 'Barronstown', 'Louth', 621, 647, 744, 746 ); INSERT INTO population VALUES ( null, 'Carlingford', 'Louth', 1334, 1384, 1801, 2201 ); INSERT INTO population VALUES ( null, 'Castlering', 'Louth', 847, 935, 1012, 1034 ); INSERT INTO population VALUES ( null, 'Castletown', 'Louth', 2961, 3939, 4210, 4307 ); INSERT INTO population VALUES ( null, 'Creggan Upper', 'Louth', 641, 684, 787, 852 ); INSERT INTO population VALUES ( null, 'Darver', 'Louth', 518, 562, 568, 678 ); INSERT INTO population VALUES ( null, 'Drummullagh', 'Louth', 903, 1120, 1257, 1350 ); INSERT INTO population VALUES ( null, 'Dundalk Rural', 'Louth', 14715, 15534, 18160, 19200 ); INSERT INTO population VALUES ( null, 'Faughart', 'Louth', 843, 905, 991, 958 ); INSERT INTO population VALUES ( null, 'Greenore', 'Louth', 898, 979, 1169, 1201 ); INSERT INTO population VALUES ( null, 'Haggardstown', 'Louth', 4894, 5864, 6390, 6919 ); INSERT INTO population VALUES ( null, 'Jenkinstown', 'Louth', 831, 948, 1173, 1277 ); INSERT INTO population VALUES ( null, 'Killanny', 'Louth', 593, 683, 799, 825 ); INSERT INTO population VALUES ( null, 'Louth', 'Louth', 1196, 1308, 1505, 1575 ); INSERT INTO population VALUES ( null, 'Mansfieldstown', 'Louth', 454, 640, 807, 855 ); INSERT INTO population VALUES ( null, 'Rathcor', 'Louth', 1163, 1203, 1352, 1374 ); INSERT INTO population VALUES ( null, 'Ravensdale', 'Louth', 907, 982, 1018, 1010 ); INSERT INTO population VALUES ( null, 'Clogher', 'Louth', 1814, 2494, 3031, 3237 ); INSERT INTO population VALUES ( null, 'Dysart', 'Louth', 649, 777, 918, 925 ); INSERT INTO population VALUES ( null, 'Monasterboice', 'Louth', 1130, 1164, 1342, 1365 ); INSERT INTO population VALUES ( null, 'Mullary', 'Louth', 1248, 1528, 1723, 1754 ); INSERT INTO population VALUES ( null, 'St. Peters', 'Louth', 5406, 7482, 9151, 9704 ); INSERT INTO population VALUES ( null, 'Termonfeckin', 'Louth', 2033, 2575, 3294, 3537 ); INSERT INTO population VALUES ( null, 'St. Marys (part)', 'Louth', 4738, 6030, 6563, 6696 ); INSERT INTO population VALUES ( null, 'Ceannanus Mr (Kells) Urban', 'Meath', 2362, 2046, 2003, 2115 ); INSERT INTO population VALUES ( null, 'Navan Urban', 'Meath', 2802, 3166, 3168, 3608 ); INSERT INTO population VALUES ( null, 'Trim Urban', 'Meath', 1204, 1170, 1269, 1259 ); INSERT INTO population VALUES ( null, 'Drumcondra', 'Meath', 1310, 1291, 1290, 1304 ); INSERT INTO population VALUES ( null, 'Grangegeeth', 'Meath', 465, 541, 594, 660 ); INSERT INTO population VALUES ( null, 'Killary', 'Meath', 1145, 1185, 1221, 1251 ); INSERT INTO population VALUES ( null, 'Culmullin', 'Meath', 1049, 1035, 1054, 1136 ); INSERT INTO population VALUES ( null, 'Donaghmore', 'Meath', 7249, 8408, 10994, 11826 ); INSERT INTO population VALUES ( null, 'Dunboyne', 'Meath', 7757, 8702, 9578, 10072 ); INSERT INTO population VALUES ( null, 'Dunshaughlin', 'Meath', 4927, 5245, 5676, 5840 ); INSERT INTO population VALUES ( null, 'Kilbrew', 'Meath', 1762, 2670, 3025, 3642 ); INSERT INTO population VALUES ( null, 'Killeen', 'Meath', 1070, 1072, 1091, 1157 ); INSERT INTO population VALUES ( null, 'Kilmessan', 'Meath', 1081, 1162, 1388, 1562 ); INSERT INTO population VALUES ( null, 'Kilmore', 'Meath', 1329, 1427, 1507, 1587 ); INSERT INTO population VALUES ( null, 'Rathfeigh', 'Meath', 921, 912, 990, 1003 ); INSERT INTO population VALUES ( null, 'Ratoath', 'Meath', 5581, 8805, 10561, 11079 ); INSERT INTO population VALUES ( null, 'Rodanstown', 'Meath', 1112, 1068, 1039, 1123 ); INSERT INTO population VALUES ( null, 'Skreen', 'Meath', 1400, 1403, 1448, 1475 ); INSERT INTO population VALUES ( null, 'Ardagh', 'Meath', 661, 644, 680, 638 ); INSERT INTO population VALUES ( null, 'Ballinlough', 'Meath', 159, 175, 223, 215 ); INSERT INTO population VALUES ( null, 'Balrathboyne', 'Meath', 406, 423, 500, 523 ); INSERT INTO population VALUES ( null, 'Boherboy', 'Meath', 301, 302, 297, 317 ); INSERT INTO population VALUES ( null, 'Burry', 'Meath', 217, 231, 266, 299 ); INSERT INTO population VALUES ( null, 'Carrickleck', 'Meath', 497, 456, 473, 457 ); INSERT INTO population VALUES ( null, 'Castlekeeran', 'Meath', 343, 390, 466, 477 ); INSERT INTO population VALUES ( null, 'Ceannanus Mr (Kells) Rural', 'Meath', 2800, 3876, 4468, 4654 ); INSERT INTO population VALUES ( null, 'Cruicetown', 'Meath', 312, 362, 366, 407 ); INSERT INTO population VALUES ( null, 'Girley', 'Meath', 332, 346, 386, 361 ); INSERT INTO population VALUES ( null, 'Kilmainham', 'Meath', 676, 741, 761, 772 ); INSERT INTO population VALUES ( null, 'Kilskeer', 'Meath', 335, 355, 387, 423 ); INSERT INTO population VALUES ( null, 'Loughan', 'Meath', 387, 413, 405, 397 ); INSERT INTO population VALUES ( null, 'Maperath', 'Meath', 512, 458, 479, 463 ); INSERT INTO population VALUES ( null, 'Martry', 'Meath', 652, 642, 663, 705 ); INSERT INTO population VALUES ( null, 'Moybolgue', 'Meath', 199, 213, 241, 247 ); INSERT INTO population VALUES ( null, 'Moynalty', 'Meath', 607, 600, 609, 637 ); INSERT INTO population VALUES ( null, 'Newcastle', 'Meath', 384, 407, 409, 442 ); INSERT INTO population VALUES ( null, 'Newtown', 'Meath', 380, 609, 886, 906 ); INSERT INTO population VALUES ( null, 'Nobber', 'Meath', 619, 652, 748, 762 ); INSERT INTO population VALUES ( null, 'Posseckstown', 'Meath', 174, 172, 198, 224 ); INSERT INTO population VALUES ( null, 'Staholmog', 'Meath', 394, 396, 405, 407 ); INSERT INTO population VALUES ( null, 'Tailtin', 'Meath', 929, 938, 886, 911 ); INSERT INTO population VALUES ( null, 'Trohanny', 'Meath', 367, 360, 328, 325 ); INSERT INTO population VALUES ( null, 'Ardcath', 'Meath', 1907, 1873, 1911, 1945 ); INSERT INTO population VALUES ( null, 'Duleek', 'Meath', 2941, 4366, 5177, 5554 ); INSERT INTO population VALUES ( null, 'Julianstown', 'Meath', 5806, 8289, 9606, 10139 ); INSERT INTO population VALUES ( null, 'Mellifont', 'Meath', 599, 523, 561, 542 ); INSERT INTO population VALUES ( null, 'St. Marys (part)', 'Meath', 5457, 9044, 10769, 11967 ); INSERT INTO population VALUES ( null, 'Stamullin', 'Meath', 2329, 3844, 4696, 5001 ); INSERT INTO population VALUES ( null, 'Ardbraccan', 'Meath', 1823, 1909, 1977, 2082 ); INSERT INTO population VALUES ( null, 'Ardmulchan', 'Meath', 894, 917, 949, 983 ); INSERT INTO population VALUES ( null, 'Bective', 'Meath', 866, 1031, 1132, 1121 ); INSERT INTO population VALUES ( null, 'Castletown', 'Meath', 902, 1007, 1017, 1002 ); INSERT INTO population VALUES ( null, 'Domhnach Phdraig', 'Meath', 1481, 1640, 1741, 1804 ); INSERT INTO population VALUES ( null, 'Kentstown', 'Meath', 1284, 1727, 1958, 2145 ); INSERT INTO population VALUES ( null, 'Navan Rural', 'Meath', 18624, 23683, 26657, 28081 ); INSERT INTO population VALUES ( null, 'Painestown', 'Meath', 1083, 1118, 1175, 1183 ); INSERT INTO population VALUES ( null, 'Rathkenny', 'Meath', 537, 556, 618, 633 ); INSERT INTO population VALUES ( null, 'Slane', 'Meath', 1336, 1587, 1834, 1858 ); INSERT INTO population VALUES ( null, 'Stackallan', 'Meath', 586, 582, 620, 664 ); INSERT INTO population VALUES ( null, 'Tara', 'Meath', 1146, 1135, 1193, 1226 ); INSERT INTO population VALUES ( null, 'Crossakeel', 'Meath', 307, 341, 465, 511 ); INSERT INTO population VALUES ( null, 'Crosskeys', 'Meath', 261, 288, 323, 326 ); INSERT INTO population VALUES ( null, 'Killallon', 'Meath', 230, 227, 270, 298 ); INSERT INTO population VALUES ( null, 'Killeagh', 'Meath', 344, 359, 382, 426 ); INSERT INTO population VALUES ( null, 'Knocklough', 'Meath', 180, 188, 216, 212 ); INSERT INTO population VALUES ( null, 'Moylagh', 'Meath', 413, 414, 416, 395 ); INSERT INTO population VALUES ( null, 'Oldcastle', 'Meath', 1858, 2230, 2324, 2301 ); INSERT INTO population VALUES ( null, 'Stonefield', 'Meath', 224, 232, 237, 214 ); INSERT INTO population VALUES ( null, 'Ardnamullan', 'Meath', 700, 796, 842, 856 ); INSERT INTO population VALUES ( null, 'Baile tha Bu', 'Meath', 1855, 2418, 2531, 2585 ); INSERT INTO population VALUES ( null, 'Ballyboggan', 'Meath', 489, 507, 536, 526 ); INSERT INTO population VALUES ( null, 'Ballyconnell', 'Meath', 726, 712, 714, 742 ); INSERT INTO population VALUES ( null, 'Castlejordan', 'Meath', 423, 481, 471, 426 ); INSERT INTO population VALUES ( null, 'Castlerickard', 'Meath', 972, 1361, 1852, 2119 ); INSERT INTO population VALUES ( null, 'Cloghbrack', 'Meath', 371, 443, 503, 503 ); INSERT INTO population VALUES ( null, 'Clonmacduff', 'Meath', 439, 433, 468, 480 ); INSERT INTO population VALUES ( null, 'Gallow', 'Meath', 822, 864, 909, 957 ); INSERT INTO population VALUES ( null, 'Galtrim', 'Meath', 616, 616, 666, 755 ); INSERT INTO population VALUES ( null, 'Grennanstown', 'Meath', 909, 1102, 1201, 1258 ); INSERT INTO population VALUES ( null, 'Hill of Down', 'Meath', 461, 469, 507, 550 ); INSERT INTO population VALUES ( null, 'Innfield', 'Meath', 1992, 3175, 4006, 4347 ); INSERT INTO population VALUES ( null, 'Cill Bhrde', 'Meath', 353, 395, 450, 468 ); INSERT INTO population VALUES ( null, 'Kilcooly', 'Meath', 277, 311, 323, 359 ); INSERT INTO population VALUES ( null, 'Kildalky', 'Meath', 597, 1025, 1232, 1301 ); INSERT INTO population VALUES ( null, 'Killaconnigan', 'Meath', 1200, 1605, 2094, 2227 ); INSERT INTO population VALUES ( null, 'Killyon', 'Meath', 502, 558, 518, 532 ); INSERT INTO population VALUES ( null, 'Laracor', 'Meath', 506, 526, 570, 611 ); INSERT INTO population VALUES ( null, 'Rahinstown', 'Meath', 504, 482, 488, 496 ); INSERT INTO population VALUES ( null, 'Rathmolyon', 'Meath', 1104, 1181, 1330, 1408 ); INSERT INTO population VALUES ( null, 'An Rth Mhr', 'Meath', 797, 860, 970, 1026 ); INSERT INTO population VALUES ( null, 'Summerhill', 'Meath', 1118, 1205, 1299, 1336 ); INSERT INTO population VALUES ( null, 'Trim Rural (part)', 'Meath', 5685, 6727, 8005, 8793 ); INSERT INTO population VALUES ( null, 'Birr Urban', 'Offaly', 3590, 4091, 4428, 4411 ); INSERT INTO population VALUES ( null, 'Tullamore Urban', 'Offaly', 10270, 10900, 11346, 11444 ); INSERT INTO population VALUES ( null, 'Ballycumber', 'Offaly', 702, 688, 736, 734 ); INSERT INTO population VALUES ( null, 'Banagher', 'Offaly', 1789, 1950, 1993, 2123 ); INSERT INTO population VALUES ( null, 'Birr Rural', 'Offaly', 1096, 1268, 1288, 1222 ); INSERT INTO population VALUES ( null, 'Broughal', 'Offaly', 135, 127, 120, 116 ); INSERT INTO population VALUES ( null, 'Cloghan', 'Offaly', 856, 854, 983, 979 ); INSERT INTO population VALUES ( null, 'Clonmacnoise', 'Offaly', 316, 321, 337, 341 ); INSERT INTO population VALUES ( null, 'Derrinboy', 'Offaly', 257, 261, 300, 303 ); INSERT INTO population VALUES ( null, 'Derryad', 'Offaly', 258, 255, 248, 252 ); INSERT INTO population VALUES ( null, 'Doon', 'Offaly', 405, 423, 457, 464 ); INSERT INTO population VALUES ( null, 'Dromoyle', 'Offaly', 294, 309, 323, 335 ); INSERT INTO population VALUES ( null, 'Drumcullen', 'Offaly', 278, 333, 354, 398 ); INSERT INTO population VALUES ( null, 'Eglish', 'Offaly', 160, 165, 145, 146 ); INSERT INTO population VALUES ( null, 'Ferbane', 'Offaly', 1122, 1170, 1222, 1219 ); INSERT INTO population VALUES ( null, 'Gallen', 'Offaly', 627, 597, 575, 542 ); INSERT INTO population VALUES ( null, 'Hinds', 'Offaly', 281, 291, 309, 307 ); INSERT INTO population VALUES ( null, 'Huntston', 'Offaly', 372, 369, 348, 357 ); INSERT INTO population VALUES ( null, 'Kilcolman', 'Offaly', 382, 356, 385, 375 ); INSERT INTO population VALUES ( null, 'Kilcormac', 'Offaly', 1296, 1288, 1304, 1386 ); INSERT INTO population VALUES ( null, 'Killyon', 'Offaly', 249, 255, 275, 256 ); INSERT INTO population VALUES ( null, 'Kinnitty', 'Offaly', 503, 518, 512, 542 ); INSERT INTO population VALUES ( null, 'Knockbarron', 'Offaly', 157, 154, 174, 129 ); INSERT INTO population VALUES ( null, 'Lea', 'Offaly', 322, 341, 367, 346 ); INSERT INTO population VALUES ( null, 'Letter', 'Offaly', 137, 156, 167, 158 ); INSERT INTO population VALUES ( null, 'Lumcloon', 'Offaly', 395, 368, 360, 342 ); INSERT INTO population VALUES ( null, 'Lusmagh', 'Offaly', 459, 506, 544, 538 ); INSERT INTO population VALUES ( null, 'Mounterin', 'Offaly', 198, 211, 252, 248 ); INSERT INTO population VALUES ( null, 'Moyclare', 'Offaly', 547, 591, 626, 640 ); INSERT INTO population VALUES ( null, 'Seirkieran', 'Offaly', 459, 460, 490, 466 ); INSERT INTO population VALUES ( null, 'Shannonbridge', 'Offaly', 353, 332, 299, 265 ); INSERT INTO population VALUES ( null, 'Shannonharbour', 'Offaly', 329, 321, 334, 314 ); INSERT INTO population VALUES ( null, 'Srah', 'Offaly', 711, 737, 733, 703 ); INSERT INTO population VALUES ( null, 'Ballyburly', 'Offaly', 1148, 1291, 1325, 1362 ); INSERT INTO population VALUES ( null, 'Ballymacwilliam', 'Offaly', 468, 565, 646, 635 ); INSERT INTO population VALUES ( null, 'Bracknagh', 'Offaly', 848, 942, 1012, 1052 ); INSERT INTO population VALUES ( null, 'Clonbulloge', 'Offaly', 650, 709, 745, 771 ); INSERT INTO population VALUES ( null, 'Clonmore', 'Offaly', 345, 419, 420, 438 ); INSERT INTO population VALUES ( null, 'Croghan', 'Offaly', 458, 457, 526, 547 ); INSERT INTO population VALUES ( null, 'Edenderry Rural', 'Offaly', 730, 715, 856, 816 ); INSERT INTO population VALUES ( null, 'Edenderry Urban', 'Offaly', 4216, 5617, 6490, 7003 ); INSERT INTO population VALUES ( null, '043/034 Esker/Ballaghassaan', 'Offaly', 384, 405, 441, 477 ); INSERT INTO population VALUES ( null, 'Knockdrin', 'Offaly', 141, 157, 189, 199 ); INSERT INTO population VALUES ( null, 'Monasteroris', 'Offaly', 732, 675, 831, 804 ); INSERT INTO population VALUES ( null, 'Aghancon', 'Offaly', 363, 380, 374, 378 ); INSERT INTO population VALUES ( null, 'Ballincor', 'Offaly', 138, 139, 158, 157 ); INSERT INTO population VALUES ( null, 'Barna', 'Offaly', 175, 171, 156, 164 ); INSERT INTO population VALUES ( null, 'Cangort', 'Offaly', 160, 182, 211, 202 ); INSERT INTO population VALUES ( null, 'Cullenwaine', 'Offaly', 649, 664, 703, 681 ); INSERT INTO population VALUES ( null, 'Dunkerrin', 'Offaly', 364, 351, 358, 358 ); INSERT INTO population VALUES ( null, 'Ettagh', 'Offaly', 419, 433, 487, 522 ); INSERT INTO population VALUES ( null, 'Gorteen', 'Offaly', 285, 286, 361, 282 ); INSERT INTO population VALUES ( null, 'Mountheaton', 'Offaly', 724, 730, 672, 693 ); INSERT INTO population VALUES ( null, 'Roscomroe', 'Offaly', 145, 148, 149, 153 ); INSERT INTO population VALUES ( null, 'Shinrone', 'Offaly', 797, 921, 949, 975 ); INSERT INTO population VALUES ( null, 'Templeharry', 'Offaly', 152, 158, 212, 229 ); INSERT INTO population VALUES ( null, 'Tulla', 'Offaly', 99, 110, 109, 109 ); INSERT INTO population VALUES ( null, 'Ballycommon', 'Offaly', 463, 532, 561, 718 ); INSERT INTO population VALUES ( null, 'Ballyshear', 'Offaly', 303, 365, 381, 396 ); INSERT INTO population VALUES ( null, 'Bawn', 'Offaly', 320, 346, 378, 359 ); INSERT INTO population VALUES ( null, 'Cappancur', 'Offaly', 1254, 1272, 1490, 1528 ); INSERT INTO population VALUES ( null, 'Clara', 'Offaly', 3226, 3587, 3894, 3967 ); INSERT INTO population VALUES ( null, 'Clonygowan', 'Offaly', 393, 424, 535, 566 ); INSERT INTO population VALUES ( null, 'Daingean', 'Offaly', 1168, 1460, 1462, 1489 ); INSERT INTO population VALUES ( null, 'Derrycooley', 'Offaly', 239, 252, 293, 269 ); INSERT INTO population VALUES ( null, 'Durrow', 'Offaly', 661, 723, 741, 759 ); INSERT INTO population VALUES ( null, 'Geashill', 'Offaly', 1212, 1449, 1617, 1607 ); INSERT INTO population VALUES ( null, 'Gorteen', 'Offaly', 272, 309, 299, 357 ); INSERT INTO population VALUES ( null, 'Hammerlane', 'Offaly', 534, 561, 564, 558 ); INSERT INTO population VALUES ( null, 'Kilclonfert', 'Offaly', 301, 319, 364, 368 ); INSERT INTO population VALUES ( null, 'Kilcumreragh', 'Offaly', 456, 497, 522, 530 ); INSERT INTO population VALUES ( null, 'Killeigh', 'Offaly', 1144, 1209, 1257, 1232 ); INSERT INTO population VALUES ( null, 'Killooly', 'Offaly', 236, 249, 270, 270 ); INSERT INTO population VALUES ( null, 'Killoughy', 'Offaly', 570, 628, 651, 716 ); INSERT INTO population VALUES ( null, 'Mountbriscoe', 'Offaly', 198, 199, 253, 242 ); INSERT INTO population VALUES ( null, 'ODempsey', 'Offaly', 112, 126, 160, 166 ); INSERT INTO population VALUES ( null, 'Portarlington North', 'Offaly', 1635, 2039, 2366, 2405 ); INSERT INTO population VALUES ( null, 'Rahan', 'Offaly', 737, 696, 720, 716 ); INSERT INTO population VALUES ( null, 'Raheenakeeran', 'Offaly', 370, 388, 424, 399 ); INSERT INTO population VALUES ( null, 'Rathfeston', 'Offaly', 259, 381, 440, 432 ); INSERT INTO population VALUES ( null, 'Rathrobin', 'Offaly', 399, 421, 403, 401 ); INSERT INTO population VALUES ( null, 'Screggan', 'Offaly', 1102, 1339, 1462, 1456 ); INSERT INTO population VALUES ( null, 'Silverbrook', 'Offaly', 591, 656, 717, 762 ); INSERT INTO population VALUES ( null, 'Tinamuck', 'Offaly', 197, 219, 261, 274 ); INSERT INTO population VALUES ( null, 'Tinnycross', 'Offaly', 420, 450, 458, 437 ); INSERT INTO population VALUES ( null, 'Tullamore Rural', 'Offaly', 996, 2181, 3030, 3216 ); INSERT INTO population VALUES ( null, 'Athlone East Urban', 'Westmeath', 4092, 4075, 4131, 4290 ); INSERT INTO population VALUES ( null, 'Athlone West Urban', 'Westmeath', 3262, 2883, 3165, 3243 ); INSERT INTO population VALUES ( null, 'Athlone East Rural', 'Westmeath', 6433, 6754, 7307, 7353 ); INSERT INTO population VALUES ( null, 'Auburn', 'Westmeath', 534, 638, 712, 723 ); INSERT INTO population VALUES ( null, 'Ballybroder', 'Westmeath', 250, 254, 239, 247 ); INSERT INTO population VALUES ( null, 'Bellanalack', 'Westmeath', 431, 454, 563, 581 ); INSERT INTO population VALUES ( null, 'Carn', 'Westmeath', 706, 729, 751, 772 ); INSERT INTO population VALUES ( null, 'Castledaly', 'Westmeath', 658, 664, 675, 715 ); INSERT INTO population VALUES ( null, 'Glassan', 'Westmeath', 816, 805, 840, 841 ); INSERT INTO population VALUES ( null, 'Kilcumreragh', 'Westmeath', 396, 411, 405, 361 ); INSERT INTO population VALUES ( null, 'Killinure', 'Westmeath', 337, 354, 365, 419 ); INSERT INTO population VALUES ( null, 'Moate', 'Westmeath', 1941, 2361, 3046, 3088 ); INSERT INTO population VALUES ( null, 'Mount Temple', 'Westmeath', 507, 525, 617, 646 ); INSERT INTO population VALUES ( null, 'Moydrum', 'Westmeath', 2136, 2482, 2794, 2908 ); INSERT INTO population VALUES ( null, 'Muckanagh', 'Westmeath', 158, 173, 173, 166 ); INSERT INTO population VALUES ( null, 'Tubbrit', 'Westmeath', 635, 669, 665, 696 ); INSERT INTO population VALUES ( null, 'Umma', 'Westmeath', 267, 268, 266, 273 ); INSERT INTO population VALUES ( null, 'Ardnagragh', 'Westmeath', 400, 425, 441, 433 ); INSERT INTO population VALUES ( null, 'Ballymore', 'Westmeath', 458, 486, 668, 734 ); INSERT INTO population VALUES ( null, 'Doonis', 'Westmeath', 199, 206, 239, 234 ); INSERT INTO population VALUES ( null, 'Drumraney', 'Westmeath', 232, 243, 273, 272 ); INSERT INTO population VALUES ( null, 'Noughaval', 'Westmeath', 323, 346, 413, 399 ); INSERT INTO population VALUES ( null, 'Piercetown', 'Westmeath', 98, 116, 113, 109 ); INSERT INTO population VALUES ( null, 'Templepatrick', 'Westmeath', 222, 213, 196, 185 ); INSERT INTO population VALUES ( null, 'Winetown', 'Westmeath', 129, 134, 143, 132 ); INSERT INTO population VALUES ( null, 'Boherquill', 'Westmeath', 107, 129, 155, 153 ); INSERT INTO population VALUES ( null, 'Coole', 'Westmeath', 209, 277, 253, 238 ); INSERT INTO population VALUES ( null, 'Coolure', 'Westmeath', 276, 286, 290, 304 ); INSERT INTO population VALUES ( null, 'Finnea', 'Westmeath', 260, 316, 272, 265 ); INSERT INTO population VALUES ( null, 'Glore', 'Westmeath', 169, 144, 193, 185 ); INSERT INTO population VALUES ( null, 'Knockarrow', 'Westmeath', 91, 98, 113, 111 ); INSERT INTO population VALUES ( null, 'Rathowen', 'Westmeath', 325, 317, 318, 363 ); INSERT INTO population VALUES ( null, 'Street', 'Westmeath', 289, 334, 303, 267 ); INSERT INTO population VALUES ( null, 'Ballinlough', 'Westmeath', 136, 147, 134, 163 ); INSERT INTO population VALUES ( null, 'Ballyhealy', 'Westmeath', 249, 281, 280, 289 ); INSERT INTO population VALUES ( null, 'Ballynaskeagh', 'Westmeath', 215, 242, 268, 277 ); INSERT INTO population VALUES ( null, 'Bracklin', 'Westmeath', 217, 238, 266, 258 ); INSERT INTO population VALUES ( null, 'Clonarney', 'Westmeath', 380, 435, 500, 505 ); INSERT INTO population VALUES ( null, 'Collinstown', 'Westmeath', 326, 431, 474, 501 ); INSERT INTO population VALUES ( null, 'Copperalley', 'Westmeath', 225, 198, 271, 270 ); INSERT INTO population VALUES ( null, 'Delvin', 'Westmeath', 558, 751, 1024, 1076 ); INSERT INTO population VALUES ( null, 'Faughalstown', 'Westmeath', 225, 236, 236, 234 ); INSERT INTO population VALUES ( null, 'Fore East', 'Westmeath', 344, 388, 409, 391 ); INSERT INTO population VALUES ( null, 'Fore West', 'Westmeath', 289, 362, 399, 384 ); INSERT INTO population VALUES ( null, 'Hilltown', 'Westmeath', 205, 245, 264, 264 ); INSERT INTO population VALUES ( null, 'Kilcumny', 'Westmeath', 159, 158, 169, 202 ); INSERT INTO population VALUES ( null, 'Killua', 'Westmeath', 708, 916, 1011, 1053 ); INSERT INTO population VALUES ( null, 'Killulagh', 'Westmeath', 342, 388, 441, 473 ); INSERT INTO population VALUES ( null, 'Kilpatrick', 'Westmeath', 196, 179, 222, 211 ); INSERT INTO population VALUES ( null, 'Kinturk', 'Westmeath', 1107, 1228, 1241, 1341 ); INSERT INTO population VALUES ( null, 'Riverdale', 'Westmeath', 259, 360, 426, 469 ); INSERT INTO population VALUES ( null, 'Rosmead', 'Westmeath', 333, 343, 327, 312 ); INSERT INTO population VALUES ( null, 'Ardnaglew', 'Westmeath', 255, 255, 275, 269 ); INSERT INTO population VALUES ( null, '085 Ballinalack/Lackan', 'Westmeath', 548, 650, 681, 600 ); INSERT INTO population VALUES ( null, 'Ballykilmore', 'Westmeath', 623, 692, 707, 734 ); INSERT INTO population VALUES ( null, 'Ballymorin', 'Westmeath', 249, 247, 316, 326 ); INSERT INTO population VALUES ( null, 'Ballynagore', 'Westmeath', 497, 510, 533, 528 ); INSERT INTO population VALUES ( null, 'Belvidere', 'Westmeath', 835, 749, 759, 702 ); INSERT INTO population VALUES ( null, 'Carrick', 'Westmeath', 301, 326, 310, 335 ); INSERT INTO population VALUES ( null, 'Castle', 'Westmeath', 662, 803, 902, 872 ); INSERT INTO population VALUES ( null, 'Castlelost', 'Westmeath', 1594, 1690, 1718, 1695 ); INSERT INTO population VALUES ( null, 'Castletown', 'Westmeath', 671, 693, 749, 745 ); INSERT INTO population VALUES ( null, 'Churchtown', 'Westmeath', 214, 285, 313, 343 ); INSERT INTO population VALUES ( null, 'Cloghan', 'Westmeath', 260, 313, 332, 354 ); INSERT INTO population VALUES ( null, 'Clonfad', 'Westmeath', 540, 612, 632, 637 ); INSERT INTO population VALUES ( null, 'Clonlost', 'Westmeath', 427, 447, 448, 446 ); INSERT INTO population VALUES ( null, 'Derrymore', 'Westmeath', 228, 223, 272, 273 ); INSERT INTO population VALUES ( null, 'Dysart', 'Westmeath', 230, 234, 250, 236 ); INSERT INTO population VALUES ( null, 'Emper', 'Westmeath', 203, 191, 214, 209 ); INSERT INTO population VALUES ( null, 'Enniscoffey', 'Westmeath', 337, 379, 409, 447 ); INSERT INTO population VALUES ( null, 'Gaybrook', 'Westmeath', 370, 373, 444, 445 ); INSERT INTO population VALUES ( null, 'Glenlough', 'Westmeath', 193, 185, 184, 172 ); INSERT INTO population VALUES ( null, 'Greenpark', 'Westmeath', 241, 250, 251, 258 ); INSERT INTO population VALUES ( null, 'Griffinstown', 'Westmeath', 493, 498, 558, 573 ); INSERT INTO population VALUES ( null, 'Heathstown', 'Westmeath', 642, 672, 706, 713 ); INSERT INTO population VALUES ( null, 'Hopestown', 'Westmeath', 531, 557, 588, 559 ); INSERT INTO population VALUES ( null, 'Huntingdon', 'Westmeath', 305, 329, 401, 428 ); INSERT INTO population VALUES ( null, 'Jamestown', 'Westmeath', 128, 127, 129, 127 ); INSERT INTO population VALUES ( null, 'Kilbeggan', 'Westmeath', 997, 1232, 1523, 1606 ); INSERT INTO population VALUES ( null, 'Kilbixy', 'Westmeath', 586, 599, 612, 605 ); INSERT INTO population VALUES ( null, 'Killare', 'Westmeath', 355, 353, 362, 361 ); INSERT INTO population VALUES ( null, 'Killucan', 'Westmeath', 1028, 1247, 1682, 1820 ); INSERT INTO population VALUES ( null, 'Kinnegad', 'Westmeath', 1429, 2379, 2830, 2912 ); INSERT INTO population VALUES ( null, 'Knockdrim', 'Westmeath', 478, 515, 554, 585 ); INSERT INTO population VALUES ( null, 'Lauree', 'Westmeath', 181, 207, 214, 205 ); INSERT INTO population VALUES ( null, 'Middleton', 'Westmeath', 280, 282, 321, 357 ); INSERT INTO population VALUES ( null, 'Milltown', 'Westmeath', 315, 319, 300, 300 ); INSERT INTO population VALUES ( null, 'Mullingar Rural', 'Westmeath', 7012, 9652, 10356, 10761 ); INSERT INTO population VALUES ( null, 'Mullingar North Urban', 'Westmeath', 5366, 5308, 5315, 5599 ); INSERT INTO population VALUES ( null, 'Mullingar South Urban', 'Westmeath', 3458, 3632, 4099, 4387 ); INSERT INTO population VALUES ( null, 'Multyfarnham', 'Westmeath', 439, 467, 605, 630 ); INSERT INTO population VALUES ( null, 'Newtown', 'Westmeath', 203, 239, 216, 234 ); INSERT INTO population VALUES ( null, 'Owel', 'Westmeath', 494, 436, 421, 440 ); INSERT INTO population VALUES ( null, 'Portloman', 'Westmeath', 297, 312, 328, 325 ); INSERT INTO population VALUES ( null, 'Raharney', 'Westmeath', 488, 533, 513, 509 ); INSERT INTO population VALUES ( null, 'Rahugh', 'Westmeath', 300, 300, 297, 273 ); INSERT INTO population VALUES ( null, 'Rathconrath', 'Westmeath', 294, 325, 355, 352 ); INSERT INTO population VALUES ( null, 'Russellstown', 'Westmeath', 436, 476, 512, 498 ); INSERT INTO population VALUES ( null, 'Skeagh', 'Westmeath', 189, 205, 243, 246 ); INSERT INTO population VALUES ( null, 'Sonna', 'Westmeath', 257, 296, 298, 316 ); INSERT INTO population VALUES ( null, 'Stonehall', 'Westmeath', 188, 218, 226, 206 ); INSERT INTO population VALUES ( null, 'Streamstown', 'Westmeath', 338, 365, 362, 377 ); INSERT INTO population VALUES ( null, 'Taghmon', 'Westmeath', 354, 378, 390, 393 ); INSERT INTO population VALUES ( null, 'Tullaghan', 'Westmeath', 389, 378, 391, 418 ); INSERT INTO population VALUES ( null, 'Woodland', 'Westmeath', 311, 308, 299, 276 ); INSERT INTO population VALUES ( null, 'Enniscorthy Urban', 'Wexford', 3166, 2723, 2384, 2671 ); INSERT INTO population VALUES ( null, 'New Ross Urban', 'Wexford', 4402, 4034, 3907, 3751 ); INSERT INTO population VALUES ( null, 'Rosbercon Urban', 'Wexford', 408, 643, 626, 642 ); INSERT INTO population VALUES ( null, 'Wexford No. 1 Urban', 'Wexford', 1846, 1699, 1581, 1612 ); INSERT INTO population VALUES ( null, 'Wexford No. 2 Urban', 'Wexford', 4823, 4559, 4126, 4079 ); INSERT INTO population VALUES ( null, 'Wexford No. 3 Urban', 'Wexford', 1351, 1372, 1321, 1241 ); INSERT INTO population VALUES ( null, 'Ballindaggan', 'Wexford', 600, 699, 806, 803 ); INSERT INTO population VALUES ( null, 'Ballycarney', 'Wexford', 311, 373, 432, 434 ); INSERT INTO population VALUES ( null, 'Ballyhoge', 'Wexford', 952, 1063, 1216, 1241 ); INSERT INTO population VALUES ( null, 'Ballyhuskard', 'Wexford', 1101, 1331, 1589, 1579 ); INSERT INTO population VALUES ( null, 'Ballymore', 'Wexford', 327, 404, 450, 486 ); INSERT INTO population VALUES ( null, 'Ballyvaldon', 'Wexford', 579, 653, 698, 733 ); INSERT INTO population VALUES ( null, 'Bolaboy', 'Wexford', 782, 990, 1161, 1235 ); INSERT INTO population VALUES ( null, 'Bree', 'Wexford', 1058, 1171, 1386, 1359 ); INSERT INTO population VALUES ( null, 'Castleboro', 'Wexford', 741, 822, 860, 942 ); INSERT INTO population VALUES ( null, 'Castledockrell', 'Wexford', 401, 408, 413, 427 ); INSERT INTO population VALUES ( null, 'Castle Ellis', 'Wexford', 909, 1025, 1094, 1115 ); INSERT INTO population VALUES ( null, 'Castle Talbot', 'Wexford', 553, 638, 776, 857 ); INSERT INTO population VALUES ( null, 'Clonroche', 'Wexford', 1087, 1152, 1286, 1251 ); INSERT INTO population VALUES ( null, 'Edermine', 'Wexford', 1097, 1362, 1474, 1481 ); INSERT INTO population VALUES ( null, 'Enniscorthy Rural', 'Wexford', 7385, 8384, 9577, 9949 ); INSERT INTO population VALUES ( null, 'Ferns', 'Wexford', 1230, 1201, 1513, 1557 ); INSERT INTO population VALUES ( null, 'Kilbora', 'Wexford', 356, 363, 390, 381 ); INSERT INTO population VALUES ( null, 'Kilcormick', 'Wexford', 433, 517, 633, 683 ); INSERT INTO population VALUES ( null, 'Killann', 'Wexford', 943, 999, 1001, 1016 ); INSERT INTO population VALUES ( null, 'Kilmallock', 'Wexford', 868, 1066, 1389, 1445 ); INSERT INTO population VALUES ( null, 'Killoughrum', 'Wexford', 584, 615, 771, 846 ); INSERT INTO population VALUES ( null, 'Kilrush', 'Wexford', 391, 430, 449, 464 ); INSERT INTO population VALUES ( null, 'Kiltealy', 'Wexford', 408, 455, 461, 457 ); INSERT INTO population VALUES ( null, 'Marshalstown', 'Wexford', 976, 1068, 1073, 1076 ); INSERT INTO population VALUES ( null, 'Moyacomb', 'Wexford', 357, 473, 444, 407 ); INSERT INTO population VALUES ( null, 'Newtownbarry', 'Wexford', 1878, 2326, 2315, 2273 ); INSERT INTO population VALUES ( null, 'Rossard', 'Wexford', 356, 391, 431, 450 ); INSERT INTO population VALUES ( null, 'St. Marys', 'Wexford', 467, 549, 664, 699 ); INSERT INTO population VALUES ( null, 'The Harrow', 'Wexford', 432, 461, 475, 467 ); INSERT INTO population VALUES ( null, 'The Leap', 'Wexford', 821, 886, 964, 984 ); INSERT INTO population VALUES ( null, 'Tinnacross', 'Wexford', 757, 810, 952, 981 ); INSERT INTO population VALUES ( null, 'Tombrack', 'Wexford', 551, 613, 689, 729 ); INSERT INTO population VALUES ( null, 'Ardamine', 'Wexford', 1227, 2340, 3293, 3665 ); INSERT INTO population VALUES ( null, 'Balloughter', 'Wexford', 418, 443, 482, 502 ); INSERT INTO population VALUES ( null, 'Ballybeg', 'Wexford', 381, 424, 557, 596 ); INSERT INTO population VALUES ( null, 'Ballycanew', 'Wexford', 795, 1009, 1102, 1158 ); INSERT INTO population VALUES ( null, 'Ballyellis', 'Wexford', 294, 352, 373, 412 ); INSERT INTO population VALUES ( null, 'Ballygarrett', 'Wexford', 684, 736, 831, 826 ); INSERT INTO population VALUES ( null, 'Ballylarkin', 'Wexford', 596, 794, 837, 854 ); INSERT INTO population VALUES ( null, 'Ballynestragh', 'Wexford', 822, 989, 1087, 1196 ); INSERT INTO population VALUES ( null, 'Cahore', 'Wexford', 327, 374, 415, 440 ); INSERT INTO population VALUES ( null, 'Coolgreany', 'Wexford', 944, 1031, 1080, 1142 ); INSERT INTO population VALUES ( null, 'Courtown', 'Wexford', 2026, 2121, 2317, 2622 ); INSERT INTO population VALUES ( null, 'Ford', 'Wexford', 405, 448, 538, 538 ); INSERT INTO population VALUES ( null, 'Gorey Rural', 'Wexford', 2819, 4321, 6161, 6861 ); INSERT INTO population VALUES ( null, 'Gorey Urban', 'Wexford', 3090, 3479, 3463, 3505 ); INSERT INTO population VALUES ( null, 'Huntingtown', 'Wexford', 202, 257, 319, 316 ); INSERT INTO population VALUES ( null, 'Kilcomb', 'Wexford', 764, 928, 1036, 1092 ); INSERT INTO population VALUES ( null, 'Kilgorman', 'Wexford', 517, 694, 803, 830 ); INSERT INTO population VALUES ( null, 'Killenagh', 'Wexford', 390, 484, 549, 549 ); INSERT INTO population VALUES ( null, 'Killincooly', 'Wexford', 416, 464, 543, 607 ); INSERT INTO population VALUES ( null, 'Kilnahue', 'Wexford', 286, 346, 409, 447 ); INSERT INTO population VALUES ( null, 'Limerick', 'Wexford', 514, 635, 835, 943 ); INSERT INTO population VALUES ( null, 'Monamolin', 'Wexford', 459, 658, 754, 787 ); INSERT INTO population VALUES ( null, 'Monaseed', 'Wexford', 481, 554, 636, 681 ); INSERT INTO population VALUES ( null, 'Rossminoge', 'Wexford', 453, 501, 564, 609 ); INSERT INTO population VALUES ( null, 'Wells', 'Wexford', 559, 635, 755, 762 ); INSERT INTO population VALUES ( null, 'Wingfield', 'Wexford', 594, 791, 937, 962 ); INSERT INTO population VALUES ( null, 'Adamstown', 'Wexford', 457, 441, 550, 595 ); INSERT INTO population VALUES ( null, 'Ballyanne', 'Wexford', 681, 716, 785, 792 ); INSERT INTO population VALUES ( null, 'Ballyhack', 'Wexford', 1258, 1232, 1302, 1237 ); INSERT INTO population VALUES ( null, 'Barrack Village', 'Wexford', 100, 95, 92, 78 ); INSERT INTO population VALUES ( null, 'Barronstown', 'Wexford', 465, 522, 580, 582 ); INSERT INTO population VALUES ( null, 'Carnagh', 'Wexford', 433, 459, 505, 523 ); INSERT INTO population VALUES ( null, 'Carrickbyrne', 'Wexford', 542, 545, 534, 559 ); INSERT INTO population VALUES ( null, 'Clongeen', 'Wexford', 834, 874, 911, 891 ); INSERT INTO population VALUES ( null, 'Clonleigh', 'Wexford', 365, 371, 448, 420 ); INSERT INTO population VALUES ( null, 'Dunmain', 'Wexford', 202, 238, 324, 328 ); INSERT INTO population VALUES ( null, 'Fethard', 'Wexford', 862, 919, 890, 849 ); INSERT INTO population VALUES ( null, 'Horetown', 'Wexford', 471, 516, 561, 558 ); INSERT INTO population VALUES ( null, 'Inch', 'Wexford', 399, 431, 508, 550 ); INSERT INTO population VALUES ( null, 'Kilgarvan', 'Wexford', 292, 302, 372, 375 ); INSERT INTO population VALUES ( null, 'Killesk', 'Wexford', 541, 642, 713, 686 ); INSERT INTO population VALUES ( null, 'Kilmokea', 'Wexford', 686, 728, 814, 843 ); INSERT INTO population VALUES ( null, 'Newbawn', 'Wexford', 494, 565, 564, 567 ); INSERT INTO population VALUES ( null, 'New Ross Rural', 'Wexford', 2052, 3367, 4014, 3963 ); INSERT INTO population VALUES ( null, 'Oldcourt', 'Wexford', 595, 670, 704, 735 ); INSERT INTO population VALUES ( null, 'Old Ross', 'Wexford', 343, 409, 449, 473 ); INSERT INTO population VALUES ( null, 'Rathroe', 'Wexford', 612, 738, 838, 828 ); INSERT INTO population VALUES ( null, 'Rochestown', 'Wexford', 192, 233, 235, 247 ); INSERT INTO population VALUES ( null, 'Templeludigan', 'Wexford', 321, 360, 403, 443 ); INSERT INTO population VALUES ( null, 'Templetown', 'Wexford', 461, 575, 585, 577 ); INSERT INTO population VALUES ( null, 'Tintern', 'Wexford', 1252, 1426, 1539, 1603 ); INSERT INTO population VALUES ( null, 'Whitechurch', 'Wexford', 492, 541, 586, 631 ); INSERT INTO population VALUES ( null, 'Whitemoor', 'Wexford', 522, 507, 584, 572 ); INSERT INTO population VALUES ( null, 'Ardcavan', 'Wexford', 1912, 2575, 2758, 2945 ); INSERT INTO population VALUES ( null, 'Ardcolm', 'Wexford', 765, 869, 889, 945 ); INSERT INTO population VALUES ( null, 'Artramon', 'Wexford', 543, 624, 660, 642 ); INSERT INTO population VALUES ( null, 'Aughwilliam', 'Wexford', 397, 439, 522, 528 ); INSERT INTO population VALUES ( null, 'Ballymitty', 'Wexford', 387, 437, 529, 524 ); INSERT INTO population VALUES ( null, 'Bannow', 'Wexford', 982, 1086, 1194, 1111 ); INSERT INTO population VALUES ( null, 'Bridgetown', 'Wexford', 636, 747, 855, 869 ); INSERT INTO population VALUES ( null, 'Carrick', 'Wexford', 1360, 1514, 1835, 1775 ); INSERT INTO population VALUES ( null, 'Drinagh', 'Wexford', 1149, 1191, 1166, 1137 ); INSERT INTO population VALUES ( null, 'Duncormick', 'Wexford', 503, 528, 615, 626 ); INSERT INTO population VALUES ( null, 'Forth', 'Wexford', 725, 816, 863, 827 ); INSERT INTO population VALUES ( null, 'Glynn', 'Wexford', 354, 484, 564, 582 ); INSERT INTO population VALUES ( null, 'Harperstown', 'Wexford', 338, 423, 497, 527 ); INSERT INTO population VALUES ( null, 'Harristown', 'Wexford', 494, 494, 514, 507 ); INSERT INTO population VALUES ( null, 'Kilbride', 'Wexford', 244, 291, 300, 311 ); INSERT INTO population VALUES ( null, 'Kilcowan', 'Wexford', 458, 472, 521, 491 ); INSERT INTO population VALUES ( null, 'Killag', 'Wexford', 347, 398, 445, 451 ); INSERT INTO population VALUES ( null, 'Killinick', 'Wexford', 788, 815, 836, 876 ); INSERT INTO population VALUES ( null, 'Killurin', 'Wexford', 530, 583, 705, 710 ); INSERT INTO population VALUES ( null, 'Kilmore', 'Wexford', 1913, 1924, 2206, 2240 ); INSERT INTO population VALUES ( null, 'Kilpatrick', 'Wexford', 677, 753, 741, 807 ); INSERT INTO population VALUES ( null, 'Kilscoran', 'Wexford', 693, 861, 967, 955 ); INSERT INTO population VALUES ( null, 'Ladys Island', 'Wexford', 582, 569, 571, 620 ); INSERT INTO population VALUES ( null, 'Mayglass', 'Wexford', 436, 484, 576, 619 ); INSERT INTO population VALUES ( null, 'Newcastle', 'Wexford', 411, 448, 501, 521 ); INSERT INTO population VALUES ( null, 'Rathaspick', 'Wexford', 1431, 1678, 1727, 1763 ); INSERT INTO population VALUES ( null, 'Rosslare', 'Wexford', 1582, 1791, 2057, 2136 ); INSERT INTO population VALUES ( null, 'St. Helens', 'Wexford', 1775, 1907, 2093, 2242 ); INSERT INTO population VALUES ( null, 'Tacumshin', 'Wexford', 385, 460, 528, 527 ); INSERT INTO population VALUES ( null, 'Taghmon', 'Wexford', 1038, 1124, 1078, 1021 ); INSERT INTO population VALUES ( null, 'Tomhaggard', 'Wexford', 561, 588, 594, 585 ); INSERT INTO population VALUES ( null, 'Wexford Rural', 'Wexford', 9761, 10993, 12085, 12476 ); INSERT INTO population VALUES ( null, 'Whitechurch', 'Wexford', 365, 425, 485, 499 ); INSERT INTO population VALUES ( null, 'Arklow No. 1 Urban', 'Wicklow', 7793, 9128, 9817, 9956 ); INSERT INTO population VALUES ( null, 'Arklow No. 2 Urban', 'Wicklow', 2162, 2584, 2953, 3011 ); INSERT INTO population VALUES ( null, 'Bray No. 1', 'Wicklow', 1619, 1700, 1746, 1845 ); INSERT INTO population VALUES ( null, 'Bray No. 2', 'Wicklow', 5972, 6305, 6192, 6410 ); INSERT INTO population VALUES ( null, 'Bray No. 3', 'Wicklow', 6684, 6557, 6424, 6481 ); INSERT INTO population VALUES ( null, 'Rathmichael (Bray)', 'Wicklow', 2450, 2431, 2380, 2418 ); INSERT INTO population VALUES ( null, 'Wicklow Urban', 'Wicklow', 7031, 6930, 6761, 6752 ); INSERT INTO population VALUES ( null, 'Ballinguile', 'Wicklow', 114, 144, 138, 136 ); INSERT INTO population VALUES ( null, 'Baltinglass', 'Wicklow', 1963, 2392, 2614, 2696 ); INSERT INTO population VALUES ( null, 'Blessington', 'Wicklow', 3126, 4001, 4399, 4607 ); INSERT INTO population VALUES ( null, 'Burgage', 'Wicklow', 1003, 1542, 1786, 2063 ); INSERT INTO population VALUES ( null, 'Donaghmore', 'Wicklow', 356, 373, 396, 429 ); INSERT INTO population VALUES ( null, 'Donard', 'Wicklow', 482, 483, 508, 522 ); INSERT INTO population VALUES ( null, 'Dunlavin', 'Wicklow', 1323, 1300, 1327, 1355 ); INSERT INTO population VALUES ( null, 'Eadestown', 'Wicklow', 154, 186, 201, 196 ); INSERT INTO population VALUES ( null, 'Hartstown', 'Wicklow', 270, 283, 276, 272 ); INSERT INTO population VALUES ( null, 'Hollywood', 'Wicklow', 639, 671, 727, 770 ); INSERT INTO population VALUES ( null, 'Humewood', 'Wicklow', 286, 301, 304, 318 ); INSERT INTO population VALUES ( null, 'Imael North', 'Wicklow', 207, 212, 235, 257 ); INSERT INTO population VALUES ( null, 'Imael South', 'Wicklow', 242, 349, 254, 251 ); INSERT INTO population VALUES ( null, 'Kilbride', 'Wicklow', 952, 982, 975, 968 ); INSERT INTO population VALUES ( null, 'Lackan', 'Wicklow', 744, 763, 743, 812 ); INSERT INTO population VALUES ( null, 'Lugglass', 'Wicklow', 150, 143, 155, 166 ); INSERT INTO population VALUES ( null, 'Rathdangan', 'Wicklow', 389, 399, 445, 459 ); INSERT INTO population VALUES ( null, 'Rathsallagh', 'Wicklow', 265, 283, 269, 293 ); INSERT INTO population VALUES ( null, 'Stratford', 'Wicklow', 350, 379, 430, 459 ); INSERT INTO population VALUES ( null, 'Talbotstown', 'Wicklow', 349, 404, 395, 413 ); INSERT INTO population VALUES ( null, 'The Grange', 'Wicklow', 392, 422, 419, 432 ); INSERT INTO population VALUES ( null, 'Tober', 'Wicklow', 419, 453, 524, 514 ); INSERT INTO population VALUES ( null, 'Togher', 'Wicklow', 309, 302, 332, 342 ); INSERT INTO population VALUES ( null, 'Tuckmill', 'Wicklow', 201, 225, 246, 294 ); INSERT INTO population VALUES ( null, 'Delgany', 'Wicklow', 4489, 5158, 5652, 5983 ); INSERT INTO population VALUES ( null, 'Enniskerry', 'Wicklow', 2801, 2696, 2765, 2894 ); INSERT INTO population VALUES ( null, 'Greystones', 'Wicklow', 7315, 7044, 7151, 7259 ); INSERT INTO population VALUES ( null, 'Kilmacanoge', 'Wicklow', 13101, 13772, 14043, 14694 ); INSERT INTO population VALUES ( null, 'Powerscourt', 'Wicklow', 761, 773, 785, 788 ); INSERT INTO population VALUES ( null, 'Altidore', 'Wicklow', 298, 303, 363, 363 ); INSERT INTO population VALUES ( null, 'Arklow Rural', 'Wicklow', 1080, 1067, 1310, 1386 ); INSERT INTO population VALUES ( null, 'Aughrim', 'Wicklow', 1177, 1440, 1760, 1860 ); INSERT INTO population VALUES ( null, 'Avoca', 'Wicklow', 773, 838, 682, 739 ); INSERT INTO population VALUES ( null, 'Ballinaclash', 'Wicklow', 517, 592, 636, 638 ); INSERT INTO population VALUES ( null, 'Ballinacor', 'Wicklow', 230, 258, 309, 346 ); INSERT INTO population VALUES ( null, 'Ballinderry', 'Wicklow', 378, 418, 459, 467 ); INSERT INTO population VALUES ( null, 'Ballyarthur', 'Wicklow', 606, 887, 1024, 1101 ); INSERT INTO population VALUES ( null, 'Ballycullen', 'Wicklow', 249, 217, 269, 333 ); INSERT INTO population VALUES ( null, 'Brockagh', 'Wicklow', 785, 733, 776, 739 ); INSERT INTO population VALUES ( null, 'Calary', 'Wicklow', 262, 283, 302, 332 ); INSERT INTO population VALUES ( null, 'Cronebane', 'Wicklow', 444, 494, 478, 465 ); INSERT INTO population VALUES ( null, 'Dunganstown East', 'Wicklow', 640, 686, 764, 842 ); INSERT INTO population VALUES ( null, 'Dunganstown South', 'Wicklow', 622, 748, 840, 902 ); INSERT INTO population VALUES ( null, 'Dunganstown West', 'Wicklow', 430, 416, 453, 450 ); INSERT INTO population VALUES ( null, 'Ennereilly', 'Wicklow', 368, 393, 382, 411 ); INSERT INTO population VALUES ( null, 'Glendalough', 'Wicklow', 280, 257, 268, 282 ); INSERT INTO population VALUES ( null, 'Glenealy', 'Wicklow', 2453, 2410, 2750, 2750 ); INSERT INTO population VALUES ( null, 'Kilbride', 'Wicklow', 772, 825, 909, 892 ); INSERT INTO population VALUES ( null, 'Kilcoole', 'Wicklow', 4066, 6832, 9834, 10730 ); INSERT INTO population VALUES ( null, 'Killiskey', 'Wicklow', 873, 1010, 1038, 1046 ); INSERT INTO population VALUES ( null, 'Knockrath', 'Wicklow', 206, 209, 239, 246 ); INSERT INTO population VALUES ( null, 'Moneystown', 'Wicklow', 261, 247, 303, 301 ); INSERT INTO population VALUES ( null, 'Newcastle Lower', 'Wicklow', 1806, 2098, 2209, 2339 ); INSERT INTO population VALUES ( null, 'Newcastle Upper', 'Wicklow', 3261, 3161, 3584, 4004 ); INSERT INTO population VALUES ( null, 'Oldtown', 'Wicklow', 511, 544, 583, 613 ); INSERT INTO population VALUES ( null, 'Rathdrum', 'Wicklow', 2123, 2237, 2448, 2534 ); INSERT INTO population VALUES ( null, 'Togher', 'Wicklow', 788, 909, 1204, 1382 ); INSERT INTO population VALUES ( null, 'Trooperstown', 'Wicklow', 249, 303, 348, 336 ); INSERT INTO population VALUES ( null, 'Wicklow Rural', 'Wicklow', 4590, 5872, 7429, 8095 ); INSERT INTO population VALUES ( null, 'Aghowle', 'Wicklow', 212, 236, 213, 238 ); INSERT INTO population VALUES ( null, 'Ballingate', 'Wicklow', 397, 388, 398, 403 ); INSERT INTO population VALUES ( null, 'Ballinglen', 'Wicklow', 228, 231, 230, 211 ); INSERT INTO population VALUES ( null, 'Ballybeg', 'Wicklow', 171, 187, 201, 184 ); INSERT INTO population VALUES ( null, 'Carnew', 'Wicklow', 1407, 1573, 1759, 1708 ); INSERT INTO population VALUES ( null, 'Coolattin', 'Wicklow', 266, 264, 290, 278 ); INSERT INTO population VALUES ( null, 'Coolballintaggart', 'Wicklow', 398, 420, 461, 492 ); INSERT INTO population VALUES ( null, 'Coolboy', 'Wicklow', 422, 462, 546, 585 ); INSERT INTO population VALUES ( null, 'Cronelea', 'Wicklow', 187, 173, 190, 175 ); INSERT INTO population VALUES ( null, 'Kilballyowen', 'Wicklow', 253, 292, 345, 346 ); INSERT INTO population VALUES ( null, 'Killinure', 'Wicklow', 346, 352, 340, 334 ); INSERT INTO population VALUES ( null, 'Kilpipe', 'Wicklow', 339, 380, 406, 428 ); INSERT INTO population VALUES ( null, 'Money', 'Wicklow', 121, 138, 149, 146 ); INSERT INTO population VALUES ( null, 'Rath', 'Wicklow', 274, 271, 261, 277 ); INSERT INTO population VALUES ( null, 'Shillelagh', 'Wicklow', 467, 562, 595, 586 ); INSERT INTO population VALUES ( null, 'Tinahely', 'Wicklow', 1227, 1508, 1536, 1502 ); INSERT INTO population VALUES ( null, 'Ennis No. 1 Urban', 'Clare', 2017, 1714, 1546, 1430 ); INSERT INTO population VALUES ( null, 'Ennis No. 2 Urban', 'Clare', 2339, 2243, 1767, 1812 ); INSERT INTO population VALUES ( null, 'Ennis No. 3 Urban', 'Clare', 497, 373, 256, 227 ); INSERT INTO population VALUES ( null, 'Ennis No. 4 Urban', 'Clare', 1488, 1593, 1396, 1471 ); INSERT INTO population VALUES ( null, 'Kilrush Urban', 'Clare', 2699, 2657, 2539, 2564 ); INSERT INTO population VALUES ( null, 'Abbey', 'Clare', 385, 442, 448, 461 ); INSERT INTO population VALUES ( null, 'Carran', 'Clare', 82, 115, 105, 116 ); INSERT INTO population VALUES ( null, 'Derreen', 'Clare', 124, 110, 101, 119 ); INSERT INTO population VALUES ( null, 'Drumcreehy', 'Clare', 448, 476, 498, 421 ); INSERT INTO population VALUES ( null, 'Gleninagh', 'Clare', 145, 132, 162, 145 ); INSERT INTO population VALUES ( null, 'Lisdoonvarna', 'Clare', 917, 900, 861, 961 ); INSERT INTO population VALUES ( null, 'Mountelva', 'Clare', 96, 98, 94, 81 ); INSERT INTO population VALUES ( null, '008 Noughaval/Castletown', 'Clare', 189, 184, 208, 198 ); INSERT INTO population VALUES ( null, 'Oughtmama', 'Clare', 135, 129, 128, 120 ); INSERT INTO population VALUES ( null, 'Rathborney', 'Clare', 101, 104, 94, 92 ); INSERT INTO population VALUES ( null, 'Boston', 'Clare', 284, 287, 294, 287 ); INSERT INTO population VALUES ( null, 'Corrofin', 'Clare', 982, 1114, 1248, 1325 ); INSERT INTO population VALUES ( null, '020/017 Glenroe/Ballyeighter', 'Clare', 163, 179, 203, 195 ); INSERT INTO population VALUES ( null, 'Killinaboy', 'Clare', 353, 330, 342, 348 ); INSERT INTO population VALUES ( null, 'Kiltoraght', 'Clare', 181, 188, 195, 191 ); INSERT INTO population VALUES ( null, 'Muckanagh', 'Clare', 267, 283, 319, 299 ); INSERT INTO population VALUES ( null, 'Rath', 'Clare', 245, 240, 275, 255 ); INSERT INTO population VALUES ( null, 'Ruan', 'Clare', 627, 688, 723, 719 ); INSERT INTO population VALUES ( null, 'Clareabbey', 'Clare', 2510, 2610, 2922, 2991 ); INSERT INTO population VALUES ( null, 'Clenagh', 'Clare', 9056, 9795, 10058, 10322 ); INSERT INTO population VALUES ( null, 'Crusheen', 'Clare', 520, 720, 865, 935 ); INSERT INTO population VALUES ( null, 'Doora', 'Clare', 1343, 1580, 1873, 1992 ); INSERT INTO population VALUES ( null, 'Drumline', 'Clare', 789, 741, 852, 970 ); INSERT INTO population VALUES ( null, 'Dysert', 'Clare', 291, 324, 323, 314 ); INSERT INTO population VALUES ( null, 'Ennis Rural', 'Clare', 14023, 16304, 17359, 17675 ); INSERT INTO population VALUES ( null, 'Furroor', 'Clare', 262, 262, 284, 282 ); INSERT INTO population VALUES ( null, 'Kilcloher', 'Clare', 677, 689, 689, 718 ); INSERT INTO population VALUES ( null, 'Killanniv', 'Clare', 584, 726, 775, 764 ); INSERT INTO population VALUES ( null, 'Killone', 'Clare', 492, 521, 582, 614 ); INSERT INTO population VALUES ( null, 'Kilnamona', 'Clare', 699, 738, 852, 876 ); INSERT INTO population VALUES ( null, 'Kilraghtis', 'Clare', 352, 417, 442, 494 ); INSERT INTO population VALUES ( null, 'Kinturk', 'Clare', 278, 276, 258, 250 ); INSERT INTO population VALUES ( null, 'Newmarket', 'Clare', 2114, 1795, 1905, 1957 ); INSERT INTO population VALUES ( null, 'Sixmilebridge', 'Clare', 1754, 2034, 2604, 2682 ); INSERT INTO population VALUES ( null, 'Spancelhill', 'Clare', 545, 795, 694, 700 ); INSERT INTO population VALUES ( null, 'Templemaley', 'Clare', 949, 1079, 1199, 1204 ); INSERT INTO population VALUES ( null, 'Tomfinlough', 'Clare', 518, 591, 654, 663 ); INSERT INTO population VALUES ( null, 'Urlan', 'Clare', 776, 844, 949, 963 ); INSERT INTO population VALUES ( null, 'Annagh', 'Clare', 528, 522, 508, 503 ); INSERT INTO population VALUES ( null, 'Ballagh', 'Clare', 174, 188, 200, 190 ); INSERT INTO population VALUES ( null, 'Ballyea', 'Clare', 617, 661, 714, 753 ); INSERT INTO population VALUES ( null, 'Ballysteen', 'Clare', 330, 277, 363, 339 ); INSERT INTO population VALUES ( null, 'Ballyvaskin', 'Clare', 275, 364, 407, 401 ); INSERT INTO population VALUES ( null, 'Cloghaun', 'Clare', 202, 211, 206, 198 ); INSERT INTO population VALUES ( null, 'Cloonanaha', 'Clare', 318, 284, 282, 268 ); INSERT INTO population VALUES ( null, 'Clooney', 'Clare', 218, 233, 269, 260 ); INSERT INTO population VALUES ( null, 'Ennistimon', 'Clare', 2056, 2101, 2215, 2338 ); INSERT INTO population VALUES ( null, 'Formoyle', 'Clare', 175, 187, 219, 210 ); INSERT INTO population VALUES ( null, 'Kilfenora', 'Clare', 361, 409, 459, 408 ); INSERT INTO population VALUES ( null, 'Killaspuglonane', 'Clare', 259, 225, 270, 274 ); INSERT INTO population VALUES ( null, 'Killilagh', 'Clare', 731, 815, 723, 828 ); INSERT INTO population VALUES ( null, 'Kilshanny', 'Clare', 138, 125, 110, 141 ); INSERT INTO population VALUES ( null, 'Liscannor', 'Clare', 352, 282, 374, 354 ); INSERT INTO population VALUES ( null, 'Lurraga', 'Clare', 203, 263, 245, 258 ); INSERT INTO population VALUES ( null, 'Magherareagh', 'Clare', 301, 319, 297, 288 ); INSERT INTO population VALUES ( null, 'Milltown Malbay', 'Clare', 1517, 1555, 1580, 1621 ); INSERT INTO population VALUES ( null, 'Moy', 'Clare', 603, 625, 645, 689 ); INSERT INTO population VALUES ( null, 'Smithstown', 'Clare', 124, 146, 142, 145 ); INSERT INTO population VALUES ( null, 'Ballynacally', 'Clare', 231, 252, 257, 239 ); INSERT INTO population VALUES ( null, 'Clondagad', 'Clare', 419, 519, 643, 648 ); INSERT INTO population VALUES ( null, 'Coolmeen', 'Clare', 250, 234, 222, 232 ); INSERT INTO population VALUES ( null, 'Kilchreest', 'Clare', 408, 419, 429, 440 ); INSERT INTO population VALUES ( null, 'Kilfiddane', 'Clare', 388, 384, 364, 324 ); INSERT INTO population VALUES ( null, 'Killadysert', 'Clare', 773, 843, 922, 905 ); INSERT INTO population VALUES ( null, 'Killofin', 'Clare', 323, 335, 333, 331 ); INSERT INTO population VALUES ( null, 'Kilmurry', 'Clare', 287, 277, 294, 287 ); INSERT INTO population VALUES ( null, 'Liscasey', 'Clare', 446, 530, 542, 575 ); INSERT INTO population VALUES ( null, 'Lisheen', 'Clare', 469, 510, 569, 585 ); INSERT INTO population VALUES ( null, 'Rinealon', 'Clare', 199, 199, 196, 183 ); INSERT INTO population VALUES ( null, 'Cahermurphy', 'Clare', 210, 220, 196, 201 ); INSERT INTO population VALUES ( null, 'Cloonadrum', 'Clare', 419, 438, 447, 471 ); INSERT INTO population VALUES ( null, 'Clooncoorha', 'Clare', 327, 363, 371, 379 ); INSERT INTO population VALUES ( null, 'Cooraclare', 'Clare', 512, 548, 535, 524 ); INSERT INTO population VALUES ( null, 'Creegh', 'Clare', 453, 458, 466, 422 ); INSERT INTO population VALUES ( null, 'Doonbeg', 'Clare', 596, 701, 761, 765 ); INSERT INTO population VALUES ( null, 'Drumellihy', 'Clare', 399, 406, 447, 418 ); INSERT INTO population VALUES ( null, 'Einagh', 'Clare', 276, 299, 324, 328 ); INSERT INTO population VALUES ( null, 'Glenmore', 'Clare', 380, 346, 354, 335 ); INSERT INTO population VALUES ( null, 'Kilballyowen', 'Clare', 282, 297, 286, 262 ); INSERT INTO population VALUES ( null, 'Kilfearagh', 'Clare', 294, 328, 383, 350 ); INSERT INTO population VALUES ( null, 'Kilkee', 'Clare', 1260, 1325, 1037, 914 ); INSERT INTO population VALUES ( null, 'Killard', 'Clare', 260, 282, 274, 265 ); INSERT INTO population VALUES ( null, 'Killimer', 'Clare', 495, 482, 498, 478 ); INSERT INTO population VALUES ( null, 'Kilmihil', 'Clare', 576, 579, 626, 640 ); INSERT INTO population VALUES ( null, 'Kilmurry', 'Clare', 739, 726, 706, 711 ); INSERT INTO population VALUES ( null, 'Kilrush Rural', 'Clare', 556, 621, 748, 720 ); INSERT INTO population VALUES ( null, 'Knock', 'Clare', 252, 228, 244, 241 ); INSERT INTO population VALUES ( null, 'Knocknaboley', 'Clare', 320, 319, 307, 294 ); INSERT INTO population VALUES ( null, 'Knocknagore', 'Clare', 228, 245, 226, 214 ); INSERT INTO population VALUES ( null, 'Moveen', 'Clare', 86, 83, 94, 86 ); INSERT INTO population VALUES ( null, 'Moyarta', 'Clare', 240, 266, 237, 224 ); INSERT INTO population VALUES ( null, 'Mullagh', 'Clare', 239, 242, 224, 193 ); INSERT INTO population VALUES ( null, 'Querrin', 'Clare', 166, 170, 199, 190 ); INSERT INTO population VALUES ( null, 'Rahona', 'Clare', 396, 379, 349, 328 ); INSERT INTO population VALUES ( null, 'St. Martins', 'Clare', 105, 108, 104, 100 ); INSERT INTO population VALUES ( null, 'Tullig', 'Clare', 137, 144, 121, 110 ); INSERT INTO population VALUES ( null, 'Tullycreen', 'Clare', 141, 136, 133, 149 ); INSERT INTO population VALUES ( null, 'Ballycannan', 'Clare', 1199, 1190, 1144, 1166 ); INSERT INTO population VALUES ( null, 'Ballyglass', 'Clare', 4938, 5379, 5860, 5925 ); INSERT INTO population VALUES ( null, 'Cappavilla', 'Clare', 372, 674, 1038, 847 ); INSERT INTO population VALUES ( null, 'Castlecrine', 'Clare', 308, 355, 443, 474 ); INSERT INTO population VALUES ( null, 'Cloghera', 'Clare', 478, 557, 592, 581 ); INSERT INTO population VALUES ( null, 'Cloontra', 'Clare', 155, 201, 259, 270 ); INSERT INTO population VALUES ( null, 'Cratloe', 'Clare', 1360, 1372, 1439, 1517 ); INSERT INTO population VALUES ( null, 'Fahymore', 'Clare', 273, 300, 333, 338 ); INSERT INTO population VALUES ( null, 'Killeely', 'Clare', 746, 968, 760, 793 ); INSERT INTO population VALUES ( null, 'Killokennedy', 'Clare', 130, 135, 151, 141 ); INSERT INTO population VALUES ( null, 'Kilseily', 'Clare', 568, 657, 729, 737 ); INSERT INTO population VALUES ( null, 'Kiltenanlea', 'Clare', 1585, 1667, 1805, 1906 ); INSERT INTO population VALUES ( null, 'Lackareagh', 'Clare', 111, 114, 135, 133 ); INSERT INTO population VALUES ( null, 'Mountievers', 'Clare', 785, 905, 1226, 1284 ); INSERT INTO population VALUES ( null, 'OBriensbridge', 'Clare', 540, 595, 638, 627 ); INSERT INTO population VALUES ( null, 'Ayle', 'Clare', 284, 309, 290, 233 ); INSERT INTO population VALUES ( null, 'Boherglass', 'Clare', 190, 218, 287, 291 ); INSERT INTO population VALUES ( null, 'Caherhurley', 'Clare', 186, 188, 220, 191 ); INSERT INTO population VALUES ( null, 'Cappaghabaun', 'Clare', 138, 141, 154, 150 ); INSERT INTO population VALUES ( null, 'Carrowbaun', 'Clare', 126, 152, 142, 110 ); INSERT INTO population VALUES ( null, 'Cloonusker', 'Clare', 183, 183, 192, 213 ); INSERT INTO population VALUES ( null, 'Coolreagh', 'Clare', 160, 152, 231, 184 ); INSERT INTO population VALUES ( null, '123 Corlea/Cahermurphy', 'Clare', 187, 168, 182, 170 ); INSERT INTO population VALUES ( null, 'Derrynagittagh', 'Clare', 168, 165, 149, 140 ); INSERT INTO population VALUES ( null, 'Drummaan', 'Clare', 542, 578, 585, 605 ); INSERT INTO population VALUES ( null, 'Feakle', 'Clare', 333, 336, 367, 351 ); INSERT INTO population VALUES ( null, '132/133 Inishcaltra North/Inishcaltra South', 'Clare', 317, 337, 314, 318 ); INSERT INTO population VALUES ( null, 'Killaloe', 'Clare', 1623, 1587, 1826, 2044 ); INSERT INTO population VALUES ( null, 'Mountshannon', 'Clare', 309, 332, 364, 423 ); INSERT INTO population VALUES ( null, 'Ogonnelloe', 'Clare', 577, 605, 696, 743 ); INSERT INTO population VALUES ( null, 'Scarriff', 'Clare', 1277, 1296, 1361, 1280 ); INSERT INTO population VALUES ( null, 'Ballyblood', 'Clare', 95, 111, 123, 154 ); INSERT INTO population VALUES ( null, 'Ballynahinch', 'Clare', 248, 265, 260, 262 ); INSERT INTO population VALUES ( null, 'Caher', 'Clare', 183, 200, 211, 228 ); INSERT INTO population VALUES ( null, 'Clooney', 'Clare', 398, 437, 475, 508 ); INSERT INTO population VALUES ( null, 'Dangan', 'Clare', 152, 209, 221, 225 ); INSERT INTO population VALUES ( null, 'Glendree', 'Clare', 138, 146, 182, 175 ); INSERT INTO population VALUES ( null, 'Kilkishen', 'Clare', 737, 858, 946, 953 ); INSERT INTO population VALUES ( null, 'Killanena', 'Clare', 241, 229, 255, 257 ); INSERT INTO population VALUES ( null, 'Killuran', 'Clare', 368, 395, 412, 416 ); INSERT INTO population VALUES ( null, 'Kiltannon', 'Clare', 137, 182, 198, 196 ); INSERT INTO population VALUES ( null, 'Kyle', 'Clare', 228, 261, 315, 314 ); INSERT INTO population VALUES ( null, 'Loughea', 'Clare', 141, 151, 169, 151 ); INSERT INTO population VALUES ( null, 'Newgrove', 'Clare', 204, 221, 293, 280 ); INSERT INTO population VALUES ( null, 'Quin', 'Clare', 853, 1048, 1454, 1479 ); INSERT INTO population VALUES ( null, 'Rathclooney', 'Clare', 141, 145, 149, 133 ); INSERT INTO population VALUES ( null, 'Rossroe', 'Clare', 651, 666, 745, 733 ); INSERT INTO population VALUES ( null, 'Toberbreeda', 'Clare', 127, 129, 160, 163 ); INSERT INTO population VALUES ( null, 'Tulla', 'Clare', 772, 1028, 1079, 1085 ); INSERT INTO population VALUES ( null, 'Ballinlough A', 'Cork City', 809, 796, 756, 787 ); INSERT INTO population VALUES ( null, 'Ballinlough B', 'Cork City', 1912, 1857, 1740, 1759 ); INSERT INTO population VALUES ( null, 'Ballinlough C', 'Cork City', 1650, 1585, 1495, 1470 ); INSERT INTO population VALUES ( null, 'Ballyphehane A', 'Cork City', 705, 700, 609, 652 ); INSERT INTO population VALUES ( null, 'Ballyphehane B', 'Cork City', 917, 881, 834, 805 ); INSERT INTO population VALUES ( null, 'Bishopstown A', 'Cork City', 1155, 1694, 1326, 2240 ); INSERT INTO population VALUES ( null, 'Bishopstown B', 'Cork City', 2005, 2116, 1950, 1943 ); INSERT INTO population VALUES ( null, 'Bishopstown C', 'Cork City', 5324, 4988, 4726, 4923 ); INSERT INTO population VALUES ( null, 'Bishopstown D', 'Cork City', 1827, 1556, 1473, 1489 ); INSERT INTO population VALUES ( null, 'Bishopstown E', 'Cork City', 3502, 3227, 3072, 3274 ); INSERT INTO population VALUES ( null, 'Blackpool A', 'Cork City', 641, 673, 663, 688 ); INSERT INTO population VALUES ( null, 'Blackpool B', 'Cork City', 1272, 1439, 1827, 2175 ); INSERT INTO population VALUES ( null, 'Browningstown', 'Cork City', 1080, 1035, 1011, 1045 ); INSERT INTO population VALUES ( null, 'Centre A', 'Cork City', 560, 791, 837, 865 ); INSERT INTO population VALUES ( null, 'Centre B', 'Cork City', 1583, 1558, 1935, 2146 ); INSERT INTO population VALUES ( null, 'Churchfield', 'Cork City', 1527, 1398, 1522, 1576 ); INSERT INTO population VALUES ( null, 'City Hall A', 'Cork City', 783, 869, 804, 808 ); INSERT INTO population VALUES ( null, 'City Hall B', 'Cork City', 1106, 1102, 1201, 1175 ); INSERT INTO population VALUES ( null, 'Commons', 'Cork City', 889, 831, 885, 961 ); INSERT INTO population VALUES ( null, 'Evergreen', 'Cork City', 1414, 1340, 1262, 1416 ); INSERT INTO population VALUES ( null, 'Fair Hill A', 'Cork City', 693, 709, 681, 717 ); INSERT INTO population VALUES ( null, 'Fair Hill B', 'Cork City', 919, 821, 777, 749 ); INSERT INTO population VALUES ( null, 'Fair Hill C', 'Cork City', 4378, 4010, 3715, 3604 ); INSERT INTO population VALUES ( null, 'Farranferris A', 'Cork City', 1802, 1616, 1812, 2014 ); INSERT INTO population VALUES ( null, 'Farranferris B', 'Cork City', 1073, 921, 887, 928 ); INSERT INTO population VALUES ( null, 'Farranferris C', 'Cork City', 676, 619, 608, 603 ); INSERT INTO population VALUES ( null, 'Gillabbey A', 'Cork City', 1948, 1639, 1941, 2419 ); INSERT INTO population VALUES ( null, 'Gillabbey B', 'Cork City', 1088, 1058, 928, 1096 ); INSERT INTO population VALUES ( null, 'Gillabbey C', 'Cork City', 1686, 1620, 1563, 2208 ); INSERT INTO population VALUES ( null, 'Glasheen A', 'Cork City', 741, 708, 703, 814 ); INSERT INTO population VALUES ( null, 'Glasheen B', 'Cork City', 728, 687, 723, 687 ); INSERT INTO population VALUES ( null, 'Glasheen C', 'Cork City', 3161, 2881, 2659, 2728 ); INSERT INTO population VALUES ( null, 'Greenmount', 'Cork City', 2265, 1989, 2045, 2061 ); INSERT INTO population VALUES ( null, 'Gurranebraher A', 'Cork City', 821, 787, 763, 772 ); INSERT INTO population VALUES ( null, 'Gurranebraher B', 'Cork City', 681, 596, 565, 582 ); INSERT INTO population VALUES ( null, 'Gurranebraher C', 'Cork City', 1079, 1021, 979, 1050 ); INSERT INTO population VALUES ( null, 'Gurranebraher D', 'Cork City', 1034, 932, 888, 945 ); INSERT INTO population VALUES ( null, 'Gurranebraher E', 'Cork City', 1241, 1067, 1107, 1146 ); INSERT INTO population VALUES ( null, 'Knocknaheeny', 'Cork City', 4439, 4558, 4301, 4050 ); INSERT INTO population VALUES ( null, 'Knockrea A', 'Cork City', 860, 1013, 1472, 1484 ); INSERT INTO population VALUES ( null, 'Knockrea B', 'Cork City', 997, 1205, 1114, 1048 ); INSERT INTO population VALUES ( null, 'Mahon A', 'Cork City', 4168, 4206, 4931, 5072 ); INSERT INTO population VALUES ( null, 'Mahon B', 'Cork City', 4275, 4241, 4843, 4943 ); INSERT INTO population VALUES ( null, 'Mahon C', 'Cork City', 3576, 3477, 3330, 3298 ); INSERT INTO population VALUES ( null, 'Mardyke', 'Cork City', 875, 768, 636, 839 ); INSERT INTO population VALUES ( null, 'Mayfield', 'Cork City', 3562, 3205, 2890, 2928 ); INSERT INTO population VALUES ( null, 'Montenotte A', 'Cork City', 1857, 1752, 1619, 1684 ); INSERT INTO population VALUES ( null, 'Montenotte B', 'Cork City', 2727, 2656, 2494, 2450 ); INSERT INTO population VALUES ( null, 'Pouladuff A', 'Cork City', 892, 826, 799, 736 ); INSERT INTO population VALUES ( null, 'Pouladuff B', 'Cork City', 1829, 1704, 1668, 1668 ); INSERT INTO population VALUES ( null, 'St. Patricks A', 'Cork City', 1352, 1175, 1299, 1607 ); INSERT INTO population VALUES ( null, 'St. Patricks B', 'Cork City', 1274, 1213, 1137, 1166 ); INSERT INTO population VALUES ( null, 'St. Patricks C', 'Cork City', 762, 836, 786, 852 ); INSERT INTO population VALUES ( null, 'Shanakiel', 'Cork City', 3147, 3031, 3423, 3637 ); INSERT INTO population VALUES ( null, 'Shandon A', 'Cork City', 1045, 1264, 1625, 1731 ); INSERT INTO population VALUES ( null, 'Shandon B', 'Cork City', 1183, 1063, 1057, 1388 ); INSERT INTO population VALUES ( null, 'South Gate A', 'Cork City', 1431, 1715, 2003, 2134 ); INSERT INTO population VALUES ( null, 'South Gate B', 'Cork City', 958, 884, 785, 963 ); INSERT INTO population VALUES ( null, 'Sundays Well A', 'Cork City', 731, 662, 649, 700 ); INSERT INTO population VALUES ( null, 'Sundays Well B', 'Cork City', 740, 695, 727, 878 ); INSERT INTO population VALUES ( null, 'The Glen A', 'Cork City', 2363, 2488, 2354, 2459 ); INSERT INTO population VALUES ( null, 'The Glen B', 'Cork City', 4244, 4153, 3775, 3701 ); INSERT INTO population VALUES ( null, 'The Lough', 'Cork City', 1436, 1515, 1396, 1622 ); INSERT INTO population VALUES ( null, 'Tivoli A', 'Cork City', 1452, 1348, 1505, 1695 ); INSERT INTO population VALUES ( null, 'Tivoli B', 'Cork City', 2512, 2624, 2587, 2749 ); INSERT INTO population VALUES ( null, 'Togher A', 'Cork City', 2451, 2055, 2130, 2057 ); INSERT INTO population VALUES ( null, 'Togher B', 'Cork City', 807, 714, 683, 700 ); INSERT INTO population VALUES ( null, 'Tramore A', 'Cork City', 834, 846, 843, 789 ); INSERT INTO population VALUES ( null, 'Tramore B', 'Cork City', 1120, 1040, 1029, 1038 ); INSERT INTO population VALUES ( null, 'Tramore C', 'Cork City', 3047, 3132, 2985, 2968 ); INSERT INTO population VALUES ( null, 'Turners Cross A', 'Cork City', 890, 887, 758, 814 ); INSERT INTO population VALUES ( null, 'Turners Cross B', 'Cork City', 1318, 1213, 1225, 1201 ); INSERT INTO population VALUES ( null, 'Turners Cross C', 'Cork City', 728, 659, 649, 782 ); INSERT INTO population VALUES ( null, 'Turners Cross D', 'Cork City', 505, 478, 451, 471 ); INSERT INTO population VALUES ( null, 'Clonakilty Urban', 'Cork County', 3432, 3745, 4000, 4057 ); INSERT INTO population VALUES ( null, 'Cobh Urban', 'Cork County', 6767, 6541, 6500, 6506 ); INSERT INTO population VALUES ( null, 'Fermoy Urban', 'Cork County', 2270, 2275, 2223, 2272 ); INSERT INTO population VALUES ( null, 'Kinsale Urban', 'Cork County', 2257, 2298, 2198, 2413 ); INSERT INTO population VALUES ( null, 'Macroom Urban', 'Cork County', 2836, 3407, 3738, 3928 ); INSERT INTO population VALUES ( null, 'Mallow North Urban', 'Cork County', 3996, 4899, 5795, 6055 ); INSERT INTO population VALUES ( null, 'Mallow South Urban', 'Cork County', 3095, 2965, 2783, 2739 ); INSERT INTO population VALUES ( null, 'Midleton Urban', 'Cork County', 3798, 3934, 3733, 3879 ); INSERT INTO population VALUES ( null, 'Skibbereen Urban', 'Cork County', 2000, 2338, 2568, 2691 ); INSERT INTO population VALUES ( null, 'Youghal Urban', 'Cork County', 6203, 6393, 6990, 7101 ); INSERT INTO population VALUES ( null, 'Ballinadee', 'Cork County', 364, 425, 486, 529 ); INSERT INTO population VALUES ( null, 'Ballygroman', 'Cork County', 977, 1321, 1572, 1675 ); INSERT INTO population VALUES ( null, 'Ballymodan', 'Cork County', 3955, 4250, 4469, 4481 ); INSERT INTO population VALUES ( null, 'Ballymurphy', 'Cork County', 672, 858, 1016, 1017 ); INSERT INTO population VALUES ( null, 'Bandon', 'Cork County', 1578, 1721, 1920, 2000 ); INSERT INTO population VALUES ( null, 'Baurleigh', 'Cork County', 264, 301, 324, 363 ); INSERT INTO population VALUES ( null, 'Bengour', 'Cork County', 234, 256, 279, 294 ); INSERT INTO population VALUES ( null, 'Boulteen', 'Cork County', 434, 550, 645, 652 ); INSERT INTO population VALUES ( null, 'Brinny', 'Cork County', 605, 632, 695, 651 ); INSERT INTO population VALUES ( null, 'Cashel', 'Cork County', 327, 347, 390, 421 ); INSERT INTO population VALUES ( null, 'Inishannon', 'Cork County', 1424, 1674, 1788, 1963 ); INSERT INTO population VALUES ( null, 'Kilbonane', 'Cork County', 885, 1121, 1271, 1269 ); INSERT INTO population VALUES ( null, 'Kilbrittain', 'Cork County', 513, 559, 595, 632 ); INSERT INTO population VALUES ( null, 'Kilbrogan', 'Cork County', 1500, 1529, 1999, 2382 ); INSERT INTO population VALUES ( null, 'Knockavilly', 'Cork County', 367, 384, 427, 464 ); INSERT INTO population VALUES ( null, 'Knockroe', 'Cork County', 527, 591, 690, 703 ); INSERT INTO population VALUES ( null, 'Moviddy', 'Cork County', 1107, 1288, 1396, 1422 ); INSERT INTO population VALUES ( null, 'Murragh', 'Cork County', 368, 423, 464, 524 ); INSERT INTO population VALUES ( null, 'Rathclarin', 'Cork County', 526, 597, 702, 699 ); INSERT INTO population VALUES ( null, 'Teadies', 'Cork County', 745, 815, 908, 919 ); INSERT INTO population VALUES ( null, 'Templemartin', 'Cork County', 591, 681, 736, 798 ); INSERT INTO population VALUES ( null, 'Ahil', 'Cork County', 229, 195, 221, 209 ); INSERT INTO population VALUES ( null, '033/046 Bantry Rural/Whiddy', 'Cork County', 981, 1033, 1092, 1095 ); INSERT INTO population VALUES ( null, 'Bantry Urban', 'Cork County', 3150, 3307, 3348, 3226 ); INSERT INTO population VALUES ( null, 'Douce', 'Cork County', 234, 238, 216, 226 ); INSERT INTO population VALUES ( null, 'Durrus East', 'Cork County', 238, 265, 291, 271 ); INSERT INTO population VALUES ( null, 'Durrus West', 'Cork County', 621, 650, 683, 608 ); INSERT INTO population VALUES ( null, 'Glanlough', 'Cork County', 202, 194, 180, 200 ); INSERT INTO population VALUES ( null, 'Glengarriff', 'Cork County', 875, 1019, 1085, 1057 ); INSERT INTO population VALUES ( null, 'Kealkill', 'Cork County', 400, 504, 543, 561 ); INSERT INTO population VALUES ( null, 'Kilcaskan', 'Cork County', 755, 760, 814, 747 ); INSERT INTO population VALUES ( null, 'Mealagh', 'Cork County', 295, 334, 354, 369 ); INSERT INTO population VALUES ( null, 'Scart', 'Cork County', 330, 349, 346, 338 ); INSERT INTO population VALUES ( null, 'Seefin', 'Cork County', 212, 234, 305, 299 ); INSERT INTO population VALUES ( null, 'Sheepshead', 'Cork County', 162, 178, 195, 177 ); INSERT INTO population VALUES ( null, 'Adrigole', 'Cork County', 479, 461, 467, 445 ); INSERT INTO population VALUES ( null, 'Bear', 'Cork County', 207, 187, 216, 167 ); INSERT INTO population VALUES ( null, 'Coulagh', 'Cork County', 519, 507, 525, 533 ); INSERT INTO population VALUES ( null, 'Curryglass', 'Cork County', 345, 362, 385, 434 ); INSERT INTO population VALUES ( null, 'Kilcatherine', 'Cork County', 766, 794, 804, 806 ); INSERT INTO population VALUES ( null, 'Killaconenagh', 'Cork County', 1478, 1463, 1518, 1478 ); INSERT INTO population VALUES ( null, 'Kilnamanagh', 'Cork County', 398, 372, 382, 341 ); INSERT INTO population VALUES ( null, 'Abbeymahon', 'Cork County', 570, 594, 636, 635 ); INSERT INTO population VALUES ( null, 'Ardfield', 'Cork County', 609, 670, 713, 749 ); INSERT INTO population VALUES ( null, 'Argideen', 'Cork County', 320, 340, 381, 365 ); INSERT INTO population VALUES ( null, 'Butlerstown', 'Cork County', 393, 401, 433, 412 ); INSERT INTO population VALUES ( null, 'Cahermore', 'Cork County', 370, 366, 394, 381 ); INSERT INTO population VALUES ( null, 'Castleventry', 'Cork County', 221, 258, 259, 290 ); INSERT INTO population VALUES ( null, 'Clonakilty Rural', 'Cork County', 1163, 1503, 1793, 1934 ); INSERT INTO population VALUES ( null, 'Coolcraheen', 'Cork County', 559, 638, 660, 660 ); INSERT INTO population VALUES ( null, 'Courtmacsherry', 'Cork County', 539, 526, 770, 864 ); INSERT INTO population VALUES ( null, 'Derry', 'Cork County', 422, 451, 509, 554 ); INSERT INTO population VALUES ( null, 'Kilkerranmore', 'Cork County', 476, 463, 514, 513 ); INSERT INTO population VALUES ( null, 'Kilmaloda East', 'Cork County', 267, 319, 322, 340 ); INSERT INTO population VALUES ( null, 'Kilmaloda West', 'Cork County', 211, 202, 205, 214 ); INSERT INTO population VALUES ( null, 'Kilmoylerane', 'Cork County', 230, 260, 315, 309 ); INSERT INTO population VALUES ( null, 'Kilnagross', 'Cork County', 552, 580, 565, 576 ); INSERT INTO population VALUES ( null, 'Knocks', 'Cork County', 272, 323, 345, 330 ); INSERT INTO population VALUES ( null, 'Rathbarry', 'Cork County', 445, 466, 468, 485 ); INSERT INTO population VALUES ( null, 'Rosscarbery', 'Cork County', 862, 929, 981, 995 ); INSERT INTO population VALUES ( null, 'Rossmore', 'Cork County', 258, 274, 316, 342 ); INSERT INTO population VALUES ( null, 'Templeomalus', 'Cork County', 660, 708, 720, 759 ); INSERT INTO population VALUES ( null, 'Timoleague', 'Cork County', 560, 662, 677, 740 ); INSERT INTO population VALUES ( null, 'Ballincollig', 'Cork County', 15119, 16308, 17965, 18872 ); INSERT INTO population VALUES ( null, 'Ballygarvan', 'Cork County', 1335, 1617, 1722, 1787 ); INSERT INTO population VALUES ( null, 'Ballynaglogh', 'Cork County', 322, 357, 427, 424 ); INSERT INTO population VALUES ( null, 'Bishopstown (part)', 'Cork County', 113, 104, 217, 367 ); INSERT INTO population VALUES ( null, 'Blackpool', 'Cork County', 778, 870, 955, 969 ); INSERT INTO population VALUES ( null, 'Blarney', 'Cork County', 4917, 5224, 5310, 5603 ); INSERT INTO population VALUES ( null, 'Caherlag', 'Cork County', 5270, 6555, 6958, 7480 ); INSERT INTO population VALUES ( null, 'Carrigaline', 'Cork County', 9343, 10969, 11818, 12111 ); INSERT INTO population VALUES ( null, 'Carrignavar', 'Cork County', 997, 1179, 1189, 1225 ); INSERT INTO population VALUES ( null, 'Carrigrohane Beg', 'Cork County', 1691, 1563, 1425, 1483 ); INSERT INTO population VALUES ( null, 'Cobh Rural', 'Cork County', 4614, 6339, 7534, 8270 ); INSERT INTO population VALUES ( null, 'Douglas', 'Cork County', 15999, 18182, 20397, 20913 ); INSERT INTO population VALUES ( null, 'Dripsey', 'Cork County', 1323, 1377, 1466, 1490 ); INSERT INTO population VALUES ( null, 'Dunderrow', 'Cork County', 1323, 1477, 1609, 1655 ); INSERT INTO population VALUES ( null, 'Firmount', 'Cork County', 489, 577, 666, 689 ); INSERT INTO population VALUES ( null, 'Glenville', 'Cork County', 339, 480, 636, 672 ); INSERT INTO population VALUES ( null, 'Greenfort', 'Cork County', 634, 689, 736, 784 ); INSERT INTO population VALUES ( null, 'Inishkenny', 'Cork County', 4914, 5314, 5522, 5637 ); INSERT INTO population VALUES ( null, 'Killeagh', 'Cork County', 526, 575, 605, 656 ); INSERT INTO population VALUES ( null, 'Knockantota', 'Cork County', 598, 803, 968, 974 ); INSERT INTO population VALUES ( null, 'Knockraha', 'Cork County', 781, 1132, 1358, 1464 ); INSERT INTO population VALUES ( null, 'Lehenagh', 'Cork County', 8102, 9534, 9898, 10267 ); INSERT INTO population VALUES ( null, 'Matehy', 'Cork County', 2593, 2579, 2783, 3011 ); INSERT INTO population VALUES ( null, 'Monkstown Rural', 'Cork County', 779, 832, 1007, 1083 ); INSERT INTO population VALUES ( null, 'Monkstown Urban', 'Cork County', 4184, 4818, 5122, 5234 ); INSERT INTO population VALUES ( null, 'Ovens', 'Cork County', 1047, 1703, 2090, 2331 ); INSERT INTO population VALUES ( null, 'Rathcooney (part)', 'Cork County', 6593, 7118, 8181, 8555 ); INSERT INTO population VALUES ( null, 'Riverstown', 'Cork County', 4285, 4451, 4565, 4483 ); INSERT INTO population VALUES ( null, 'St. Marys (part)', 'Cork County', 4100, 4611, 5158, 5522 ); INSERT INTO population VALUES ( null, 'Whitechurch', 'Cork County', 1833, 2183, 2813, 2999 ); INSERT INTO population VALUES ( null, 'Aultagh', 'Cork County', 306, 327, 335, 356 ); INSERT INTO population VALUES ( null, 'Ballingurteen', 'Cork County', 501, 545, 643, 692 ); INSERT INTO population VALUES ( null, 'Ballymoney', 'Cork County', 779, 785, 808, 776 ); INSERT INTO population VALUES ( null, 'Bal tha an Ghaorthaidh', 'Cork County', 239, 240, 210, 218 ); INSERT INTO population VALUES ( null, 'Bealock', 'Cork County', 284, 270, 272, 290 ); INSERT INTO population VALUES ( null, 'Carrigboy', 'Cork County', 410, 453, 491, 495 ); INSERT INTO population VALUES ( null, 'Castletown', 'Cork County', 387, 404, 459, 470 ); INSERT INTO population VALUES ( null, 'Coolmountain', 'Cork County', 430, 443, 429, 429 ); INSERT INTO population VALUES ( null, 'Drinagh', 'Cork County', 207, 206, 225, 239 ); INSERT INTO population VALUES ( null, 'Dunmanway North', 'Cork County', 1161, 1060, 1048, 1048 ); INSERT INTO population VALUES ( null, 'Dunmanway South', 'Cork County', 1167, 1339, 1359, 1442 ); INSERT INTO population VALUES ( null, 'Garrown', 'Cork County', 264, 262, 290, 275 ); INSERT INTO population VALUES ( null, 'Kinneigh', 'Cork County', 389, 381, 416, 457 ); INSERT INTO population VALUES ( null, 'Manch', 'Cork County', 477, 547, 596, 581 ); INSERT INTO population VALUES ( null, 'Milane', 'Cork County', 201, 178, 199, 159 ); INSERT INTO population VALUES ( null, 'Teerelton', 'Cork County', 469, 497, 579, 593 ); INSERT INTO population VALUES ( null, 'Aghern', 'Cork County', 198, 189, 231, 241 ); INSERT INTO population VALUES ( null, 'Ballyhooly', 'Cork County', 531, 606, 778, 845 ); INSERT INTO population VALUES ( null, 'Ballynoe', 'Cork County', 482, 590, 661, 694 ); INSERT INTO population VALUES ( null, 'Carrig', 'Cork County', 114, 133, 145, 153 ); INSERT INTO population VALUES ( null, 'Castlecooke', 'Cork County', 165, 167, 195, 204 ); INSERT INTO population VALUES ( null, 'Castle Hyde', 'Cork County', 659, 751, 767, 824 ); INSERT INTO population VALUES ( null, 'Castlelyons', 'Cork County', 918, 957, 1040, 1140 ); INSERT INTO population VALUES ( null, 'Castletownroche', 'Cork County', 793, 822, 857, 893 ); INSERT INTO population VALUES ( null, 'Coole', 'Cork County', 738, 768, 1050, 1142 ); INSERT INTO population VALUES ( null, 'Curraglass', 'Cork County', 346, 355, 363, 382 ); INSERT INTO population VALUES ( null, 'Fermoy Rural', 'Cork County', 3110, 4276, 4808, 4859 ); INSERT INTO population VALUES ( null, 'Glanworth East', 'Cork County', 392, 408, 406, 427 ); INSERT INTO population VALUES ( null, 'Glanworth West', 'Cork County', 811, 908, 1029, 1113 ); INSERT INTO population VALUES ( null, 'Gortnaskehy', 'Cork County', 263, 295, 320, 320 ); INSERT INTO population VALUES ( null, 'Gortroe', 'Cork County', 586, 650, 743, 755 ); INSERT INTO population VALUES ( null, 'Kilcor', 'Cork County', 338, 330, 377, 402 ); INSERT INTO population VALUES ( null, 'Kilcummer', 'Cork County', 240, 244, 244, 257 ); INSERT INTO population VALUES ( null, 'Kildinan', 'Cork County', 452, 522, 589, 607 ); INSERT INTO population VALUES ( null, 'Killathy', 'Cork County', 374, 376, 381, 374 ); INSERT INTO population VALUES ( null, 'Kilworth', 'Cork County', 926, 1170, 1545, 1657 ); INSERT INTO population VALUES ( null, 'Knockmourne', 'Cork County', 840, 1045, 1146, 1233 ); INSERT INTO population VALUES ( null, 'Leitrim', 'Cork County', 284, 306, 353, 357 ); INSERT INTO population VALUES ( null, 'Rathcormack', 'Cork County', 966, 1638, 2107, 2386 ); INSERT INTO population VALUES ( null, 'Watergrasshill', 'Cork County', 739, 1073, 1319, 1464 ); INSERT INTO population VALUES ( null, 'Allow', 'Cork County', 420, 411, 464, 468 ); INSERT INTO population VALUES ( null, 'Ballyhoolahan', 'Cork County', 275, 278, 277, 276 ); INSERT INTO population VALUES ( null, 'Banteer', 'Cork County', 689, 698, 705, 726 ); INSERT INTO population VALUES ( null, 'Barleyhill', 'Cork County', 512, 560, 531, 518 ); INSERT INTO population VALUES ( null, 'Barnacurra', 'Cork County', 227, 214, 219, 211 ); INSERT INTO population VALUES ( null, 'Bawncross', 'Cork County', 346, 352, 325, 345 ); INSERT INTO population VALUES ( null, 'Boherboy', 'Cork County', 676, 662, 655, 618 ); INSERT INTO population VALUES ( null, 'Castlecor', 'Cork County', 339, 323, 412, 411 ); INSERT INTO population VALUES ( null, 'Castlemagner', 'Cork County', 368, 378, 582, 620 ); INSERT INTO population VALUES ( null, 'Clonfert East', 'Cork County', 357, 383, 373, 381 ); INSERT INTO population VALUES ( null, 'Clonfert West', 'Cork County', 188, 174, 164, 163 ); INSERT INTO population VALUES ( null, 'Clonmeen', 'Cork County', 234, 260, 279, 285 ); INSERT INTO population VALUES ( null, 'Coolclogh', 'Cork County', 322, 367, 388, 411 ); INSERT INTO population VALUES ( null, 'Dromina', 'Cork County', 511, 544, 605, 624 ); INSERT INTO population VALUES ( null, 'Glenlara', 'Cork County', 339, 342, 399, 410 ); INSERT INTO population VALUES ( null, 'Gortmore', 'Cork County', 158, 184, 207, 220 ); INSERT INTO population VALUES ( null, 'Greenane', 'Cork County', 981, 1205, 1280, 1281 ); INSERT INTO population VALUES ( null, 'Kanturk', 'Cork County', 1538, 1600, 1886, 1912 ); INSERT INTO population VALUES ( null, 'Kilbrin', 'Cork County', 280, 325, 349, 330 ); INSERT INTO population VALUES ( null, 'Kilmeen', 'Cork County', 298, 309, 345, 351 ); INSERT INTO population VALUES ( null, 'Knockatooan', 'Cork County', 322, 306, 317, 310 ); INSERT INTO population VALUES ( null, 'Knocktemple', 'Cork County', 371, 399, 429, 484 ); INSERT INTO population VALUES ( null, 'Meens', 'Cork County', 546, 484, 461, 459 ); INSERT INTO population VALUES ( null, 'Milford', 'Cork County', 616, 603, 680, 678 ); INSERT INTO population VALUES ( null, 'Nad', 'Cork County', 97, 86, 88, 86 ); INSERT INTO population VALUES ( null, 'Newmarket', 'Cork County', 1595, 1559, 1537, 1515 ); INSERT INTO population VALUES ( null, 'Newtown', 'Cork County', 744, 851, 941, 911 ); INSERT INTO population VALUES ( null, 'Roskeen', 'Cork County', 406, 431, 479, 458 ); INSERT INTO population VALUES ( null, 'Rosnalee', 'Cork County', 402, 377, 364, 357 ); INSERT INTO population VALUES ( null, 'Rowls', 'Cork County', 191, 181, 160, 156 ); INSERT INTO population VALUES ( null, 'Tincoora', 'Cork County', 304, 370, 479, 486 ); INSERT INTO population VALUES ( null, 'Tullylease', 'Cork County', 408, 425, 437, 406 ); INSERT INTO population VALUES ( null, 'Williamstown', 'Cork County', 447, 452, 503, 498 ); INSERT INTO population VALUES ( null, 'Ballinspittle', 'Cork County', 513, 580, 631, 659 ); INSERT INTO population VALUES ( null, 'Ballyfeard', 'Cork County', 271, 327, 358, 373 ); INSERT INTO population VALUES ( null, 'Ballyfoyle', 'Cork County', 234, 274, 355, 363 ); INSERT INTO population VALUES ( null, 'Ballymackean', 'Cork County', 316, 314, 343, 363 ); INSERT INTO population VALUES ( null, 'Ballymartle', 'Cork County', 821, 968, 1185, 1233 ); INSERT INTO population VALUES ( null, 'Carrigaline', 'Cork County', 1769, 1708, 1878, 2452 ); INSERT INTO population VALUES ( null, 'Coolmain', 'Cork County', 402, 406, 404, 454 ); INSERT INTO population VALUES ( null, 'Cullen', 'Cork County', 399, 481, 492, 496 ); INSERT INTO population VALUES ( null, 'Farranbrien', 'Cork County', 460, 492, 518, 537 ); INSERT INTO population VALUES ( null, 'Kilmonoge', 'Cork County', 571, 978, 1235, 1324 ); INSERT INTO population VALUES ( null, 'Kilpatrick', 'Cork County', 362, 371, 479, 529 ); INSERT INTO population VALUES ( null, 'Kinsale Rural', 'Cork County', 3044, 3819, 4673, 4839 ); INSERT INTO population VALUES ( null, 'Kinure', 'Cork County', 290, 292, 306, 357 ); INSERT INTO population VALUES ( null, 'Laherne', 'Cork County', 309, 385, 465, 575 ); INSERT INTO population VALUES ( null, 'Leighmoney', 'Cork County', 505, 633, 743, 779 ); INSERT INTO population VALUES ( null, 'Liscleary', 'Cork County', 3282, 3614, 4385, 4618 ); INSERT INTO population VALUES ( null, 'Nohaval', 'Cork County', 209, 270, 281, 319 ); INSERT INTO population VALUES ( null, 'Templebreedy', 'Cork County', 2696, 3061, 3491, 3794 ); INSERT INTO population VALUES ( null, 'Templemichael', 'Cork County', 620, 670, 695, 736 ); INSERT INTO population VALUES ( null, 'Aghinagh', 'Cork County', 426, 444, 445, 477 ); INSERT INTO population VALUES ( null, 'Aglish', 'Cork County', 1339, 1333, 1366, 1453 ); INSERT INTO population VALUES ( null, 'Bal tha an Ghaorthaidh', 'Cork County', 494, 542, 544, 535 ); INSERT INTO population VALUES ( null, 'Ceann Droma', 'Cork County', 257, 292, 317, 330 ); INSERT INTO population VALUES ( null, 'Cannaway', 'Cork County', 473, 523, 595, 625 ); INSERT INTO population VALUES ( null, 'Claonrth', 'Cork County', 189, 215, 216, 229 ); INSERT INTO population VALUES ( null, 'Clondrohid', 'Cork County', 814, 835, 883, 883 ); INSERT INTO population VALUES ( null, 'Clonmoyle', 'Cork County', 430, 474, 526, 544 ); INSERT INTO population VALUES ( null, 'Doire Fhnn', 'Cork County', 217, 229, 251, 244 ); INSERT INTO population VALUES ( null, 'Gort na Tiobratan', 'Cork County', 426, 420, 450, 451 ); INSERT INTO population VALUES ( null, 'Gowlane', 'Cork County', 905, 1074, 1175, 1180 ); INSERT INTO population VALUES ( null, 'Greenville', 'Cork County', 196, 224, 264, 283 ); INSERT INTO population VALUES ( null, 'Inchigeelagh', 'Cork County', 507, 527, 538, 533 ); INSERT INTO population VALUES ( null, 'Kilberrihert', 'Cork County', 494, 555, 651, 709 ); INSERT INTO population VALUES ( null, 'Kilcullen', 'Cork County', 660, 741, 792, 842 ); INSERT INTO population VALUES ( null, 'Cill na Martra', 'Cork County', 614, 669, 652, 672 ); INSERT INTO population VALUES ( null, 'Macloneigh', 'Cork County', 780, 804, 825, 867 ); INSERT INTO population VALUES ( null, 'Magourney', 'Cork County', 994, 1059, 1065, 1043 ); INSERT INTO population VALUES ( null, 'Mashanaglass', 'Cork County', 432, 442, 445, 447 ); INSERT INTO population VALUES ( null, 'Mountrivers', 'Cork County', 548, 610, 662, 684 ); INSERT INTO population VALUES ( null, 'Rahalisk', 'Cork County', 430, 490, 550, 571 ); INSERT INTO population VALUES ( null, 'An Sliabh Riabhach', 'Cork County', 760, 816, 833, 853 ); INSERT INTO population VALUES ( null, 'Na hUlin', 'Cork County', 537, 612, 632, 600 ); INSERT INTO population VALUES ( null, 'Warrenscourt', 'Cork County', 753, 742, 775, 738 ); INSERT INTO population VALUES ( null, 'Ardskeagh', 'Cork County', 390, 376, 418, 429 ); INSERT INTO population VALUES ( null, 'Ballyclogh', 'Cork County', 579, 641, 681, 702 ); INSERT INTO population VALUES ( null, 'Ballynamona', 'Cork County', 778, 895, 971, 990 ); INSERT INTO population VALUES ( null, 'Buttevant', 'Cork County', 1665, 1659, 1706, 1752 ); INSERT INTO population VALUES ( null, 'Caherduggan', 'Cork County', 444, 507, 540, 618 ); INSERT INTO population VALUES ( null, 'Carrig', 'Cork County', 249, 232, 238, 244 ); INSERT INTO population VALUES ( null, 'Churchtown', 'Cork County', 682, 854, 1079, 1169 ); INSERT INTO population VALUES ( null, 'Clenor', 'Cork County', 313, 336, 328, 333 ); INSERT INTO population VALUES ( null, 'Doneraile', 'Cork County', 1380, 1390, 1390, 1407 ); INSERT INTO population VALUES ( null, 'Dromore', 'Cork County', 1611, 2000, 2518, 2707 ); INSERT INTO population VALUES ( null, 'Imphrick', 'Cork County', 269, 300, 311, 346 ); INSERT INTO population VALUES ( null, 'Kilmaclenine', 'Cork County', 629, 665, 744, 727 ); INSERT INTO population VALUES ( null, 'Kilshannig', 'Cork County', 838, 983, 1076, 1080 ); INSERT INTO population VALUES ( null, 'Liscarroll', 'Cork County', 555, 571, 574, 589 ); INSERT INTO population VALUES ( null, 'Mallow Rural', 'Cork County', 2698, 3347, 4026, 4604 ); INSERT INTO population VALUES ( null, 'Milltown', 'Cork County', 355, 356, 374, 377 ); INSERT INTO population VALUES ( null, 'Monanimy', 'Cork County', 632, 669, 761, 814 ); INSERT INTO population VALUES ( null, 'Rahan', 'Cork County', 762, 795, 916, 885 ); INSERT INTO population VALUES ( null, 'Rathluirc', 'Cork County', 3021, 3368, 4004, 4254 ); INSERT INTO population VALUES ( null, 'Shanballymore', 'Cork County', 487, 543, 623, 631 ); INSERT INTO population VALUES ( null, 'Skahanagh', 'Cork County', 141, 135, 143, 162 ); INSERT INTO population VALUES ( null, 'Springfort', 'Cork County', 541, 593, 606, 619 ); INSERT INTO population VALUES ( null, 'Streamhill', 'Cork County', 125, 125, 123, 94 ); INSERT INTO population VALUES ( null, 'Templemary', 'Cork County', 301, 331, 344, 324 ); INSERT INTO population VALUES ( null, 'Wallstown', 'Cork County', 209, 199, 271, 265 ); INSERT INTO population VALUES ( null, 'Ballintemple', 'Cork County', 441, 455, 537, 544 ); INSERT INTO population VALUES ( null, 'Ballycottin', 'Cork County', 1293, 1407, 1487, 1705 ); INSERT INTO population VALUES ( null, 'Ballyspillane', 'Cork County', 283, 317, 316, 353 ); INSERT INTO population VALUES ( null, 'Carrigtohill', 'Cork County', 3507, 4875, 6665, 7333 ); INSERT INTO population VALUES ( null, 'Castlemartyr', 'Cork County', 873, 872, 919, 1012 ); INSERT INTO population VALUES ( null, 'Clonmult', 'Cork County', 158, 181, 196, 213 ); INSERT INTO population VALUES ( null, 'Cloyne', 'Cork County', 2512, 3196, 3859, 4382 ); INSERT INTO population VALUES ( null, 'Corkbeg', 'Cork County', 1845, 2206, 2571, 2605 ); INSERT INTO population VALUES ( null, 'Dangan', 'Cork County', 160, 203, 253, 265 ); INSERT INTO population VALUES ( null, 'Dungourney', 'Cork County', 479, 536, 664, 752 ); INSERT INTO population VALUES ( null, 'Garryvoe', 'Cork County', 536, 567, 622, 623 ); INSERT INTO population VALUES ( null, 'Ightermurragh', 'Cork County', 1323, 1829, 2340, 2777 ); INSERT INTO population VALUES ( null, 'Inch', 'Cork County', 382, 421, 467, 530 ); INSERT INTO population VALUES ( null, 'Lisgoold', 'Cork County', 609, 762, 949, 999 ); INSERT INTO population VALUES ( null, 'Midleton Rural', 'Cork County', 4675, 6381, 8316, 8916 ); INSERT INTO population VALUES ( null, 'Mogeely', 'Cork County', 362, 457, 592, 604 ); INSERT INTO population VALUES ( null, 'Rostellan', 'Cork County', 798, 943, 1141, 1242 ); INSERT INTO population VALUES ( null, 'Templebodan', 'Cork County', 399, 490, 574, 624 ); INSERT INTO population VALUES ( null, 'Templenacarriga', 'Cork County', 498, 535, 572, 591 ); INSERT INTO population VALUES ( null, 'Caherbarnagh', 'Cork County', 565, 519, 520, 511 ); INSERT INTO population VALUES ( null, 'Coomlogane', 'Cork County', 927, 831, 903, 907 ); INSERT INTO population VALUES ( null, 'Crinnaloo', 'Cork County', 209, 200, 204, 204 ); INSERT INTO population VALUES ( null, 'Cullen', 'Cork County', 434, 416, 429, 422 ); INSERT INTO population VALUES ( null, 'Derragh', 'Cork County', 205, 223, 213, 215 ); INSERT INTO population VALUES ( null, 'Doonasleen', 'Cork County', 387, 422, 489, 468 ); INSERT INTO population VALUES ( null, 'Drishane', 'Cork County', 1423, 1662, 2001, 1957 ); INSERT INTO population VALUES ( null, 'Keale', 'Cork County', 307, 317, 341, 350 ); INSERT INTO population VALUES ( null, 'Kilcorney', 'Cork County', 290, 305, 313, 335 ); INSERT INTO population VALUES ( null, 'Knocknagree', 'Cork County', 635, 630, 601, 596 ); INSERT INTO population VALUES ( null, 'Rathcool', 'Cork County', 418, 426, 542, 554 ); INSERT INTO population VALUES ( null, 'Skagh', 'Cork County', 435, 433, 379, 374 ); INSERT INTO population VALUES ( null, 'Ballyarthur', 'Cork County', 250, 228, 304, 308 ); INSERT INTO population VALUES ( null, 'Derryvillane', 'Cork County', 472, 473, 458, 490 ); INSERT INTO population VALUES ( null, 'Farahy', 'Cork County', 332, 389, 458, 456 ); INSERT INTO population VALUES ( null, 'Kildorrery', 'Cork County', 473, 510, 632, 735 ); INSERT INTO population VALUES ( null, 'Kilgullane', 'Cork County', 132, 122, 135, 151 ); INSERT INTO population VALUES ( null, 'Kilphelan', 'Cork County', 549, 517, 531, 515 ); INSERT INTO population VALUES ( null, 'Marshalstown', 'Cork County', 360, 358, 384, 385 ); INSERT INTO population VALUES ( null, 'Mitchelstown', 'Cork County', 4621, 4821, 5059, 5134 ); INSERT INTO population VALUES ( null, 'Templemolaga', 'Cork County', 300, 286, 295, 308 ); INSERT INTO population VALUES ( null, 'Aghadown North', 'Cork County', 287, 282, 287, 289 ); INSERT INTO population VALUES ( null, 'Aghadown South', 'Cork County', 597, 624, 569, 574 ); INSERT INTO population VALUES ( null, 'Bredagh', 'Cork County', 613, 637, 602, 579 ); INSERT INTO population VALUES ( null, 'Caheragh', 'Cork County', 289, 298, 327, 294 ); INSERT INTO population VALUES ( null, 'Clire', 'Cork County', 346, 319, 332, 341 ); INSERT INTO population VALUES ( null, 'Carrigbaun', 'Cork County', 369, 357, 362, 328 ); INSERT INTO population VALUES ( null, 'Castlehaven North', 'Cork County', 720, 789, 793, 806 ); INSERT INTO population VALUES ( null, 'Castlehaven South', 'Cork County', 396, 408, 450, 498 ); INSERT INTO population VALUES ( null, 'Cloghdonnell', 'Cork County', 364, 345, 346, 354 ); INSERT INTO population VALUES ( null, 'Cloonkeen', 'Cork County', 349, 367, 380, 348 ); INSERT INTO population VALUES ( null, 'Drinagh', 'Cork County', 323, 344, 370, 351 ); INSERT INTO population VALUES ( null, 'Dromdaleague North', 'Cork County', 235, 256, 294, 294 ); INSERT INTO population VALUES ( null, 'Dromdaleague South', 'Cork County', 494, 566, 622, 633 ); INSERT INTO population VALUES ( null, 'Garranes', 'Cork County', 371, 354, 357, 346 ); INSERT INTO population VALUES ( null, 'Gortnascreeny', 'Cork County', 418, 440, 483, 505 ); INSERT INTO population VALUES ( null, 'Kilfaughnabeg', 'Cork County', 520, 498, 536, 540 ); INSERT INTO population VALUES ( null, 'Killeenleagh', 'Cork County', 348, 360, 368, 364 ); INSERT INTO population VALUES ( null, 'Knockskagh', 'Cork County', 510, 570, 545, 535 ); INSERT INTO population VALUES ( null, 'Myross', 'Cork County', 643, 634, 735, 752 ); INSERT INTO population VALUES ( null, 'Shreelane', 'Cork County', 316, 315, 365, 397 ); INSERT INTO population VALUES ( null, 'Skibbereen Rural', 'Cork County', 1146, 1200, 1252, 1294 ); INSERT INTO population VALUES ( null, 'Tullagh', 'Cork County', 798, 772, 791, 730 ); INSERT INTO population VALUES ( null, 'Woodfort', 'Cork County', 404, 394, 377, 361 ); INSERT INTO population VALUES ( null, 'Ballybane', 'Cork County', 233, 254, 303, 267 ); INSERT INTO population VALUES ( null, 'Ballydehob', 'Cork County', 778, 812, 835, 844 ); INSERT INTO population VALUES ( null, 'Coolagh', 'Cork County', 187, 176, 205, 192 ); INSERT INTO population VALUES ( null, 'Crookhaven', 'Cork County', 250, 239, 230, 228 ); INSERT INTO population VALUES ( null, 'Dunbeacon', 'Cork County', 213, 211, 199, 174 ); INSERT INTO population VALUES ( null, 'Dunmanus', 'Cork County', 197, 240, 238, 237 ); INSERT INTO population VALUES ( null, 'Goleen', 'Cork County', 260, 239, 256, 228 ); INSERT INTO population VALUES ( null, 'Kilcoe', 'Cork County', 403, 446, 431, 438 ); INSERT INTO population VALUES ( null, 'Lowertown', 'Cork County', 206, 222, 247, 231 ); INSERT INTO population VALUES ( null, 'Skull', 'Cork County', 1068, 1033, 987, 1056 ); INSERT INTO population VALUES ( null, 'Toormore', 'Cork County', 214, 205, 183, 182 ); INSERT INTO population VALUES ( null, 'Ardagh', 'Cork County', 461, 528, 649, 667 ); INSERT INTO population VALUES ( null, 'Clonpriest', 'Cork County', 799, 904, 1060, 1072 ); INSERT INTO population VALUES ( null, 'Kilcronat', 'Cork County', 114, 131, 174, 181 ); INSERT INTO population VALUES ( null, 'Killeagh', 'Cork County', 893, 1061, 1330, 1560 ); INSERT INTO population VALUES ( null, 'Kilmacdonogh', 'Cork County', 739, 781, 886, 923 ); INSERT INTO population VALUES ( null, 'Youghal Rural', 'Cork County', 801, 774, 1202, 1264 ); INSERT INTO population VALUES ( null, 'Killarney Urban', 'Kerry', 9395, 10194, 9663, 10627 ); INSERT INTO population VALUES ( null, 'Listowel Urban', 'Kerry', 3589, 3901, 4205, 4267 ); INSERT INTO population VALUES ( null, 'Tralee Urban', 'Kerry', 6311, 5456, 4885, 5101 ); INSERT INTO population VALUES ( null, 'Na Beathacha', 'Kerry', 208, 210, 199, 199 ); INSERT INTO population VALUES ( null, 'Baile an Sceilg', 'Kerry', 358, 355, 375, 390 ); INSERT INTO population VALUES ( null, 'An Baile Breac', 'Kerry', 119, 122, 93, 84 ); INSERT INTO population VALUES ( null, 'Caher', 'Kerry', 2043, 2127, 2012, 1824 ); INSERT INTO population VALUES ( null, 'Cathair Dnall', 'Kerry', 335, 348, 312, 316 ); INSERT INTO population VALUES ( null, '020 Ceannig/Mistir Gaoithe', 'Kerry', 232, 249, 233, 214 ); INSERT INTO population VALUES ( null, 'Castlequin', 'Kerry', 528, 544, 585, 598 ); INSERT INTO population VALUES ( null, 'Curraghbeg', 'Kerry', 187, 197, 171, 170 ); INSERT INTO population VALUES ( null, 'Doire Fhonin', 'Kerry', 210, 170, 189, 178 ); INSERT INTO population VALUES ( null, '011 Cloon/Daoire Ianna', 'Kerry', 282, 282, 282, 251 ); INSERT INTO population VALUES ( null, 'An tImleach', 'Kerry', 830, 924, 926, 875 ); INSERT INTO population VALUES ( null, 'Glanbehy', 'Kerry', 1054, 1116, 1037, 1086 ); INSERT INTO population VALUES ( null, 'Killinane', 'Kerry', 271, 273, 255, 256 ); INSERT INTO population VALUES ( null, 'Lickeen', 'Kerry', 105, 118, 106, 111 ); INSERT INTO population VALUES ( null, 'Loch Luoch', 'Kerry', 315, 324, 269, 315 ); INSERT INTO population VALUES ( null, 'Maum', 'Kerry', 257, 266, 270, 274 ); INSERT INTO population VALUES ( null, 'Portmagee', 'Kerry', 363, 376, 390, 414 ); INSERT INTO population VALUES ( null, 'Toghroinn Fhonin', 'Kerry', 137, 154, 161, 164 ); INSERT INTO population VALUES ( null, 'Teeranearagh', 'Kerry', 304, 284, 272, 280 ); INSERT INTO population VALUES ( null, 'Valencia', 'Kerry', 690, 713, 665, 654 ); INSERT INTO population VALUES ( null, 'Ballinvoher', 'Kerry', 421, 509, 530, 558 ); INSERT INTO population VALUES ( null, 'An Baile Dubh', 'Kerry', 137, 119, 131, 107 ); INSERT INTO population VALUES ( null, 'Ballynacourty', 'Kerry', 219, 226, 274, 284 ); INSERT INTO population VALUES ( null, 'C Bhranainn', 'Kerry', 133, 168, 152, 153 ); INSERT INTO population VALUES ( null, 'Castlegregory', 'Kerry', 870, 938, 923, 981 ); INSERT INTO population VALUES ( null, 'An Clochn', 'Kerry', 268, 273, 297, 231 ); INSERT INTO population VALUES ( null, 'Deelis', 'Kerry', 299, 288, 339, 350 ); INSERT INTO population VALUES ( null, 'An Daingean', 'Kerry', 1647, 1775, 1538, 1621 ); INSERT INTO population VALUES ( null, 'Dn Chaoin', 'Kerry', 212, 159, 176, 184 ); INSERT INTO population VALUES ( null, 'Dn Urlann', 'Kerry', 422, 455, 438, 464 ); INSERT INTO population VALUES ( null, 'Na Gleannta', 'Kerry', 1471, 1496, 1823, 1826 ); INSERT INTO population VALUES ( null, 'Inch', 'Kerry', 171, 173, 151, 139 ); INSERT INTO population VALUES ( null, 'Cill Maoilchadair', 'Kerry', 549, 508, 479, 481 ); INSERT INTO population VALUES ( null, 'Cill Chuin', 'Kerry', 453, 462, 443, 433 ); INSERT INTO population VALUES ( null, 'Cinn Aird', 'Kerry', 366, 381, 357, 345 ); INSERT INTO population VALUES ( null, 'Lack', 'Kerry', 274, 283, 312, 270 ); INSERT INTO population VALUES ( null, 'Mrthain', 'Kerry', 243, 276, 246, 260 ); INSERT INTO population VALUES ( null, 'An Mhin Aird', 'Kerry', 383, 387, 388, 369 ); INSERT INTO population VALUES ( null, 'An Sridbhaile', 'Kerry', 230, 207, 229, 240 ); INSERT INTO population VALUES ( null, 'Ceann Tr', 'Kerry', 460, 413, 423, 394 ); INSERT INTO population VALUES ( null, 'Ardea', 'Kerry', 219, 212, 205, 181 ); INSERT INTO population VALUES ( null, 'Banawn', 'Kerry', 206, 214, 222, 234 ); INSERT INTO population VALUES ( null, 'Cappagh', 'Kerry', 312, 333, 367, 411 ); INSERT INTO population VALUES ( null, 'Castlecove', 'Kerry', 311, 293, 319, 303 ); INSERT INTO population VALUES ( null, 'Dawros', 'Kerry', 500, 599, 551, 581 ); INSERT INTO population VALUES ( null, 'Dromore', 'Kerry', 228, 248, 269, 281 ); INSERT INTO population VALUES ( null, 'Glanlee', 'Kerry', 204, 214, 195, 171 ); INSERT INTO population VALUES ( null, 'Glanlough', 'Kerry', 142, 158, 164, 131 ); INSERT INTO population VALUES ( null, 'Glanmore', 'Kerry', 264, 255, 269, 229 ); INSERT INTO population VALUES ( null, 'Greenane', 'Kerry', 255, 248, 246, 237 ); INSERT INTO population VALUES ( null, 'Kenmare', 'Kerry', 2672, 2462, 2912, 3161 ); INSERT INTO population VALUES ( null, 'Kilgarvan', 'Kerry', 599, 633, 665, 662 ); INSERT INTO population VALUES ( null, 'Loughbrin', 'Kerry', 187, 170, 163, 146 ); INSERT INTO population VALUES ( null, 'Reen', 'Kerry', 220, 178, 135, 147 ); INSERT INTO population VALUES ( null, 'Sneem', 'Kerry', 672, 577, 557, 786 ); INSERT INTO population VALUES ( null, 'Tahilla', 'Kerry', 207, 193, 210, 178 ); INSERT INTO population VALUES ( null, 'Aghadoe', 'Kerry', 857, 877, 872, 855 ); INSERT INTO population VALUES ( null, 'Aglish', 'Kerry', 328, 357, 435, 428 ); INSERT INTO population VALUES ( null, 'Ballyhar', 'Kerry', 150, 180, 180, 184 ); INSERT INTO population VALUES ( null, 'Brewsterfield', 'Kerry', 578, 676, 791, 769 ); INSERT INTO population VALUES ( null, 'Caragh', 'Kerry', 809, 852, 881, 947 ); INSERT INTO population VALUES ( null, 'Churchtown', 'Kerry', 391, 461, 518, 480 ); INSERT INTO population VALUES ( null, 'Clydagh', 'Kerry', 119, 126, 128, 118 ); INSERT INTO population VALUES ( null, 'Coolies', 'Kerry', 672, 732, 811, 826 ); INSERT INTO population VALUES ( null, 'Coom', 'Kerry', 1897, 1910, 1983, 1969 ); INSERT INTO population VALUES ( null, 'Curraghmore', 'Kerry', 294, 285, 327, 323 ); INSERT INTO population VALUES ( null, 'Currans', 'Kerry', 237, 258, 283, 271 ); INSERT INTO population VALUES ( null, 'Doocarrig', 'Kerry', 541, 569, 598, 668 ); INSERT INTO population VALUES ( null, 'Dromin', 'Kerry', 699, 654, 764, 798 ); INSERT INTO population VALUES ( null, 'Dunloe', 'Kerry', 727, 790, 759, 850 ); INSERT INTO population VALUES ( null, 'Flesk', 'Kerry', 376, 377, 402, 396 ); INSERT INTO population VALUES ( null, 'Headfort', 'Kerry', 541, 616, 698, 769 ); INSERT INTO population VALUES ( null, 'Kilbonane', 'Kerry', 435, 504, 570, 597 ); INSERT INTO population VALUES ( null, 'Kilcummin', 'Kerry', 1534, 1677, 2026, 2108 ); INSERT INTO population VALUES ( null, 'Kilfelim', 'Kerry', 232, 238, 244, 246 ); INSERT INTO population VALUES ( null, 'Kilgobnet', 'Kerry', 783, 817, 877, 870 ); INSERT INTO population VALUES ( null, 'Killarney Rural', 'Kerry', 5913, 6585, 6472, 6914 ); INSERT INTO population VALUES ( null, 'Killeentierna', 'Kerry', 856, 892, 913, 878 ); INSERT INTO population VALUES ( null, 'Killorglin', 'Kerry', 3517, 3868, 4185, 4373 ); INSERT INTO population VALUES ( null, 'Kilnanare', 'Kerry', 795, 872, 1011, 995 ); INSERT INTO population VALUES ( null, 'Knocknahoe', 'Kerry', 255, 283, 302, 319 ); INSERT INTO population VALUES ( null, 'Lahard', 'Kerry', 546, 595, 709, 748 ); INSERT INTO population VALUES ( null, 'Milltown', 'Kerry', 1202, 1447, 1939, 2142 ); INSERT INTO population VALUES ( null, 'Molahiffe', 'Kerry', 1085, 1384, 1490, 1572 ); INSERT INTO population VALUES ( null, 'Muckross', 'Kerry', 692, 849, 776, 843 ); INSERT INTO population VALUES ( null, 'Rathmore', 'Kerry', 1434, 1647, 1838, 1809 ); INSERT INTO population VALUES ( null, 'Rockfield', 'Kerry', 294, 338, 407, 440 ); INSERT INTO population VALUES ( null, 'Ardagh', 'Kerry', 645, 691, 710, 680 ); INSERT INTO population VALUES ( null, 'Astee', 'Kerry', 528, 503, 481, 482 ); INSERT INTO population VALUES ( null, 'Ballincloher', 'Kerry', 418, 429, 460, 453 ); INSERT INTO population VALUES ( null, 'Ballyconry', 'Kerry', 423, 435, 442, 417 ); INSERT INTO population VALUES ( null, 'Ballyduff', 'Kerry', 914, 921, 868, 841 ); INSERT INTO population VALUES ( null, 'Ballyegan', 'Kerry', 119, 116, 105, 115 ); INSERT INTO population VALUES ( null, 'Ballyhorgan', 'Kerry', 396, 405, 423, 424 ); INSERT INTO population VALUES ( null, 'Beal', 'Kerry', 160, 162, 162, 144 ); INSERT INTO population VALUES ( null, 'Carrig', 'Kerry', 396, 409, 397, 350 ); INSERT INTO population VALUES ( null, 'Causeway', 'Kerry', 612, 571, 647, 646 ); INSERT INTO population VALUES ( null, 'Cloontubbrid', 'Kerry', 278, 318, 335, 322 ); INSERT INTO population VALUES ( null, 'Drommartin', 'Kerry', 454, 461, 519, 529 ); INSERT INTO population VALUES ( null, 'Duagh', 'Kerry', 469, 470, 512, 532 ); INSERT INTO population VALUES ( null, 'Ennismore', 'Kerry', 556, 584, 612, 569 ); INSERT INTO population VALUES ( null, 'Gullane', 'Kerry', 239, 220, 247, 249 ); INSERT INTO population VALUES ( null, 'Gunsborough', 'Kerry', 347, 342, 365, 377 ); INSERT INTO population VALUES ( null, 'Kilfeighny', 'Kerry', 786, 843, 944, 947 ); INSERT INTO population VALUES ( null, 'Killehenny', 'Kerry', 1759, 1795, 1804, 1873 ); INSERT INTO population VALUES ( null, 'Killury', 'Kerry', 535, 533, 542, 500 ); INSERT INTO population VALUES ( null, 'Kilmeany', 'Kerry', 618, 666, 771, 698 ); INSERT INTO population VALUES ( null, 'Kilshenane', 'Kerry', 277, 263, 255, 226 ); INSERT INTO population VALUES ( null, 'Kiltomy', 'Kerry', 411, 411, 445, 425 ); INSERT INTO population VALUES ( null, 'Leitrim', 'Kerry', 483, 499, 512, 544 ); INSERT INTO population VALUES ( null, 'Lislaughtin', 'Kerry', 628, 646, 627, 589 ); INSERT INTO population VALUES ( null, 'Lisselton', 'Kerry', 349, 342, 353, 369 ); INSERT INTO population VALUES ( null, 'Listowel Rural', 'Kerry', 1257, 1397, 1567, 1589 ); INSERT INTO population VALUES ( null, 'Lixnaw', 'Kerry', 566, 790, 1016, 1056 ); INSERT INTO population VALUES ( null, 'Moynsha', 'Kerry', 454, 455, 513, 514 ); INSERT INTO population VALUES ( null, 'Newtownsandes', 'Kerry', 1004, 1036, 1072, 1004 ); INSERT INTO population VALUES ( null, 'Rathea', 'Kerry', 399, 420, 421, 414 ); INSERT INTO population VALUES ( null, 'Shronowen', 'Kerry', 250, 239, 239, 236 ); INSERT INTO population VALUES ( null, 'Tarbert', 'Kerry', 805, 810, 779, 764 ); INSERT INTO population VALUES ( null, 'Tarmon', 'Kerry', 471, 492, 521, 476 ); INSERT INTO population VALUES ( null, 'Trienearagh', 'Kerry', 397, 411, 493, 488 ); INSERT INTO population VALUES ( null, 'Urlee', 'Kerry', 371, 356, 369, 378 ); INSERT INTO population VALUES ( null, 'Abbeydorney', 'Kerry', 905, 969, 1184, 1142 ); INSERT INTO population VALUES ( null, 'Arabela', 'Kerry', 1289, 1298, 1290, 1381 ); INSERT INTO population VALUES ( null, 'Ardfert', 'Kerry', 887, 935, 997, 960 ); INSERT INTO population VALUES ( null, 'Ballyegan', 'Kerry', 264, 301, 374, 383 ); INSERT INTO population VALUES ( null, 'Ballyheige', 'Kerry', 1334, 1459, 1412, 1489 ); INSERT INTO population VALUES ( null, 'Ballynahaglish', 'Kerry', 1377, 1406, 1600, 1604 ); INSERT INTO population VALUES ( null, 'Ballynorig', 'Kerry', 468, 476, 512, 511 ); INSERT INTO population VALUES ( null, 'Ballyseedy', 'Kerry', 1068, 1574, 1739, 1818 ); INSERT INTO population VALUES ( null, 'Banna', 'Kerry', 724, 732, 714, 721 ); INSERT INTO population VALUES ( null, 'Baurtregaum', 'Kerry', 422, 419, 431, 379 ); INSERT INTO population VALUES ( null, 'Blennerville', 'Kerry', 484, 711, 698, 651 ); INSERT INTO population VALUES ( null, 'Boolteens', 'Kerry', 402, 422, 478, 477 ); INSERT INTO population VALUES ( null, 'Brosna', 'Kerry', 762, 755, 756, 697 ); INSERT INTO population VALUES ( null, 'Carker', 'Kerry', 436, 438, 434, 416 ); INSERT INTO population VALUES ( null, 'Castleisland', 'Kerry', 3130, 3285, 3426, 3329 ); INSERT INTO population VALUES ( null, 'Clogherbrien', 'Kerry', 1484, 1564, 1645, 1481 ); INSERT INTO population VALUES ( null, 'Cordal', 'Kerry', 283, 278, 283, 278 ); INSERT INTO population VALUES ( null, 'Crinny', 'Kerry', 288, 307, 325, 288 ); INSERT INTO population VALUES ( null, 'Derreen', 'Kerry', 197, 181, 193, 189 ); INSERT INTO population VALUES ( null, 'Doon', 'Kerry', 570, 619, 695, 692 ); INSERT INTO population VALUES ( null, 'Gneeves', 'Kerry', 342, 340, 365, 368 ); INSERT INTO population VALUES ( null, 'Kerryhead', 'Kerry', 582, 575, 617, 578 ); INSERT INTO population VALUES ( null, 'Kilflyn', 'Kerry', 224, 280, 264, 251 ); INSERT INTO population VALUES ( null, 'Kilgarrylander', 'Kerry', 629, 634, 666, 631 ); INSERT INTO population VALUES ( null, 'Kilgobban', 'Kerry', 262, 270, 293, 272 ); INSERT INTO population VALUES ( null, 'Killahan', 'Kerry', 326, 317, 335, 361 ); INSERT INTO population VALUES ( null, 'Kilmurry', 'Kerry', 306, 305, 326, 289 ); INSERT INTO population VALUES ( null, 'Kiltallagh', 'Kerry', 474, 597, 568, 565 ); INSERT INTO population VALUES ( null, 'Knockglass', 'Kerry', 252, 320, 334, 353 ); INSERT INTO population VALUES ( null, 'Knocknagashel', 'Kerry', 728, 721, 697, 706 ); INSERT INTO population VALUES ( null, 'Lackabaun', 'Kerry', 444, 445, 454, 435 ); INSERT INTO population VALUES ( null, 'Millbrook', 'Kerry', 482, 469, 451, 456 ); INSERT INTO population VALUES ( null, 'Mount Eagle', 'Kerry', 178, 185, 171, 178 ); INSERT INTO population VALUES ( null, 'Nohaval', 'Kerry', 309, 349, 374, 353 ); INSERT INTO population VALUES ( null, 'OBrennan', 'Kerry', 400, 463, 508, 495 ); INSERT INTO population VALUES ( null, 'Ratass', 'Kerry', 952, 1071, 1092, 1075 ); INSERT INTO population VALUES ( null, 'Scartaglin', 'Kerry', 607, 631, 662, 698 ); INSERT INTO population VALUES ( null, 'Tralee Rural', 'Kerry', 15433, 16611, 17952, 17906 ); INSERT INTO population VALUES ( null, 'Tubrid', 'Kerry', 711, 780, 817, 796 ); INSERT INTO population VALUES ( null, 'Abbey A', 'Limerick', 4226, 4616, 4678, 4613 ); INSERT INTO population VALUES ( null, 'Abbey B', 'Limerick', 1595, 2040, 2497, 2633 ); INSERT INTO population VALUES ( null, 'Abbey C', 'Limerick', 628, 602, 509, 556 ); INSERT INTO population VALUES ( null, 'Abbey D', 'Limerick', 1608, 1503, 1456, 1514 ); INSERT INTO population VALUES ( null, 'Ballinacurra A', 'Limerick', 1638, 1955, 2137, 1957 ); INSERT INTO population VALUES ( null, 'Ballinacurra B', 'Limerick', 1640, 1502, 1375, 1365 ); INSERT INTO population VALUES ( null, 'Ballynanty', 'Limerick', 4110, 3468, 2918, 2879 ); INSERT INTO population VALUES ( null, 'Castle A', 'Limerick', 1352, 1221, 1157, 1138 ); INSERT INTO population VALUES ( null, 'Castle B', 'Limerick', 508, 486, 508, 458 ); INSERT INTO population VALUES ( null, 'Castle C', 'Limerick', 1003, 973, 1171, 1242 ); INSERT INTO population VALUES ( null, 'Castle D', 'Limerick', 2480, 2207, 2155, 2085 ); INSERT INTO population VALUES ( null, 'Coolraine', 'Limerick', 1951, 1774, 1625, 1572 ); INSERT INTO population VALUES ( null, 'Custom House', 'Limerick', 503, 535, 570, 682 ); INSERT INTO population VALUES ( null, 'Dock A', 'Limerick', 1879, 2138, 1799, 2317 ); INSERT INTO population VALUES ( null, 'Dock B', 'Limerick', 793, 845, 1080, 1084 ); INSERT INTO population VALUES ( null, 'Dock C', 'Limerick', 1068, 1046, 1028, 983 ); INSERT INTO population VALUES ( null, 'Dock D', 'Limerick', 1015, 937, 872, 773 ); INSERT INTO population VALUES ( null, 'Farranshone', 'Limerick', 1175, 1111, 948, 952 ); INSERT INTO population VALUES ( null, 'Galvone A', 'Limerick', 1701, 1542, 1467, 1489 ); INSERT INTO population VALUES ( null, 'Galvone B', 'Limerick', 2022, 1574, 878, 660 ); INSERT INTO population VALUES ( null, 'Glentworth A', 'Limerick', 577, 594, 498, 554 ); INSERT INTO population VALUES ( null, 'Glentworth B', 'Limerick', 1406, 1241, 1169, 1190 ); INSERT INTO population VALUES ( null, 'Glentworth C', 'Limerick', 654, 549, 524, 501 ); INSERT INTO population VALUES ( null, 'Johns A', 'Limerick', 1358, 1211, 863, 764 ); INSERT INTO population VALUES ( null, 'Johns B', 'Limerick', 1115, 1053, 976, 958 ); INSERT INTO population VALUES ( null, 'Johns C', 'Limerick', 287, 438, 368, 459 ); INSERT INTO population VALUES ( null, 'Killeely A', 'Limerick', 1559, 1579, 1445, 1446 ); INSERT INTO population VALUES ( null, 'Killeely B', 'Limerick', 869, 950, 810, 822 ); INSERT INTO population VALUES ( null, 'Market', 'Limerick', 1245, 1409, 1755, 1965 ); INSERT INTO population VALUES ( null, 'Prospect A', 'Limerick', 904, 1014, 1039, 1132 ); INSERT INTO population VALUES ( null, 'Prospect B', 'Limerick', 1139, 1026, 751, 713 ); INSERT INTO population VALUES ( null, 'Rathbane', 'Limerick', 1984, 1702, 1567, 1586 ); INSERT INTO population VALUES ( null, 'St. Laurence', 'Limerick', 1184, 1106, 1116, 965 ); INSERT INTO population VALUES ( null, 'Shannon A', 'Limerick', 294, 458, 704, 977 ); INSERT INTO population VALUES ( null, 'Shannon B', 'Limerick', 819, 519, 662, 931 ); INSERT INTO population VALUES ( null, 'Singland A', 'Limerick', 1868, 1754, 1677, 1663 ); INSERT INTO population VALUES ( null, 'Singland B', 'Limerick', 3866, 3861, 3869, 3876 ); INSERT INTO population VALUES ( null, 'Limerick North Rural', 'Limerick', 6932, 7251, 6485, 6865 ); INSERT INTO population VALUES ( null, 'Abbeyville', 'Limerick', 259, 291, 344, 352 ); INSERT INTO population VALUES ( null, 'Adare North', 'Limerick', 580, 593, 622, 583 ); INSERT INTO population VALUES ( null, 'Adare South', 'Limerick', 2012, 1860, 2028, 2026 ); INSERT INTO population VALUES ( null, 'Ballingarry', 'Limerick', 699, 838, 930, 936 ); INSERT INTO population VALUES ( null, 'Ballyagran', 'Limerick', 550, 507, 507, 493 ); INSERT INTO population VALUES ( null, 'Ballygrennan', 'Limerick', 254, 273, 320, 302 ); INSERT INTO population VALUES ( null, 'Ballynabanoge', 'Limerick', 321, 313, 330, 326 ); INSERT INTO population VALUES ( null, 'Ballynoe', 'Limerick', 449, 445, 452, 464 ); INSERT INTO population VALUES ( null, 'Castletown', 'Limerick', 391, 377, 370, 368 ); INSERT INTO population VALUES ( null, 'Coolrus', 'Limerick', 395, 417, 408, 411 ); INSERT INTO population VALUES ( null, 'Crean', 'Limerick', 374, 419, 403, 411 ); INSERT INTO population VALUES ( null, 'Crecora', 'Limerick', 439, 429, 443, 425 ); INSERT INTO population VALUES ( null, 'Croom', 'Limerick', 1564, 1597, 1690, 1690 ); INSERT INTO population VALUES ( null, 'Dunnaman', 'Limerick', 554, 628, 686, 693 ); INSERT INTO population VALUES ( null, 'Fedamore', 'Limerick', 1020, 1088, 1222, 1258 ); INSERT INTO population VALUES ( null, 'Garrane', 'Limerick', 295, 308, 294, 294 ); INSERT INTO population VALUES ( null, 'Grange', 'Limerick', 469, 493, 524, 536 ); INSERT INTO population VALUES ( null, 'Kilfinny', 'Limerick', 260, 265, 270, 278 ); INSERT INTO population VALUES ( null, 'Kilpeacon', 'Limerick', 478, 498, 539, 527 ); INSERT INTO population VALUES ( null, 'Rathmore', 'Limerick', 264, 288, 289, 298 ); INSERT INTO population VALUES ( null, 'Fleanmore', 'Limerick', 199, 205, 213, 217 ); INSERT INTO population VALUES ( null, 'Glin', 'Limerick', 1178, 1211, 1195, 1170 ); INSERT INTO population VALUES ( null, 'Kilfergus', 'Limerick', 508, 503, 448, 418 ); INSERT INTO population VALUES ( null, 'Kilmoylan', 'Limerick', 475, 461, 431, 400 ); INSERT INTO population VALUES ( null, 'Ardpatrick', 'Limerick', 388, 401, 388, 381 ); INSERT INTO population VALUES ( null, 'Athlacca', 'Limerick', 371, 360, 407, 383 ); INSERT INTO population VALUES ( null, 'Ballymacshaneboy', 'Limerick', 403, 434, 476, 491 ); INSERT INTO population VALUES ( null, 'Bruff', 'Limerick', 1265, 1264, 1386, 1417 ); INSERT INTO population VALUES ( null, 'Bruree', 'Limerick', 920, 1002, 1159, 1196 ); INSERT INTO population VALUES ( null, 'Bulgaden', 'Limerick', 306, 350, 346, 338 ); INSERT INTO population VALUES ( null, 'Cahercorney', 'Limerick', 529, 602, 722, 733 ); INSERT INTO population VALUES ( null, 'Colmanswell', 'Limerick', 557, 550, 540, 547 ); INSERT INTO population VALUES ( null, 'Darragh', 'Limerick', 300, 316, 316, 308 ); INSERT INTO population VALUES ( null, 'Dromin', 'Limerick', 476, 523, 562, 558 ); INSERT INTO population VALUES ( null, 'Emlygrennan', 'Limerick', 633, 662, 748, 755 ); INSERT INTO population VALUES ( null, 'Glenbrohane', 'Limerick', 379, 402, 452, 430 ); INSERT INTO population VALUES ( null, 'Griston', 'Limerick', 263, 262, 299, 304 ); INSERT INTO population VALUES ( null, 'Hospital', 'Limerick', 1143, 1206, 1257, 1330 ); INSERT INTO population VALUES ( null, 'Kilfinnane', 'Limerick', 1104, 1087, 1129, 1123 ); INSERT INTO population VALUES ( null, 'Kilflyn', 'Limerick', 225, 226, 227, 198 ); INSERT INTO population VALUES ( null, 'Kilmallock', 'Limerick', 2088, 2201, 2373, 2400 ); INSERT INTO population VALUES ( null, 'Kilteely', 'Limerick', 457, 553, 609, 580 ); INSERT INTO population VALUES ( null, 'Knockainy', 'Limerick', 625, 672, 732, 722 ); INSERT INTO population VALUES ( null, 'Knocklong', 'Limerick', 799, 868, 885, 865 ); INSERT INTO population VALUES ( null, 'Particles', 'Limerick', 166, 190, 222, 238 ); INSERT INTO population VALUES ( null, 'Rockhill', 'Limerick', 301, 318, 330, 324 ); INSERT INTO population VALUES ( null, 'Tobernea', 'Limerick', 627, 623, 670, 643 ); INSERT INTO population VALUES ( null, 'Uregare', 'Limerick', 539, 565, 625, 631 ); INSERT INTO population VALUES ( null, 'Abington', 'Limerick', 733, 756, 1206, 1240 ); INSERT INTO population VALUES ( null, 'Ballybricken', 'Limerick', 1391, 1606, 1738, 1804 ); INSERT INTO population VALUES ( null, 'Ballycummin', 'Limerick', 13435, 16335, 17490, 18489 ); INSERT INTO population VALUES ( null, 'Ballysimon', 'Limerick', 9675, 11321, 13073, 13760 ); INSERT INTO population VALUES ( null, 'Ballyvarra', 'Limerick', 3740, 4110, 4269, 4295 ); INSERT INTO population VALUES ( null, 'Caherconlish East', 'Limerick', 458, 510, 514, 507 ); INSERT INTO population VALUES ( null, 'Caherconlish West', 'Limerick', 1218, 1393, 2050, 2228 ); INSERT INTO population VALUES ( null, 'Caherelly', 'Limerick', 228, 281, 342, 366 ); INSERT INTO population VALUES ( null, 'Cappamore', 'Limerick', 1408, 1407, 1428, 1359 ); INSERT INTO population VALUES ( null, 'Carrig', 'Limerick', 589, 590, 607, 593 ); INSERT INTO population VALUES ( null, 'Castleconnell', 'Limerick', 2647, 2634, 3180, 3352 ); INSERT INTO population VALUES ( null, 'Clarina', 'Limerick', 1451, 1650, 1730, 1769 ); INSERT INTO population VALUES ( null, 'Clonkeen', 'Limerick', 526, 691, 920, 988 ); INSERT INTO population VALUES ( null, 'Doon West', 'Limerick', 204, 220, 240, 238 ); INSERT INTO population VALUES ( null, 'Glenstal', 'Limerick', 919, 931, 1095, 1142 ); INSERT INTO population VALUES ( null, 'Kilmurry', 'Limerick', 761, 868, 897, 902 ); INSERT INTO population VALUES ( null, 'Limerick South Rural', 'Limerick', 980, 1424, 1660, 1804 ); INSERT INTO population VALUES ( null, 'Patrickswell', 'Limerick', 1574, 1522, 1445, 1450 ); INSERT INTO population VALUES ( null, 'Roxborough', 'Limerick', 1678, 1605, 1601, 1495 ); INSERT INTO population VALUES ( null, 'Anglesborough', 'Limerick', 351, 325, 336, 339 ); INSERT INTO population VALUES ( null, 'Ballylanders', 'Limerick', 606, 611, 652, 631 ); INSERT INTO population VALUES ( null, 'Cullane', 'Limerick', 364, 355, 367, 375 ); INSERT INTO population VALUES ( null, 'Duntryleague', 'Limerick', 301, 321, 352, 339 ); INSERT INTO population VALUES ( null, 'Galbally', 'Limerick', 524, 554, 546, 565 ); INSERT INTO population VALUES ( null, 'Kilbeheny', 'Limerick', 242, 250, 253, 237 ); INSERT INTO population VALUES ( null, 'Kilglass', 'Limerick', 287, 280, 312, 302 ); INSERT INTO population VALUES ( null, 'Knocknascrow', 'Limerick', 162, 162, 191, 194 ); INSERT INTO population VALUES ( null, 'Riversdale', 'Limerick', 212, 218, 238, 248 ); INSERT INTO population VALUES ( null, 'Abbeyfeale', 'Limerick', 2263, 2508, 2528, 2545 ); INSERT INTO population VALUES ( null, 'Ardagh', 'Limerick', 942, 977, 1006, 990 ); INSERT INTO population VALUES ( null, 'Ballintober', 'Limerick', 345, 362, 360, 374 ); INSERT INTO population VALUES ( null, 'Ballynoe West', 'Limerick', 276, 316, 336, 333 ); INSERT INTO population VALUES ( null, 'Boola', 'Limerick', 155, 142, 138, 153 ); INSERT INTO population VALUES ( null, 'Broadford', 'Limerick', 846, 894, 917, 957 ); INSERT INTO population VALUES ( null, 'Caher', 'Limerick', 326, 337, 364, 353 ); INSERT INTO population VALUES ( null, 'Cleanglass', 'Limerick', 317, 311, 282, 284 ); INSERT INTO population VALUES ( null, 'Cloncagh', 'Limerick', 235, 259, 294, 299 ); INSERT INTO population VALUES ( null, 'Danganbeg', 'Limerick', 373, 384, 415, 410 ); INSERT INTO population VALUES ( null, 'Dromcolliher', 'Limerick', 976, 983, 984, 946 ); INSERT INTO population VALUES ( null, 'Dromtrasna', 'Limerick', 786, 841, 890, 895 ); INSERT INTO population VALUES ( null, 'Feenagh', 'Limerick', 315, 314, 347, 333 ); INSERT INTO population VALUES ( null, 'Garryduff', 'Limerick', 306, 295, 284, 272 ); INSERT INTO population VALUES ( null, 'Glenagower', 'Limerick', 472, 511, 527, 503 ); INSERT INTO population VALUES ( null, 'Glengort', 'Limerick', 737, 712, 701, 664 ); INSERT INTO population VALUES ( null, 'Glensharrold', 'Limerick', 446, 437, 448, 418 ); INSERT INTO population VALUES ( null, 'Kilmeedy', 'Limerick', 350, 344, 373, 354 ); INSERT INTO population VALUES ( null, 'Knockaderry', 'Limerick', 458, 477, 506, 513 ); INSERT INTO population VALUES ( null, 'Mahoonagh', 'Limerick', 463, 517, 511, 522 ); INSERT INTO population VALUES ( null, 'Monagay', 'Limerick', 1018, 1113, 1219, 1223 ); INSERT INTO population VALUES ( null, 'Mountcollins', 'Limerick', 546, 509, 490, 487 ); INSERT INTO population VALUES ( null, 'Mountplummer', 'Limerick', 298, 315, 328, 311 ); INSERT INTO population VALUES ( null, 'Newcastle Rural', 'Limerick', 1305, 1961, 2218, 2249 ); INSERT INTO population VALUES ( null, 'Newcastle Urban', 'Limerick', 3495, 3922, 4880, 5014 ); INSERT INTO population VALUES ( null, 'Port', 'Limerick', 560, 547, 541, 505 ); INSERT INTO population VALUES ( null, 'Rathronan', 'Limerick', 876, 841, 852, 863 ); INSERT INTO population VALUES ( null, 'Rooskagh', 'Limerick', 286, 292, 300, 285 ); INSERT INTO population VALUES ( null, 'Templeglentan', 'Limerick', 839, 846, 915, 968 ); INSERT INTO population VALUES ( null, 'Askeaton East', 'Limerick', 718, 687, 659, 612 ); INSERT INTO population VALUES ( null, 'Askeaton West', 'Limerick', 881, 1002, 1178, 1183 ); INSERT INTO population VALUES ( null, 'Aughinish', 'Limerick', 230, 264, 213, 237 ); INSERT INTO population VALUES ( null, 'Ballyallinan', 'Limerick', 359, 387, 415, 429 ); INSERT INTO population VALUES ( null, 'Ballynacarriga', 'Limerick', 586, 645, 820, 862 ); INSERT INTO population VALUES ( null, 'Castletown', 'Limerick', 399, 415, 452, 481 ); INSERT INTO population VALUES ( null, 'Craggs', 'Limerick', 267, 272, 272, 262 ); INSERT INTO population VALUES ( null, 'Croagh', 'Limerick', 671, 693, 748, 782 ); INSERT INTO population VALUES ( null, 'Dromard', 'Limerick', 674, 749, 857, 877 ); INSERT INTO population VALUES ( null, 'Dunmoylan East', 'Limerick', 442, 460, 467, 438 ); INSERT INTO population VALUES ( null, 'Dunmoylan West', 'Limerick', 94, 85, 79, 66 ); INSERT INTO population VALUES ( null, 'Iveruss', 'Limerick', 293, 277, 287, 302 ); INSERT INTO population VALUES ( null, 'Kilcornan', 'Limerick', 632, 671, 745, 772 ); INSERT INTO population VALUES ( null, 'Kildimo', 'Limerick', 597, 598, 666, 665 ); INSERT INTO population VALUES ( null, 'Kilscannell', 'Limerick', 466, 478, 534, 511 ); INSERT INTO population VALUES ( null, 'Lismakeery', 'Limerick', 403, 427, 428, 433 ); INSERT INTO population VALUES ( null, 'Loghill', 'Limerick', 674, 707, 734, 673 ); INSERT INTO population VALUES ( null, 'Mohernagh', 'Limerick', 128, 137, 138, 136 ); INSERT INTO population VALUES ( null, 'Nantinan', 'Limerick', 701, 769, 759, 729 ); INSERT INTO population VALUES ( null, 'Pallaskenry', 'Limerick', 1009, 1016, 1076, 1074 ); INSERT INTO population VALUES ( null, 'Rathkeale Rural', 'Limerick', 335, 360, 321, 314 ); INSERT INTO population VALUES ( null, 'Rathkeale Urban', 'Limerick', 1362, 1445, 1479, 1351 ); INSERT INTO population VALUES ( null, 'Riddlestown', 'Limerick', 440, 485, 593, 584 ); INSERT INTO population VALUES ( null, 'Shanagolden', 'Limerick', 981, 1004, 946, 925 ); INSERT INTO population VALUES ( null, 'Shanid', 'Limerick', 456, 478, 523, 532 ); INSERT INTO population VALUES ( null, 'Bilboa', 'Limerick', 381, 402, 405, 407 ); INSERT INTO population VALUES ( null, 'Doon South', 'Limerick', 1210, 1250, 1290, 1272 ); INSERT INTO population VALUES ( null, 'Grean', 'Limerick', 1310, 1374, 1504, 1510 ); INSERT INTO population VALUES ( null, 'Oola', 'Limerick', 1063, 1089, 1061, 1091 ); INSERT INTO population VALUES ( null, 'Templebredon', 'Limerick', 462, 498, 550, 541 ); INSERT INTO population VALUES ( null, 'Nenagh East Urban', 'Tipperary', 1934, 2680, 2912, 3214 ); INSERT INTO population VALUES ( null, 'Nenagh West Urban', 'Tipperary', 4187, 4735, 5111, 5465 ); INSERT INTO population VALUES ( null, 'Templemore', 'Tipperary', 2159, 2255, 1941, 1943 ); INSERT INTO population VALUES ( null, 'Thurles Urban', 'Tipperary', 6852, 6831, 6929, 6851 ); INSERT INTO population VALUES ( null, 'Aglishcloghane', 'Tipperary', 292, 289, 299, 266 ); INSERT INTO population VALUES ( null, 'Ballingarry', 'Tipperary', 583, 574, 531, 500 ); INSERT INTO population VALUES ( null, 'Ballylusky', 'Tipperary', 267, 307, 349, 338 ); INSERT INTO population VALUES ( null, 'Borrisokane', 'Tipperary', 1171, 1139, 1294, 1247 ); INSERT INTO population VALUES ( null, 'Carrig', 'Tipperary', 186, 188, 174, 177 ); INSERT INTO population VALUES ( null, 'Cloghjordan', 'Tipperary', 740, 784, 973, 1054 ); INSERT INTO population VALUES ( null, 'Cloghprior', 'Tipperary', 238, 270, 294, 301 ); INSERT INTO population VALUES ( null, 'Clohaskin', 'Tipperary', 222, 196, 242, 231 ); INSERT INTO population VALUES ( null, 'Finnoe', 'Tipperary', 158, 186, 188, 194 ); INSERT INTO population VALUES ( null, 'Graigue', 'Tipperary', 267, 276, 299, 267 ); INSERT INTO population VALUES ( null, 'Kilbarron', 'Tipperary', 576, 572, 601, 616 ); INSERT INTO population VALUES ( null, 'Lorrha East', 'Tipperary', 329, 338, 319, 296 ); INSERT INTO population VALUES ( null, 'Lorrha West', 'Tipperary', 319, 347, 321, 311 ); INSERT INTO population VALUES ( null, 'Mertonhall', 'Tipperary', 168, 149, 178, 171 ); INSERT INTO population VALUES ( null, 'Rathcabban', 'Tipperary', 222, 243, 312, 324 ); INSERT INTO population VALUES ( null, 'Redwood', 'Tipperary', 143, 131, 128, 138 ); INSERT INTO population VALUES ( null, 'Riverstown', 'Tipperary', 482, 522, 566, 560 ); INSERT INTO population VALUES ( null, 'Terryglass', 'Tipperary', 504, 451, 479, 473 ); INSERT INTO population VALUES ( null, 'Uskane', 'Tipperary', 195, 213, 248, 252 ); INSERT INTO population VALUES ( null, 'Abington', 'Tipperary', 563, 555, 615, 572 ); INSERT INTO population VALUES ( null, 'Aghnameadle', 'Tipperary', 271, 275, 290, 301 ); INSERT INTO population VALUES ( null, 'Ardcrony', 'Tipperary', 451, 488, 525, 558 ); INSERT INTO population VALUES ( null, 'Ballina', 'Tipperary', 1720, 2459, 2959, 3111 ); INSERT INTO population VALUES ( null, 'Ballygibbon', 'Tipperary', 487, 526, 630, 617 ); INSERT INTO population VALUES ( null, 'Ballymackey', 'Tipperary', 505, 506, 546, 553 ); INSERT INTO population VALUES ( null, 'Ballynaclogh', 'Tipperary', 647, 654, 667, 680 ); INSERT INTO population VALUES ( null, 'Birdhill', 'Tipperary', 588, 671, 729, 730 ); INSERT INTO population VALUES ( null, 'Burgesbeg', 'Tipperary', 418, 425, 405, 429 ); INSERT INTO population VALUES ( null, 'Carrigatogher', 'Tipperary', 641, 705, 686, 704 ); INSERT INTO population VALUES ( null, 'Castletown', 'Tipperary', 1223, 1352, 1468, 1468 ); INSERT INTO population VALUES ( null, 'Derrycastle', 'Tipperary', 349, 423, 434, 429 ); INSERT INTO population VALUES ( null, 'Dolla', 'Tipperary', 215, 217, 235, 213 ); INSERT INTO population VALUES ( null, '037/045 Greenhall/Lackagh', 'Tipperary', 257, 299, 368, 396 ); INSERT INTO population VALUES ( null, 'Kilcomenty', 'Tipperary', 579, 648, 672, 690 ); INSERT INTO population VALUES ( null, 'Kilkeary', 'Tipperary', 532, 590, 651, 659 ); INSERT INTO population VALUES ( null, 'Killoscully', 'Tipperary', 311, 387, 418, 458 ); INSERT INTO population VALUES ( null, 'Kilmore', 'Tipperary', 581, 642, 682, 707 ); INSERT INTO population VALUES ( null, 'Kilnaneave', 'Tipperary', 474, 488, 473, 447 ); INSERT INTO population VALUES ( null, 'Kilnarath', 'Tipperary', 302, 311, 334, 330 ); INSERT INTO population VALUES ( null, 'Knigh', 'Tipperary', 678, 703, 776, 768 ); INSERT INTO population VALUES ( null, 'Latteragh', 'Tipperary', 639, 629, 688, 684 ); INSERT INTO population VALUES ( null, 'Monsea', 'Tipperary', 628, 648, 681, 636 ); INSERT INTO population VALUES ( null, 'Nenagh Rural', 'Tipperary', 1710, 1796, 1868, 1874 ); INSERT INTO population VALUES ( null, 'Newport', 'Tipperary', 1643, 2121, 2729, 2955 ); INSERT INTO population VALUES ( null, 'Templederry', 'Tipperary', 180, 157, 141, 119 ); INSERT INTO population VALUES ( null, 'Youghalarra', 'Tipperary', 626, 877, 912, 927 ); INSERT INTO population VALUES ( null, 'Borrisnafarney', 'Tipperary', 247, 279, 296, 309 ); INSERT INTO population VALUES ( null, 'Borrisnoe', 'Tipperary', 94, 105, 107, 115 ); INSERT INTO population VALUES ( null, 'Bourney East', 'Tipperary', 287, 275, 255, 274 ); INSERT INTO population VALUES ( null, 'Bourney West', 'Tipperary', 383, 371, 387, 381 ); INSERT INTO population VALUES ( null, 'Killavinoge', 'Tipperary', 405, 405, 442, 461 ); INSERT INTO population VALUES ( null, 'Killea', 'Tipperary', 330, 350, 381, 381 ); INSERT INTO population VALUES ( null, 'Rathnaveoge', 'Tipperary', 271, 252, 278, 263 ); INSERT INTO population VALUES ( null, 'Roscrea', 'Tipperary', 5496, 5911, 6318, 6298 ); INSERT INTO population VALUES ( null, 'Timoney', 'Tipperary', 268, 304, 349, 365 ); INSERT INTO population VALUES ( null, 'Ballycahill', 'Tipperary', 393, 390, 434, 440 ); INSERT INTO population VALUES ( null, 'Ballymurreen', 'Tipperary', 252, 231, 254, 271 ); INSERT INTO population VALUES ( null, 'Borrisoleigh', 'Tipperary', 1129, 1184, 1231, 1220 ); INSERT INTO population VALUES ( null, 'Drom', 'Tipperary', 920, 1047, 1150, 1185 ); INSERT INTO population VALUES ( null, 'Foilnaman', 'Tipperary', 293, 290, 332, 331 ); INSERT INTO population VALUES ( null, 'Glenkeen', 'Tipperary', 388, 389, 419, 435 ); INSERT INTO population VALUES ( null, 'Gortkelly', 'Tipperary', 476, 476, 526, 546 ); INSERT INTO population VALUES ( null, 'Holycross', 'Tipperary', 1424, 1423, 1394, 1404 ); INSERT INTO population VALUES ( null, 'Inch', 'Tipperary', 421, 452, 413, 396 ); INSERT INTO population VALUES ( null, 'Kilrush', 'Tipperary', 422, 488, 523, 500 ); INSERT INTO population VALUES ( null, 'Littleton', 'Tipperary', 1153, 1136, 1088, 1102 ); INSERT INTO population VALUES ( null, 'Longfordpass', 'Tipperary', 268, 292, 298, 320 ); INSERT INTO population VALUES ( null, 'Loughmoe', 'Tipperary', 569, 599, 638, 635 ); INSERT INTO population VALUES ( null, 'Moyaliff', 'Tipperary', 357, 382, 408, 391 ); INSERT INTO population VALUES ( null, 'Moycarky', 'Tipperary', 533, 490, 549, 515 ); INSERT INTO population VALUES ( null, 'Moyne', 'Tipperary', 484, 494, 532, 550 ); INSERT INTO population VALUES ( null, 'Rahelty', 'Tipperary', 594, 672, 765, 768 ); INSERT INTO population VALUES ( null, 'Templetouhy', 'Tipperary', 837, 821, 849, 814 ); INSERT INTO population VALUES ( null, 'Thurles Rural', 'Tipperary', 1858, 2142, 2300, 2326 ); INSERT INTO population VALUES ( null, 'Twomileborris', 'Tipperary', 728, 831, 807, 874 ); INSERT INTO population VALUES ( null, 'Upperchurch', 'Tipperary', 318, 314, 329, 296 ); INSERT INTO population VALUES ( null, 'Carrickbeg Urban', 'Tipperary', 1229, 1415, 1534, 2029 ); INSERT INTO population VALUES ( null, 'Carrick-on-Suir Urban', 'Tipperary', 4313, 4441, 4352, 4632 ); INSERT INTO population VALUES ( null, 'Cashel Urban', 'Tipperary', 2403, 2413, 2275, 2419 ); INSERT INTO population VALUES ( null, 'Clonmel East Urban', 'Tipperary', 4121, 3920, 3922, 3970 ); INSERT INTO population VALUES ( null, 'Clonmel West Urban', 'Tipperary', 6530, 6126, 5699, 5561 ); INSERT INTO population VALUES ( null, 'Tipperary East Urban', 'Tipperary', 2830, 2674, 2467, 2411 ); INSERT INTO population VALUES ( null, 'Tipperary West Urban', 'Tipperary', 1716, 1741, 1855, 1803 ); INSERT INTO population VALUES ( null, 'Carrick-on-Suir Rural', 'Tipperary', 485, 498, 501, 504 ); INSERT INTO population VALUES ( null, 'Garrangibbon', 'Tipperary', 604, 634, 634, 646 ); INSERT INTO population VALUES ( null, 'Kilmurry', 'Tipperary', 321, 318, 342, 355 ); INSERT INTO population VALUES ( null, 'Newtown', 'Tipperary', 374, 382, 422, 414 ); INSERT INTO population VALUES ( null, 'Ardmayle', 'Tipperary', 533, 567, 635, 578 ); INSERT INTO population VALUES ( null, 'Ardsallagh', 'Tipperary', 426, 463, 435, 422 ); INSERT INTO population VALUES ( null, 'Ballysheehan', 'Tipperary', 448, 480, 499, 501 ); INSERT INTO population VALUES ( null, 'Cashel Rural', 'Tipperary', 1457, 1763, 2680, 2978 ); INSERT INTO population VALUES ( null, 'Clogher', 'Tipperary', 233, 220, 244, 230 ); INSERT INTO population VALUES ( null, 'Cloneen', 'Tipperary', 336, 410, 462, 514 ); INSERT INTO population VALUES ( null, 'Clonoulty East', 'Tipperary', 475, 518, 530, 543 ); INSERT INTO population VALUES ( null, 'Clonoulty West', 'Tipperary', 681, 667, 672, 711 ); INSERT INTO population VALUES ( null, 'Colman', 'Tipperary', 362, 395, 451, 441 ); INSERT INTO population VALUES ( null, 'Cooleagh', 'Tipperary', 443, 519, 541, 552 ); INSERT INTO population VALUES ( null, 'Drangan', 'Tipperary', 565, 625, 667, 671 ); INSERT INTO population VALUES ( null, 'Fethard', 'Tipperary', 843, 788, 900, 873 ); INSERT INTO population VALUES ( null, 'Gaile', 'Tipperary', 555, 727, 761, 744 ); INSERT INTO population VALUES ( null, 'Graigue', 'Tipperary', 154, 144, 153, 146 ); INSERT INTO population VALUES ( null, 'Greystown', 'Tipperary', 391, 430, 445, 427 ); INSERT INTO population VALUES ( null, 'Killeenasteena', 'Tipperary', 714, 676, 708, 690 ); INSERT INTO population VALUES ( null, 'Killenaule', 'Tipperary', 1307, 1180, 1238, 1149 ); INSERT INTO population VALUES ( null, 'Kilpatrick', 'Tipperary', 886, 994, 970, 884 ); INSERT INTO population VALUES ( null, 'Knockgraffon', 'Tipperary', 704, 751, 782, 788 ); INSERT INTO population VALUES ( null, 'Magorban', 'Tipperary', 461, 534, 639, 624 ); INSERT INTO population VALUES ( null, 'Nodstown', 'Tipperary', 391, 473, 543, 570 ); INSERT INTO population VALUES ( null, 'Oughterleague', 'Tipperary', 493, 511, 553, 530 ); INSERT INTO population VALUES ( null, 'Peppardstown', 'Tipperary', 1285, 1327, 1352, 1395 ); INSERT INTO population VALUES ( null, 'Tullamain', 'Tipperary', 504, 692, 683, 677 ); INSERT INTO population VALUES ( null, 'Ardfinnan', 'Tipperary', 1022, 990, 1117, 1103 ); INSERT INTO population VALUES ( null, 'Ballybacon', 'Tipperary', 372, 409, 457, 459 ); INSERT INTO population VALUES ( null, 'Ballyporeen', 'Tipperary', 833, 878, 952, 921 ); INSERT INTO population VALUES ( null, 'Burncourt', 'Tipperary', 361, 386, 419, 450 ); INSERT INTO population VALUES ( null, 'Caher', 'Tipperary', 1068, 1205, 1153, 1136 ); INSERT INTO population VALUES ( null, 'Clogheen', 'Tipperary', 986, 957, 961, 942 ); INSERT INTO population VALUES ( null, 'Coolagarranroe', 'Tipperary', 485, 501, 530, 564 ); INSERT INTO population VALUES ( null, 'Derrygrath', 'Tipperary', 542, 608, 653, 707 ); INSERT INTO population VALUES ( null, 'Kilcommon', 'Tipperary', 2182, 2150, 2134, 2098 ); INSERT INTO population VALUES ( null, 'Kilcoran', 'Tipperary', 396, 432, 522, 528 ); INSERT INTO population VALUES ( null, 'Mortlestown', 'Tipperary', 870, 1455, 1721, 1767 ); INSERT INTO population VALUES ( null, 'Newcastle', 'Tipperary', 506, 583, 680, 737 ); INSERT INTO population VALUES ( null, 'Tubbrid', 'Tipperary', 511, 550, 593, 605 ); INSERT INTO population VALUES ( null, 'Tullaghmelan', 'Tipperary', 904, 964, 1024, 1068 ); INSERT INTO population VALUES ( null, 'Tullaghorton', 'Tipperary', 239, 262, 277, 275 ); INSERT INTO population VALUES ( null, 'Ballyclerahan', 'Tipperary', 655, 997, 1045, 1092 ); INSERT INTO population VALUES ( null, 'Clonmel Rural', 'Tipperary', 4122, 4653, 5553, 5650 ); INSERT INTO population VALUES ( null, 'Inishlounaght', 'Tipperary', 2971, 3091, 3324, 3333 ); INSERT INTO population VALUES ( null, 'Kilcash', 'Tipperary', 594, 671, 824, 806 ); INSERT INTO population VALUES ( null, '136 Kilsheelan/Killaloan', 'Tipperary', 1190, 1197, 1460, 1440 ); INSERT INTO population VALUES ( null, 'Kiltinan', 'Tipperary', 310, 300, 332, 313 ); INSERT INTO population VALUES ( null, 'Lisronagh', 'Tipperary', 580, 793, 905, 887 ); INSERT INTO population VALUES ( null, 'Anner', 'Tipperary', 337, 366, 416, 371 ); INSERT INTO population VALUES ( null, 'Ballingarry', 'Tipperary', 738, 710, 757, 710 ); INSERT INTO population VALUES ( null, 'Ballyphilip', 'Tipperary', 370, 400, 415, 449 ); INSERT INTO population VALUES ( null, 'Buolick', 'Tipperary', 578, 588, 652, 620 ); INSERT INTO population VALUES ( null, 'Crohane', 'Tipperary', 199, 223, 251, 253 ); INSERT INTO population VALUES ( null, 'Farranrory', 'Tipperary', 451, 473, 479, 481 ); INSERT INTO population VALUES ( null, 'Fennor', 'Tipperary', 524, 554, 539, 509 ); INSERT INTO population VALUES ( null, 'Kilcooly', 'Tipperary', 307, 290, 291, 312 ); INSERT INTO population VALUES ( null, 'Kilvemnon', 'Tipperary', 382, 374, 433, 430 ); INSERT INTO population VALUES ( null, 'Modeshil', 'Tipperary', 330, 314, 348, 348 ); INSERT INTO population VALUES ( null, 'Mullinahone', 'Tipperary', 764, 813, 862, 859 ); INSERT INTO population VALUES ( null, 'New Birmingham', 'Tipperary', 397, 483, 435, 431 ); INSERT INTO population VALUES ( null, 'Poyntstown', 'Tipperary', 185, 191, 178, 176 ); INSERT INTO population VALUES ( null, 'Ballycarron', 'Tipperary', 229, 257, 347, 336 ); INSERT INTO population VALUES ( null, 'Ballygriffin', 'Tipperary', 247, 253, 250, 260 ); INSERT INTO population VALUES ( null, 'Ballykisteen', 'Tipperary', 577, 668, 788, 749 ); INSERT INTO population VALUES ( null, 'Bansha', 'Tipperary', 858, 819, 868, 853 ); INSERT INTO population VALUES ( null, 'Bruis', 'Tipperary', 255, 312, 326, 330 ); INSERT INTO population VALUES ( null, 'Cappagh', 'Tipperary', 774, 810, 907, 873 ); INSERT INTO population VALUES ( null, 'Clonbeg', 'Tipperary', 651, 647, 746, 730 ); INSERT INTO population VALUES ( null, 'Cullen', 'Tipperary', 254, 284, 282, 286 ); INSERT INTO population VALUES ( null, 'Curraheen', 'Tipperary', 286, 302, 285, 289 ); INSERT INTO population VALUES ( null, 'Donohill', 'Tipperary', 620, 629, 644, 638 ); INSERT INTO population VALUES ( null, 'Drumwood', 'Tipperary', 461, 497, 559, 574 ); INSERT INTO population VALUES ( null, 'Emly', 'Tipperary', 612, 602, 729, 663 ); INSERT INTO population VALUES ( null, 'Glengar', 'Tipperary', 245, 266, 273, 253 ); INSERT INTO population VALUES ( null, 'Golden', 'Tipperary', 754, 788, 802, 827 ); INSERT INTO population VALUES ( null, 'Kilfeakle', 'Tipperary', 448, 471, 461, 452 ); INSERT INTO population VALUES ( null, 'Killadriffe', 'Tipperary', 532, 521, 533, 535 ); INSERT INTO population VALUES ( null, 'Kilmucklin', 'Tipperary', 502, 510, 561, 542 ); INSERT INTO population VALUES ( null, 'Lattin', 'Tipperary', 451, 488, 526, 495 ); INSERT INTO population VALUES ( null, 'Rathlynin', 'Tipperary', 278, 318, 394, 364 ); INSERT INTO population VALUES ( null, 'Rodus', 'Tipperary', 258, 243, 255, 249 ); INSERT INTO population VALUES ( null, 'Shronell', 'Tipperary', 390, 389, 403, 370 ); INSERT INTO population VALUES ( null, 'Solloghodbeg', 'Tipperary', 195, 218, 238, 227 ); INSERT INTO population VALUES ( null, 'Templeneiry', 'Tipperary', 389, 406, 428, 395 ); INSERT INTO population VALUES ( null, 'Thomastown', 'Tipperary', 373, 391, 401, 417 ); INSERT INTO population VALUES ( null, 'Tipperary Rural', 'Tipperary', 1648, 1905, 2188, 2152 ); INSERT INTO population VALUES ( null, 'Ballybeg North', 'Waterford', 3040, 2590, 2789, 2844 ); INSERT INTO population VALUES ( null, '002/006 Ballybeg South/Ballynaneashagh', 'Waterford', 282, 305, 297, 300 ); INSERT INTO population VALUES ( null, 'Ballybricken West', 'Waterford', 184, 155, 130, 144 ); INSERT INTO population VALUES ( null, 'Ballymaclode', 'Waterford', 1287, 1323, 1321, 1246 ); INSERT INTO population VALUES ( null, 'Ballynakill', 'Waterford', 2172, 2202, 2150, 2133 ); INSERT INTO population VALUES ( null, 'Ballytruckle', 'Waterford', 4464, 5048, 5917, 5937 ); INSERT INTO population VALUES ( null, 'Bilberry', 'Waterford', 472, 590, 718, 798 ); INSERT INTO population VALUES ( null, 'Centre A', 'Waterford', 731, 669, 679, 786 ); INSERT INTO population VALUES ( null, 'Centre B', 'Waterford', 253, 287, 233, 232 ); INSERT INTO population VALUES ( null, 'Cleaboy', 'Waterford', 2640, 2941, 2576, 2549 ); INSERT INTO population VALUES ( null, 'Custom House A', 'Waterford', 374, 367, 287, 351 ); INSERT INTO population VALUES ( null, 'Custom House B', 'Waterford', 338, 301, 213, 267 ); INSERT INTO population VALUES ( null, 'Farranshoneen', 'Waterford', 4987, 5370, 5465, 5598 ); INSERT INTO population VALUES ( null, 'Ferrybank', 'Waterford', 1171, 936, 911, 874 ); INSERT INTO population VALUES ( null, 'Gracedieu', 'Waterford', 488, 382, 1234, 1665 ); INSERT INTO population VALUES ( null, 'Grange North', 'Waterford', 1059, 1046, 934, 891 ); INSERT INTO population VALUES ( null, 'Grange South', 'Waterford', 1842, 1832, 2656, 2730 ); INSERT INTO population VALUES ( null, 'Grange Upper', 'Waterford', 2279, 2604, 2327, 2476 ); INSERT INTO population VALUES ( null, 'Kilbarry', 'Waterford', 267, 814, 982, 1153 ); INSERT INTO population VALUES ( null, 'Kingsmeadow', 'Waterford', 1110, 1398, 1106, 1121 ); INSERT INTO population VALUES ( null, 'Larchville', 'Waterford', 1051, 862, 942, 942 ); INSERT INTO population VALUES ( null, 'Lisduggan', 'Waterford', 1296, 1091, 1052, 1002 ); INSERT INTO population VALUES ( null, 'Military Road', 'Waterford', 929, 868, 821, 762 ); INSERT INTO population VALUES ( null, 'Morrissons Avenue East', 'Waterford', 506, 504, 560, 501 ); INSERT INTO population VALUES ( null, 'Morrissons Avenue West', 'Waterford', 358, 316, 295, 298 ); INSERT INTO population VALUES ( null, 'Morrissons Road', 'Waterford', 628, 576, 508, 503 ); INSERT INTO population VALUES ( null, 'Mount Sion', 'Waterford', 793, 760, 747, 794 ); INSERT INTO population VALUES ( null, 'Newports Square', 'Waterford', 583, 561, 556, 543 ); INSERT INTO population VALUES ( null, 'Newtown', 'Waterford', 1251, 1186, 1106, 1074 ); INSERT INTO population VALUES ( null, 'Park', 'Waterford', 1447, 1435, 1382, 1525 ); INSERT INTO population VALUES ( null, 'Poleberry', 'Waterford', 1001, 1338, 1055, 1370 ); INSERT INTO population VALUES ( null, 'Roanmore', 'Waterford', 847, 894, 814, 801 ); INSERT INTO population VALUES ( null, 'Shortcourse', 'Waterford', 314, 332, 274, 301 ); INSERT INTO population VALUES ( null, 'Slievekeale', 'Waterford', 711, 649, 592, 595 ); INSERT INTO population VALUES ( null, 'The Glen', 'Waterford', 283, 629, 566, 725 ); INSERT INTO population VALUES ( null, 'Ticor North', 'Waterford', 2618, 2171, 2164, 2161 ); INSERT INTO population VALUES ( null, 'Ticor South', 'Waterford', 538, 416, 373, 377 ); INSERT INTO population VALUES ( null, 'Dungarvan No. 1 Urban', 'Waterford', 4495, 4680, 4717, 4772 ); INSERT INTO population VALUES ( null, 'Dungarvan No. 2 Urban', 'Waterford', 2725, 3133, 3274, 3451 ); INSERT INTO population VALUES ( null, 'Ballydurn', 'Waterford', 148, 168, 180, 186 ); INSERT INTO population VALUES ( null, 'Carrickbeg Rural', 'Waterford', 450, 459, 445, 459 ); INSERT INTO population VALUES ( null, 'Clonea', 'Waterford', 439, 406, 433, 427 ); INSERT INTO population VALUES ( null, 'Fenoagh', 'Waterford', 203, 218, 234, 221 ); INSERT INTO population VALUES ( null, 'Glen', 'Waterford', 417, 404, 449, 427 ); INSERT INTO population VALUES ( null, 'Kilmeadan', 'Waterford', 612, 702, 729, 744 ); INSERT INTO population VALUES ( null, 'Mothel', 'Waterford', 395, 445, 474, 456 ); INSERT INTO population VALUES ( null, 'Portlaw', 'Waterford', 1081, 1393, 1598, 1628 ); INSERT INTO population VALUES ( null, 'Rathgormuck', 'Waterford', 173, 176, 197, 233 ); INSERT INTO population VALUES ( null, 'Ross', 'Waterford', 254, 265, 286, 281 ); INSERT INTO population VALUES ( null, 'Ballymacarbry', 'Waterford', 410, 436, 470, 512 ); INSERT INTO population VALUES ( null, 'Graignagower', 'Waterford', 472, 470, 514, 520 ); INSERT INTO population VALUES ( null, 'Gurteen', 'Waterford', 276, 335, 376, 351 ); INSERT INTO population VALUES ( null, 'Kilmacomma', 'Waterford', 482, 484, 491, 462 ); INSERT INTO population VALUES ( null, 'Kilronan', 'Waterford', 161, 164, 218, 213 ); INSERT INTO population VALUES ( null, 'St. Marys', 'Waterford', 691, 635, 726, 683 ); INSERT INTO population VALUES ( null, 'Aird Mhr', 'Waterford', 156, 171, 194, 208 ); INSERT INTO population VALUES ( null, 'Baile Mhac Airt', 'Waterford', 321, 369, 351, 363 ); INSERT INTO population VALUES ( null, 'Bohadoon', 'Waterford', 246, 236, 268, 310 ); INSERT INTO population VALUES ( null, 'Cappagh', 'Waterford', 342, 370, 370, 363 ); INSERT INTO population VALUES ( null, 'Carriglea', 'Waterford', 557, 562, 562, 537 ); INSERT INTO population VALUES ( null, 'Clonea', 'Waterford', 1415, 1779, 2123, 2294 ); INSERT INTO population VALUES ( null, 'Colligan', 'Waterford', 564, 611, 660, 696 ); INSERT INTO population VALUES ( null, 'Coumaraglin', 'Waterford', 225, 230, 239, 255 ); INSERT INTO population VALUES ( null, 'Dromana', 'Waterford', 485, 542, 765, 793 ); INSERT INTO population VALUES ( null, 'Dromore', 'Waterford', 208, 191, 259, 242 ); INSERT INTO population VALUES ( null, 'Dungarvan Rural', 'Waterford', 1157, 1449, 1867, 1897 ); INSERT INTO population VALUES ( null, 'Keereen', 'Waterford', 234, 241, 227, 227 ); INSERT INTO population VALUES ( null, 'Knockaunbrandaun', 'Waterford', 165, 155, 211, 210 ); INSERT INTO population VALUES ( null, 'Modelligo', 'Waterford', 251, 274, 327, 328 ); INSERT INTO population VALUES ( null, 'Mountstuart', 'Waterford', 57, 76, 92, 91 ); INSERT INTO population VALUES ( null, 'An Rinn', 'Waterford', 1079, 1191, 1350, 1360 ); INSERT INTO population VALUES ( null, 'Seskinan', 'Waterford', 446, 434, 455, 406 ); INSERT INTO population VALUES ( null, 'Whitechurch', 'Waterford', 212, 209, 216, 206 ); INSERT INTO population VALUES ( null, 'Annestown', 'Waterford', 604, 769, 816, 816 ); INSERT INTO population VALUES ( null, 'Ballylaneen', 'Waterford', 218, 261, 262, 268 ); INSERT INTO population VALUES ( null, 'Carrigcastle', 'Waterford', 257, 273, 282, 268 ); INSERT INTO population VALUES ( null, 'Comeragh', 'Waterford', 449, 473, 477, 436 ); INSERT INTO population VALUES ( null, 'Dunhill', 'Waterford', 217, 221, 266, 248 ); INSERT INTO population VALUES ( null, 'Fews', 'Waterford', 246, 252, 336, 350 ); INSERT INTO population VALUES ( null, 'Foxs Castle', 'Waterford', 392, 386, 432, 462 ); INSERT INTO population VALUES ( null, 'Gardenmorris', 'Waterford', 365, 402, 416, 432 ); INSERT INTO population VALUES ( null, 'Georgestown', 'Waterford', 149, 159, 186, 208 ); INSERT INTO population VALUES ( null, 'Kilbarrymeaden', 'Waterford', 190, 280, 395, 391 ); INSERT INTO population VALUES ( null, 'Kilmacthomas', 'Waterford', 1183, 1316, 1397, 1371 ); INSERT INTO population VALUES ( null, 'Knockmahon', 'Waterford', 426, 423, 391, 388 ); INSERT INTO population VALUES ( null, 'Mountkennedy', 'Waterford', 359, 407, 449, 432 ); INSERT INTO population VALUES ( null, 'Newtown', 'Waterford', 435, 455, 468, 472 ); INSERT INTO population VALUES ( null, 'Stradbally', 'Waterford', 619, 740, 772, 809 ); INSERT INTO population VALUES ( null, 'Tinnasaggart', 'Waterford', 84, 88, 98, 86 ); INSERT INTO population VALUES ( null, 'Ballyduff', 'Waterford', 257, 292, 295, 307 ); INSERT INTO population VALUES ( null, 'Ballyhane', 'Waterford', 404, 414, 454, 475 ); INSERT INTO population VALUES ( null, 'Ballyin', 'Waterford', 455, 448, 518, 506 ); INSERT INTO population VALUES ( null, 'Ballynamult', 'Waterford', 171, 179, 175, 169 ); INSERT INTO population VALUES ( null, 'Ballysaggartmore', 'Waterford', 315, 318, 337, 346 ); INSERT INTO population VALUES ( null, 'Cappoquin', 'Waterford', 1232, 1266, 1303, 1248 ); INSERT INTO population VALUES ( null, 'Castlerichard', 'Waterford', 493, 527, 498, 489 ); INSERT INTO population VALUES ( null, 'Drumroe', 'Waterford', 279, 259, 261, 271 ); INSERT INTO population VALUES ( null, 'Gortnapeaky', 'Waterford', 148, 171, 191, 204 ); INSERT INTO population VALUES ( null, 'Kilcockan', 'Waterford', 198, 195, 196, 218 ); INSERT INTO population VALUES ( null, 'Kilwatermoy East', 'Waterford', 119, 110, 105, 122 ); INSERT INTO population VALUES ( null, 'Kilwatermoy West', 'Waterford', 144, 161, 183, 200 ); INSERT INTO population VALUES ( null, 'Lismore Rural', 'Waterford', 863, 973, 1200, 1244 ); INSERT INTO population VALUES ( null, 'Lismore Urban', 'Waterford', 788, 790, 727, 651 ); INSERT INTO population VALUES ( null, 'Mocollop', 'Waterford', 210, 216, 233, 242 ); INSERT INTO population VALUES ( null, 'Modelligo', 'Waterford', 287, 292, 301, 294 ); INSERT INTO population VALUES ( null, 'Tallow', 'Waterford', 1137, 1215, 1271, 1301 ); INSERT INTO population VALUES ( null, 'Drumcannon', 'Waterford', 382, 338, 366, 372 ); INSERT INTO population VALUES ( null, 'Faithlegg (part)', 'Waterford', 1809, 1905, 2104, 2153 ); INSERT INTO population VALUES ( null, 'Islandikane', 'Waterford', 1670, 2000, 2043, 2081 ); INSERT INTO population VALUES ( null, 'Killea', 'Waterford', 1665, 1453, 1347, 1560 ); INSERT INTO population VALUES ( null, 'Killoteran', 'Waterford', 611, 635, 593, 563 ); INSERT INTO population VALUES ( null, 'Kilmacleague', 'Waterford', 295, 362, 405, 397 ); INSERT INTO population VALUES ( null, 'Kilmeadan', 'Waterford', 795, 831, 787, 754 ); INSERT INTO population VALUES ( null, 'Newcastle', 'Waterford', 399, 450, 496, 487 ); INSERT INTO population VALUES ( null, 'Pembrokestown', 'Waterford', 378, 473, 494, 502 ); INSERT INTO population VALUES ( null, 'Rathmoylan', 'Waterford', 849, 926, 1093, 1150 ); INSERT INTO population VALUES ( null, 'Reisk', 'Waterford', 879, 949, 1123, 1154 ); INSERT INTO population VALUES ( null, 'Tramore', 'Waterford', 7684, 8797, 9503, 9570 ); INSERT INTO population VALUES ( null, 'Woodstown', 'Waterford', 568, 589, 601, 602 ); INSERT INTO population VALUES ( null, 'Ardmore', 'Waterford', 694, 709, 733, 737 ); INSERT INTO population VALUES ( null, 'Ballyheeny', 'Waterford', 410, 540, 577, 594 ); INSERT INTO population VALUES ( null, 'Clashmore', 'Waterford', 385, 400, 405, 406 ); INSERT INTO population VALUES ( null, 'Glenwilliam', 'Waterford', 162, 177, 180, 164 ); INSERT INTO population VALUES ( null, 'Grallagh', 'Waterford', 178, 200, 244, 235 ); INSERT INTO population VALUES ( null, 'Grange', 'Waterford', 237, 262, 319, 353 ); INSERT INTO population VALUES ( null, 'Kinsalebeg', 'Waterford', 460, 481, 530, 574 ); INSERT INTO population VALUES ( null, 'Templemichael', 'Waterford', 373, 424, 435, 412 ); INSERT INTO population VALUES ( null, 'Ballybaan', 'Galway City', 5522, 9871, 12298, 13053 ); INSERT INTO population VALUES ( null, 'Baile an Bhriotaihg', 'Galway City', 701, 724, 898, 951 ); INSERT INTO population VALUES ( null, 'Bearna', 'Galway City', 10822, 12792, 14384, 15199 ); INSERT INTO population VALUES ( null, 'An Caislen Gearr', 'Galway City', 2334, 3602, 4135, 4037 ); INSERT INTO population VALUES ( null, 'Claddagh', 'Galway City', 2856, 2614, 2429, 2612 ); INSERT INTO population VALUES ( null, 'Dangan', 'Galway City', 4923, 4206, 3686, 4130 ); INSERT INTO population VALUES ( null, 'Eyre Square', 'Galway City', 4066, 4105, 4461, 4102 ); INSERT INTO population VALUES ( null, 'An Cnocn Carrach', 'Galway City', 1567, 1428, 1515, 1490 ); INSERT INTO population VALUES ( null, 'Lough Atalia', 'Galway City', 1154, 1113, 920, 918 ); INSERT INTO population VALUES ( null, 'Mionlach', 'Galway City', 4853, 5752, 4990, 5113 ); INSERT INTO population VALUES ( null, 'Mervue', 'Galway City', 2353, 2130, 1796, 1793 ); INSERT INTO population VALUES ( null, 'Murroogh', 'Galway City', 2219, 2382, 2414, 2838 ); INSERT INTO population VALUES ( null, 'Newcastle', 'Galway City', 2440, 1999, 1820, 1900 ); INSERT INTO population VALUES ( null, 'Nuns Island', 'Galway City', 1494, 1336, 1293, 1466 ); INSERT INTO population VALUES ( null, 'Rahoon', 'Galway City', 2340, 2920, 3009, 3065 ); INSERT INTO population VALUES ( null, 'Renmore', 'Galway City', 1664, 1426, 1394, 1309 ); INSERT INTO population VALUES ( null, 'Rockbarton', 'Galway City', 1867, 1813, 1922, 2084 ); INSERT INTO population VALUES ( null, 'Pariste San Nicolis', 'Galway City', 2769, 2677, 2598, 3265 ); INSERT INTO population VALUES ( null, 'Salthill', 'Galway City', 3402, 3376, 3482, 3650 ); INSERT INTO population VALUES ( null, 'Shantalla', 'Galway City', 1974, 1874, 1785, 1914 ); INSERT INTO population VALUES ( null, 'Taylors Hill', 'Galway City', 3003, 2713, 2457, 2960 ); INSERT INTO population VALUES ( null, 'Wellpark', 'Galway City', 1509, 1561, 1843, 1655 ); INSERT INTO population VALUES ( null, 'Ballinasloe Urban', 'Galway County', 5984, 6049, 6449, 6654 ); INSERT INTO population VALUES ( null, 'Abbeygormacan', 'Galway County', 426, 415, 416, 414 ); INSERT INTO population VALUES ( null, 'Ahascragh', 'Galway County', 645, 628, 637, 603 ); INSERT INTO population VALUES ( null, 'Aughrim', 'Galway County', 546, 573, 595, 576 ); INSERT INTO population VALUES ( null, 'Ballinasloe Rural', 'Galway County', 588, 571, 599, 574 ); INSERT INTO population VALUES ( null, 'Ballymacward', 'Galway County', 288, 319, 315, 308 ); INSERT INTO population VALUES ( null, 'Clonfert', 'Galway County', 427, 447, 457, 417 ); INSERT INTO population VALUES ( null, 'Clontuskert', 'Galway County', 238, 226, 212, 214 ); INSERT INTO population VALUES ( null, 'Kellysgrove', 'Galway County', 343, 343, 387, 361 ); INSERT INTO population VALUES ( null, 'Kilconnell', 'Galway County', 674, 680, 670, 675 ); INSERT INTO population VALUES ( null, 'Killaan', 'Galway County', 524, 520, 500, 526 ); INSERT INTO population VALUES ( null, 'Killallaghtan', 'Galway County', 418, 432, 436, 454 ); INSERT INTO population VALUES ( null, 'Killoran', 'Galway County', 323, 286, 279, 256 ); INSERT INTO population VALUES ( null, 'Killure', 'Galway County', 714, 800, 802, 727 ); INSERT INTO population VALUES ( null, 'Kilmacshane', 'Galway County', 202, 230, 245, 232 ); INSERT INTO population VALUES ( null, 'Kiltormer', 'Galway County', 605, 574, 531, 490 ); INSERT INTO population VALUES ( null, 'Kylemore', 'Galway County', 177, 172, 161, 153 ); INSERT INTO population VALUES ( null, 'Laurencetown', 'Galway County', 407, 371, 351, 360 ); INSERT INTO population VALUES ( null, 'Lismanny', 'Galway County', 261, 241, 239, 255 ); INSERT INTO population VALUES ( null, 'Oatfield', 'Galway County', 363, 412, 435, 434 ); INSERT INTO population VALUES ( null, 'Ballynakill', 'Galway County', 506, 527, 593, 425 ); INSERT INTO population VALUES ( null, 'Bunowen', 'Galway County', 448, 435, 460, 389 ); INSERT INTO population VALUES ( null, 'Cleggan', 'Galway County', 301, 287, 263, 276 ); INSERT INTO population VALUES ( null, 'Clifden', 'Galway County', 1929, 2118, 2613, 2145 ); INSERT INTO population VALUES ( null, 'Cushkillary', 'Galway County', 272, 177, 249, 319 ); INSERT INTO population VALUES ( null, 'Doonloughan', 'Galway County', 109, 103, 94, 76 ); INSERT INTO population VALUES ( null, 'Errislannan', 'Galway County', 259, 230, 229, 217 ); INSERT INTO population VALUES ( null, 'An Uillinn', 'Galway County', 99, 99, 103, 98 ); INSERT INTO population VALUES ( null, 'Inishbofin', 'Galway County', 178, 199, 160, 165 ); INSERT INTO population VALUES ( null, 'An Cnoc Bu', 'Galway County', 831, 798, 853, 810 ); INSERT INTO population VALUES ( null, 'Maros', 'Galway County', 406, 370, 337, 351 ); INSERT INTO population VALUES ( null, 'Abhainn Ghabhla', 'Galway County', 341, 313, 301, 257 ); INSERT INTO population VALUES ( null, 'Rinvyle', 'Galway County', 1365, 1280, 1330, 1211 ); INSERT INTO population VALUES ( null, 'Cloch na Rn', 'Galway County', 423, 393, 459, 417 ); INSERT INTO population VALUES ( null, 'Sillerna', 'Galway County', 444, 446, 441, 391 ); INSERT INTO population VALUES ( null, 'Scainimh', 'Galway County', 648, 619, 684, 611 ); INSERT INTO population VALUES ( null, 'Eanach Dhin', 'Galway County', 1551, 1710, 1860, 1885 ); INSERT INTO population VALUES ( null, 'Aughrim', 'Galway County', 865, 1072, 1215, 1296 ); INSERT INTO population VALUES ( null, 'Baile an Teampaill (part)', 'Galway County', 1096, 1393, 1462, 1477 ); INSERT INTO population VALUES ( null, 'Ballynacourty', 'Galway County', 1050, 1076, 1162, 1177 ); INSERT INTO population VALUES ( null, 'Bearna (part)', 'Galway County', 2476, 3024, 3630, 3739 ); INSERT INTO population VALUES ( null, 'Belleville', 'Galway County', 462, 502, 576, 624 ); INSERT INTO population VALUES ( null, 'An Carn Mr', 'Galway County', 1989, 2138, 2609, 2573 ); INSERT INTO population VALUES ( null, 'Ceathr an Bhrnaigh (part)', 'Galway County', 756, 881, 918, 989 ); INSERT INTO population VALUES ( null, 'Baile Chlir', 'Galway County', 1635, 1853, 2042, 2121 ); INSERT INTO population VALUES ( null, 'Clarinbridge', 'Galway County', 2092, 2666, 3271, 3548 ); INSERT INTO population VALUES ( null, 'Deerpark', 'Galway County', 1069, 1169, 1314, 1311 ); INSERT INTO population VALUES ( null, 'Na Forbacha', 'Galway County', 1272, 1239, 1312, 1403 ); INSERT INTO population VALUES ( null, 'Galway Rural (part)', 'Galway County', 131, 129, 126, 149 ); INSERT INTO population VALUES ( null, 'rainn', 'Galway County', 1280, 1225, 1251, 1217 ); INSERT INTO population VALUES ( null, 'Cill Chuimin', 'Galway County', 1298, 1304, 1315, 1312 ); INSERT INTO population VALUES ( null, 'Cill Aithnn', 'Galway County', 831, 963, 1000, 1044 ); INSERT INTO population VALUES ( null, 'Leacach Beag', 'Galway County', 947, 1236, 1403, 1527 ); INSERT INTO population VALUES ( null, 'Liscananaun', 'Galway County', 1112, 1348, 1432, 1533 ); INSERT INTO population VALUES ( null, 'Lisn an Bhealaigh', 'Galway County', 780, 911, 1005, 1064 ); INSERT INTO population VALUES ( null, 'Maigh Cuilinn', 'Galway County', 1402, 1772, 2008, 2143 ); INSERT INTO population VALUES ( null, 'Oranmore', 'Galway County', 2385, 3523, 4325, 4291 ); INSERT INTO population VALUES ( null, 'Sailearna', 'Galway County', 1299, 1362, 1448, 1451 ); INSERT INTO population VALUES ( null, 'Sliabh an Aonaigh', 'Galway County', 649, 690, 763, 762 ); INSERT INTO population VALUES ( null, 'An Spidal', 'Galway County', 1253, 1357, 1450, 1440 ); INSERT INTO population VALUES ( null, 'Stradbally', 'Galway County', 854, 1045, 1207, 1216 ); INSERT INTO population VALUES ( null, 'Tulaigh Mhic Aodhin', 'Galway County', 1367, 1755, 1985, 1992 ); INSERT INTO population VALUES ( null, 'Ballinastack', 'Galway County', 326, 327, 324, 330 ); INSERT INTO population VALUES ( null, 'Ballymoe', 'Galway County', 431, 428, 399, 417 ); INSERT INTO population VALUES ( null, 'Ballynakill', 'Galway County', 408, 451, 419, 386 ); INSERT INTO population VALUES ( null, 'Boyounagh', 'Galway County', 275, 271, 257, 253 ); INSERT INTO population VALUES ( null, 'Creggs', 'Galway County', 384, 392, 367, 365 ); INSERT INTO population VALUES ( null, 'Curraghmore', 'Galway County', 168, 171, 158, 176 ); INSERT INTO population VALUES ( null, 'Glennamaddy', 'Galway County', 835, 862, 867, 826 ); INSERT INTO population VALUES ( null, 'Island', 'Galway County', 289, 285, 286, 254 ); INSERT INTO population VALUES ( null, 'Kilcroan', 'Galway County', 535, 539, 561, 547 ); INSERT INTO population VALUES ( null, 'Kiltullagh', 'Galway County', 181, 180, 198, 219 ); INSERT INTO population VALUES ( null, 'Raheen', 'Galway County', 442, 490, 492, 470 ); INSERT INTO population VALUES ( null, 'Scregg', 'Galway County', 210, 221, 236, 230 ); INSERT INTO population VALUES ( null, 'Shankill', 'Galway County', 308, 306, 287, 286 ); INSERT INTO population VALUES ( null, 'Templetogher', 'Galway County', 431, 408, 393, 386 ); INSERT INTO population VALUES ( null, 'Toberroe', 'Galway County', 323, 316, 321, 302 ); INSERT INTO population VALUES ( null, 'Ardamullivan', 'Galway County', 562, 576, 587, 610 ); INSERT INTO population VALUES ( null, 'Ardrahan', 'Galway County', 375, 480, 540, 571 ); INSERT INTO population VALUES ( null, 'Ballycahalan', 'Galway County', 176, 190, 222, 216 ); INSERT INTO population VALUES ( null, 'Beagh', 'Galway County', 547, 603, 718, 708 ); INSERT INTO population VALUES ( null, 'Cahermore', 'Galway County', 337, 454, 515, 524 ); INSERT INTO population VALUES ( null, 'Cappard', 'Galway County', 96, 102, 99, 99 ); INSERT INTO population VALUES ( null, 'Castletaylor', 'Galway County', 386, 486, 574, 630 ); INSERT INTO population VALUES ( null, 'Doorus', 'Galway County', 517, 684, 748, 803 ); INSERT INTO population VALUES ( null, 'Drumacoo', 'Galway County', 867, 997, 1239, 1370 ); INSERT INTO population VALUES ( null, 'Gort', 'Galway County', 1809, 2782, 2671, 3037 ); INSERT INTO population VALUES ( null, 'Kilbeacanty', 'Galway County', 274, 285, 318, 326 ); INSERT INTO population VALUES ( null, 'Killeely', 'Galway County', 975, 1257, 1596, 1749 ); INSERT INTO population VALUES ( null, 'Killeenavarra', 'Galway County', 439, 651, 746, 805 ); INSERT INTO population VALUES ( null, 'Killinny', 'Galway County', 391, 399, 429, 454 ); INSERT INTO population VALUES ( null, 'Kiltartan', 'Galway County', 648, 670, 743, 827 ); INSERT INTO population VALUES ( null, 'Kilthomas', 'Galway County', 96, 90, 83, 88 ); INSERT INTO population VALUES ( null, 'Kinvarra', 'Galway County', 945, 1160, 1351, 1536 ); INSERT INTO population VALUES ( null, 'Rahasane', 'Galway County', 241, 279, 329, 337 ); INSERT INTO population VALUES ( null, 'Skehanagh', 'Galway County', 347, 395, 477, 480 ); INSERT INTO population VALUES ( null, 'Aille', 'Galway County', 394, 412, 389, 391 ); INSERT INTO population VALUES ( null, 'Athenry', 'Galway County', 2910, 4042, 4828, 5469 ); INSERT INTO population VALUES ( null, 'Ballynagar', 'Galway County', 183, 202, 195, 191 ); INSERT INTO population VALUES ( null, 'Bracklagh', 'Galway County', 418, 427, 460, 458 ); INSERT INTO population VALUES ( null, 'Bullaun', 'Galway County', 182, 213, 254, 326 ); INSERT INTO population VALUES ( null, 'Cappalusk', 'Galway County', 324, 357, 384, 384 ); INSERT INTO population VALUES ( null, 'Castleboy', 'Galway County', 472, 491, 550, 566 ); INSERT INTO population VALUES ( null, 'Cloonkeen', 'Galway County', 274, 348, 429, 463 ); INSERT INTO population VALUES ( null, 'Colmanstown', 'Galway County', 104, 93, 120, 131 ); INSERT INTO population VALUES ( null, 'Craughwell', 'Galway County', 1169, 1363, 1640, 1763 ); INSERT INTO population VALUES ( null, 'Derrylaur', 'Galway County', 129, 113, 108, 106 ); INSERT INTO population VALUES ( null, 'Drumkeary', 'Galway County', 538, 568, 573, 585 ); INSERT INTO population VALUES ( null, 'Graigabbey', 'Galway County', 235, 294, 393, 379 ); INSERT INTO population VALUES ( null, 'Grange', 'Galway County', 677, 696, 739, 711 ); INSERT INTO population VALUES ( null, 'Greethill', 'Galway County', 654, 809, 920, 1002 ); INSERT INTO population VALUES ( null, 'Kilchreest', 'Galway County', 303, 316, 312, 273 ); INSERT INTO population VALUES ( null, 'Kilconickny', 'Galway County', 469, 599, 655, 642 ); INSERT INTO population VALUES ( null, 'Kilconierin', 'Galway County', 311, 398, 527, 580 ); INSERT INTO population VALUES ( null, 'Killimor', 'Galway County', 321, 312, 331, 331 ); INSERT INTO population VALUES ( null, 'Killogilleen', 'Galway County', 490, 640, 818, 906 ); INSERT INTO population VALUES ( null, 'Kilmeen', 'Galway County', 544, 599, 631, 645 ); INSERT INTO population VALUES ( null, 'Kilreekill', 'Galway County', 278, 281, 325, 340 ); INSERT INTO population VALUES ( null, 'Kilteskill', 'Galway County', 266, 310, 368, 370 ); INSERT INTO population VALUES ( null, 'Kiltullagh', 'Galway County', 540, 648, 702, 749 ); INSERT INTO population VALUES ( null, 'Lackalea', 'Galway County', 220, 311, 383, 390 ); INSERT INTO population VALUES ( null, 'Leitrim', 'Galway County', 344, 404, 457, 484 ); INSERT INTO population VALUES ( null, 'Loughrea Rural', 'Galway County', 832, 885, 873, 860 ); INSERT INTO population VALUES ( null, 'Loughrea Urban', 'Galway County', 4004, 4532, 5062, 5542 ); INSERT INTO population VALUES ( null, 'Marblehill/Loughatorick', 'Galway County', 397, 405, 397, 365 ); INSERT INTO population VALUES ( null, 'Mountain', 'Galway County', 246, 256, 307, 276 ); INSERT INTO population VALUES ( null, 'Movode', 'Galway County', 185, 199, 254, 263 ); INSERT INTO population VALUES ( null, 'Raford', 'Galway County', 320, 381, 440, 479 ); INSERT INTO population VALUES ( null, 'Tiaquin', 'Galway County', 397, 479, 660, 728 ); INSERT INTO population VALUES ( null, 'Woodford', 'Galway County', 479, 500, 493, 459 ); INSERT INTO population VALUES ( null, 'Annagh', 'Galway County', 340, 343, 375, 363 ); INSERT INTO population VALUES ( null, 'Ballynakill', 'Galway County', 514, 506, 592, 606 ); INSERT INTO population VALUES ( null, 'Caltra', 'Galway County', 333, 351, 365, 366 ); INSERT INTO population VALUES ( null, 'Castleblakeney', 'Galway County', 429, 475, 526, 531 ); INSERT INTO population VALUES ( null, 'Castleffrench', 'Galway County', 451, 479, 524, 522 ); INSERT INTO population VALUES ( null, 'Clonbrock', 'Galway County', 499, 505, 553, 580 ); INSERT INTO population VALUES ( null, 'Cloonkeen', 'Galway County', 303, 280, 310, 306 ); INSERT INTO population VALUES ( null, 'Cooloo', 'Galway County', 508, 515, 542, 533 ); INSERT INTO population VALUES ( null, 'Derryglassaun', 'Galway County', 744, 792, 867, 859 ); INSERT INTO population VALUES ( null, 'Killeroran', 'Galway County', 1247, 1314, 1289, 1297 ); INSERT INTO population VALUES ( null, 'Killian', 'Galway County', 304, 311, 340, 347 ); INSERT INTO population VALUES ( null, 'Mount Bellew', 'Galway County', 1481, 1722, 1874, 1916 ); INSERT INTO population VALUES ( null, 'Mounthazel', 'Galway County', 404, 454, 496, 513 ); INSERT INTO population VALUES ( null, 'Taghboy', 'Galway County', 218, 209, 228, 221 ); INSERT INTO population VALUES ( null, 'Camas', 'Galway County', 388, 367, 358, 316 ); INSERT INTO population VALUES ( null, 'An Fhairche', 'Galway County', 916, 1006, 1098, 1124 ); INSERT INTO population VALUES ( null, 'Conga', 'Galway County', 512, 573, 561, 514 ); INSERT INTO population VALUES ( null, 'An Crompn', 'Galway County', 2266, 2294, 2505, 2470 ); INSERT INTO population VALUES ( null, 'An Chorr', 'Galway County', 159, 162, 155, 172 ); INSERT INTO population VALUES ( null, 'Garmna', 'Galway County', 1290, 1288, 1359, 1281 ); INSERT INTO population VALUES ( null, 'Cill Chuimn', 'Galway County', 118, 122, 162, 149 ); INSERT INTO population VALUES ( null, 'Leitir Breacin', 'Galway County', 220, 208, 250, 212 ); INSERT INTO population VALUES ( null, 'Letterfore', 'Galway County', 296, 288, 306, 259 ); INSERT INTO population VALUES ( null, 'Leitir Mir', 'Galway County', 812, 875, 908, 840 ); INSERT INTO population VALUES ( null, 'Oughterard', 'Galway County', 2380, 2563, 2604, 2636 ); INSERT INTO population VALUES ( null, 'An Ros', 'Galway County', 111, 104, 94, 95 ); INSERT INTO population VALUES ( null, 'An Turlach', 'Galway County', 477, 557, 545, 548 ); INSERT INTO population VALUES ( null, 'Wormhole', 'Galway County', 1655, 1985, 2315, 2374 ); INSERT INTO population VALUES ( null, 'Abbeyville', 'Galway County', 270, 252, 280, 266 ); INSERT INTO population VALUES ( null, 'Ballyglass', 'Galway County', 179, 169, 162, 176 ); INSERT INTO population VALUES ( null, 'Coos', 'Galway County', 140, 136, 111, 105 ); INSERT INTO population VALUES ( null, 'Derrew', 'Galway County', 173, 156, 166, 169 ); INSERT INTO population VALUES ( null, 'Drummin', 'Galway County', 350, 369, 369, 377 ); INSERT INTO population VALUES ( null, 'Eyrecourt', 'Galway County', 532, 477, 454, 444 ); INSERT INTO population VALUES ( null, 'Killimor', 'Galway County', 674, 702, 698, 704 ); INSERT INTO population VALUES ( null, 'Kilmalinoge', 'Galway County', 223, 236, 218, 231 ); INSERT INTO population VALUES ( null, 'Kilquain', 'Galway County', 300, 291, 318, 304 ); INSERT INTO population VALUES ( null, 'Meelick', 'Galway County', 231, 258, 278, 263 ); INSERT INTO population VALUES ( null, 'Moat', 'Galway County', 158, 162, 176, 148 ); INSERT INTO population VALUES ( null, 'Pallas', 'Galway County', 399, 420, 401, 397 ); INSERT INTO population VALUES ( null, 'Portumna', 'Galway County', 1920, 2030, 2327, 2277 ); INSERT INTO population VALUES ( null, 'Tiranascragh', 'Galway County', 164, 170, 174, 171 ); INSERT INTO population VALUES ( null, 'Tynagh', 'Galway County', 369, 414, 442, 447 ); INSERT INTO population VALUES ( null, 'Abbey East', 'Galway County', 597, 629, 670, 636 ); INSERT INTO population VALUES ( null, 'Abbey West', 'Galway County', 481, 577, 710, 777 ); INSERT INTO population VALUES ( null, 'Addergoole', 'Galway County', 497, 502, 550, 547 ); INSERT INTO population VALUES ( null, 'Annaghdown', 'Galway County', 1075, 1244, 1381, 1380 ); INSERT INTO population VALUES ( null, 'Ballinderry', 'Galway County', 292, 334, 468, 513 ); INSERT INTO population VALUES ( null, 'Ballinduff', 'Galway County', 513, 621, 705, 736 ); INSERT INTO population VALUES ( null, 'Ballynapark', 'Galway County', 665, 858, 990, 1116 ); INSERT INTO population VALUES ( null, 'Beaghmore', 'Galway County', 244, 288, 331, 369 ); INSERT INTO population VALUES ( null, 'Belclare', 'Galway County', 654, 742, 794, 750 ); INSERT INTO population VALUES ( null, 'Carrownagur', 'Galway County', 381, 379, 445, 439 ); INSERT INTO population VALUES ( null, 'Carrowrevagh', 'Galway County', 408, 398, 457, 442 ); INSERT INTO population VALUES ( null, 'Claretuam', 'Galway County', 943, 980, 1032, 1030 ); INSERT INTO population VALUES ( null, 'Clonbern', 'Galway County', 372, 370, 396, 360 ); INSERT INTO population VALUES ( null, 'Cloonkeen', 'Galway County', 417, 451, 460, 466 ); INSERT INTO population VALUES ( null, 'Cummer', 'Galway County', 706, 936, 1079, 1149 ); INSERT INTO population VALUES ( null, 'Donaghpatrick', 'Galway County', 483, 538, 563, 532 ); INSERT INTO population VALUES ( null, 'Doonbally', 'Galway County', 447, 503, 580, 618 ); INSERT INTO population VALUES ( null, 'Dunmore North', 'Galway County', 544, 548, 597, 570 ); INSERT INTO population VALUES ( null, 'Dunmore South', 'Galway County', 813, 861, 812, 831 ); INSERT INTO population VALUES ( null, 'Foxhall', 'Galway County', 563, 558, 591, 633 ); INSERT INTO population VALUES ( null, 'Headford', 'Galway County', 1281, 1349, 1489, 1518 ); INSERT INTO population VALUES ( null, 'Hillsbrook', 'Galway County', 639, 646, 692, 684 ); INSERT INTO population VALUES ( null, 'Kilbennan', 'Galway County', 339, 361, 376, 336 ); INSERT INTO population VALUES ( null, 'Kilcoona', 'Galway County', 475, 512, 619, 663 ); INSERT INTO population VALUES ( null, 'Killeany', 'Galway County', 456, 534, 610, 608 ); INSERT INTO population VALUES ( null, 'Killeen', 'Galway County', 598, 648, 658, 707 ); INSERT INTO population VALUES ( null, 'Killererin', 'Galway County', 675, 714, 732, 772 ); INSERT INTO population VALUES ( null, 'Killower', 'Galway County', 701, 729, 851, 885 ); INSERT INTO population VALUES ( null, 'Killursa', 'Galway County', 785, 959, 1076, 1155 ); INSERT INTO population VALUES ( null, 'Kilmoylan', 'Galway County', 700, 896, 1040, 1072 ); INSERT INTO population VALUES ( null, 'Kilshanvy', 'Galway County', 373, 384, 394, 378 ); INSERT INTO population VALUES ( null, 'Levally', 'Galway County', 338, 366, 360, 354 ); INSERT INTO population VALUES ( null, 'Milltown', 'Galway County', 538, 538, 633, 671 ); INSERT INTO population VALUES ( null, 'Monivea', 'Galway County', 564, 638, 655, 658 ); INSERT INTO population VALUES ( null, 'Moyne', 'Galway County', 645, 640, 678, 675 ); INSERT INTO population VALUES ( null, 'Ryehill', 'Galway County', 403, 569, 707, 782 ); INSERT INTO population VALUES ( null, 'Toberadosh', 'Galway County', 340, 353, 382, 361 ); INSERT INTO population VALUES ( null, 'Tuam Rural', 'Galway County', 3465, 4622, 5520, 6033 ); INSERT INTO population VALUES ( null, 'Tuam Urban', 'Galway County', 3104, 2997, 3304, 3517 ); INSERT INTO population VALUES ( null, 'Ballinamore', 'Leitrim', 997, 1079, 1096, 1105 ); INSERT INTO population VALUES ( null, 'Cloverhill', 'Leitrim', 311, 333, 345, 346 ); INSERT INTO population VALUES ( null, 'Corrala', 'Leitrim', 211, 226, 248, 244 ); INSERT INTO population VALUES ( null, 'Drumreilly North', 'Leitrim', 150, 157, 157, 158 ); INSERT INTO population VALUES ( null, 'Drumreilly South', 'Leitrim', 129, 126, 135, 143 ); INSERT INTO population VALUES ( null, 'Garadice', 'Leitrim', 520, 483, 569, 523 ); INSERT INTO population VALUES ( null, '011 Greaghlass/Stralongford', 'Leitrim', 325, 345, 358, 335 ); INSERT INTO population VALUES ( null, 'Killygar', 'Leitrim', 125, 133, 143, 124 ); INSERT INTO population VALUES ( null, 'Newtowngore', 'Leitrim', 201, 196, 230, 244 ); INSERT INTO population VALUES ( null, 'Oughteragh', 'Leitrim', 90, 83, 89, 90 ); INSERT INTO population VALUES ( null, 'Aghacashel', 'Leitrim', 74, 87, 73, 77 ); INSERT INTO population VALUES ( null, 'Annaduff', 'Leitrim', 164, 206, 221, 227 ); INSERT INTO population VALUES ( null, 'Barnameenagh', 'Leitrim', 128, 154, 159, 145 ); INSERT INTO population VALUES ( null, 'Carrick-on-Shannon', 'Leitrim', 2663, 3505, 3986, 4085 ); INSERT INTO population VALUES ( null, '016 Drumreilly West/Drumreilly East', 'Leitrim', 181, 186, 186, 168 ); INSERT INTO population VALUES ( null, 'Drumshanbo', 'Leitrim', 977, 1061, 1282, 1375 ); INSERT INTO population VALUES ( null, 'Drumsna', 'Leitrim', 532, 594, 701, 685 ); INSERT INTO population VALUES ( null, 'Gortnagullion', 'Leitrim', 234, 279, 266, 290 ); INSERT INTO population VALUES ( null, 'Gowel', 'Leitrim', 295, 317, 333, 325 ); INSERT INTO population VALUES ( null, 'Keshcarrigan', 'Leitrim', 270, 365, 473, 486 ); INSERT INTO population VALUES ( null, 'Kiltubbrid', 'Leitrim', 124, 149, 153, 145 ); INSERT INTO population VALUES ( null, 'Leitrim', 'Leitrim', 618, 870, 1123, 1221 ); INSERT INTO population VALUES ( null, 'Moher', 'Leitrim', 181, 199, 234, 224 ); INSERT INTO population VALUES ( null, 'Yugan', 'Leitrim', 228, 238, 225, 221 ); INSERT INTO population VALUES ( null, 'Gubacreeny', 'Leitrim', 463, 521, 779, 741 ); INSERT INTO population VALUES ( null, 'Kinlough', 'Leitrim', 498, 864, 960, 978 ); INSERT INTO population VALUES ( null, 'Tullaghan', 'Leitrim', 520, 594, 690, 694 ); INSERT INTO population VALUES ( null, 'Ballaghameehan', 'Leitrim', 200, 206, 216, 189 ); INSERT INTO population VALUES ( null, 'Belhavel', 'Leitrim', 257, 281, 261, 239 ); INSERT INTO population VALUES ( null, 'Cloonclare', 'Leitrim', 184, 193, 189, 176 ); INSERT INTO population VALUES ( null, 'Cloonlogher', 'Leitrim', 263, 272, 309, 285 ); INSERT INTO population VALUES ( null, 'Drumahaire', 'Leitrim', 973, 1244, 1506, 1530 ); INSERT INTO population VALUES ( null, 'Drumkeeran', 'Leitrim', 523, 535, 525, 465 ); INSERT INTO population VALUES ( null, 'Garvagh(041)/Arigna(034)', 'Leitrim', 134, 140, 166, 180 ); INSERT INTO population VALUES ( null, 'Glenade', 'Leitrim', 153, 175, 154, 172 ); INSERT INTO population VALUES ( null, 'Glenaniff', 'Leitrim', 160, 158, 175, 163 ); INSERT INTO population VALUES ( null, 'Glenboy', 'Leitrim', 212, 244, 238, 237 ); INSERT INTO population VALUES ( null, 'Glencar', 'Leitrim', 239, 248, 250, 256 ); INSERT INTO population VALUES ( null, 'Glenfarn', 'Leitrim', 121, 131, 147, 133 ); INSERT INTO population VALUES ( null, 'Killanummery', 'Leitrim', 346, 367, 385, 361 ); INSERT INTO population VALUES ( null, 'Killarga', 'Leitrim', 100, 91, 88, 67 ); INSERT INTO population VALUES ( null, 'Kiltyclogher', 'Leitrim', 254, 254, 233, 206 ); INSERT INTO population VALUES ( null, 'Lurganboy', 'Leitrim', 363, 385, 388, 416 ); INSERT INTO population VALUES ( null, 'Mahanagh', 'Leitrim', 265, 290, 315, 296 ); INSERT INTO population VALUES ( null, 'Manorhamilton', 'Leitrim', 1422, 1655, 1782, 1889 ); INSERT INTO population VALUES ( null, 'Munakill', 'Leitrim', 191, 213, 196, 172 ); INSERT INTO population VALUES ( null, 'Sramore', 'Leitrim', 268, 307, 370, 390 ); INSERT INTO population VALUES ( null, 'St. Patricks', 'Leitrim', 141, 146, 137, 125 ); INSERT INTO population VALUES ( null, 'Aghavas', 'Leitrim', 284, 296, 322, 323 ); INSERT INTO population VALUES ( null, 'Beihy', 'Leitrim', 306, 310, 328, 330 ); INSERT INTO population VALUES ( null, 'Breandrum', 'Leitrim', 267, 267, 269, 253 ); INSERT INTO population VALUES ( null, 'Bunnybeg', 'Leitrim', 146, 150, 169, 152 ); INSERT INTO population VALUES ( null, 'Carrigallen East', 'Leitrim', 281, 321, 301, 297 ); INSERT INTO population VALUES ( null, 'Carrigallen West', 'Leitrim', 400, 387, 525, 561 ); INSERT INTO population VALUES ( null, 'Cashel', 'Leitrim', 156, 159, 164, 170 ); INSERT INTO population VALUES ( null, 'Castlefore', 'Leitrim', 227, 252, 256, 259 ); INSERT INTO population VALUES ( null, 'Cattan', 'Leitrim', 261, 267, 260, 235 ); INSERT INTO population VALUES ( null, 'Cloone', 'Leitrim', 321, 327, 333, 336 ); INSERT INTO population VALUES ( null, 'Corriga', 'Leitrim', 172, 162, 149, 142 ); INSERT INTO population VALUES ( null, 'Drumard', 'Leitrim', 229, 209, 215, 206 ); INSERT INTO population VALUES ( null, 'Drumdoo', 'Leitrim', 319, 290, 299, 305 ); INSERT INTO population VALUES ( null, 'Drumod', 'Leitrim', 511, 586, 776, 871 ); INSERT INTO population VALUES ( null, 'Fenagh', 'Leitrim', 318, 344, 380, 392 ); INSERT INTO population VALUES ( null, 'Gortermone', 'Leitrim', 296, 300, 289, 273 ); INSERT INTO population VALUES ( null, 'Keeldra', 'Leitrim', 235, 205, 198, 179 ); INSERT INTO population VALUES ( null, 'Lisgillock', 'Leitrim', 209, 216, 197, 185 ); INSERT INTO population VALUES ( null, 'Mohill', 'Leitrim', 1328, 1390, 1378, 1257 ); INSERT INTO population VALUES ( null, 'Rinn', 'Leitrim', 245, 267, 293, 369 ); INSERT INTO population VALUES ( null, 'Riverstown', 'Leitrim', 249, 262, 248, 237 ); INSERT INTO population VALUES ( null, 'Roosky', 'Leitrim', 404, 423, 497, 613 ); INSERT INTO population VALUES ( null, 'Rowan', 'Leitrim', 226, 231, 251, 248 ); INSERT INTO population VALUES ( null, 'Ardnaree South Urban', 'Mayo', 2367, 2582, 2455, 2417 ); INSERT INTO population VALUES ( null, 'Ballina Urban', 'Mayo', 4627, 4280, 4021, 4136 ); INSERT INTO population VALUES ( null, 'Castlebar Urban', 'Mayo', 6585, 6185, 6049, 6162 ); INSERT INTO population VALUES ( null, 'Westport Urban', 'Mayo', 5314, 5163, 5543, 5894 ); INSERT INTO population VALUES ( null, 'Ardagh', 'Mayo', 314, 334, 347, 357 ); INSERT INTO population VALUES ( null, 'Ardnaree North', 'Mayo', 920, 968, 986, 964 ); INSERT INTO population VALUES ( null, 'Ardnaree South Rural', 'Mayo', 1687, 2446, 2928, 3083 ); INSERT INTO population VALUES ( null, 'Attymass East', 'Mayo', 371, 405, 393, 383 ); INSERT INTO population VALUES ( null, 'Attymass West', 'Mayo', 223, 229, 241, 231 ); INSERT INTO population VALUES ( null, 'Ballina Rural', 'Mayo', 2283, 2548, 2905, 2991 ); INSERT INTO population VALUES ( null, 'Ballycastle', 'Mayo', 675, 633, 659, 609 ); INSERT INTO population VALUES ( null, 'Ballysakeery', 'Mayo', 523, 548, 589, 614 ); INSERT INTO population VALUES ( null, 'Bal Deirg Mr', 'Mayo', 199, 179, 175, 157 ); INSERT INTO population VALUES ( null, 'Bunaveela', 'Mayo', 117, 108, 94, 80 ); INSERT INTO population VALUES ( null, 'Carrowmore', 'Mayo', 768, 850, 917, 909 ); INSERT INTO population VALUES ( null, 'Crossmolina North', 'Mayo', 924, 960, 1032, 1061 ); INSERT INTO population VALUES ( null, 'Crossmolina South', 'Mayo', 779, 810, 878, 818 ); INSERT INTO population VALUES ( null, 'Deel', 'Mayo', 551, 511, 532, 487 ); INSERT INTO population VALUES ( null, 'Derry', 'Mayo', 236, 216, 195, 175 ); INSERT INTO population VALUES ( null, 'Fortland', 'Mayo', 476, 480, 551, 567 ); INSERT INTO population VALUES ( null, 'Kilfian East', 'Mayo', 233, 219, 226, 237 ); INSERT INTO population VALUES ( null, 'Kilfian South', 'Mayo', 250, 246, 259, 254 ); INSERT INTO population VALUES ( null, 'Kilfian West', 'Mayo', 151, 133, 134, 111 ); INSERT INTO population VALUES ( null, 'Kilgarvan', 'Mayo', 749, 773, 801, 757 ); INSERT INTO population VALUES ( null, 'Killala', 'Mayo', 1321, 1256, 1310, 1247 ); INSERT INTO population VALUES ( null, 'Lackan North', 'Mayo', 350, 354, 351, 305 ); INSERT INTO population VALUES ( null, 'Lackan South', 'Mayo', 454, 435, 445, 430 ); INSERT INTO population VALUES ( null, 'Letterbrick', 'Mayo', 188, 162, 154, 125 ); INSERT INTO population VALUES ( null, 'Mount Falcon', 'Mayo', 1178, 1218, 1297, 1261 ); INSERT INTO population VALUES ( null, 'Rathoma', 'Mayo', 231, 218, 239, 217 ); INSERT INTO population VALUES ( null, 'Sallymount', 'Mayo', 464, 446, 474, 482 ); INSERT INTO population VALUES ( null, 'Sraheen', 'Mayo', 910, 1054, 1189, 1077 ); INSERT INTO population VALUES ( null, 'Baile an Chalaidh', 'Mayo', 236, 261, 226, 223 ); INSERT INTO population VALUES ( null, 'Ballinrobe', 'Mayo', 2536, 3155, 3678, 3685 ); INSERT INTO population VALUES ( null, 'Baile bha', 'Mayo', 218, 221, 215, 206 ); INSERT INTO population VALUES ( null, 'Burriscarra', 'Mayo', 447, 442, 440, 422 ); INSERT INTO population VALUES ( null, 'An Cheapaigh Dhuibh', 'Mayo', 341, 340, 342, 370 ); INSERT INTO population VALUES ( null, 'Cong', 'Mayo', 750, 739, 823, 865 ); INSERT INTO population VALUES ( null, 'Coonard', 'Mayo', 258, 270, 279, 261 ); INSERT INTO population VALUES ( null, 'Dalgan', 'Mayo', 1037, 1099, 1108, 1111 ); INSERT INTO population VALUES ( null, 'Hollymount', 'Mayo', 762, 766, 823, 789 ); INSERT INTO population VALUES ( null, 'Houndswood', 'Mayo', 553, 601, 648, 650 ); INSERT INTO population VALUES ( null, 'Kilcommon', 'Mayo', 657, 652, 692, 667 ); INSERT INTO population VALUES ( null, 'Kilmaine', 'Mayo', 943, 964, 988, 970 ); INSERT INTO population VALUES ( null, 'Neale', 'Mayo', 674, 685, 773, 780 ); INSERT INTO population VALUES ( null, 'Newbrook', 'Mayo', 522, 518, 531, 518 ); INSERT INTO population VALUES ( null, 'Abhainn Bhrain', 'Mayo', 245, 248, 241, 197 ); INSERT INTO population VALUES ( null, 'Partra', 'Mayo', 479, 493, 562, 563 ); INSERT INTO population VALUES ( null, 'Roslee', 'Mayo', 376, 392, 413, 437 ); INSERT INTO population VALUES ( null, 'Shrule', 'Mayo', 889, 1070, 1131, 1144 ); INSERT INTO population VALUES ( null, 'An Geata Mr Thuaidh', 'Mayo', 883, 843, 976, 917 ); INSERT INTO population VALUES ( null, 'An Geata Mr Theas', 'Mayo', 929, 921, 914, 978 ); INSERT INTO population VALUES ( null, 'Bangor', 'Mayo', 463, 478, 465, 462 ); INSERT INTO population VALUES ( null, 'Barr Rsca', 'Mayo', 134, 109, 113, 100 ); INSERT INTO population VALUES ( null, 'Bal an Mhuirthead', 'Mayo', 1880, 2011, 2073, 1945 ); INSERT INTO population VALUES ( null, 'Gleann na Muaidhe', 'Mayo', 248, 251, 243, 214 ); INSERT INTO population VALUES ( null, 'Gleann Chaisil', 'Mayo', 490, 520, 526, 493 ); INSERT INTO population VALUES ( null, 'Glenco(058)/Sheskin(065)', 'Mayo', 125, 117, 97, 91 ); INSERT INTO population VALUES ( null, 'Guala Mhr', 'Mayo', 168, 155, 129, 134 ); INSERT INTO population VALUES ( null, 'Cnoc an Daimh', 'Mayo', 389, 356, 358, 339 ); INSERT INTO population VALUES ( null, 'Cnoc na Lobhar', 'Mayo', 847, 857, 831, 755 ); INSERT INTO population VALUES ( null, 'Moing na B', 'Mayo', 309, 326, 282, 239 ); INSERT INTO population VALUES ( null, 'Na Monga', 'Mayo', 258, 237, 252, 221 ); INSERT INTO population VALUES ( null, 'Cnoc na Rithe', 'Mayo', 804, 742, 746, 712 ); INSERT INTO population VALUES ( null, 'Addergoole', 'Mayo', 709, 772, 861, 841 ); INSERT INTO population VALUES ( null, 'Balla', 'Mayo', 1213, 1362, 1477, 1549 ); INSERT INTO population VALUES ( null, 'Ballinafad', 'Mayo', 436, 506, 606, 591 ); INSERT INTO population VALUES ( null, 'Ballyhean', 'Mayo', 487, 532, 610, 587 ); INSERT INTO population VALUES ( null, 'Ballynagoraher', 'Mayo', 385, 357, 358, 357 ); INSERT INTO population VALUES ( null, 'Bellavary', 'Mayo', 914, 938, 1007, 1081 ); INSERT INTO population VALUES ( null, 'Breaghwy', 'Mayo', 1361, 1703, 1755, 1839 ); INSERT INTO population VALUES ( null, 'Burren', 'Mayo', 276, 292, 300, 307 ); INSERT INTO population VALUES ( null, 'Castlebar Rural', 'Mayo', 5882, 6841, 7209, 7334 ); INSERT INTO population VALUES ( null, 'Clogher', 'Mayo', 488, 495, 552, 552 ); INSERT INTO population VALUES ( null, 'Cloonkeen', 'Mayo', 753, 766, 778, 793 ); INSERT INTO population VALUES ( null, 'Croaghmoyle', 'Mayo', 188, 162, 166, 168 ); INSERT INTO population VALUES ( null, 'Killavally', 'Mayo', 402, 454, 460, 483 ); INSERT INTO population VALUES ( null, 'Manulla', 'Mayo', 789, 856, 987, 986 ); INSERT INTO population VALUES ( null, 'Pontoon', 'Mayo', 381, 417, 473, 486 ); INSERT INTO population VALUES ( null, 'Strade', 'Mayo', 602, 570, 590, 596 ); INSERT INTO population VALUES ( null, 'Tamhnaigh na Gra', 'Mayo', 366, 360, 361, 348 ); INSERT INTO population VALUES ( null, 'Turlough', 'Mayo', 1022, 1229, 1465, 1436 ); INSERT INTO population VALUES ( null, 'Ballindine', 'Mayo', 814, 796, 823, 812 ); INSERT INTO population VALUES ( null, 'Ballyhaunis', 'Mayo', 2149, 2598, 2994, 3056 ); INSERT INTO population VALUES ( null, 'Ballyhowly', 'Mayo', 438, 494, 464, 434 ); INSERT INTO population VALUES ( null, 'Bekan', 'Mayo', 732, 718, 756, 752 ); INSERT INTO population VALUES ( null, 'Caraun', 'Mayo', 339, 346, 343, 408 ); INSERT INTO population VALUES ( null, 'Claremorris', 'Mayo', 2685, 3170, 3987, 4487 ); INSERT INTO population VALUES ( null, 'Cloghermore', 'Mayo', 185, 168, 163, 161 ); INSERT INTO population VALUES ( null, 'Course', 'Mayo', 414, 443, 450, 413 ); INSERT INTO population VALUES ( null, 'Crossboyne', 'Mayo', 493, 599, 585, 584 ); INSERT INTO population VALUES ( null, 'Culnacleha', 'Mayo', 460, 484, 477, 461 ); INSERT INTO population VALUES ( null, 'Garrymore', 'Mayo', 443, 455, 465, 461 ); INSERT INTO population VALUES ( null, 'Kilcolman', 'Mayo', 466, 452, 523, 460 ); INSERT INTO population VALUES ( null, 'Kilvine', 'Mayo', 585, 607, 587, 628 ); INSERT INTO population VALUES ( null, 'Knock North', 'Mayo', 670, 699, 840, 944 ); INSERT INTO population VALUES ( null, 'Knock South', 'Mayo', 734, 747, 730, 725 ); INSERT INTO population VALUES ( null, 'Loughanboy', 'Mayo', 354, 354, 358, 335 ); INSERT INTO population VALUES ( null, 'Mayo', 'Mayo', 426, 426, 438, 450 ); INSERT INTO population VALUES ( null, 'Murneen', 'Mayo', 399, 420, 396, 349 ); INSERT INTO population VALUES ( null, 'Tagheen', 'Mayo', 184, 201, 197, 168 ); INSERT INTO population VALUES ( null, 'Aghamore', 'Mayo', 589, 620, 626, 617 ); INSERT INTO population VALUES ( null, 'Ballinamore', 'Mayo', 394, 353, 388, 353 ); INSERT INTO population VALUES ( null, 'Bohola', 'Mayo', 205, 225, 309, 276 ); INSERT INTO population VALUES ( null, 'Brackloon', 'Mayo', 573, 603, 646, 636 ); INSERT INTO population VALUES ( null, 'Callow', 'Mayo', 392, 378, 412, 389 ); INSERT INTO population VALUES ( null, 'Cloonmore', 'Mayo', 508, 504, 492, 438 ); INSERT INTO population VALUES ( null, 'Coolnaha', 'Mayo', 459, 496, 503, 511 ); INSERT INTO population VALUES ( null, 'Cuildoo', 'Mayo', 363, 380, 373, 347 ); INSERT INTO population VALUES ( null, 'Doocastle', 'Mayo', 402, 419, 377, 366 ); INSERT INTO population VALUES ( null, 'Kilbeagh', 'Mayo', 963, 1057, 1078, 993 ); INSERT INTO population VALUES ( null, 'Kilkelly', 'Mayo', 839, 905, 958, 899 ); INSERT INTO population VALUES ( null, 'Killedan', 'Mayo', 648, 707, 733, 689 ); INSERT INTO population VALUES ( null, 'Kilmovee', 'Mayo', 613, 633, 687, 654 ); INSERT INTO population VALUES ( null, 'Kiltamagh', 'Mayo', 1386, 1534, 1510, 1427 ); INSERT INTO population VALUES ( null, 'Meelick', 'Mayo', 517, 565, 591, 574 ); INSERT INTO population VALUES ( null, 'Sonnagh', 'Mayo', 1206, 1287, 1124, 1150 ); INSERT INTO population VALUES ( null, 'Swineford', 'Mayo', 2724, 2682, 2622, 2526 ); INSERT INTO population VALUES ( null, 'Toocananagh', 'Mayo', 351, 378, 426, 426 ); INSERT INTO population VALUES ( null, 'Toomore', 'Mayo', 1312, 1410, 1621, 1599 ); INSERT INTO population VALUES ( null, 'Tumgesh', 'Mayo', 325, 326, 360, 362 ); INSERT INTO population VALUES ( null, 'Urlaur', 'Mayo', 523, 527, 543, 494 ); INSERT INTO population VALUES ( null, 'Acaill', 'Mayo', 958, 932, 896, 851 ); INSERT INTO population VALUES ( null, 'Aghagower North', 'Mayo', 735, 849, 994, 1011 ); INSERT INTO population VALUES ( null, 'Aghagower South', 'Mayo', 140, 131, 116, 108 ); INSERT INTO population VALUES ( null, 'Aillemore', 'Mayo', 373, 353, 341, 347 ); INSERT INTO population VALUES ( null, 'Ballycroy North', 'Mayo', 315, 306, 320, 300 ); INSERT INTO population VALUES ( null, 'Ballycroy South', 'Mayo', 353, 373, 343, 331 ); INSERT INTO population VALUES ( null, 'Clare Island', 'Mayo', 199, 194, 221, 208 ); INSERT INTO population VALUES ( null, 'Clogher', 'Mayo', 743, 776, 870, 858 ); INSERT INTO population VALUES ( null, 'An Corrn', 'Mayo', 744, 700, 726, 673 ); INSERT INTO population VALUES ( null, 'Croaghpatrick', 'Mayo', 448, 563, 572, 579 ); INSERT INTO population VALUES ( null, 'Derryloughan', 'Mayo', 548, 579, 654, 683 ); INSERT INTO population VALUES ( null, 'Dumha ige', 'Mayo', 673, 662, 626, 623 ); INSERT INTO population VALUES ( null, 'Drummin', 'Mayo', 186, 190, 183, 181 ); INSERT INTO population VALUES ( null, 'Emlagh', 'Mayo', 267, 255, 306, 325 ); INSERT INTO population VALUES ( null, 'Erriff', 'Mayo', 107, 104, 125, 122 ); INSERT INTO population VALUES ( null, 'Glenhest', 'Mayo', 212, 228, 235, 245 ); INSERT INTO population VALUES ( null, 'Islandeady', 'Mayo', 915, 1000, 1008, 1006 ); INSERT INTO population VALUES ( null, 'Kilgeever', 'Mayo', 127, 105, 114, 117 ); INSERT INTO population VALUES ( null, 'Kilmaclasser', 'Mayo', 539, 534, 560, 637 ); INSERT INTO population VALUES ( null, 'Kilmeena', 'Mayo', 1170, 1445, 1546, 1514 ); INSERT INTO population VALUES ( null, 'Kilsallagh', 'Mayo', 442, 501, 585, 531 ); INSERT INTO population VALUES ( null, 'Knappagh', 'Mayo', 609, 645, 751, 770 ); INSERT INTO population VALUES ( null, 'Louisburgh', 'Mayo', 755, 811, 983, 959 ); INSERT INTO population VALUES ( null, 'Newport East', 'Mayo', 935, 1021, 1133, 1159 ); INSERT INTO population VALUES ( null, 'Newport West', 'Mayo', 701, 790, 780, 811 ); INSERT INTO population VALUES ( null, 'Owennadornaun(150)/Bundorragha(130)', 'Mayo', 193, 151, 160, 173 ); INSERT INTO population VALUES ( null, 'Slievemahanagh', 'Mayo', 398, 429, 456, 454 ); INSERT INTO population VALUES ( null, 'Slievemore', 'Mayo', 1028, 1052, 1072, 990 ); INSERT INTO population VALUES ( null, 'Srahmore', 'Mayo', 113, 131, 128, 139 ); INSERT INTO population VALUES ( null, 'Westport Rural', 'Mayo', 1336, 1463, 1577, 1516 ); INSERT INTO population VALUES ( null, 'Athlone West Rural', 'Roscommon', 2262, 3122, 4450, 4960 ); INSERT INTO population VALUES ( null, 'Ballydangan', 'Roscommon', 623, 653, 702, 716 ); INSERT INTO population VALUES ( null, 'Ballynamona', 'Roscommon', 493, 504, 538, 512 ); INSERT INTO population VALUES ( null, 'Caltragh', 'Roscommon', 220, 251, 275, 262 ); INSERT INTO population VALUES ( null, 'Carnagh', 'Roscommon', 567, 693, 777, 794 ); INSERT INTO population VALUES ( null, 'Carrowreagh', 'Roscommon', 446, 468, 534, 524 ); INSERT INTO population VALUES ( null, 'Castlesampson', 'Roscommon', 371, 342, 394, 405 ); INSERT INTO population VALUES ( null, 'Cloonburren', 'Roscommon', 199, 232, 244, 235 ); INSERT INTO population VALUES ( null, 'Cloonown', 'Roscommon', 210, 237, 243, 263 ); INSERT INTO population VALUES ( null, 'Crannagh', 'Roscommon', 1058, 1148, 1177, 1181 ); INSERT INTO population VALUES ( null, 'Creagh', 'Roscommon', 1060, 1084, 1035, 1000 ); INSERT INTO population VALUES ( null, 'Culliagh', 'Roscommon', 197, 191, 204, 207 ); INSERT INTO population VALUES ( null, 'Drumlosh', 'Roscommon', 304, 319, 323, 335 ); INSERT INTO population VALUES ( null, 'Dysart', 'Roscommon', 213, 229, 242, 243 ); INSERT INTO population VALUES ( null, 'Kilcar', 'Roscommon', 290, 334, 369, 359 ); INSERT INTO population VALUES ( null, 'Kiltoom', 'Roscommon', 1468, 1614, 1656, 1620 ); INSERT INTO population VALUES ( null, 'Lecarrow', 'Roscommon', 266, 311, 314, 350 ); INSERT INTO population VALUES ( null, 'Moore', 'Roscommon', 260, 278, 310, 308 ); INSERT INTO population VALUES ( null, 'Rockhill', 'Roscommon', 279, 333, 374, 411 ); INSERT INTO population VALUES ( null, 'Taghboy', 'Roscommon', 386, 402, 473, 513 ); INSERT INTO population VALUES ( null, 'Taghmaconnell', 'Roscommon', 268, 254, 276, 271 ); INSERT INTO population VALUES ( null, 'Thomastown', 'Roscommon', 733, 743, 738, 738 ); INSERT INTO population VALUES ( null, 'Turrock', 'Roscommon', 287, 317, 347, 340 ); INSERT INTO population VALUES ( null, 'Aghafin', 'Roscommon', 138, 130, 135, 140 ); INSERT INTO population VALUES ( null, 'Aughrim East', 'Roscommon', 206, 204, 227, 221 ); INSERT INTO population VALUES ( null, 'Aughrim West', 'Roscommon', 176, 187, 188, 173 ); INSERT INTO population VALUES ( null, 'Ballyfarnan', 'Roscommon', 234, 215, 247, 234 ); INSERT INTO population VALUES ( null, 'Ballyfermoyle', 'Roscommon', 144, 135, 155, 165 ); INSERT INTO population VALUES ( null, 'Boyle Rural', 'Roscommon', 970, 1366, 1533, 1595 ); INSERT INTO population VALUES ( null, 'Boyle Urban', 'Roscommon', 1643, 1599, 1459, 1501 ); INSERT INTO population VALUES ( null, 'Breedoge', 'Roscommon', 264, 257, 239, 241 ); INSERT INTO population VALUES ( null, 'Cloonteen', 'Roscommon', 255, 284, 291, 273 ); INSERT INTO population VALUES ( null, 'Creeve', 'Roscommon', 149, 126, 169, 120 ); INSERT INTO population VALUES ( null, 'Croghan', 'Roscommon', 256, 269, 359, 379 ); INSERT INTO population VALUES ( null, 'Crossna', 'Roscommon', 172, 187, 207, 187 ); INSERT INTO population VALUES ( null, 'Danesfort', 'Roscommon', 583, 758, 865, 827 ); INSERT INTO population VALUES ( null, 'Estersnow', 'Roscommon', 98, 97, 88, 87 ); INSERT INTO population VALUES ( null, 'Keadew', 'Roscommon', 454, 481, 486, 533 ); INSERT INTO population VALUES ( null, 'Kilbryan', 'Roscommon', 301, 304, 321, 326 ); INSERT INTO population VALUES ( null, 'Kilcolagh', 'Roscommon', 85, 86, 126, 148 ); INSERT INTO population VALUES ( null, 'Killukin', 'Roscommon', 226, 256, 286, 270 ); INSERT INTO population VALUES ( null, 'Killummod', 'Roscommon', 90, 90, 107, 119 ); INSERT INTO population VALUES ( null, 'Kilmacumsy', 'Roscommon', 183, 253, 319, 310 ); INSERT INTO population VALUES ( null, 'Kilmore', 'Roscommon', 158, 159, 184, 180 ); INSERT INTO population VALUES ( null, '048 Lisgarve/Mantua', 'Roscommon', 214, 220, 237, 224 ); INSERT INTO population VALUES ( null, '025 Lough Allen/Altagowlan', 'Roscommon', 330, 309, 312, 275 ); INSERT INTO population VALUES ( null, 'Oakport', 'Roscommon', 235, 246, 319, 414 ); INSERT INTO population VALUES ( null, 'Rockingham', 'Roscommon', 379, 339, 345, 343 ); INSERT INTO population VALUES ( null, 'Rushfield', 'Roscommon', 423, 436, 425, 371 ); INSERT INTO population VALUES ( null, 'Tivannagh', 'Roscommon', 236, 253, 285, 258 ); INSERT INTO population VALUES ( null, 'Tumna North', 'Roscommon', 170, 181, 178, 166 ); INSERT INTO population VALUES ( null, 'Tumna South', 'Roscommon', 174, 192, 204, 191 ); INSERT INTO population VALUES ( null, 'Artagh North', 'Roscommon', 802, 799, 850, 829 ); INSERT INTO population VALUES ( null, 'Artagh South', 'Roscommon', 435, 444, 458, 450 ); INSERT INTO population VALUES ( null, 'Ballaghaderreen', 'Roscommon', 2319, 2740, 2768, 2651 ); INSERT INTO population VALUES ( null, 'Ballinlough', 'Roscommon', 948, 1027, 1013, 992 ); INSERT INTO population VALUES ( null, 'Ballintober', 'Roscommon', 686, 686, 758, 736 ); INSERT INTO population VALUES ( null, 'Baslick', 'Roscommon', 147, 152, 163, 153 ); INSERT INTO population VALUES ( null, 'Bellanagare', 'Roscommon', 536, 575, 629, 639 ); INSERT INTO population VALUES ( null, 'Buckill', 'Roscommon', 387, 371, 374, 331 ); INSERT INTO population VALUES ( null, 'Carrowduff', 'Roscommon', 189, 216, 203, 236 ); INSERT INTO population VALUES ( null, 'Castleplunket', 'Roscommon', 483, 514, 512, 521 ); INSERT INTO population VALUES ( null, 'Castlereagh', 'Roscommon', 2689, 2844, 3077, 2970 ); INSERT INTO population VALUES ( null, 'Castleteheen', 'Roscommon', 314, 314, 353, 336 ); INSERT INTO population VALUES ( null, 'Cloonfower', 'Roscommon', 295, 306, 359, 320 ); INSERT INTO population VALUES ( null, 'Coolougher', 'Roscommon', 497, 506, 491, 504 ); INSERT INTO population VALUES ( null, 'Edmondstown', 'Roscommon', 418, 435, 446, 419 ); INSERT INTO population VALUES ( null, 'Fairymount', 'Roscommon', 350, 366, 359, 313 ); INSERT INTO population VALUES ( null, 'Frenchpark', 'Roscommon', 793, 886, 860, 898 ); INSERT INTO population VALUES ( null, 'Kiltullagh', 'Roscommon', 906, 1028, 1134, 1055 ); INSERT INTO population VALUES ( null, 'Loughglinn', 'Roscommon', 733, 699, 727, 690 ); INSERT INTO population VALUES ( null, 'Annaghmore', 'Roscommon', 318, 327, 325, 295 ); INSERT INTO population VALUES ( null, 'Athleague East', 'Roscommon', 340, 407, 458, 455 ); INSERT INTO population VALUES ( null, 'Athleague West', 'Roscommon', 482, 493, 552, 535 ); INSERT INTO population VALUES ( null, 'Ballygarden', 'Roscommon', 180, 207, 220, 176 ); INSERT INTO population VALUES ( null, 'Bumlin', 'Roscommon', 335, 359, 408, 472 ); INSERT INTO population VALUES ( null, 'Cams', 'Roscommon', 409, 471, 494, 469 ); INSERT INTO population VALUES ( null, 'Cloonfinlough', 'Roscommon', 183, 188, 201, 173 ); INSERT INTO population VALUES ( null, 'Cloontuskert', 'Roscommon', 973, 1057, 1238, 1279 ); INSERT INTO population VALUES ( null, 'Cloonygormican', 'Roscommon', 431, 413, 451, 454 ); INSERT INTO population VALUES ( null, 'Cloonyquin', 'Roscommon', 289, 289, 288, 261 ); INSERT INTO population VALUES ( null, 'Creeve', 'Roscommon', 131, 151, 116, 162 ); INSERT INTO population VALUES ( null, 'Cregga', 'Roscommon', 161, 172, 164, 156 ); INSERT INTO population VALUES ( null, 'Drumdaff', 'Roscommon', 363, 440, 434, 449 ); INSERT INTO population VALUES ( null, 'Dunamon', 'Roscommon', 310, 317, 360, 332 ); INSERT INTO population VALUES ( null, 'Elia', 'Roscommon', 112, 133, 127, 139 ); INSERT INTO population VALUES ( null, 'Elphin', 'Roscommon', 711, 769, 794, 764 ); INSERT INTO population VALUES ( null, 'Fuerty', 'Roscommon', 631, 693, 713, 701 ); INSERT INTO population VALUES ( null, 'Kilbride North', 'Roscommon', 348, 380, 372, 408 ); INSERT INTO population VALUES ( null, 'Kilbride South', 'Roscommon', 309, 336, 395, 388 ); INSERT INTO population VALUES ( null, 'Kilgefin', 'Roscommon', 280, 285, 316, 320 ); INSERT INTO population VALUES ( null, 'Kilglass North', 'Roscommon', 390, 397, 392, 434 ); INSERT INTO population VALUES ( null, 'Kilglass South', 'Roscommon', 293, 312, 322, 312 ); INSERT INTO population VALUES ( null, 'Killavackan', 'Roscommon', 182, 190, 231, 205 ); INSERT INTO population VALUES ( null, 'Killukin', 'Roscommon', 217, 224, 207, 191 ); INSERT INTO population VALUES ( null, 'Kilteevan', 'Roscommon', 333, 444, 522, 530 ); INSERT INTO population VALUES ( null, 'Lackan', 'Roscommon', 277, 320, 388, 367 ); INSERT INTO population VALUES ( null, 'Lismaha', 'Roscommon', 330, 342, 370, 357 ); INSERT INTO population VALUES ( null, 'Lissonuffy', 'Roscommon', 163, 174, 164, 169 ); INSERT INTO population VALUES ( null, 'Mote', 'Roscommon', 610, 748, 902, 944 ); INSERT INTO population VALUES ( null, 'Ogulla', 'Roscommon', 251, 227, 330, 341 ); INSERT INTO population VALUES ( null, 'Roosky', 'Roscommon', 505, 586, 707, 708 ); INSERT INTO population VALUES ( null, 'Roscommon Rural', 'Roscommon', 3694, 4178, 4782, 4916 ); INSERT INTO population VALUES ( null, 'Roscommon Urban', 'Roscommon', 1623, 1677, 1701, 1723 ); INSERT INTO population VALUES ( null, 'Rosmoylan', 'Roscommon', 173, 157, 162, 165 ); INSERT INTO population VALUES ( null, 'Rossmore', 'Roscommon', 170, 150, 168, 169 ); INSERT INTO population VALUES ( null, 'Scregg', 'Roscommon', 378, 400, 488, 515 ); INSERT INTO population VALUES ( null, 'Strokestown', 'Roscommon', 943, 984, 1003, 1049 ); INSERT INTO population VALUES ( null, 'Termonbarry', 'Roscommon', 398, 517, 696, 777 ); INSERT INTO population VALUES ( null, 'Tulsk', 'Roscommon', 215, 268, 279, 315 ); INSERT INTO population VALUES ( null, 'Sligo East', 'Sligo', 5568, 5334, 4937, 4972 ); INSERT INTO population VALUES ( null, 'Sligo North', 'Sligo', 5745, 5346, 5502, 5168 ); INSERT INTO population VALUES ( null, 'Sligo West', 'Sligo', 7160, 7212, 7129, 7215 ); INSERT INTO population VALUES ( null, 'Aghanagh', 'Sligo', 249, 315, 361, 361 ); INSERT INTO population VALUES ( null, 'Ballynashee', 'Sligo', 243, 270, 337, 330 ); INSERT INTO population VALUES ( null, 'Coolavin', 'Sligo', 393, 447, 466, 459 ); INSERT INTO population VALUES ( null, 'Cuilmore', 'Sligo', 510, 490, 511, 491 ); INSERT INTO population VALUES ( null, 'Drumrat', 'Sligo', 413, 440, 527, 534 ); INSERT INTO population VALUES ( null, 'Kilfree', 'Sligo', 465, 479, 521, 538 ); INSERT INTO population VALUES ( null, 'Killadoon', 'Sligo', 302, 296, 293, 278 ); INSERT INTO population VALUES ( null, 'Killaraght', 'Sligo', 413, 392, 417, 426 ); INSERT INTO population VALUES ( null, 'Kilmactranny', 'Sligo', 335, 338, 344, 322 ); INSERT INTO population VALUES ( null, 'Kilshalvy', 'Sligo', 262, 299, 290, 303 ); INSERT INTO population VALUES ( null, 'Shancough', 'Sligo', 134, 139, 153, 123 ); INSERT INTO population VALUES ( null, 'Templevanny', 'Sligo', 221, 240, 245, 235 ); INSERT INTO population VALUES ( null, 'Toomour', 'Sligo', 225, 239, 229, 220 ); INSERT INTO population VALUES ( null, 'Aughris', 'Sligo', 186, 174, 172, 162 ); INSERT INTO population VALUES ( null, 'Buncrowey', 'Sligo', 349, 329, 314, 286 ); INSERT INTO population VALUES ( null, 'Castleconor East', 'Sligo', 257, 231, 243, 213 ); INSERT INTO population VALUES ( null, 'Castleconor West', 'Sligo', 825, 891, 1002, 1015 ); INSERT INTO population VALUES ( null, 'Dromard East', 'Sligo', 161, 163, 174, 175 ); INSERT INTO population VALUES ( null, 'Dromard West', 'Sligo', 164, 178, 190, 196 ); INSERT INTO population VALUES ( null, 'Dromore', 'Sligo', 308, 444, 473, 469 ); INSERT INTO population VALUES ( null, 'Easky East', 'Sligo', 535, 588, 615, 595 ); INSERT INTO population VALUES ( null, 'Easky West', 'Sligo', 698, 695, 681, 648 ); INSERT INTO population VALUES ( null, 'Kilglass', 'Sligo', 1245, 1347, 1639, 1603 ); INSERT INTO population VALUES ( null, 'Rathmacurkey', 'Sligo', 558, 556, 579, 562 ); INSERT INTO population VALUES ( null, 'Skreen', 'Sligo', 159, 165, 177, 165 ); INSERT INTO population VALUES ( null, 'Templeboy North', 'Sligo', 280, 285, 301, 309 ); INSERT INTO population VALUES ( null, '031/027 Templeboy South/Mullagheruse', 'Sligo', 243, 232, 225, 211 ); INSERT INTO population VALUES ( null, 'Toberpatrick East', 'Sligo', 219, 263, 249, 207 ); INSERT INTO population VALUES ( null, 'Toberpatrick West', 'Sligo', 281, 296, 277, 299 ); INSERT INTO population VALUES ( null, 'Ballintogher East', 'Sligo', 430, 543, 627, 635 ); INSERT INTO population VALUES ( null, 'Ballintogher West', 'Sligo', 384, 419, 435, 447 ); INSERT INTO population VALUES ( null, 'Ballymote', 'Sligo', 1405, 1717, 2074, 2062 ); INSERT INTO population VALUES ( null, 'Ballynakill', 'Sligo', 283, 370, 461, 479 ); INSERT INTO population VALUES ( null, 'Ballysadare East', 'Sligo', 1215, 1220, 1261, 1234 ); INSERT INTO population VALUES ( null, 'Ballysadare West', 'Sligo', 319, 336, 346, 348 ); INSERT INTO population VALUES ( null, 'Bricklieve', 'Sligo', 216, 234, 238, 234 ); INSERT INTO population VALUES ( null, 'Calry', 'Sligo', 1836, 1808, 1806, 1695 ); INSERT INTO population VALUES ( null, 'Carney', 'Sligo', 707, 681, 692, 689 ); INSERT INTO population VALUES ( null, 'Carrickbanagher', 'Sligo', 561, 598, 663, 675 ); INSERT INTO population VALUES ( null, 'Cliffony North', 'Sligo', 760, 911, 906, 900 ); INSERT INTO population VALUES ( null, 'Cliffony South', 'Sligo', 618, 607, 602, 571 ); INSERT INTO population VALUES ( null, 'Collooney', 'Sligo', 1255, 1754, 2543, 2742 ); INSERT INTO population VALUES ( null, 'Drumcliff East', 'Sligo', 855, 780, 736, 727 ); INSERT INTO population VALUES ( null, 'Drumcliff West', 'Sligo', 1929, 1927, 1830, 1897 ); INSERT INTO population VALUES ( null, 'Drumcolumb', 'Sligo', 277, 293, 309, 289 ); INSERT INTO population VALUES ( null, 'Drumfin', 'Sligo', 338, 339, 414, 387 ); INSERT INTO population VALUES ( null, 'Glencar', 'Sligo', 210, 222, 215, 237 ); INSERT INTO population VALUES ( null, 'Kilmacowen', 'Sligo', 1868, 2050, 2230, 2141 ); INSERT INTO population VALUES ( null, 'Knockaree', 'Sligo', 2833, 3219, 3557, 3690 ); INSERT INTO population VALUES ( null, 'Lakeview', 'Sligo', 366, 391, 474, 434 ); INSERT INTO population VALUES ( null, 'Lisconny', 'Sligo', 367, 401, 422, 384 ); INSERT INTO population VALUES ( null, 'Lissadill East', 'Sligo', 507, 637, 782, 857 ); INSERT INTO population VALUES ( null, 'Lissadill North', 'Sligo', 969, 1128, 1440, 1479 ); INSERT INTO population VALUES ( null, 'Lissadill West', 'Sligo', 483, 475, 553, 605 ); INSERT INTO population VALUES ( null, 'Riverstown', 'Sligo', 562, 638, 732, 679 ); INSERT INTO population VALUES ( null, 'Rossinver East', 'Sligo', 175, 165, 194, 193 ); INSERT INTO population VALUES ( null, 'Rossinver West', 'Sligo', 217, 233, 256, 240 ); INSERT INTO population VALUES ( null, 'Achonry East', 'Sligo', 483, 528, 539, 491 ); INSERT INTO population VALUES ( null, 'Achonry West', 'Sligo', 625, 683, 739, 752 ); INSERT INTO population VALUES ( null, 'Aclare', 'Sligo', 309, 303, 292, 255 ); INSERT INTO population VALUES ( null, 'Annagh', 'Sligo', 165, 182, 202, 197 ); INSERT INTO population VALUES ( null, 'Banada', 'Sligo', 576, 579, 604, 598 ); INSERT INTO population VALUES ( null, '069 Branchfield/Carrownaskeagh', 'Sligo', 154, 145, 160, 162 ); INSERT INTO population VALUES ( null, 'Breencorragh', 'Sligo', 154, 128, 132, 117 ); INSERT INTO population VALUES ( null, 'Cartron', 'Sligo', 182, 179, 190, 174 ); INSERT INTO population VALUES ( null, 'Cloonoghill', 'Sligo', 307, 308, 307, 320 ); INSERT INTO population VALUES ( null, 'Coolaney', 'Sligo', 457, 550, 1200, 1332 ); INSERT INTO population VALUES ( null, 'Glendarragh', 'Sligo', 145, 160, 201, 216 ); INSERT INTO population VALUES ( null, 'Kilmacteige', 'Sligo', 235, 235, 242, 221 ); INSERT INTO population VALUES ( null, 'Kilturra', 'Sligo', 205, 240, 241, 223 ); INSERT INTO population VALUES ( null, 'Leitrim', 'Sligo', 325, 331, 366, 367 ); INSERT INTO population VALUES ( null, '071 Loughill/Cloonacool', 'Sligo', 308, 325, 352, 343 ); INSERT INTO population VALUES ( null, 'Owenmore', 'Sligo', 104, 103, 114, 122 ); INSERT INTO population VALUES ( null, 'Streamstown', 'Sligo', 292, 298, 302, 262 ); INSERT INTO population VALUES ( null, 'Temple', 'Sligo', 229, 227, 301, 348 ); INSERT INTO population VALUES ( null, 'Tobercurry', 'Sligo', 1894, 2181, 2538, 2817 ); INSERT INTO population VALUES ( null, 'Cavan Urban', 'Cavan', 3538, 3934, 3649, 3780 ); INSERT INTO population VALUES ( null, 'Bailieborough', 'Cavan', 2844, 3190, 3862, 4006 ); INSERT INTO population VALUES ( null, 'Carnagarve', 'Cavan', 487, 585, 623, 573 ); INSERT INTO population VALUES ( null, 'Crossbane', 'Cavan', 416, 489, 594, 618 ); INSERT INTO population VALUES ( null, 'Drumanespick', 'Cavan', 329, 421, 462, 448 ); INSERT INTO population VALUES ( null, 'Enniskeen', 'Cavan', 372, 391, 461, 455 ); INSERT INTO population VALUES ( null, 'Killinkere', 'Cavan', 364, 368, 480, 449 ); INSERT INTO population VALUES ( null, 'Kingscourt', 'Cavan', 2019, 2580, 3224, 3339 ); INSERT INTO population VALUES ( null, 'Lisagoan', 'Cavan', 319, 327, 388, 401 ); INSERT INTO population VALUES ( null, 'Mullagh', 'Cavan', 953, 1395, 1962, 2216 ); INSERT INTO population VALUES ( null, 'Shercock', 'Cavan', 953, 1029, 1169, 1255 ); INSERT INTO population VALUES ( null, 'Skeagh', 'Cavan', 397, 394, 428, 407 ); INSERT INTO population VALUES ( null, 'Taghart', 'Cavan', 521, 560, 626, 614 ); INSERT INTO population VALUES ( null, 'Termon', 'Cavan', 436, 472, 546, 537 ); INSERT INTO population VALUES ( null, 'Ballyconnell', 'Cavan', 1072, 1229, 1512, 1554 ); INSERT INTO population VALUES ( null, 'Ballymagauran', 'Cavan', 270, 252, 251, 245 ); INSERT INTO population VALUES ( null, 'Bawnboy', 'Cavan', 541, 544, 580, 588 ); INSERT INTO population VALUES ( null, 'Bilberry', 'Cavan', 167, 146, 179, 165 ); INSERT INTO population VALUES ( null, 'Carn', 'Cavan', 210, 226, 229, 135 ); INSERT INTO population VALUES ( null, 'Diamond', 'Cavan', 117, 115, 138, 130 ); INSERT INTO population VALUES ( null, 'Doogary', 'Cavan', 138, 150, 147, 142 ); INSERT INTO population VALUES ( null, 'Kinawley', 'Cavan', 114, 121, 112, 111 ); INSERT INTO population VALUES ( null, 'Lissanover', 'Cavan', 269, 271, 288, 290 ); INSERT INTO population VALUES ( null, 'Pedara Vohers(025)/Tircahan(028)', 'Cavan', 186, 192, 203, 186 ); INSERT INTO population VALUES ( null, 'Swanlinbar', 'Cavan', 387, 441, 399, 377 ); INSERT INTO population VALUES ( null, '018 Templeport/Benbrack', 'Cavan', 380, 381, 366, 338 ); INSERT INTO population VALUES ( null, 'Ballyjamesduff', 'Cavan', 1401, 2240, 3134, 3230 ); INSERT INTO population VALUES ( null, 'Castlerahan', 'Cavan', 695, 869, 911, 902 ); INSERT INTO population VALUES ( null, 'Kilbride', 'Cavan', 777, 884, 956, 970 ); INSERT INTO population VALUES ( null, 'Lurgan', 'Cavan', 390, 524, 565, 632 ); INSERT INTO population VALUES ( null, 'Munterconnaught', 'Cavan', 790, 969, 1116, 1130 ); INSERT INTO population VALUES ( null, 'Virginia', 'Cavan', 2370, 3197, 3943, 4393 ); INSERT INTO population VALUES ( null, 'Ardue', 'Cavan', 643, 633, 734, 868 ); INSERT INTO population VALUES ( null, 'Arvagh', 'Cavan', 858, 900, 925, 954 ); INSERT INTO population VALUES ( null, 'Ashfield', 'Cavan', 323, 346, 343, 358 ); INSERT INTO population VALUES ( null, 'Ballintemple', 'Cavan', 475, 459, 460, 425 ); INSERT INTO population VALUES ( null, 'Ballyhaise', 'Cavan', 882, 982, 975, 1057 ); INSERT INTO population VALUES ( null, 'Ballymachugh', 'Cavan', 651, 713, 762, 829 ); INSERT INTO population VALUES ( null, 'Bellananagh', 'Cavan', 1080, 1242, 1358, 1528 ); INSERT INTO population VALUES ( null, 'Belturbet Urban', 'Cavan', 1295, 1395, 1378, 1501 ); INSERT INTO population VALUES ( null, 'Bruce Hall', 'Cavan', 191, 219, 208, 211 ); INSERT INTO population VALUES ( null, 'Butlers Bridge', 'Cavan', 356, 371, 478, 472 ); INSERT INTO population VALUES ( null, 'Canningstown', 'Cavan', 529, 558, 571, 533 ); INSERT INTO population VALUES ( null, 'Carrafin', 'Cavan', 333, 363, 417, 399 ); INSERT INTO population VALUES ( null, 'Castlesaunderson', 'Cavan', 228, 223, 282, 299 ); INSERT INTO population VALUES ( null, 'Cavan Rural', 'Cavan', 3603, 4865, 7203, 8272 ); INSERT INTO population VALUES ( null, 'Clonervy', 'Cavan', 752, 790, 896, 850 ); INSERT INTO population VALUES ( null, 'Cootehill Rural', 'Cavan', 861, 1181, 1068, 1089 ); INSERT INTO population VALUES ( null, 'Cootehill Urban', 'Cavan', 1399, 1243, 1592, 1598 ); INSERT INTO population VALUES ( null, 'Corr', 'Cavan', 277, 255, 280, 268 ); INSERT INTO population VALUES ( null, 'Corraneary', 'Cavan', 390, 406, 438, 447 ); INSERT INTO population VALUES ( null, 'Crossdoney', 'Cavan', 477, 542, 584, 543 ); INSERT INTO population VALUES ( null, 'Crosskeys', 'Cavan', 614, 643, 708, 700 ); INSERT INTO population VALUES ( null, 'Cuttragh', 'Cavan', 316, 342, 389, 395 ); INSERT INTO population VALUES ( null, 'Denn', 'Cavan', 655, 690, 709, 701 ); INSERT INTO population VALUES ( null, 'Derrin', 'Cavan', 355, 384, 416, 459 ); INSERT INTO population VALUES ( null, 'Drumcarban', 'Cavan', 560, 556, 615, 611 ); INSERT INTO population VALUES ( null, 'Drumcarn', 'Cavan', 525, 522, 535, 528 ); INSERT INTO population VALUES ( null, 'Drung', 'Cavan', 527, 546, 539, 519 ); INSERT INTO population VALUES ( null, 'Graddum', 'Cavan', 462, 475, 538, 541 ); INSERT INTO population VALUES ( null, 'Grilly', 'Cavan', 378, 402, 403, 485 ); INSERT INTO population VALUES ( null, 'Kilconny', 'Cavan', 284, 379, 479, 548 ); INSERT INTO population VALUES ( null, 'Kill', 'Cavan', 329, 352, 369, 346 ); INSERT INTO population VALUES ( null, 'Killashandra', 'Cavan', 1123, 1130, 1141, 1151 ); INSERT INTO population VALUES ( null, 'Killykeen', 'Cavan', 538, 538, 584, 601 ); INSERT INTO population VALUES ( null, 'Kilnaleck', 'Cavan', 796, 956, 1057, 1112 ); INSERT INTO population VALUES ( null, 'Knappagh', 'Cavan', 399, 421, 440, 470 ); INSERT INTO population VALUES ( null, 'Larah North', 'Cavan', 425, 444, 501, 470 ); INSERT INTO population VALUES ( null, 'Larah South', 'Cavan', 502, 477, 465, 506 ); INSERT INTO population VALUES ( null, 'Milltown', 'Cavan', 341, 338, 335, 352 ); INSERT INTO population VALUES ( null, 'Moynehall', 'Cavan', 1304, 1503, 1675, 1741 ); INSERT INTO population VALUES ( null, 'Rakenny', 'Cavan', 448, 413, 442, 401 ); INSERT INTO population VALUES ( null, 'Redhill', 'Cavan', 425, 420, 439, 447 ); INSERT INTO population VALUES ( null, 'Springfield', 'Cavan', 182, 175, 198, 171 ); INSERT INTO population VALUES ( null, 'Stradone', 'Cavan', 708, 723, 777, 756 ); INSERT INTO population VALUES ( null, 'Tullyvin East', 'Cavan', 378, 386, 430, 464 ); INSERT INTO population VALUES ( null, 'Tullyvin West', 'Cavan', 254, 230, 264, 277 ); INSERT INTO population VALUES ( null, 'Waterloo', 'Cavan', 645, 682, 758, 759 ); INSERT INTO population VALUES ( null, 'Derrylahan', 'Cavan', 115, 120, 96, 91 ); INSERT INTO population VALUES ( null, 'Dowra', 'Cavan', 152, 129, 161, 159 ); INSERT INTO population VALUES ( null, 'Dunmakeever(084)/Derrynananta(082)', 'Cavan', 169, 168, 152, 135 ); INSERT INTO population VALUES ( null, 'Eskey', 'Cavan', 269, 283, 342, 320 ); INSERT INTO population VALUES ( null, 'Killinagh(086)/Teebane(087)', 'Cavan', 144, 160, 154, 131 ); INSERT INTO population VALUES ( null, 'Tuam', 'Cavan', 339, 349, 388, 331 ); INSERT INTO population VALUES ( null, 'Drumlumman', 'Cavan', 520, 516, 535, 584 ); INSERT INTO population VALUES ( null, 'Kilcogy', 'Cavan', 371, 365, 434, 450 ); INSERT INTO population VALUES ( null, 'Kilgolagh', 'Cavan', 314, 319, 317, 318 ); INSERT INTO population VALUES ( null, 'Loughdawan', 'Cavan', 342, 326, 338, 330 ); INSERT INTO population VALUES ( null, 'Scrabby', 'Cavan', 513, 569, 605, 615 ); INSERT INTO population VALUES ( null, 'Buncrana Urban', 'Donegal', 3420, 3411, 3452, 3390 ); INSERT INTO population VALUES ( null, 'Bundoran Urban', 'Donegal', 1678, 1706, 1781, 1665 ); INSERT INTO population VALUES ( null, 'Letterkenny Urban', 'Donegal', 2478, 1914, 1931, 2193 ); INSERT INTO population VALUES ( null, 'Ballintra', 'Donegal', 735, 694, 692, 689 ); INSERT INTO population VALUES ( null, 'Ballyshannon Rural', 'Donegal', 1272, 1560, 1657, 1617 ); INSERT INTO population VALUES ( null, 'Ballyshannon Urban', 'Donegal', 2232, 2004, 1855, 1734 ); INSERT INTO population VALUES ( null, 'Bundoran Rural', 'Donegal', 814, 888, 1063, 975 ); INSERT INTO population VALUES ( null, 'Carrickboy', 'Donegal', 441, 444, 419, 373 ); INSERT INTO population VALUES ( null, 'Cavangarden', 'Donegal', 304, 327, 391, 431 ); INSERT INTO population VALUES ( null, 'Cliff', 'Donegal', 169, 211, 283, 256 ); INSERT INTO population VALUES ( null, 'Ballintra', 'Donegal', 508, 564, 638, 673 ); INSERT INTO population VALUES ( null, 'An Bhinn Bhn', 'Donegal', 177, 175, 150, 170 ); INSERT INTO population VALUES ( null, 'Bonnyglen', 'Donegal', 347, 349, 386, 403 ); INSERT INTO population VALUES ( null, 'Clogher', 'Donegal', 660, 757, 847, 856 ); INSERT INTO population VALUES ( null, 'Corkermore', 'Donegal', 260, 278, 325, 303 ); INSERT INTO population VALUES ( null, 'Donegal', 'Donegal', 3724, 3753, 4010, 4031 ); INSERT INTO population VALUES ( null, 'Dunkineely', 'Donegal', 801, 878, 932, 900 ); INSERT INTO population VALUES ( null, 'Eanymore', 'Donegal', 501, 529, 557, 518 ); INSERT INTO population VALUES ( null, 'Grousehall', 'Donegal', 85, 79, 76, 75 ); INSERT INTO population VALUES ( null, 'Haugh', 'Donegal', 216, 233, 240, 224 ); INSERT INTO population VALUES ( null, 'Inver', 'Donegal', 745, 742, 767, 747 ); INSERT INTO population VALUES ( null, 'Laghy', 'Donegal', 710, 702, 845, 796 ); INSERT INTO population VALUES ( null, 'Loch Iascaigh', 'Donegal', 135, 119, 245, 289 ); INSERT INTO population VALUES ( null, 'Pettigoe', 'Donegal', 414, 424, 396, 391 ); INSERT INTO population VALUES ( null, 'Tantallon', 'Donegal', 1534, 1555, 1594, 1627 ); INSERT INTO population VALUES ( null, 'Tawnawully', 'Donegal', 258, 255, 305, 322 ); INSERT INTO population VALUES ( null, 'Templecarn', 'Donegal', 135, 127, 128, 124 ); INSERT INTO population VALUES ( null, 'Tullynaught', 'Donegal', 473, 503, 594, 603 ); INSERT INTO population VALUES ( null, 'Ards', 'Donegal', 668, 679, 754, 723 ); INSERT INTO population VALUES ( null, 'Croch na Smar', 'Donegal', 269, 273, 266, 278 ); INSERT INTO population VALUES ( null, 'An Craoslach', 'Donegal', 648, 691, 764, 736 ); INSERT INTO population VALUES ( null, 'Na Croisbheala', 'Donegal', 2207, 2168, 2149, 1952 ); INSERT INTO population VALUES ( null, 'Caislen na dTuath', 'Donegal', 205, 219, 234, 227 ); INSERT INTO population VALUES ( null, 'Dn Fionnachaidh', 'Donegal', 855, 865, 934, 922 ); INSERT INTO population VALUES ( null, 'Dn Liche', 'Donegal', 694, 695, 769, 686 ); INSERT INTO population VALUES ( null, 'Gort an Choirce', 'Donegal', 1625, 1599, 1705, 1602 ); INSERT INTO population VALUES ( null, 'Machaire Chlochair', 'Donegal', 2666, 2651, 2885, 2744 ); INSERT INTO population VALUES ( null, 'Mn an Chladaigh', 'Donegal', 1298, 1326, 1412, 1293 ); INSERT INTO population VALUES ( null, 'Anagaire', 'Donegal', 2234, 2235, 2354, 2197 ); INSERT INTO population VALUES ( null, 'rainn Mhr', 'Donegal', 543, 529, 514, 471 ); INSERT INTO population VALUES ( null, 'Ard an Rtha', 'Donegal', 1029, 1052, 1194, 1173 ); INSERT INTO population VALUES ( null, 'Cr Bheithe', 'Donegal', 179, 161, 160, 155 ); INSERT INTO population VALUES ( null, 'Cr Chaorach', 'Donegal', 135, 121, 121, 119 ); INSERT INTO population VALUES ( null, 'Crownarad', 'Donegal', 296, 341, 358, 348 ); INSERT INTO population VALUES ( null, 'Dawros', 'Donegal', 658, 648, 662, 636 ); INSERT INTO population VALUES ( null, 'An Dchoraidh', 'Donegal', 83, 85, 85, 100 ); INSERT INTO population VALUES ( null, 'An Clochn Liath', 'Donegal', 1871, 1912, 1931, 1876 ); INSERT INTO population VALUES ( null, 'Baile na Finne', 'Donegal', 312, 316, 313, 275 ); INSERT INTO population VALUES ( null, 'Gleann Cholm Cille', 'Donegal', 720, 726, 745, 738 ); INSERT INTO population VALUES ( null, 'Gleann Gheis', 'Donegal', 734, 684, 677, 667 ); INSERT INTO population VALUES ( null, 'Gleann Lithn', 'Donegal', 178, 191, 179, 161 ); INSERT INTO population VALUES ( null, 'Na Gleannta', 'Donegal', 1394, 1481, 1508, 1437 ); INSERT INTO population VALUES ( null, 'An Ghrafaidh', 'Donegal', 196, 209, 181, 149 ); INSERT INTO population VALUES ( null, 'Inis Caoil', 'Donegal', 117, 104, 94, 90 ); INSERT INTO population VALUES ( null, 'Cill Charthaigh', 'Donegal', 661, 659, 686, 678 ); INSERT INTO population VALUES ( null, 'Cill Ghabhlaigh', 'Donegal', 391, 394, 379, 344 ); INSERT INTO population VALUES ( null, 'Killybegs', 'Donegal', 2428, 2325, 2341, 2277 ); INSERT INTO population VALUES ( null, 'An Leargaidh Mhr', 'Donegal', 602, 563, 578, 559 ); INSERT INTO population VALUES ( null, 'Leitir Mhic an Bhaird', 'Donegal', 666, 679, 708, 625 ); INSERT INTO population VALUES ( null, 'Maas', 'Donegal', 281, 318, 309, 287 ); INSERT INTO population VALUES ( null, 'An Machaire', 'Donegal', 642, 710, 783, 765 ); INSERT INTO population VALUES ( null, 'Mlainn Bhig', 'Donegal', 390, 391, 365, 379 ); INSERT INTO population VALUES ( null, 'Maol Mosg', 'Donegal', 211, 225, 211, 216 ); INSERT INTO population VALUES ( null, 'Inis Mhic an Doirn', 'Donegal', 1465, 1429, 1582, 1431 ); INSERT INTO population VALUES ( null, 'Tieveskeelta', 'Donegal', 109, 102, 114, 124 ); INSERT INTO population VALUES ( null, 'Ardmalin', 'Donegal', 677, 727, 741, 719 ); INSERT INTO population VALUES ( null, 'Ballyliffin', 'Donegal', 1171, 1299, 1394, 1375 ); INSERT INTO population VALUES ( null, 'Birdstown', 'Donegal', 775, 1026, 1324, 1300 ); INSERT INTO population VALUES ( null, 'Buncrana Rural', 'Donegal', 2365, 2949, 3749, 3785 ); INSERT INTO population VALUES ( null, 'Burt', 'Donegal', 1178, 1264, 1422, 1259 ); INSERT INTO population VALUES ( null, 'Carndonagh', 'Donegal', 1761, 1931, 2375, 2340 ); INSERT INTO population VALUES ( null, 'Carthage', 'Donegal', 1013, 995, 950, 879 ); INSERT INTO population VALUES ( null, 'Castlecary', 'Donegal', 542, 666, 680, 699 ); INSERT INTO population VALUES ( null, 'Castleforward', 'Donegal', 913, 909, 1345, 1351 ); INSERT INTO population VALUES ( null, 'Culdaff', 'Donegal', 841, 899, 955, 947 ); INSERT INTO population VALUES ( null, 'Desertegny', 'Donegal', 682, 662, 705, 720 ); INSERT INTO population VALUES ( null, 'Dunaff', 'Donegal', 653, 663, 694, 688 ); INSERT INTO population VALUES ( null, 'Fahan', 'Donegal', 1316, 1476, 1670, 1684 ); INSERT INTO population VALUES ( null, 'Glennagannon', 'Donegal', 606, 671, 758, 720 ); INSERT INTO population VALUES ( null, 'Gleneely', 'Donegal', 693, 746, 824, 838 ); INSERT INTO population VALUES ( null, 'Glentogher', 'Donegal', 980, 1133, 1277, 1175 ); INSERT INTO population VALUES ( null, 'Greencastle', 'Donegal', 747, 807, 973, 1020 ); INSERT INTO population VALUES ( null, 'Illies', 'Donegal', 738, 796, 857, 856 ); INSERT INTO population VALUES ( null, 'Inch Island', 'Donegal', 438, 438, 448, 434 ); INSERT INTO population VALUES ( null, 'Kilderry', 'Donegal', 1367, 1744, 2203, 2102 ); INSERT INTO population VALUES ( null, 'Killea', 'Donegal', 1190, 1547, 1860, 1785 ); INSERT INTO population VALUES ( null, 'Malin', 'Donegal', 556, 622, 681, 668 ); INSERT INTO population VALUES ( null, 'Mintiaghs', 'Donegal', 707, 797, 909, 863 ); INSERT INTO population VALUES ( null, 'Moville', 'Donegal', 2279, 2174, 2343, 2378 ); INSERT INTO population VALUES ( null, 'Newtown Cunningham', 'Donegal', 769, 1178, 980, 1040 ); INSERT INTO population VALUES ( null, 'Redcastle', 'Donegal', 638, 791, 895, 937 ); INSERT INTO population VALUES ( null, 'Straid', 'Donegal', 1254, 1344, 1378, 1284 ); INSERT INTO population VALUES ( null, 'Three Trees', 'Donegal', 551, 646, 724, 673 ); INSERT INTO population VALUES ( null, 'Turmone', 'Donegal', 309, 297, 312, 307 ); INSERT INTO population VALUES ( null, 'Whitecastle', 'Donegal', 699, 883, 1078, 1003 ); INSERT INTO population VALUES ( null, 'Ballymacool', 'Donegal', 1125, 1610, 2201, 2344 ); INSERT INTO population VALUES ( null, 'Castlewray', 'Donegal', 2942, 3334, 3477, 3474 ); INSERT INTO population VALUES ( null, 'Mn an Lbin', 'Donegal', 281, 281, 356, 381 ); INSERT INTO population VALUES ( null, 'Corravaddy', 'Donegal', 752, 1132, 1534, 1602 ); INSERT INTO population VALUES ( null, 'Edenacarnan', 'Donegal', 616, 806, 1626, 1657 ); INSERT INTO population VALUES ( null, 'Gartn', 'Donegal', 184, 180, 201, 187 ); INSERT INTO population VALUES ( null, 'Gortnavern', 'Donegal', 978, 1012, 1174, 1194 ); INSERT INTO population VALUES ( null, 'Killymasny', 'Donegal', 379, 417, 473, 515 ); INSERT INTO population VALUES ( null, 'Kincraigy', 'Donegal', 867, 877, 1019, 1024 ); INSERT INTO population VALUES ( null, 'Letterkenny Rural', 'Donegal', 9289, 10863, 11235, 11385 ); INSERT INTO population VALUES ( null, 'Magheraboy', 'Donegal', 1396, 1565, 1722, 1716 ); INSERT INTO population VALUES ( null, 'Manorcunningham', 'Donegal', 713, 837, 1171, 1207 ); INSERT INTO population VALUES ( null, 'Su Corr', 'Donegal', 84, 95, 106, 94 ); INSERT INTO population VALUES ( null, 'Templedouglas', 'Donegal', 692, 817, 949, 985 ); INSERT INTO population VALUES ( null, 'Ballyarr', 'Donegal', 356, 457, 622, 638 ); INSERT INTO population VALUES ( null, 'Carraig Airt', 'Donegal', 828, 920, 918, 894 ); INSERT INTO population VALUES ( null, 'An Cheathr Chaol', 'Donegal', 844, 875, 885, 819 ); INSERT INTO population VALUES ( null, 'Creamhghort', 'Donegal', 611, 590, 625, 575 ); INSERT INTO population VALUES ( null, 'Fnaid Thuaidh', 'Donegal', 566, 546, 570, 517 ); INSERT INTO population VALUES ( null, 'Fnaid Thiar', 'Donegal', 481, 461, 435, 395 ); INSERT INTO population VALUES ( null, 'Glen', 'Donegal', 234, 254, 251, 240 ); INSERT INTO population VALUES ( null, 'Glenalla', 'Donegal', 360, 393, 466, 493 ); INSERT INTO population VALUES ( null, 'Grianfort', 'Donegal', 377, 348, 350, 299 ); INSERT INTO population VALUES ( null, 'Killygarvan', 'Donegal', 112, 89, 103, 111 ); INSERT INTO population VALUES ( null, 'Kilmacrenan', 'Donegal', 961, 1205, 1432, 1488 ); INSERT INTO population VALUES ( null, 'Cnoc Colbha', 'Donegal', 244, 233, 291, 281 ); INSERT INTO population VALUES ( null, 'Loch Caol', 'Donegal', 251, 276, 314, 314 ); INSERT INTO population VALUES ( null, 'Millford', 'Donegal', 1385, 1439, 1530, 1615 ); INSERT INTO population VALUES ( null, 'Rathmelton', 'Donegal', 1911, 2112, 2363, 2375 ); INSERT INTO population VALUES ( null, 'Rathmullan', 'Donegal', 825, 865, 863, 852 ); INSERT INTO population VALUES ( null, 'Ros Goill', 'Donegal', 812, 885, 922, 868 ); INSERT INTO population VALUES ( null, 'Rosnakill', 'Donegal', 244, 249, 261, 262 ); INSERT INTO population VALUES ( null, 'An Tearmann', 'Donegal', 375, 446, 492, 499 ); INSERT INTO population VALUES ( null, 'Allt na Piste', 'Donegal', 369, 393, 410, 398 ); INSERT INTO population VALUES ( null, 'Castlefinn', 'Donegal', 1322, 1335, 1311, 1220 ); INSERT INTO population VALUES ( null, 'An Clochn', 'Donegal', 849, 852, 895, 923 ); INSERT INTO population VALUES ( null, 'Cloghard', 'Donegal', 624, 667, 707, 653 ); INSERT INTO population VALUES ( null, 'Clonleigh North', 'Donegal', 1328, 1339, 1466, 1345 ); INSERT INTO population VALUES ( null, 'Clonleigh South', 'Donegal', 2004, 2050, 2215, 2156 ); INSERT INTO population VALUES ( null, 'Convoy', 'Donegal', 2093, 2188, 2372, 2448 ); INSERT INTO population VALUES ( null, 'Dooish', 'Donegal', 773, 1024, 1059, 1076 ); INSERT INTO population VALUES ( null, 'Feddyglass', 'Donegal', 405, 397, 449, 442 ); INSERT INTO population VALUES ( null, 'Figart', 'Donegal', 725, 861, 957, 1023 ); INSERT INTO population VALUES ( null, 'Gleneely', 'Donegal', 1267, 1384, 1591, 1561 ); INSERT INTO population VALUES ( null, 'Goland', 'Donegal', 313, 327, 371, 371 ); INSERT INTO population VALUES ( null, 'Killygordon', 'Donegal', 1018, 1016, 1137, 1124 ); INSERT INTO population VALUES ( null, 'Knock', 'Donegal', 998, 1506, 1796, 1805 ); INSERT INTO population VALUES ( null, 'Lettermore', 'Donegal', 334, 369, 412, 415 ); INSERT INTO population VALUES ( null, 'Mn Charraigeach', 'Donegal', 97, 90, 111, 132 ); INSERT INTO population VALUES ( null, 'Raphoe', 'Donegal', 1329, 1468, 1552, 1465 ); INSERT INTO population VALUES ( null, 'St. Johnstown', 'Donegal', 1128, 1227, 1404, 1341 ); INSERT INTO population VALUES ( null, 'Stranorlar', 'Donegal', 4176, 4149, 4536, 4513 ); INSERT INTO population VALUES ( null, 'Treantaghmucklagh', 'Donegal', 564, 637, 764, 792 ); INSERT INTO population VALUES ( null, 'Urney West', 'Donegal', 490, 499, 618, 608 ); INSERT INTO population VALUES ( null, 'Carrickmacross Urban', 'Monaghan', 1964, 1973, 1978, 2084 ); INSERT INTO population VALUES ( null, 'Castleblayney Urban', 'Monaghan', 960, 920, 900, 883 ); INSERT INTO population VALUES ( null, 'Clones Urban', 'Monaghan', 1105, 995, 960, 911 ); INSERT INTO population VALUES ( null, 'Monaghan Urban', 'Monaghan', 2032, 2183, 2189, 2406 ); INSERT INTO population VALUES ( null, 'Ballymackney', 'Monaghan', 897, 928, 951, 906 ); INSERT INTO population VALUES ( null, 'Bocks', 'Monaghan', 530, 599, 663, 703 ); INSERT INTO population VALUES ( null, 'Carrickmacross Rural', 'Monaghan', 2540, 3091, 3677, 3924 ); INSERT INTO population VALUES ( null, 'Corracharra', 'Monaghan', 250, 266, 271, 291 ); INSERT INTO population VALUES ( null, 'Crossalare', 'Monaghan', 462, 569, 656, 755 ); INSERT INTO population VALUES ( null, 'Donaghmoyne', 'Monaghan', 615, 641, 674, 673 ); INSERT INTO population VALUES ( null, 'Drumboory', 'Monaghan', 446, 466, 523, 509 ); INSERT INTO population VALUES ( null, 'Drumcarrow', 'Monaghan', 343, 381, 444, 462 ); INSERT INTO population VALUES ( null, 'Drumgurra', 'Monaghan', 489, 557, 683, 698 ); INSERT INTO population VALUES ( null, 'Enagh', 'Monaghan', 674, 704, 681, 690 ); INSERT INTO population VALUES ( null, 'Inishkeen', 'Monaghan', 956, 979, 1010, 1047 ); INSERT INTO population VALUES ( null, 'Kilmurry', 'Monaghan', 496, 537, 625, 614 ); INSERT INTO population VALUES ( null, 'Kiltybegs', 'Monaghan', 539, 572, 648, 641 ); INSERT INTO population VALUES ( null, 'Loughfea', 'Monaghan', 526, 571, 610, 638 ); INSERT INTO population VALUES ( null, 'Raferagh', 'Monaghan', 447, 457, 460, 452 ); INSERT INTO population VALUES ( null, 'Annayalla', 'Monaghan', 546, 593, 581, 563 ); INSERT INTO population VALUES ( null, 'Ballybay Rural', 'Monaghan', 1181, 1379, 1528, 1538 ); INSERT INTO population VALUES ( null, 'Ballybay Urban', 'Monaghan', 437, 401, 298, 286 ); INSERT INTO population VALUES ( null, 'Bellatrain', 'Monaghan', 211, 243, 291, 273 ); INSERT INTO population VALUES ( null, 'Broomfield', 'Monaghan', 652, 718, 777, 780 ); INSERT INTO population VALUES ( null, 'Carrickaslane', 'Monaghan', 462, 506, 607, 645 ); INSERT INTO population VALUES ( null, 'Carrickatee', 'Monaghan', 304, 313, 333, 335 ); INSERT INTO population VALUES ( null, 'Castleblayney Rural', 'Monaghan', 2980, 3198, 3715, 3712 ); INSERT INTO population VALUES ( null, 'Church Hill', 'Monaghan', 569, 572, 667, 724 ); INSERT INTO population VALUES ( null, 'Creeve', 'Monaghan', 538, 562, 612, 628 ); INSERT INTO population VALUES ( null, 'Cremartin', 'Monaghan', 910, 975, 1166, 1178 ); INSERT INTO population VALUES ( null, 'Greagh', 'Monaghan', 448, 417, 433, 420 ); INSERT INTO population VALUES ( null, 'Laragh', 'Monaghan', 512, 525, 561, 561 ); INSERT INTO population VALUES ( null, 'Mullyash', 'Monaghan', 353, 355, 363, 359 ); INSERT INTO population VALUES ( null, 'Aghabog', 'Monaghan', 303, 310, 339, 339 ); INSERT INTO population VALUES ( null, 'Anny', 'Monaghan', 359, 349, 376, 367 ); INSERT INTO population VALUES ( null, 'Clones Rural', 'Monaghan', 1484, 1436, 1616, 1560 ); INSERT INTO population VALUES ( null, 'Cormeen', 'Monaghan', 457, 457, 458, 519 ); INSERT INTO population VALUES ( null, 'Currin', 'Monaghan', 530, 559, 660, 692 ); INSERT INTO population VALUES ( null, 'Dawsongrove', 'Monaghan', 643, 672, 701, 682 ); INSERT INTO population VALUES ( null, 'Drum', 'Monaghan', 182, 190, 187, 190 ); INSERT INTO population VALUES ( null, 'Drummully', 'Monaghan', 102, 92, 98, 116 ); INSERT INTO population VALUES ( null, 'Killeevan', 'Monaghan', 357, 365, 369, 346 ); INSERT INTO population VALUES ( null, 'Killynenagh', 'Monaghan', 174, 170, 203, 206 ); INSERT INTO population VALUES ( null, 'Lisnaveane', 'Monaghan', 385, 428, 395, 397 ); INSERT INTO population VALUES ( null, 'Newbliss', 'Monaghan', 666, 741, 798, 819 ); INSERT INTO population VALUES ( null, 'St. Tierney', 'Monaghan', 409, 416, 395, 397 ); INSERT INTO population VALUES ( null, 'Anketell Grove', 'Monaghan', 954, 1009, 1129, 1152 ); INSERT INTO population VALUES ( null, 'Bellanode', 'Monaghan', 1170, 1359, 1606, 1504 ); INSERT INTO population VALUES ( null, 'Bragan', 'Monaghan', 263, 290, 298, 311 ); INSERT INTO population VALUES ( null, 'Caddagh', 'Monaghan', 440, 469, 495, 497 ); INSERT INTO population VALUES ( null, 'Castleshane', 'Monaghan', 730, 876, 966, 986 ); INSERT INTO population VALUES ( null, 'Clones', 'Monaghan', 464, 462, 472, 451 ); INSERT INTO population VALUES ( null, 'Clontibret', 'Monaghan', 722, 700, 701, 757 ); INSERT INTO population VALUES ( null, 'Derrygorry', 'Monaghan', 283, 273, 272, 283 ); INSERT INTO population VALUES ( null, 'Drumhillagh', 'Monaghan', 612, 630, 691, 668 ); INSERT INTO population VALUES ( null, 'Drumsnat', 'Monaghan', 930, 937, 982, 998 ); INSERT INTO population VALUES ( null, 'Emyvale', 'Monaghan', 1091, 1223, 1230, 1224 ); INSERT INTO population VALUES ( null, 'Enagh', 'Monaghan', 449, 487, 492, 504 ); INSERT INTO population VALUES ( null, 'Figullar', 'Monaghan', 413, 422, 472, 503 ); INSERT INTO population VALUES ( null, 'Glaslough', 'Monaghan', 726, 757, 857, 813 ); INSERT INTO population VALUES ( null, 'Killylough', 'Monaghan', 558, 554, 568, 577 ); INSERT INTO population VALUES ( null, 'Kilmore', 'Monaghan', 539, 536, 519, 508 ); INSERT INTO population VALUES ( null, 'Monaghan Rural', 'Monaghan', 4969, 5611, 6204, 6214 ); INSERT INTO population VALUES ( null, 'Rackwallace', 'Monaghan', 777, 794, 903, 909 ); INSERT INTO population VALUES ( null, 'Scotstown', 'Monaghan', 993, 1083, 1155, 1153 ); INSERT INTO population VALUES ( null, 'Shanmullagh', 'Monaghan', 210, 226, 219, 220 ); INSERT INTO population VALUES ( null, 'Sheskin', 'Monaghan', 532, 559, 648, 655 ); INSERT INTO population VALUES ( null, 'Tedavnet', 'Monaghan', 830, 860, 871, 921 ); INSERT INTO population VALUES ( null, 'Tehallan', 'Monaghan', 891, 910, 942, 892 ); INSERT INTO population VALUES ( null, 'Tullycorbet', 'Monaghan', 622, 639, 661, 654 ); INSERT INTO population VALUES ( null, 'Ballynakill (part)(070)/Kilbarry (part)(074)', 'Waterford', 372, 518, 647, 676 ); INSERT INTO population VALUES ( null, 'Bencorr(022)/Derrycunlagh(028)/Derrylea(027)', 'Galway County', 478, 498, 561, 547 ); INSERT INTO population VALUES ( null, 'Aghalateeve(027)/Aghavoghill(029)/Aghanlish(028)/Melvin(032)', 'Leitrim', 431, 444, 457, 433 ); SELECT * from population;
true
0aa76531040d74123d7aa8d1455d71a32119ec1b
SQL
ArshadAQ/Social-Network-Analysis
/Analysis/dbconstraints.cql
UTF-8
621
2.78125
3
[]
no_license
CREATE CONSTRAINT ON ( follower:Follower ) ASSERT follower.id IS UNIQUE CREATE CONSTRAINT ON ( follower:Follower ) ASSERT follower.screen_name IS UNIQUE CREATE CONSTRAINT ON ( member:Member ) ASSERT member.id IS UNIQUE CREATE CONSTRAINT ON ( member:Member ) ASSERT member.screen_name IS UNIQUE CREATE CONSTRAINT ON ( party:Party ) ASSERT party.id IS UNIQUE CREATE CONSTRAINT ON ( party:Party ) ASSERT party.name IS UNIQUE CREATE CONSTRAINT ON ( tweet:Tweet ) ASSERT tweet.id IS UNIQUE CREATE CONSTRAINT ON ( user:User ) ASSERT user.id IS UNIQUE CREATE CONSTRAINT ON ( user:User ) ASSERT user.screen_name IS UNIQUE
true
d7f7ec6829de214aaafeff65e0496832c504f964
SQL
PlusOneToX/MiPlus
/mysql/misql.sql
UTF-8
836
2.9375
3
[]
no_license
#客户端连接服务器端使用的编码是UTF8 SET NAMES UTF8; #丢弃数据库xz DROP DATABASE IF EXISTS mi; #创建数据库xz并设置存储的编码为UTF8 CREATE DATABASE mi CHARSET=UTF8; #进入数据库xz USE mi; #创建保存用户数据的表miuser并添加字段及其字段类型 CREATE TABLE miuser( miid INT PRIMARY KEY AUTO_INCREMENT, miname VARCHAR(50), mipwd VARCHAR(50), miemail VARCHAR(50), miphone VARCHAR(30) ); #添加数据 INSERT INTO miuser VALUES(1,"李知恩","iu123456","iu123@163.com",18888888881); INSERT INTO miuser VALUES(2,"王祖贤","wzx123456","wzx123@163.com",18888888882); INSERT INTO miuser VALUES(3,"张曼玉","zmy123456","zmy123@163.com",18888888883); INSERT INTO miuser VALUES(4,"李嘉欣","ljx123456","ljx123@163.com",18888888885); INSERT INTO miuser VALUES(5,"李若彤","lrt123456","lrt123@163.com",18888888886);
true
2a2c20c48f4d61312be07c8f012201ccba542c64
SQL
ggjacob/oncoclinicas-agenda
/agenda.sql
UTF-8
3,002
3.0625
3
[]
no_license
-- MySQL dump 10.13 Distrib 5.6.13, for osx10.6 (i386) -- -- Host: localhost Database: agenda -- ------------------------------------------------------ -- Server version 5.6.13-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP DATABASE IF EXISTS agenda; CREATE DATABASE agenda DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; USE agenda; -- -- Table structure for table `agendas` -- DROP TABLE IF EXISTS `agendas`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `agendas` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(45) DEFAULT NULL, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `agendas` -- LOCK TABLES `agendas` WRITE; /*!40000 ALTER TABLE `agendas` DISABLE KEYS */; INSERT INTO `agendas` VALUES (1,'OncoClinicas','2013-10-28 21:50:21','2013-10-28 21:50:21'); /*!40000 ALTER TABLE `agendas` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `appointments` -- DROP TABLE IF EXISTS `appointments`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `appointments` ( `id` int(11) NOT NULL AUTO_INCREMENT, `patient_name` varchar(45) DEFAULT NULL, `birth_date` date DEFAULT NULL, `phone` varchar(25) DEFAULT NULL, `doctor_name` varchar(45) DEFAULT NULL, `date` date DEFAULT NULL, `time` time DEFAULT NULL, `agenda_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `appointments` -- LOCK TABLES `appointments` WRITE; /*!40000 ALTER TABLE `appointments` DISABLE KEYS */; /*!40000 ALTER TABLE `appointments` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2013-10-29 17:57:19
true
1a96cfd2b4197ac770ce6a4105b588b44a235952
SQL
farbod2u/human-resource-service
/src/test/resources/Person.sql
UTF-8
701
2.5625
3
[]
no_license
-- INSERT INTO schoolgrade (id_key, name) VALUES(1, 'first'); -- INSERT INTO schoolgrade (id_key, name) VALUES(2, 'second'); -- INSERT INTO schoolgrade (id_key, name) VALUES(3, 'third'); -- INSERT INTO schoolgrade (id_key, name) VALUES(4, 'fourth'); insert into person (id_key, first_name, last_name, id_number) values (1, 'Saeed', 'Safaeian', '0123456789'); insert into person (id_key, first_name, last_name, id_number) values (2, 'Ali', 'Safaeian', '0123456780'); -- insert into person_schoolgrade (graduate_date, person_id_key, school_grade_id_key) -- values ('2001-01-01',1,1); -- insert into person_schoolgrade (graduate_date, person_id_key, school_grade_id_key) -- values ('2002-01-01',2,2);
true
70edfdac92b9d3539a77459797f71778dd93c1c8
SQL
InfoHome/SuporteMU
/Scripts/Listar Impressoras a ser utilizada para emissão da DANFE.sql
ISO-8859-1
638
2.953125
3
[]
no_license
-- Impressora a ser utilizada para emisso da DANFE --------------------------------------------------------------------------- select distinct u.nome,a.svalor from historiconfe h join USUARIO_R u on h.USUARIO = u.OID left join ADITIVO a on u.oid = a.RITEM and a.RDEFINICAO = 33324 where h.dataprocessamento > ='20180101' and a.SVALOR is not null ---------------------------------------------- select distinct USUARIO, u.nome,a.svalor from historiconfe h join USUARIO_R u on h.USUARIO = u.OID left join ADITIVO a on u.oid = a.RITEM and a.RDEFINICAO = 33324 where h.dataprocessamento > ='20180701' and a.SVALOR is null
true
069e66da0f00993068000ccce7abc9c05ca07176
SQL
sm-valery/gTravel
/SQLQuery1.sql
UTF-8
696
3.828125
4
[]
no_license
select ag.AgentId, ag.Name, count(*) sold, sum(cr.InsPrem) Prem, sum(cr.InsPremRur) PremRur, sum(ca.insprem) comm, sum(ca.inspremrur) commrur, count(case st.code when 'annul' then 1 end) annul_count, sum(case st.code when 'annul' then cr.InsPremRur end) annul_sum , sum(case st.code when 'annul' then ca.inspremrur end) annul_comm from contract c join ContractStatus cs on cs.ContractStatusId = c.ContractStatusId join Status st on st.StatusId = cs.StatusId join ContractAgent ca on ca.ContractId = c.ContractId join Agent ag on ag.AgentId = ca.AgentId join ContractRisk cr on cr.ContractId = c.ContractId where st.Code in ('confirmed','annul') group by ag.AgentId, ag.Name order by ag.Name
true
579459de6b8bb22b23b06193c180bed75b0198d0
SQL
tgenman/internet_shop
/shop-core/src/main/resources/db/migration/V1__Init_DB.sql
UTF-8
4,606
3.28125
3
[]
no_license
create table category( id bigint not null auto_increment, category_name varchar(255), primary key (id) ) engine=InnoDB; create table product ( id bigint not null auto_increment, active bit not null, title varchar(255), brand varchar(255), category_id bigint, price integer not null, color varchar(255), quantity integer not null, size varchar(255), weight integer not null, day_of_warranty integer not null, filename varchar(255), advertising bit not null, primary key (id) ) engine=InnoDB; create table user ( id bigint not null auto_increment, email varchar(255), password varchar(60), enabled bit, first_name varchar(255), last_name varchar(255), date_of_birth varchar(255), primary key (id) ) engine=InnoDB; create table address ( id bigint not null auto_increment, active bit not null, postal_code integer not null, country varchar(255), city varchar(255), street varchar(255), building varchar(255), flat varchar(255), primary key (id) ) engine=InnoDB; create table cart ( id bigint not null auto_increment, user_id bigint, session_id varchar(255), primary key (id) ) engine=InnoDB; create table cart_products ( cart_id bigint not null, products integer, products_key bigint not null, primary key (cart_id, products_key) ) engine=InnoDB; create table order_entity ( id bigint not null auto_increment, date_of_order datetime, user_id bigint, total integer, bill varchar(255), address_string varchar(255), status_of_delivery varchar(255), status_of_payment varchar(255), type_of_delivery varchar(255), type_of_payment varchar(255), primary key (id) ) engine=InnoDB; create table order_entity_product ( order_entity_id bigint not null, list_of_products integer, list_of_products_key bigint not null, primary key (order_entity_id, list_of_products_key) ) engine=InnoDB; create table user_addresses ( user_id bigint not null, address_id bigint not null, primary key (user_id, address_id) ) engine=InnoDB; create table user_roles ( user_id bigint not null, roles varchar(255) ) engine=InnoDB; create table verification_token ( id bigint not null auto_increment, expiry_date datetime, token varchar(255), user_id bigint not null, primary key (id)) engine=InnoDB; create table password_reset_token ( id bigint not null auto_increment, expiry_date datetime, token varchar(255), user_id bigint not null, primary key (id) ) engine=InnoDB; create table hibernate_sequence ( next_val bigint ) engine=InnoDB; insert into hibernate_sequence values ( 1000 ); insert into hibernate_sequence values ( 1000 ); insert into hibernate_sequence values ( 1000 ); insert into hibernate_sequence values ( 1000 ); insert into hibernate_sequence values ( 1000 ); insert into hibernate_sequence values ( 1000 ); insert into hibernate_sequence values ( 1000 ); ALTER TABLE product AUTO_INCREMENT = 1; alter table product add constraint FK1mtsbur82frn64de7balymq9s foreign key (category_id) references category (id); alter table cart add constraint FKl70asp4l4w0jmbm1tqyofho4o foreign key (user_id) references user (id); alter table cart_products add constraint FK8x7wyc1ajldym6lj0uoi57ono foreign key (products_key) references product (id); alter table cart_products add constraint FKnlhjc091rdu9k5c8u9xwp280w foreign key (cart_id) references cart (id); alter table order_entity add constraint FKdikderaycp8pwoigw489wohfa foreign key (user_id) references user (id); alter table order_entity_product add constraint FK59u8ap2q6itt6bq1kxjhkxrep foreign key (list_of_products_key) references product (id); alter table order_entity_product add constraint FK2dg1g0qjsth4l3thsoaxpl6y4 foreign key (order_entity_id) references order_entity (id); alter table password_reset_token add constraint FK5lwtbncug84d4ero33v3cfxvl foreign key (user_id) references user (id); alter table user_addresses add constraint FKd2jqv60joaqmw8h94mdpx0f55 foreign key (address_id) references address (id); alter table user_addresses add constraint FKfm6x520mag23hvgr1oshaut8b foreign key (user_id) references user (id); alter table user_roles add constraint FK55itppkw3i07do3h7qoclqd4k foreign key (user_id) references user (id); alter table verification_token add constraint FKrdn0mss276m9jdobfhhn2qogw foreign key (user_id) references user (id);
true
1f3f6c020fd9d48111169fcb3b74168bbfe68fd5
SQL
DenisKP/geekden
/HW7BD.sql
UTF-8
2,355
4.25
4
[]
no_license
-- 1 USE VK; DROP TABLE IF EXISTS users_orders; CREATE TABLE IF NOT EXISTS users_orders ( user_id SERIAL PRIMARY KEY, name VARCHAR(255) NOT NULL, order_id INT ); DROP TABLE IF EXISTS orders; CREATE TABLE IF NOT EXISTS orders ( order_id SERIAL PRIMARY KEY, product_id INT NOT NULL, product_name VARCHAR(255) NOT NULL ); INSERT INTO users_orders (name, order_id) VALUES ( 'Ãåííàäèé', 1), ( 'Ìèõàèë', 2), ( 'Åâãåíèé', 3), ( 'Ñâåòëàíà', NULL), ( 'Dmitriy', NULL); INSERT INTO orders (product_id , product_name) VALUES ( 34, 'PC'), ( 334, 'phone'), ( 3234, 'memory'), ( 123, 'Motherboard 32'); SELECT u.user_id, u.name, o.order_id, o.product_id, o.product_name FROM users_orders AS u JOIN orders AS o ON o.order_id = u.order_id; -- 2 DROP TABLE IF EXISTS products; CREATE TABLE IF NOT EXISTS products ( product_id INT NOT NULL, product_name VARCHAR(255) NOT NULL, product_price INT, catalogue_id INT ); DROP TABLE IF EXISTS catalogues; CREATE TABLE IF NOT EXISTS catalogues ( id SERIAL PRIMARY KEY, catal_name VARCHAR(255) ); INSERT INTO catalogues (catal_name) VALUES ('motherboards'), ('computers'), ('phones'), ('memories'); INSERT INTO products VALUES ( 123, 'Motherboard 32', 456, 1), ( 34, 'PC', 584, 2), ( 334, 'phone', 985, 3), ( 3234, 'memory', 52, 4); SELECT p.product_id, p.product_name, p.product_price, c.catal_name FROM products AS p LEFT JOIN catalogues AS c ON p.catalogue_id = c.id ; -- 3 DROP TABLE IF EXISTS flights; CREATE TABLE IF NOT EXISTS flights ( id SERIAL PRIMARY KEY, f_from VARCHAR(255) NOT NULL, f_to VARCHAR(255) NOT NULL ); DROP TABLE IF EXISTS cities; CREATE TABLE IF NOT EXISTS cities ( label VARCHAR(255) NOT NULL UNIQUE, name VARCHAR(255) NOT NULL UNIQUE ); INSERT INTO flights (f_from, f_to) VALUES ('moscow', 'omsk'), ('novgorod', 'kazan'), ('irkutsk', 'moscow'), ('omsk', 'irkutsk'), ('moscow', 'kazan'); INSERT INTO cities (label, name) VALUES ('moscow', 'Ìîñêâà'), ('irkutsk', 'Èðêóòñê'), ('novgorod', 'Íîâãîðîä'), ('kazan', 'Êàçàíü'), ('omsk', 'Îìñê'); SELECT f.id, cities_from.name AS f_from, cities_to.name AS f_to FROM flights AS f JOIN cities AS cities_from ON f.f_from = cities_from.label JOIN cities AS cities_to ON f.f_to = cities_to.label;
true
5926cbc349e896022d2bd729c7f0041ef27fe2cb
SQL
ChFaizan009/OOP-PROJECTS
/DSA_PROJECT/SQL ServerQuery/Compoiste key.sql
UTF-8
136
2.625
3
[]
no_license
use Lab; create table books( Isbn varchar(100), title varchar(150), author varchar(200), constraint pk_Name PRIMARY KEY (Isbn,title) );
true
18ada2a3eebd1e907332707d77a0f6cb9eab8b0b
SQL
yanmu913/githubfile
/StuInfo-parent/sql/StuInfo.sql
UTF-8
1,177
3.625
4
[]
no_license
DROP DATABASE IF EXISTS info; CREATE DATABASE info DEFAULT CHARACTER SET utf8;; USE info; DROP TABLE IF EXISTS student; CREATE TABLE student( s_id INT(10) PRIMARY KEY AUTO_INCREMENT COMMENT'学生id', s_name VARCHAR(255) NOT NULL COMMENT'学生姓名', s_birthday DATETIME NOT NULL COMMENT'学生生日', s_gender VARCHAR(255) NOT NULL COMMENT'学生电话', s_telephone VARCHAR(255) NOT NULL COMMENT'学生性别', s_email VARCHAR(255) NOT NULL COMMENT'学生i邮箱', classId INT(10) NOT NULL COMMENT'学生所在班级id' ); DROP TABLE IF EXISTS classes; CREATE TABLE classes( c_id INT(10) PRIMARY KEY AUTO_INCREMENT COMMENT'班级id', c_name VARCHAR(255) NOT NULL COMMENT'班级名' ); INSERT INTO classes VALUES(DEFAULT,'S111'),(DEFAULT,'S1112'),(DEFAULT,'S1113'),(DEFAULT,'S1114'),(DEFAULT,'S1115'); INSERT INTO student VALUES(DEFAULT,'tom','1999-01-01','男','123456789','123@qq.com',1), (DEFAULT,'ann','1993-05-14','女','123456789','127@qq.com',2), (DEFAULT,'李磊','1992-01-30','男','125556789','120@qq.com',3), (DEFAULT,'丽丽','1995-12-01','女','123245789','122@qq.com',4), (DEFAULT,'杨过','1997-01-01','男','12278789','121@qq.com',5);
true
e65ee3b917b995c7fae960e58ffbb74ac3104876
SQL
cb-raghu/Training-Exercises
/SQLQueries/training4.sql
UTF-8
1,908
4.1875
4
[]
no_license
1. select cust.id,cust.handle,cust.first_name from customers cust inner join subscriptions sub on cust.id = sub.customer_id group by sub.customer_id having count(sub.customer_id) > 1 3. select sub.id,handle, ad.code from subscriptions sub inner join subscriptions_addons sub_adon on sub.id = sub_adon.subscription_id inner join addons ad on ad.id = sub_adon.addon_id where sub.id in(select sub_adon1.subscription_id from subscriptions_addons sub_adon1 where sub_adon1.addon_id in(57000000002,57000000005)); 4.SELECT p.id,p.name FROM plans p left join subscriptions sub on sub.plan_id = p.id left join line_items li on li.entity_id = p.id where sub.plan_id is null and li.entity_id is null; 8. SELECT distinct(p.id) FROM plans p cross join plans p1 where p.price = p1.price and p.trial_period = p1.trial_period and p.billing_cycles = p1.billing_cycles and p.id != p1.id 10.select concat(ifnull(first_name,''),ifnull(last_name,''),ifnull(email,'')) FirstLastEmail from customers having FirstLastEmail like '%active%'; 1. create temporary table if not exists TempCustomers(id varchar(20),first_name varchar(50),amount_paid float) as (select cust.id,cust.first_name,sum(if(status in (300),amount,0)) amount_paid from customers cust left join invoices inv on cust.id = inv.customer_id group by cust.id); select * from TempCustomers; drop temporary table if exists TempCustomers; 2. create temporary table if not exists TempSubscriptions(id varchar(20)) as (select sub_adon1.subscription_id id from subscriptions_addons sub_adon1 where sub_adon1.addon_id in(57000000002,57000000005)); select sub.id,handle, ad.code from subscriptions sub inner join subscriptions_addons sub_adon on sub.id = sub_adon.subscription_id inner join addons ad on ad.id = sub_adon.addon_id where sub.id in (select id from TempSubscriptions); drop temporary table if exists TempSubscriptions;
true
cab41bb257ae5154adbf3861e540da0c4dfa05b8
SQL
deva7mad/TakiemF
/Database/takieidl_takiem.sql
UTF-8
84,358
3.28125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Apr 24, 2019 at 11:01 AM -- Server version: 5.6.41-84.1-log -- PHP Version: 7.2.7 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `takieidl_takiem` -- -- -------------------------------------------------------- -- -- Table structure for table `classes` -- CREATE TABLE `classes` ( `class_id` int(11) NOT NULL, `class_name` varchar(40) NOT NULL, `class_subject` varchar(250) NOT NULL, `class_teacher_id` int(11) NOT NULL, `class_period` varchar(40) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `classes` -- INSERT INTO `classes` (`class_id`, `class_name`, `class_subject`, `class_teacher_id`, `class_period`) VALUES (1, 'أول أ', 'رياضيات', 13, 'التانية'), (2, 'أول أ', 'رياضيات', 13, 'التانية'), (3, 'أول ب', 'رياضيات', 73, 'التانية'), (4, 'gfsd', 'dsfd', 13, 'fesdf'), (5, 'أول أ', 'رياضيات', 13, 'التانية'), (6, 'أول أ', 'رياضيات', 68, 'التانية'), (7, 'أول أ', 'رياضيات', 68, 'التانية'); -- -------------------------------------------------------- -- -- Table structure for table `classes-table` -- CREATE TABLE `classes-table` ( `Id` int(11) NOT NULL, `Name` varchar(40) NOT NULL, `Hours` int(40) NOT NULL, `StartDate` datetime NOT NULL, `EndDate` datetime NOT NULL, `SubjectName` varchar(40) NOT NULL, `Class` varchar(40) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `c_plan` -- CREATE TABLE `c_plan` ( `c_plan_id` int(20) NOT NULL, `plan_id` int(20) NOT NULL, `subject_name` varchar(40) NOT NULL, `class_name` varchar(40) NOT NULL, `day_name` varchar(20) NOT NULL, `period_name` varchar(20) NOT NULL, `section_name` varchar(20) NOT NULL, `homework_type` int(11) NOT NULL, `homework_text` varchar(250) DEFAULT NULL, `homework_url` varchar(250) NOT NULL, `teacher_id` int(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `c_plan` -- INSERT INTO `c_plan` (`c_plan_id`, `plan_id`, `subject_name`, `class_name`, `day_name`, `period_name`, `section_name`, `homework_type`, `homework_text`, `homework_url`, `teacher_id`) VALUES (1, 1, 'رياضيات', 'أول ب', 'الأحد', 'الثانية', '', 1, '0', '0', 55), (2, 1, 'رياضيات', 'أول ب', 'الأحد', 'الثانية', '', 1, NULL, '0', 55), (3, 1, 'رياضيات', 'أول ب', 'الأحد', 'الثانية', '', 1, NULL, '', 55), (4, 1, 'رياضيات', 'أول ب', 'الأحد', 'الثانية', '', 1, NULL, '', 55), (5, 1, 'رياضيات', 'أول ب', 'الأحد', 'الثانية', '', 1, 'واجب', '', 55), (6, 1, 'رياضيات', 'أول ب', 'الأحد', 'الثانية', '', 2, NULL, 'http://localhost/takiem/services/teacher/planclasses', 55), (7, 1, 'رياضيات', 'أول ب', 'الأحد', 'الثانية', '', 2, NULL, 'http://localhost/takiem/services/teacher/planclasses', 55), (8, 1, 'رياضيات', 'أول ب', 'الأحد', 'الثانية', '', 1, 'واجب', '', 55); -- -------------------------------------------------------- -- -- Table structure for table `evaluation` -- CREATE TABLE `evaluation` ( `evaluation_id` int(11) NOT NULL, `evaluation_type` varchar(40) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `evaluation` -- INSERT INTO `evaluation` (`evaluation_id`, `evaluation_type`) VALUES (1, '10 - 1'), (2, 'انجز / لم ينجز'), (3, 'اجتاز / لم يجتاز'), (4, 'حاضر / غائب'); -- -------------------------------------------------------- -- -- Table structure for table `evaluations` -- CREATE TABLE `evaluations` ( `e_id` int(20) NOT NULL, `e_type` varchar(20) NOT NULL, `e_txt_one` varchar(20) NOT NULL, `e_txt_two` varchar(20) NOT NULL, `e_txt_three` varchar(20) DEFAULT NULL, `e_txt_four` varchar(20) DEFAULT NULL, `teacher_id` int(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `evaluations` -- INSERT INTO `evaluations` (`e_id`, `e_type`, `e_txt_one`, `e_txt_two`, `e_txt_three`, `e_txt_four`, `teacher_id`) VALUES (15, '2', 'جضر', 'غياب', '', '', 68), (16, '2', 'ض', 'ج', 'ج ج', 'م', 68), (18, '1', '1', '10', NULL, NULL, 68); -- -------------------------------------------------------- -- -- Table structure for table `father` -- CREATE TABLE `father` ( `parent_id` int(11) NOT NULL, `parent_name` varchar(250) NOT NULL, `parent_email` varchar(250) NOT NULL, `parent_password` varchar(250) NOT NULL, `parent_phone` varchar(50) NOT NULL, `parent_status` varchar(20) NOT NULL, `parent_code` varchar(20) NOT NULL, `parent_no_msg` int(2) NOT NULL, `parent_token` varchar(250) NOT NULL, `parent_token_web` varchar(250) NOT NULL, `parent_enterdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `father` -- INSERT INTO `father` (`parent_id`, `parent_name`, `parent_email`, `parent_password`, `parent_phone`, `parent_status`, `parent_code`, `parent_no_msg`, `parent_token`, `parent_token_web`, `parent_enterdate`) VALUES (1, 'Ahmed', 'ahmed@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '8678676876', '', '', 0, '', '', '2018-10-16 20:58:22'), (2, 'عماد السيد حمزة', 'emad.elsayed@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '01012380', '', '', 0, 'kxhxy4YAtE:APA91bGoxKGAGe1bdaXm1szNbAYtG9XKyQ0gcrKdsSrRBq4YgTW_nyMBrbjMwFaw9i_bNY_IktyvyduaeJXb7nfHGr0bzGO4MXPYFX_IZ_n49ryNL4EkC', 'd25630c2a0a7023d26f6451dc510ca25', '2018-10-16 21:21:06'), (5, 'سارة ابراهيم ', 'sara.khater@gmail.net', '827ccb0eea8a706c4c34a16891f84e7b', '01012380709', 'active', '4529', 0, 'asdsdasdasd', '624eb1ffc343f6311974852f04329728', '2018-10-23 19:38:40'), (13, 'Sara', 'sara.khater@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '01063779301', 'active', '3846', 0, 'APA91bGoxKGAGe1bdaXm1szNbAYtG9XKyQ0gcrKdsSrRBq4YgTW_nyMBrbjMwFaw9i_bNY_IktyvyduaeJXb7nfHGr0bzGO4MXPYFX_IZ_n49ryNL4EkC', '698f94bb4eb1d15ec4cfb211cfd8fb42', '2018-11-09 13:01:56'), (15, 'Sara', 'sara.kter@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '01063879301', 'active', '9219', 0, 'APA91bGoxKGAGe1bdaXm1szNbAYtG9XKyQ0gcrKdsSrRBq4YgTW_nyMBrbjMwFaw9i_bNY_IktyvyduaeJXb7nfHGr0bzGO4MXPYFX_IZ_n49ryNL4EkC', 'd650c84c0336e9b73813112edcf2886e', '2018-11-09 22:51:12'), (16, 'moaaz Fathy', 'm.elneshawy@gmail.com', 'dcddb75469b4b4875094e14561e573d8', '01099885903', 'active', '1194', 0, 'cTxIrfgi8g4:APA91bF3Ck2mhiruNiUiPFhZ3arv1IHMRkW2T74j_tO596zZRiY_Gxa-W3BCuM9DoAax64SqCIyAIvlopJx-PqVHvurX0Y7M8zoCzWL5kc2V6z88dChvljv7slIX4aKfcEYAdWAKTLnY', '6007ea722b36475fde0b563f7409bb9a', '2018-11-09 23:24:47'), (34, 'ffsdgf', 'sfgdf@dsv5ffscd.dffd', '71d62ceb873b45ee9ab53f3e9fa52412', '42655454523', 'deactive', '1108', 1, '1549160468198', '88c81cc1a260cd15e53fa67bbd1feec0', '2019-02-09 04:38:41'), (35, 'hdggdfgh', 'xbcvbg@fxfbhxfh.fhxfh', 'e10adc3949ba59abbe56e057f20f883e', '4346543645', 'deactive', '5987', 1, '1549687639988', 'b6a5e584a30e11bbf961f1ece2126511', '2019-02-09 04:47:22'), (36, 'hdggdfghgsfd', 'xbcvbg@fgsdf.fhxfh', 'e10adc3949ba59abbe56e057f20f883e', '563456356', 'deactive', '4172', 1, '1549687725906', 'ca4d42ebfa45a11e85c9c01b8728c215', '2019-02-09 04:48:48'), (37, 'ffsdgf', 'sfgdf@dsv5ffscd.dffdffd', '71d62ceb873b45ee9ab53f3e9fa52412', '4265355454523', 'active', '9649', 0, '1549160468198f', 'c26959ff1e9bf7641e6df1b114e52d2c', '2019-02-09 04:49:29'), (38, 'fgdgfndgf', 'fssbfg@fdbf.fbgf', 'e10adc3949ba59abbe56e057f20f883e', '5246543645', 'deactive', '6222', 1, '1549687824638', '4aa659273fb8c0d444b50b050a202ccc', '2019-02-09 04:50:28'), (39, 'adel', 'adel@mail.com', 'e10adc3949ba59abbe56e057f20f883e', '01091460759', 'active', '5701', 0, '1552405073350', 'cba6c5e2b3d0f33a145e280b5a323345', '2019-02-09 04:59:01'), (40, 'ffsdgfg', 'sfgdf@dsv5ffscd.dffdffdg', 'cc3f49d6d00aca039831dff368adb0c1', '42653554545239', 'active', '9212', 0, '1549160468198f', '79ce43ceddf030c5a82e85d500c2523f', '2019-02-09 05:17:52'); -- -------------------------------------------------------- -- -- Table structure for table `government` -- CREATE TABLE `government` ( `government_id` int(11) NOT NULL, `government_name` varchar(50) NOT NULL, `government_parent` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `government` -- INSERT INTO `government` (`government_id`, `government_name`, `government_parent`) VALUES (1, 'الرياض', 0), (2, 'مكة المكرمة', 0), (3, 'المدينة المنورة', 0), (4, 'القصيم', 0), (5, 'المدينة الشرقية', 0), (6, 'منطقة عسير', 0), (7, 'منطقة تبوك', 0), (8, 'منطقة حائل', 0), (9, 'منطقة الحدود الشمالية', 0), (10, 'منطقة جازان', 0), (11, 'منطقة نجران', 0), (12, 'منطقة الباحة', 0), (13, 'منطقة الجوف', 0); -- -------------------------------------------------------- -- -- Table structure for table `group_student` -- CREATE TABLE `group_student` ( `plan_student_group_id` int(11) NOT NULL, `plan_group_idd` int(11) NOT NULL, `plan_student_id` int(20) NOT NULL, `plan_type` int(10) NOT NULL, `plan_group_code` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `group_student` -- INSERT INTO `group_student` (`plan_student_group_id`, `plan_group_idd`, `plan_student_id`, `plan_type`, `plan_group_code`) VALUES (16, 4, 9, 2, '36372'), (17, 7, 10, 2, '44441'), (18, 4, 6, 2, ''), (19, 4, 9, 2, ''), (20, 4, 10, 2, ''), (21, 4, 10, 2, ''), (22, 4, 11, 2, ''); -- -------------------------------------------------------- -- -- Table structure for table `group_student_c` -- CREATE TABLE `group_student_c` ( `plan_student_group_id` int(11) NOT NULL, `plan_group_idd` int(11) NOT NULL, `plan_student_id` int(20) NOT NULL, `plan_type` int(10) NOT NULL, `plan_group_code` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `group_student_c` -- INSERT INTO `group_student_c` (`plan_student_group_id`, `plan_group_idd`, `plan_student_id`, `plan_type`, `plan_group_code`) VALUES (16, 4, 9, 2, '86762'), (17, 7, 10, 2, '86762'); -- -------------------------------------------------------- -- -- Table structure for table `group_student_old` -- CREATE TABLE `group_student_old` ( `group_student_id` int(11) NOT NULL, `group_id` int(11) NOT NULL, `group_student_name` varchar(250) NOT NULL, `group_student_code` varchar(50) NOT NULL, `group_link` varchar(250) NOT NULL, `group_type` enum('manual','code','excel','group') NOT NULL DEFAULT 'manual', `group_code` varchar(20) NOT NULL, `group_student_deleteflag` int(11) NOT NULL DEFAULT '0' ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `group_student_old` -- INSERT INTO `group_student_old` (`group_student_id`, `group_id`, `group_student_name`, `group_student_code`, `group_link`, `group_type`, `group_code`, `group_student_deleteflag`) VALUES (6, 1, 'بدر بن محمد بن عبد اللهالزهرانى', '', '', 'manual', '50073', 0), (5, 1, 'حسن بن احمد بن حسن', '', '', 'manual', '50073', 0), (7, 1, 'سعود عبد العزيز يحيى حسن', '', '', 'manual', '50073', 0), (8, 1, 'سعود عبد العزيز يحيى حسن', '', '', 'manual', '50073', 0), (9, 1, 'نواف منصور نواف الحربى ', '', '', 'manual', '50073', 0), (10, 1, 'مهنى مهيد مهناء السبيعى', '', '', 'manual', '50073', 0), (11, 1, 'سلطان متعب مهناء السبيعى', '', '', 'manual', '50073', 1), (12, 12, 'سارة ابراهيم ', '', '', 'manual', '19038', 0), (13, 12, '', '', 'excel sheet', 'excel', '19038', 0), (14, 12, '', '54545', '', 'code', '19038', 0), (15, 12, '', '', 'excel sheet', 'excel', '19038', 0), (16, 12, '', '', 'excel sheet', 'excel', '', 0), (17, 12, '', '54545', '', 'code', '', 0), (18, 3, 'احمد محمد محمود عدلى', '', '', 'manual', '55006', 0), (19, 3, '', '', 'http://localhost/takiem/index.php/services/teacher/group', 'excel', '55006', 0), (20, 3, '', '222222', '', 'code', '55006', 0), (21, 3, '', '222222', '', 'code', '', 0), (22, 6, '', '1', '', 'code', '', 0), (23, 6, '', '1', '', 'code', '', 0), (24, 6, '', '1', '', 'code', '', 0), (25, 6, '', '1', '', 'code', '', 0), (26, 9, '', '1', '', 'code', '', 0), (27, 8, '', '1', '', 'code', '', 0); -- -------------------------------------------------------- -- -- Table structure for table `group_takiem` -- CREATE TABLE `group_takiem` ( `plan_group_id` int(11) NOT NULL, `plan_school_id` varchar(20) NOT NULL, `plan_school_name` varchar(250) NOT NULL, `plan_class` varchar(40) NOT NULL, `plan_classroom` varchar(20) NOT NULL, `plan_subject` varchar(40) NOT NULL, `plan_teacher_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `group_takiem` -- INSERT INTO `group_takiem` (`plan_group_id`, `plan_school_id`, `plan_school_name`, `plan_class`, `plan_classroom`, `plan_subject`, `plan_teacher_id`) VALUES (4, '23', 'ابتدائية أجيال الرموك الأهلية الابتدائية', 'أول ', 'أ', 'رياضيات', 68), (5, '23', 'ابتدائية أجيال الرموك الأهلية الابتدائية', 'أول', 'أ', 'رياضيات', 68), (6, '23', 'ابتدائية أجيال الرموك الأهلية الابتدائية', 'أول', 'أ', 'رياضيات', 68), (7, '24', 'دار البراء الابتدائية الأهلية للبنين', 'أول', 'أ', 'لغة عربية ', 68), (8, '23', 'ابتدائى - ابتدائية أجيال الرموك الأهلية الابتدائية', 'أول ', 'أ', 'علوم', 68); -- -------------------------------------------------------- -- -- Table structure for table `group_takiem_old` -- CREATE TABLE `group_takiem_old` ( `group_id` int(11) NOT NULL, `group_school_id` varchar(20) NOT NULL, `group_school_name` varchar(250) NOT NULL, `group_stage` varchar(40) NOT NULL, `group_class` varchar(20) NOT NULL, `group_subject` varchar(40) NOT NULL, `group_teacher_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `group_takiem_old` -- INSERT INTO `group_takiem_old` (`group_id`, `group_school_id`, `group_school_name`, `group_stage`, `group_class`, `group_subject`, `group_teacher_id`) VALUES (1, '2', 'دار البراء الابتدائية الأهلية للبنين', 'أول', 'أ', 'رياضيات', 73), (2, '2', 'دار البراء الابتدائية الأهلية للبنين', 'أول', 'أ', 'علوم', 73), (3, '', 'ابتدائية أجيال اليرموك الأهلية', 'أول', 'أ', 'رياضيات', 13), (4, '', 'ابتدائية أجيال اليرموك الأهلية', 'أول', 'أ', 'رياضيات', 13), (5, '', 'ابتدائية أجيال اليرموك الأهلية', 'أول', 'أ', 'رياضيات ', 25), (6, '', 'ابتدائية أجيال اليرموك الأهلية', 'ثانى ', 'أ', 'رياضيات', 68), (7, '', 'ابتدائية أجيال اليرموك الأهلية', 'خامس', 'ج', 'علوم', 68), (8, '', 'ابتدائية أجيال اليرموك الأهلية', 'سادس', 'ب', 'رياضيات', 68), (9, '', 'ابتدائية أجيال اليرموك الأهلية', 'أول ', 'د', 'علوم', 68); -- -------------------------------------------------------- -- -- Table structure for table `holiday` -- CREATE TABLE `holiday` ( `holiday_id` int(20) NOT NULL, `holiday_name` varchar(40) NOT NULL, `holiday_startdate` varchar(20) NOT NULL, `holiday_endate` varchar(20) NOT NULL, `teacher_id` int(20) NOT NULL, `holiday_deletefag` int(1) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `holiday` -- INSERT INTO `holiday` (`holiday_id`, `holiday_name`, `holiday_startdate`, `holiday_endate`, `teacher_id`, `holiday_deletefag`) VALUES (2, 'اجازة 111', '16/07/2018', '20/07/2018', 55, 1), (3, 'اجازة 111', '16/07/2018', '20/07/2018', 55, 1), (4, 'اجازة 1', '16/07/2018', '20/07/2018', 55, 0), (5, 'اجازة 4', '16/07/2018', '20/07/2018', 55, 0), (7, 'اجازه عيد الفطر', '16/07/2018', '20/07/2018', 68, 0), (8, 'اجازه ', '16/07/2018', '20/07/2018', 68, 0), (9, 'اجازه ', '16/07/2018', '20/07/2018', 68, 0), (10, 'اجازه ', '16/17/2018', '20/07/2018', 68, 0), (11, 'البحث عن المشاركات', '13/02/2019', '28/02/2019', 68, 1), (12, 'اجازه ', '21/02/2019', '27/02/2019', 68, 0), (14, ' thanks ', '27/02/2019', '28/02/2019', 68, 0), (15, '25 jan', '11/02/2019', '12/02/2019', 78, 0); -- -------------------------------------------------------- -- -- Table structure for table `homework` -- CREATE TABLE `homework` ( `homework_id` int(20) NOT NULL, `homework_week` varchar(40) NOT NULL, `homework_week_id` int(20) NOT NULL, `homework_period` varchar(20) NOT NULL, `homework_subject` varchar(40) NOT NULL, `homework_type` varchar(20) NOT NULL, `homework_details` varchar(40) NOT NULL, `homework_day` varchar(40) NOT NULL, `homework_day_id` int(20) NOT NULL, `homework_note` varchar(250) NOT NULL, `homework_student_id` int(20) NOT NULL, `homework_student_name` varchar(250) NOT NULL, `homework_more_details` varchar(250) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `homework` -- INSERT INTO `homework` (`homework_id`, `homework_week`, `homework_week_id`, `homework_period`, `homework_subject`, `homework_type`, `homework_details`, `homework_day`, `homework_day_id`, `homework_note`, `homework_student_id`, `homework_student_name`, `homework_more_details`) VALUES (1, 'الأسبوع الأول', 1, 'الاولى ', 'رياضيات', '1', 'كتاب الطالب', 'الاحد', 1, 'لم يقم بعمل الواجب', 1, 'زياد رجب', 'لم يتم تحديد صفحات'), (2, 'الأسبوع الأول', 1, 'الثالثة', 'علوم ', '2', 'كتاب نشاط ', 'الأحد ', 1, '', 1, 'زياد رجب', 'صفحة رقم 22 الفقرةالثانية و الثالثة'), (3, 'الأسبوع الأول', 1, 'الرابعة', 'لغة عربية', '3', 'ورقة عمل', 'الاحد', 1, '', 1, 'زياد رجب', 'لم يتم فيها تحديد صفحات'), (4, 'الأسبوع الأول', 1, 'الاولى ', 'رياضيات', '1', 'كتاب الطالب', 'الاحد', 1, 'لم يقم بعمل الواجب', 20, 'Ahmed', 'لم يتم تحديد صفحات'), (5, 'الأسبوع الأول', 1, 'الثالثة', 'علوم ', '2', 'كتاب نشاط ', 'الأحد ', 1, '', 20, 'Ahmed', 'صفحة رقم 22 الفقرةالثانية و الثالثة'), (6, 'الأسبوع الأول', 1, 'الرابعة', 'لغة عربية', '3', 'ورقة عمل', 'الاحد', 1, '', 20, 'Ahmed', 'لم يتم فيها تحديد صفحات'), (7, 'الأسبوع الثانى', 1, 'الاولى ', 'رياضيات', '1', 'كتاب الطالب', 'الاحد', 1, 'لم يقم بعمل الواجب', 20, 'Ahmed', 'لم يتم تحديد صفحات'), (8, 'الأسبوع الثالث', 1, 'الاولى ', 'رياضيات', '1', 'كتاب الطالب', 'الاحد', 1, 'لم يقم بعمل الواجب', 20, 'Ahmed', 'لم يتم تحديد صفحات'), (9, 'الأسبوع الرابع', 1, 'الاولى ', 'رياضيات', '1', 'كتاب الطالب', 'الاحد', 1, 'لم يقم بعمل الواجب', 20, 'Ahmed', 'لم يتم تحديد صفحات'); -- -------------------------------------------------------- -- -- Table structure for table `logs` -- CREATE TABLE `logs` ( `id` int(11) NOT NULL, `uri` varchar(255) NOT NULL, `method` varchar(6) NOT NULL, `params` text, `api_key` varchar(40) NOT NULL, `ip_address` varchar(45) NOT NULL, `time` int(11) NOT NULL, `rtime` float DEFAULT NULL, `authorized` varchar(1) NOT NULL, `response_code` smallint(3) DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `main_tab` -- CREATE TABLE `main_tab` ( `main_tab_id` int(11) NOT NULL, `main_group_id` int(11) NOT NULL, `main_tab_title` varchar(250) CHARACTER SET utf8 NOT NULL, `tab_sub_title_first` varchar(250) CHARACTER SET utf8 NOT NULL, `evaluation_id` varchar(250) NOT NULL, `main_teacher_id` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `main_tab` -- INSERT INTO `main_tab` (`main_tab_id`, `main_group_id`, `main_tab_title`, `tab_sub_title_first`, `evaluation_id`, `main_teacher_id`) VALUES (1, 4, 'كتاب النشاط ', '', '', '68'), (2, 7, 'كتاب الدعوي', 'الحضور', '', '68'), (3, 7, 'البحث المتقدم', 'الصورة الرمزية', '', '68'), (4, 7, 'البحث المتقدم', 'الصورة للتوضيح', '', '68'), (5, 7, 'الكتاب الاول', 'البحث المتقدم', '', '68'), (6, 7, 'علي', 'حسن', '', '68'), (7, 4, 'كتاب الرياضيات ', 'الجمع', '', '68'), (8, 4, 'كتاب طالب', 'تدريبات ', '', '68'), (9, 4, 'رياضيات', 'الجمع', '', '68'), (10, 5, 'Roll', 'Back', '', '68'), (11, 4, 'تيست 1', 'فرعي 1', '', '68'), (12, 4, 'ت رئيسي', 'ت فرعي 1', '18', '68'), (13, 7, 'sffdfs', 'sdfsdf', '12', '68'), (14, 4, 'new', 'sub 1', '15', '68'), (15, 8, 't 1', 's1', '15', '68'), (16, 4, 't1 new', 's1 new', '15', '68'), (17, 4, 'تبويب جديد 1', 'تبويب فرعي 1', '15', '68'), (18, 11, 'new main tab', 'new sub tab', '7', '68'), (19, 5, 'tttttt', 'ssss1', '15', '68'), (20, 4, 'tttttt', 'ssss1', '15', '68'); -- -------------------------------------------------------- -- -- Table structure for table `main_tab_new` -- CREATE TABLE `main_tab_new` ( `main_tab_id` int(11) NOT NULL, `main_group_id` int(11) NOT NULL, `main_tab_title` varchar(250) CHARACTER SET utf8 NOT NULL, `main_teacher_id` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `messages` -- CREATE TABLE `messages` ( `message_id` int(11) NOT NULL, `message_msg` varchar(40) NOT NULL, `message_type` int(3) NOT NULL, `message_enterdate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `message_recivername` varchar(40) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `new_plans` -- CREATE TABLE `new_plans` ( `plan_id` int(20) NOT NULL, `plan_week_id` int(20) NOT NULL, `plan_week` varchar(40) NOT NULL, `plan_period` varchar(40) NOT NULL, `plan_day_id` int(20) NOT NULL, `plan_day` varchar(40) NOT NULL, `plan_subject` varchar(40) NOT NULL, `plan_details` varchar(40) NOT NULL, `plan_student_id` int(20) NOT NULL, `plan_student_name` varchar(40) NOT NULL, `period_start_time` varchar(20) NOT NULL, `period_end_time` varchar(20) NOT NULL, `student_class` varchar(20) NOT NULL, `student_classroom` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `new_plans` -- INSERT INTO `new_plans` (`plan_id`, `plan_week_id`, `plan_week`, `plan_period`, `plan_day_id`, `plan_day`, `plan_subject`, `plan_details`, `plan_student_id`, `plan_student_name`, `period_start_time`, `period_end_time`, `student_class`, `student_classroom`) VALUES (1, 1, 'الأسبوع الأول', 'الأولى', 1, 'الأحد', 'رياضيات ', 'التجميع التصاعدى', 1, 'زياد رجب', '06:45', '07:30', 'خامس', 'ب'), (2, 1, 'الأسبوع الأول', 'الثانية', 1, 'الأحد', 'علوم', 'البناء الضوئى', 1, 'زياد رجب', '06:45', '07:30', 'خامس', 'ب'), (3, 1, 'الأسبوع الأول', 'الثالثة', 1, 'الأحد', 'تاريخ', 'بداية الدولةالسعودية', 1, 'زياد رجب', '06:45', '07:30', 'خامس', 'ب'), (4, 1, 'الأسبوع الأول', 'الرابعة', 1, 'الأحد', 'لغة عربية', 'نصوص', 1, 'زياد رجب', '06:45', '07:30', 'خامس', 'ب'), (5, 1, 'الأسبوع الأول', 'الخامسة', 1, 'الأحد', 'قران كريم', 'سورة الشرح', 1, 'زياد رجب', '06:45', '07:30', 'خامس', 'ب'), (6, 2, 'الأسبوع الثانى', 'الأولى', 1, 'الأحد', 'رياضيات ', 'التجميع التصاعدى', 1, 'زياد رجب', '06:45', '07:30', '', ''), (7, 3, 'الأسبوع الثالث', 'الأولى', 1, 'الأحد', 'رياضيات ', 'التجميع التصاعدى', 1, 'زياد رجب', '06:45', '07:30', '', ''), (8, 4, 'الأسبوع الرابع', 'الأولى', 1, 'الأحد', 'رياضيات ', 'التجميع التصاعدى', 1, 'زياد رجب', '06:45', '07:30', '', ''), (9, 5, 'الأسبوع الخامس', 'الأولى', 1, 'الأحد', 'رياضيات ', 'التجميع التصاعدى', 1, 'زياد رجب', '06:45', '07:30', '', ''), (10, 6, 'الأسبوع السادس', 'الأولى', 1, 'الأحد', 'رياضيات ', 'التجميع التصاعدى', 1, 'زياد رجب', '06:45', '07:30', '', ''), (11, 7, 'الأسبوع السابع', 'الأولى', 1, 'الأحد', 'رياضيات ', 'التجميع التصاعدى', 1, 'زياد رجب', '06:45', '07:30', '', ''), (12, 1, 'الأسبوع الأول', 'الأولى', 1, 'الأحد', 'رياضيات ', 'التجميع التصاعدى', 20, 'Ahmed', '06:45', '07:30', 'خامس', 'ب'), (13, 1, 'الأسبوع الأول', 'الرابعة', 1, 'الأحد', 'لغة عربية', 'نصوص', 20, 'Ahmed', '06:45', '07:30', 'خامس', 'ب'), (14, 1, 'الأسبوع الأول', 'الثانية', 1, 'الأحد', 'علوم', 'البناء الضوئى', 20, 'Ahmed', '06:45', '07:30', 'خامس', 'ب'), (15, 1, 'الأسبوع الأول', 'الثالثة', 1, 'الأحد', 'تاريخ', 'بداية الدولة السعودية', 20, 'Ahmed', '06:45', '07:30', 'خامس', 'ب'), (16, 2, 'الأسبوع الثانى', 'الأولى', 1, 'الأحد', 'رياضيات ', 'التجميع التصاعدى', 20, 'Ahmed', '06:45', '07:30', '', ''), (17, 3, 'الأسبوع الثالث', 'الأولى', 1, 'الأحد', 'رياضيات ', 'التجميع التصاعدى', 20, 'Ahmed', '06:45', '07:30', 'خامس ', 'ب'), (18, 4, 'الأسبوع الرابع', 'الأولى', 1, 'الأحد', 'رياضيات ', 'التجميع التصاعدى', 20, 'Ahmed', '06:45', '07:30', '', ''), (19, 5, 'الأسبوع الخامس', 'الأولى', 1, 'الأحد', 'رياضيات ', 'التجميع التصاعدى', 20, 'Ahmed', '06:45', '07:30', 'خامس ', 'ب'), (20, 7, 'الأسبوع السابع', 'الأولى', 1, 'الأحد', 'رياضيات ', 'التجميع التصاعدى', 20, 'Ahmed', '06:45', '07:30', '', ''), (21, 6, 'الأسبوع السادس', 'الأولى', 1, 'الأحد', 'رياضيات ', 'التجميع التصاعدى', 20, 'Ahmed', '06:45', '07:30', '', ''); -- -------------------------------------------------------- -- -- Stand-in structure for view `new_tabs_sub` -- (See below for the actual view) -- CREATE TABLE `new_tabs_sub` ( ); -- -------------------------------------------------------- -- -- Table structure for table `notes` -- CREATE TABLE `notes` ( `note_id` int(11) NOT NULL, `note_type` varchar(20) NOT NULL, `note_content` varchar(20) NOT NULL, `note_student_id` int(11) NOT NULL, `note_teacher_id` int(11) NOT NULL, `note_group_id` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `notes` -- INSERT INTO `notes` (`note_id`, `note_type`, `note_content`, `note_student_id`, `note_teacher_id`, `note_group_id`) VALUES (1, 'golden_card', '3', 2, 5, 1), (2, 'golden_card', '3', 2, 5, 1), (3, 'golden card', '3', 12, 13, 10), (4, 'golden card', '3', 12, 13, 10), (5, 'text ', 'مشارك بفعالية', 12, 13, 10), (6, 'text', 'مشارك بفعالية', 11, 5, 1); -- -------------------------------------------------------- -- -- Table structure for table `notification_father` -- CREATE TABLE `notification_father` ( `notif_id` int(40) NOT NULL, `notif_teacher_id` varchar(40) NOT NULL, `notif_parent_id` varchar(40) NOT NULL, `notif_message` varchar(250) NOT NULL, `notif_status` varchar(40) NOT NULL, `notif_option` varchar(20) NOT NULL, `notif_delete` tinyint(4) NOT NULL, `notif_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `notif_msg_flag` tinyint(4) NOT NULL DEFAULT '0' ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `notification_father` -- INSERT INTO `notification_father` (`notif_id`, `notif_teacher_id`, `notif_parent_id`, `notif_message`, `notif_status`, `notif_option`, `notif_delete`, `notif_date`, `notif_msg_flag`) VALUES (2, '68', '1', 'قام بدر بن محمد بن عبد الله بإرسال طلب إضافة ', 'unread', '0', 0, '2019-01-04 21:52:52', 0), (3, '68', '1', 'قام بدر بن محمد بن عبد الله بإرسال طلب إضافة ', 'unread', '0', 0, '2019-01-04 21:53:25', 0), (4, '68', '1', 'قام بدر بن محمد بن عبد الله بإرسال طلب إضافة ', 'unread', '0', 0, '2019-01-04 22:11:01', 0), (5, '68', '1', 'قام بدر بن محمد بن عبد الله بإرسال طلب إضافة ', 'unread', '0', 0, '2019-01-04 22:11:02', 0), (6, '68', '1', 'قام بدر بن محمد بن عبد الله بإرسال طلب إضافة ', 'unread', '0', 0, '2019-01-04 22:11:05', 0), (14, '68', '16', 'قام بدر بن محمد بن عبد الله بإرسال طلب إضافة ', 'unread', 'outbox', 0, '2019-01-04 22:11:07', 0), (19, '68', '39', 'قام احمد محمد بإرسال طلب إضافة ', 'unread', 'notif', 0, '2019-01-04 22:11:07', 1), (22, '68', '39', 'قام مجدى بإرسال طلب إضافة ', 'unread', 'notif', 0, '2019-01-04 22:11:07', 1), (23, '68', '16', 'قام بدر بن محمد بن عبد الله بإرسال طلب إضافة ', 'unread', 'inbox', 0, '2019-01-04 22:11:07', 0); -- -------------------------------------------------------- -- -- Table structure for table `notification_teacher` -- CREATE TABLE `notification_teacher` ( `notif_id` int(40) NOT NULL, `notif_teacher_id` varchar(40) NOT NULL, `notif_parent_id` varchar(40) NOT NULL, `notif_message` varchar(250) NOT NULL, `notif_option` varchar(40) NOT NULL, `notif_status` varchar(40) NOT NULL, `notif_delete` tinyint(4) NOT NULL DEFAULT '0', `notif_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `notif_student_id` int(40) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `notification_teacher` -- INSERT INTO `notification_teacher` (`notif_id`, `notif_teacher_id`, `notif_parent_id`, `notif_message`, `notif_option`, `notif_status`, `notif_delete`, `notif_date`, `notif_student_id`) VALUES (1, '55', '23', 'ابنكم مشاغب ', 'ready', 'unread', 0, '2019-01-01 12:53:57', 0), (2, '55', '23', 'ابنكم مشاغب ', 'outbox', 'unread', 0, '2019-01-01 13:02:36', 0), (3, '55', '23', 'ابنكم مشاغب ', 'outbox', 'unread', 0, '2019-01-02 11:06:15', 0), (9, '68', '23', 'فضلا أستاذ اريد تقريرلأبنى هذا الأسبوع', 'ready', 'unread', 0, '2019-01-05 17:45:41', 0), (11, '68', '23', 'فضلا أستاذ اريد تقريرلأبنى هذا الأسبوع', 'inbox', 'unread', 0, '2019-01-05 17:48:04', 0), (12, '68', '23', 'فضلا استاذ أريد تقرير لأبنى هذا الأسبوع', 'inbox', 'unread', 0, '2019-01-05 17:47:57', 0), (13, '68', '23', 'فضلا استاذاريد تقرير لأبنى هذا الأسبوع', 'inbox', 'unread', 0, '2019-01-28 20:43:24', 0), (14, '68', '23', 'قام زياد رجب عبد الله الزهرانى بإرسال طلب إضافة', 'notif', 'unread', 0, '2019-01-28 20:53:52', 1), (15, '68', '23', 'قام منصور نواف حربى بإرسال طلب إضافة', 'notif', 'unread', 0, '2019-01-05 17:50:40', 0), (16, '68', '23', 'شكرا ', 'outbox', 'unread', 0, '2019-01-05 17:56:54', 0), (17, '68', '23', 'لا عليك ، هذا واجبنا', 'outbox', 'unread', 0, '2019-01-05 17:56:54', 0), (18, '55', '23', 'ابنكم مشاغب ', 'ready', 'unread', 0, '2019-01-09 19:33:55', 0), (19, '68', '23', 'ابنكم مشاغب ', 'outbox', 'unread', 0, '2019-01-09 19:40:57', 0), (20, '3', '2', 'message', 'notif', 'unread', 0, '2019-01-19 08:02:07', 4), (21, '3', '2', 'message', 'outbox', 'unread', 0, '2019-01-19 08:07:27', 0), (22, '68', '23', 'ابنكم مشاغب ', 'ready', 'unread', 0, '2019-01-24 17:25:34', 0), (23, '68', '23', 'ابنكم مشاغب ', 'ready', 'unread', 0, '2019-01-24 17:25:36', 0), (24, '68', '23', 'ابنكم مشاغب ', 'ready', 'unread', 0, '2019-01-24 17:25:37', 0), (25, '68', '23', 'ابنكم مشاغب ', 'ready', 'unread', 0, '2019-01-24 17:25:38', 0), (26, '68', '23', 'ابنكم مشاغب ', 'ready', 'unread', 0, '2019-01-24 17:25:39', 0), (28, '73', '16', 'hi from moaaz postman', 'notif', 'unread', 0, '2019-01-28 15:08:13', 60), (29, '68', '23', 'ابنكم مشاغب ', 'inbox', 'unread', 0, '2019-01-24 17:25:39', 0), (30, '68', '23', 'فضلا استاذاريد تقرير لأبنى هذا الأسبوع', 'inbox', 'read', 0, '2019-01-05 17:48:18', 0), (31, '12', '13', 'dfdsfsdfds', 'outbox', 'unread', 0, '2019-01-28 21:11:54', 0), (32, '73', '16', 'hi from moaaz postman', 'outbox', 'unread', 0, '2019-01-28 21:16:27', 0), (33, '73', '16', 'test', 'outbox', 'unread', 0, '2019-01-28 21:22:08', 0), (34, '73', '16', 'test', 'outbox', 'unread', 0, '2019-01-28 21:55:24', 0), (35, '68', '23', 'ابنكم مشاغب ', 'outbox', 'unread', 0, '2019-01-29 19:16:41', 0), (36, '68', '23', 'ابنكم مشاغب [vh ', 'outbox', 'unread', 0, '2019-01-29 19:16:57', 0), (37, '68', '16', 'mmmmmmmmmm the money to you ', 'outbox', 'unread', 0, '2019-01-29 19:31:20', 0), (38, '68', '2', 'nmmmmm', 'outbox', 'unread', 0, '2019-01-29 19:32:05', 0), (39, '68', '5', 'mmmmmmmmmm', 'outbox', 'unread', 0, '2019-01-29 19:48:12', 0), (40, '68', '2', 'mmmmmmmmmm the money to pay for the', 'outbox', 'unread', 0, '2019-01-29 19:52:10', 0), (41, '68', '1', 'mmmm', 'outbox', 'unread', 0, '2019-01-29 19:54:27', 0), (42, '12', '0', 'كل عام و انتم بخير ', 'ready', 'unread', 0, '2019-02-01 17:43:42', 0), (43, '68', '0', 'any', 'ready', 'unread', 0, '2019-02-01 18:03:08', 0), (44, '68', '0', 'الصورة الأصلية كتبت بواسطه البريد', 'ready', 'unread', 0, '2019-02-01 18:13:26', 0), (45, '68', '0', 'البحث عن المشاركات التي كتبها', 'ready', 'unread', 0, '2019-02-01 18:14:26', 0), (46, '73', '16', 'السلام عليكم', 'outbox', 'unread', 0, '2019-02-02 19:52:48', 0), (47, '68', '16', 'gyjj', 'outbox', 'unread', 0, '2019-02-02 21:25:20', 0), (48, '68', '16', 'xxxxc', 'outbox', 'unread', 0, '2019-02-08 20:42:31', 0), (49, '68', '16', 'ssssss', 'outbox', 'unread', 0, '2019-02-09 18:00:28', 0), (50, '73', '39', 'ؤيةي', 'outbox', 'unread', 0, '2019-02-09 23:41:35', 0), (51, '73', '39', 'رتيو', 'outbox', 'unread', 0, '2019-02-10 01:53:47', 0), (52, '68', '0', 'ss', 'ready', 'unread', 0, '2019-02-10 13:32:00', 0), (53, '68', '16', 'ففففف', 'outbox', 'unread', 0, '2019-02-10 15:03:33', 0), (54, '68', '16', 'ابنكم مشاغب ', 'outbox', 'unread', 0, '2019-02-10 15:03:42', 0), (55, '68', '16', 'البحث عن المشاركات التي كتبها ام', 'outbox', 'unread', 0, '2019-02-10 15:04:35', 0), (56, '68', '16', 'ابنكم مشاغب ', 'outbox', 'unread', 0, '2019-02-10 15:05:01', 0), (57, '68', '16', 'البحث عن المشاركات التي كتبها', 'outbox', 'unread', 0, '2019-02-10 15:07:36', 0), (58, '68', '16', 'ابنكم مشاغب ', 'outbox', 'unread', 0, '2019-02-10 15:08:45', 0), (59, '68', '16', 'البحث عن المشاركات التي كتبها ام', 'outbox', 'unread', 0, '2019-02-10 15:09:02', 0), (60, '68', '16', 'البحث عن المشاركات التي كتبها ام', 'outbox', 'unread', 0, '2019-02-10 15:09:23', 0), (61, '68', '16', 'ابنكم مشاغب ', 'outbox', 'unread', 0, '2019-02-10 15:09:31', 0), (62, '68', '15', 'البحث عن المشاركات التي كتبها ام في', 'outbox', 'unread', 0, '2019-02-10 15:58:02', 0), (63, '68', '1', 'البحث عن المشاركات التي كتبها ام في بي بي ', 'outbox', 'unread', 0, '2019-02-10 15:58:25', 0), (64, '68', '1', 'الصورة الأصلية كتبت بواسطه البريد', 'outbox', 'unread', 0, '2019-02-10 15:58:35', 0), (65, '68', '1', 'الصورة في بي ام في هذه', 'outbox', 'unread', 0, '2019-02-10 15:58:59', 0), (66, '68', '1', 'ابنكم مشاغب ', 'outbox', 'unread', 0, '2019-02-10 15:59:06', 0), (67, '68', '16', 'الصورة الأصلية كتبت بواسطه البريد', 'outbox', 'unread', 0, '2019-02-10 15:59:26', 0), (68, '73', '39', 'روؤززرت', 'outbox', 'unread', 0, '2019-02-23 14:43:39', 0), (69, '73', '33', 'فاتوو', 'outbox', 'unread', 0, '2019-03-05 17:24:42', 0), (70, '73', '39', 'fhdfgh', 'outbox', 'unread', 0, '2019-03-05 17:39:45', 0), (71, '73', '16', 'ahln', 'outbox', 'unread', 0, '2019-03-08 21:25:40', 0), (72, '73', '16', 'ahln', 'outbox', 'unread', 0, '2019-03-08 21:25:40', 0); -- -------------------------------------------------------- -- -- Table structure for table `period` -- CREATE TABLE `period` ( `period_id` int(11) NOT NULL, `period_name` varchar(40) NOT NULL, `period_start_time` varchar(20) NOT NULL, `period_end_time` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `period` -- INSERT INTO `period` (`period_id`, `period_name`, `period_start_time`, `period_end_time`) VALUES (1, 'الأولى', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (2, 'الأولى', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (3, 'الثالثة', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (4, 'الثالثة', '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (5, 'الثالثة', '10:45', '11:30'), (6, 'gfsd', 'dsfd', 'fdsffs'), (7, 'الأولى', '06:45', '07:30'); -- -------------------------------------------------------- -- -- Table structure for table `plan` -- CREATE TABLE `plan` ( `plan_week_id` int(20) NOT NULL, `plan_week` varchar(40) NOT NULL, `plan_teacher_id` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `plan` -- INSERT INTO `plan` (`plan_week_id`, `plan_week`, `plan_teacher_id`) VALUES (4, 'الأسبوع الأول', '68'), (5, 'الأسبوع الثانى', '68'), (6, 'الأسبوع الثالث', '68'), (7, 'الاسبوع الرابع', '68'), (8, 'الاسبوع الخامس', '68'); -- -------------------------------------------------------- -- -- Table structure for table `plans_teacher` -- CREATE TABLE `plans_teacher` ( `plan_id` int(20) NOT NULL, `plan_week_id` int(20) NOT NULL, `plan_week` varchar(40) NOT NULL, `plan_period` varchar(40) NOT NULL, `plan_day_id` int(20) NOT NULL, `plan_day` varchar(40) NOT NULL, `plan_subject` varchar(40) NOT NULL, `plan_details` varchar(40) NOT NULL, `plan_start_time` varchar(20) NOT NULL, `plan_end_time` varchar(20) NOT NULL, `plan_class` varchar(20) NOT NULL, `plan_classroom` varchar(20) NOT NULL, `plan_school_id` varchar(20) NOT NULL, `plan_school_name` varchar(250) NOT NULL, `plan_homework_type` varchar(10) NOT NULL, `plan_homewok_details` varchar(250) NOT NULL, `plan_teacher_id` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `plans_teacher` -- INSERT INTO `plans_teacher` (`plan_id`, `plan_week_id`, `plan_week`, `plan_period`, `plan_day_id`, `plan_day`, `plan_subject`, `plan_details`, `plan_start_time`, `plan_end_time`, `plan_class`, `plan_classroom`, `plan_school_id`, `plan_school_name`, `plan_homework_type`, `plan_homewok_details`, `plan_teacher_id`) VALUES (1, 4, 'الأسبوع الأول ', 'الفترة الأولى', 1, 'الأحد', 'رياضيات ', 'التجميع التصاعدى', '06:30', '07:15', 'رابع', 'ج', '23', 'ابتدائية أجيال اليرموك الابتدائية', '1', 'واجب', '68'), (3, 5, 'الأسبوع الثانى ', 'الفترة الأولى', 1, 'الأحد', 'رياضيات ', 'التجميع التصاعدى', '06:30', '07:15', 'رابع', 'ج', '23', 'ابتدائية أجيال اليرموك الابتدائية', '1', 'واجب', '68'), (4, 6, 'الأسبوع الثالث', 'الفترة الأولى', 1, 'الأحد', 'رياضيات ', 'التجميع التصاعدى', '06:30', '07:15', 'رابع', 'ج', '23', 'ابتدائية أجيال اليرموك الابتدائية', '1', 'واجب', '68'); -- -------------------------------------------------------- -- -- Table structure for table `report` -- CREATE TABLE `report` ( `report_id` int(20) NOT NULL, `report_title` varchar(40) NOT NULL, `report_class` varchar(40) NOT NULL, `report_subject` varchar(40) NOT NULL, `report_student_id` int(20) NOT NULL, `report_tab_type` varchar(20) NOT NULL, `teacher_id` int(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `report` -- INSERT INTO `report` (`report_id`, `report_title`, `report_class`, `report_subject`, `report_student_id`, `report_tab_type`, `teacher_id`) VALUES (1, 'تقرير الطالب بدر بن محمد', 'أول أ', 'رياضيات', 11, 'كتاب الطالب', 55), (2, 'تقرير الطالب بدر بن محمد', 'أول أ', 'رياضيات', 11, 'كتاب الطالب', 55); -- -------------------------------------------------------- -- -- Table structure for table `reports` -- CREATE TABLE `reports` ( `report_id` int(11) NOT NULL, `report_name` varchar(40) NOT NULL, `report_date` datetime NOT NULL, `report_type` varchar(20) NOT NULL, `report_subject` varchar(20) NOT NULL, `report_homeworktype` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `school` -- CREATE TABLE `school` ( `school_id` int(11) NOT NULL, `school_name` varchar(250) NOT NULL, `school_government` varchar(40) NOT NULL, `school_administration` varchar(250) NOT NULL, `school_stage` varchar(40) NOT NULL, `school_type` varchar(40) NOT NULL, `school_sector` varchar(40) NOT NULL, `school_no_classes` int(10) NOT NULL, `school_teacher_id` int(11) NOT NULL, `school_country` varchar(250) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `school` -- INSERT INTO `school` (`school_id`, `school_name`, `school_government`, `school_administration`, `school_stage`, `school_type`, `school_sector`, `school_no_classes`, `school_teacher_id`, `school_country`) VALUES (1, 'ابتدائية أجيال اليرموك الابتدائية', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى ', 'بنين', 7, 39, ''), (2, 'دار البراء الابتدائية الأهلية للبنين', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى ', 'بنين', 7, 73, ''), (3, 'المؤمن العالمية الأهلية للبنين', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى ', 'بنين', 7, 13, ''), (5, 'المؤمن العالمية الأهلية للبنين', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى ', 'بنين', 7, 13, ''), (6, 'fgsf', 'الرياض', 'dfsdg', 'sfgd', 'fsgd', 'fdgsf', 5, 59, ''), (7, 'المؤمن العالمية الأهلية للبنين', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى ', 'بنين', 7, 59, ''), (8, 'المؤمن العالمية الأهلية للبنين', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى ', 'بنين', 7, 59, ''), (9, 'المؤمن العالمية الأهلية للبنين', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى ', 'بنين', 7, 59, ''), (10, 'المؤمن العالمية الأهلية للبنين', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى ', 'بنين', 7, 59, ''), (12, 'مدرسة كفر شيشتا', 'الغربية', 'ادارة شرق المحلة التعليمية', 'الثانية', 'بنين', 'الابتدائي', 0, 30, ''), (13, 'sklsldf', 'الغربية', 'dkfmksdf', 'slkdjflskdjf', 'lkjvlksdf', 'lskdflskd', 0, 30, ''), (14, 'مسنيبنمس', 'اليبسي', 'نقتصثخهقت', 'مسيبةى', 'سينبمن', 'نسيبم', 0, 30, ''), (15, 'سيببيبي يبص', 'الغربية', 'ادارة شرق المحلة التعليمية', 'الثانية', 'سيبس', 'شسير', 0, 30, ''), (16, 'KLKL', 'الرياض', 'الرياض', 'dff', ';slkds;dksldkm', 'fg', 0, 30, ''), (17, 'أجيال االيرموك', 'الرياض', 'الرياض', 'ابتدائي', 'أهلي', 'الرياض', 8, 64, ''), (18, 'المؤمن العالمية الأهلية للبنين', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى ', 'بنين', 7, 13, ''), (23, 'ابتدائية أجيال الرموك الأهلية الابتدائية', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى', 'kjabjab', 30, 68, 'السعودية تدعو'), (24, 'المؤمنddccvvv', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى', 'kjabjabخ', 0, 68, 'دولة'), (28, 'المؤمن العالمية الأهلية للبنين', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى ', 'kjabjab', 0, 68, 'السعودية'), (30, 'dfghfghgd', 'gdfhgfh', 'dgfhfg', 'dscadhfghsd', 'dscadhfghsd', 'cggf', 6, 70, ''), (31, 'dfghfghgd', 'gdfhgfh', 'dgfhfg', 'gfhfgd', 'dscadhfghsd', 'cggf', 6, 70, ''), (32, 'dfghfghgd', 'gdfhgfh', 'dgfhfg', 'gfhfgd', 'dscadhfghsd', 'cggf', 6, 70, ''), (33, 'dfghfghgd', 'gdfhgfh', 'dgfhfg', 'gfhfgd', 'dscadhfghsd', 'cggf', 6, 70, ''), (34, 'school_name', 'school_government', 'school_administration', 'school_stage', 'school_type', 'school_sector', 0, 0, ''), (35, 'aaa', 'aaa', 'aaa', 'aaa', 'aaa', 'aaa', 6, 70, ''), (36, 'school_name', 'school_government', 'school_administration', 'school_stage', 'school_type', 'school_sector', 0, 0, ''), (37, 'school_name', 'school_government', 'school_administration', 'school_stage', 'school_type', 'school_sector', 0, 0, ''), (38, 'fvdf', 'القصيم', 'fgsdf', 'fvdfv', 'fav fav', 'SFSU', 9, 70, ''), (39, 'daddy', 'مكة المكرمة', 'staff', 'dsfsd', 'dsfsd', 'dafsdsdf', 6, 70, ''), (40, 'ابتدائية أجيال اليرموك الأهليه', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى', 'بنين', 7, 76, ''), (41, 'اجيال اليرموك', 'الرياض', 'الرياض', 'الابتدائية', 'اهلي', 'الرياض', 8, 79, ''), (42, 'ااا', 'اااا', 'اتتا', 'ااا', 'اااا', 'تتتت', 8, 79, ''), (43, 'aaa', 'aaa', 'aaa', 'aaa', 'aaa', 'aaa', 8, 80, ''), (44, 'jjj', 'hgff', 'mjjj', 'njj', 'nnnj', 'jjjh', 1, 75, ''), (45, 'bbb', 'bbb', 'bbb', 'bbb', 'bbb', 'bbb', 8, 80, ''), (46, 'hi the following information', 'hi to the', 'hi the following information', 'hi the following information', 'hi the following information', 'hi the following', 3, 68, 'hhhhhh'), (47, 'hi the following information', 'hi the following information to', 'hi the following information to', 'hi the following', 'hi the following information to', 'hi the following information to', 33, 68, 'hi'), (48, 'hi the following information', 'hi the following information', 'hi the following information to', 'hi the following information', 'hi the following information', 'if so what', 3999, 68, 'info'), (49, 'hi the following information', 'hi to the the', 'hi the following information', 'hi the following', 'if so what', 'hi the following file', 338, 68, 'file'), (50, 'a', 'a', 'a', 'a', 'a', 'a', 8, 81, ''), (52, 'اجيال اليرموك', 'الرياض', 'الرياض', 'ابتدائي', 'بنين', 'أهلي', 8, 82, 'الرياض'), (53, 'hgccc', 'gharbya', 'hgfdsr', 'hgfcb', 'jggff', 'nkgf', 6, 78, NULL); -- -------------------------------------------------------- -- -- Table structure for table `studentnew` -- CREATE TABLE `studentnew` ( `student_id` int(40) NOT NULL, `student_name` varchar(40) CHARACTER SET utf8 NOT NULL, `student_parent_id` varchar(20) NOT NULL, `student_school_id` varchar(20) NOT NULL, `student_school_name` varchar(250) CHARACTER SET utf8 NOT NULL, `student_group_id` varchar(20) NOT NULL, `student_country` varchar(20) CHARACTER SET utf8 NOT NULL, `student_teacher_id` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `studentnew` -- INSERT INTO `studentnew` (`student_id`, `student_name`, `student_parent_id`, `student_school_id`, `student_school_name`, `student_group_id`, `student_country`, `student_teacher_id`) VALUES (1, 'سارة ابراهيم عباس', '1', '1', 'مدرسة مصر الجديدة النموذجية بنات', '1', '??????? ??? ???????', '1'), (2, 'سارة ابراهيم عباس', '1', '1', 'مدرسة مصر الجديدة النموذجية بنات', '1', 'جمهورية مصر العربية', '1'), (18, 'علي', '33', '2', 'دار البراء الابتدائية الأهلية للبنين', '1', 'Egypt', '73'), (20, 'Ahmed', '39', '2', 'دار البراء الابتدائية الأهلية للبنين', '2', 'ابتدائى', '73'), (9, 'moaaz', '16', '2', 'دار البراء الابتدائية الأهلية للبنين', '2', 'Egypt', '68'), (10, 'Adel', '16', '2', 'دار البراء الابتدائية الأهلية للبنين', '1', 'Egypt', '73'), (11, 'Ali', '16', '2', 'دار البراء الابتدائية الأهلية للبنين', '1', 'Egypt', '73'), (19, 'dfsdfdfg', '39', '2', 'دار البراء الابتدائية الأهلية للبنين', '2', 'ابتدائى', '73'), (21, 'Mohamed', '39', '2', 'دار البراء الابتدائية الأهلية للبنين', '2', 'ابتدائى', '73'); -- -------------------------------------------------------- -- -- Table structure for table `students` -- CREATE TABLE `students` ( `student_id` int(11) NOT NULL, `student_name` varchar(250) NOT NULL, `student_school` varchar(250) NOT NULL, `student_government` varchar(50) NOT NULL, `student_admin` varchar(250) NOT NULL, `student_stage` varchar(250) NOT NULL, `student_education_type` varchar(40) NOT NULL, `student_sector` varchar(10) NOT NULL, `student_class` varchar(10) NOT NULL, `student_classroom` varchar(4) NOT NULL, `student_code` int(11) NOT NULL, `student_parent_id` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `students` -- INSERT INTO `students` (`student_id`, `student_name`, `student_school`, `student_government`, `student_admin`, `student_stage`, `student_education_type`, `student_sector`, `student_class`, `student_classroom`, `student_code`, `student_parent_id`) VALUES (13, 'زياد رجب عبد الله الزهرانى', 'ابتدائية أجيال اليرموك الأهلية ', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى', 'بنين', 'أول ', 'أ', 35626598, 5), (2, 'خالد رجب عبد الله الزهرانى', 'ابتدائية أجيال اليرموك الأهلية ', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى', 'بنين', 'ثانى', 'ج', 35626598, 5), (4, 'نواف رجب عبد الله الزهرانى', 'ابتدائية أجيال اليرموك الأهلية ', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى', 'بنين', 'خامس', 'ب', 35626598, 5), (5, 'نواف رجب عبد الله الزهرانى', 'ابتدائية أجيال اليرموك الأهلية ', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى', 'بنين', 'خامس', 'ب', 35626598, 5), (6, 'نواف رجب عبد الله الزهرانى', 'ابتدائية أجيال اليرموك الأهلية ', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى', 'بنين', 'خامس', 'ب', 35626598, 5), (9, 'زايد رجب عبد الله الزهرانى', 'ابتدائية أجيال اليرموك الأهلية ', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى', 'بنين', 'خامس', 'ب', 35626598, 5), (10, 'زايد رجب عبد الله الزهرانى', 'ابتدائية أجيال اليرموك الأهلية ', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى', 'بنين', 'خامس', 'ب', 35626598, 5), (11, 'زايد رجب عبد الله الزهرانى', 'ابتدائية أجيال اليرموك الأهلية ', 'الرياض', 'الإدارة العامة للتعليم بمنطقة الرياض', 'ابتدائى', 'أهلى', 'بنين', 'خامس', 'ب', 35626598, 5), (1, 'moaaz', 'مدرسة', 'الرياض', 'ادارة شرق', 'الابتدائية', 'اهلي', 'بنين', 'الرابع', 'ب', 12, 16), (14, 'آمن', 'مدرسة المحلة الراقية', 'الغربية', 'ادارة شرق المحلة التعليمية', 'الابتدائية', 'عام', 'بنين', 'الاول', 'أ', 12, 16), (18, 'خالد رجب عبد الله الزهرانى ', 'ابتدائية أجيال اليرموك الأهلية ', 'الرياض', 'الإدارة العامة للتعليم بمنطفة الرياض ', 'ابتدائى ', 'أهلى', 'بنين', 'أول', 'ب', 323233, 16); -- -------------------------------------------------------- -- -- Table structure for table `students_tabs` -- CREATE TABLE `students_tabs` ( `student_tab_id` int(11) NOT NULL, `student_name` varchar(250) CHARACTER SET utf8 NOT NULL, `student_group` varchar(20) NOT NULL, `student_evaluation` varchar(40) CHARACTER SET utf8 NOT NULL, `student_main_id` varchar(20) NOT NULL, `student_sub_tab` varchar(20) NOT NULL, `teacher_id` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `students_tabs` -- INSERT INTO `students_tabs` (`student_tab_id`, `student_name`, `student_group`, `student_evaluation`, `student_main_id`, `student_sub_tab`, `teacher_id`) VALUES (1, 'sara', '7', 'excellent', '1', '2', '68'), (2, 'ahmed', '7', 'good', '1', '2', '68'), (3, 'mohamed', '7', 'good', '1', '2', '68'), (4, 'sara ibrahim', '7', 'very good', '1', '2', '68'); -- -------------------------------------------------------- -- -- Table structure for table `subjects` -- CREATE TABLE `subjects` ( `subject_id` int(11) NOT NULL, `subject_name` varchar(40) NOT NULL, `subject_enterdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `sub_tab` -- CREATE TABLE `sub_tab` ( `sub_tab_id` int(11) NOT NULL, `sub_main_id` int(11) NOT NULL, `sub_tab_title` varchar(250) CHARACTER SET utf8 NOT NULL, `evaluation_id` varchar(250) NOT NULL, `sub_group_id` varchar(20) NOT NULL, `sub_teacher_id` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `sub_tab` -- INSERT INTO `sub_tab` (`sub_tab_id`, `sub_main_id`, `sub_tab_title`, `evaluation_id`, `sub_group_id`, `sub_teacher_id`) VALUES (1, 7, 'الحضور', '1', '4', '68'), (2, 2, 'dsjkfhdsklfjhkdj', '2', '4', '68'), (3, 1, 'صفحة 1', '15', '4', '68'), (4, 1, 'صفحة 2', '18', '4', '68'), (5, 9, 'الجمع', '15', '4', '68'), (6, 12, 'ت فرعي 2', '15', '4', '68'), (7, 16, 's2 new', '16', '4', '68'), (8, 17, 'تبوبب فرعي 2', '15', '4', '68'); -- -------------------------------------------------------- -- -- Table structure for table `tab` -- CREATE TABLE `tab` ( `tab_id` int(20) NOT NULL, `tab_main_name` varchar(40) NOT NULL, `tab_sub_name` varchar(40) NOT NULL, `tab_eva` varchar(40) NOT NULL, `tab_main_id` int(20) NOT NULL, `tab_student_id` int(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `tab` -- INSERT INTO `tab` (`tab_id`, `tab_main_name`, `tab_sub_name`, `tab_eva`, `tab_main_id`, `tab_student_id`) VALUES (1, 'كتاب اللطلاب', 'التقييم العام', '10', 1, 1), (2, 'كتاب الطلاب', 'التدريبات', 'انجز', 1, 1), (3, 'كتاب الطلاب', 'الإختبار', 'اجتاز', 1, 1), (4, 'كتاب النشاط', 'التقييم العام', 'اجتاز', 2, 1), (4, 'كتاب النشاط', 'التقييم العام', 'اجتاز', 2, 1); -- -------------------------------------------------------- -- -- Table structure for table `tabs` -- CREATE TABLE `tabs` ( `tab_id` int(11) NOT NULL, `tab_main_name` varchar(50) NOT NULL, `tab_sub_name` varchar(50) NOT NULL, `tab_evaluation` varchar(50) NOT NULL, `tab_teacher_id` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `tabs` -- INSERT INTO `tabs` (`tab_id`, `tab_main_name`, `tab_sub_name`, `tab_evaluation`, `tab_teacher_id`) VALUES (2, 'كتاب الطلاب', 'التقييم ', '', 5), (3, 'كتاب الطلاب', 'التقييم ', '10 - 1', 5), (4, 'كتاب الطلاب', 'التدريبات', 'اجتاز / لم يجتاز ', 5), (5, 'كتاب النشاط', 'التقييم', '1-10', 13), (6, 'كتاب النشاط', 'التقيي', '1-10', 13), (7, 'كتاب النشاط', 'الحضور', 'حاضر / غائب', 13), (8, 'كتاب النشاط', 'التقييم', '1-10', 13), (9, 'كتاب الطلاب', 'التدريبات', 'اجتاز / لم يجتاز ', 5), (10, 'كتاب الطلاب', 'التدريبات', 'اجتاز / لم يجتاز ', 5); -- -------------------------------------------------------- -- -- Table structure for table `teacher` -- CREATE TABLE `teacher` ( `teacher_id` int(11) NOT NULL, `teacher_name` varchar(250) NOT NULL, `teacher_email` varchar(250) NOT NULL, `teacher_password` varchar(250) NOT NULL, `teacher_phone` varchar(50) NOT NULL, `teacher_status` varchar(20) NOT NULL, `teacher_code` varchar(20) NOT NULL, `teacher_no_msg` int(11) NOT NULL, `teacher_token` varchar(250) NOT NULL, `teacher_token_web` varchar(250) CHARACTER SET utf32 NOT NULL, `teacher_enterdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `teacher` -- INSERT INTO `teacher` (`teacher_id`, `teacher_name`, `teacher_email`, `teacher_password`, `teacher_phone`, `teacher_status`, `teacher_code`, `teacher_no_msg`, `teacher_token`, `teacher_token_web`, `teacher_enterdate`) VALUES (28, 'Ahmed', 'ahmed@gmmail.com', 'e10adc3949ba59abbe56e057f20f883e', '01012380709', 'active', '5656', 0, '', '', '2018-10-16 20:56:10'), (13, 'sara', 'sasasasas@jkkj.com', '827ccb0eea8a706c4c34a16891f84e7b', '123456789', 'active', '1598', 0, '', '', '2018-10-16 20:56:10'), (30, 'Moaaz', 'moaaz@gmail.com', '670b14728ad9902aecba32e22fa4f6bd', '01226073054', 'active', '7589', 0, '', '', '2018-10-16 20:56:10'), (29, 'Ahmed', 'ahmed@gmmrrail.com', 'e10adc3949ba59abbe56e057f20f883e', '01012380709', 'active', '4253', 0, '', '', '2018-10-16 20:56:10'), (27, 'Ahmed', 'ahmed@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '01012380709', 'active', '1542', 0, '', '', '2018-10-16 20:56:10'), (32, 'عماد السيد بدير حمزة', 'emad.elsayed@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '5423536321542', 'active', '2236', 0, 'kxhxy4YAtE:APA91bGoxKGAGe1bdaXm1szNbAYtG9XKyQ0gcrKdsSrRBq4YgTW_nyMBrbjMwFaw9i_bNY_IktyvyduaeJXb7nfHGr0bzGO4MXPYFX_IZ_n49ryNL4EkC', '8fb54a2b0d61974d27e1158aafb150e8', '2018-10-16 21:03:52'), (33, 'Sara', 'adsfd@dfd.dsfgs', '827ccb0eea8a706c4c34a16891f84e7b', '5635463546', 'active', '9865', 0, 'APA91bGoxKGAGe1bdaXm1szNbAYtG9XKyQ0gcrKdsSrRBq4YgTW_nyMBrbjMwFaw9i_bNY_IktyvyduaeJXb7nfHGr0bzGO4MXPYFX_IZ_n49ryNL4EkC', '78c7b34a77a7a8a5c73b44b71668d5a2', '2018-10-17 19:42:00'), (34, 'عماد السيد بدير حمزة', 'emad@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '5423536321542', 'deactive', '7504', 1, 'kxhxy4YAtE:APA91bGoxKGAGe1bdaXm1szNbAYtG9XKyQ0gcrKdsSrRBq4YgTW_nyMBrbjMwFaw9i_bNY_IktyvyduaeJXb7nfHGr0bzGO4MXPYFX_IZ_n49ryNL4EkC', '0dbb9563735af2378a855b6a88c90a3a', '2018-10-17 21:46:30'), (39, 'Sara ', 'sara.khater@gmail.com', 'dcddb75469b4b4875094e14561e573d8', '0106377930188888', 'active', '0562', 0, 'APA91bGoxKGAGe1bdaXm1szNbAYtG9XKyQ0gcrKdsSrRBq4YgTW_nyMBrbjMwFaw9i_bNY_IktyvyduaeJXb7nfHGr0bzGO4MXPYFX_IZ_n49ryNL4EkC]]]]]', '679b420264dd4017647d027dae6bb2e4', '2018-11-09 11:49:22'), (36, 'عماد السيد بدير حمزة', 'emad.elsaye1d@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '542353611321542', 'deactive', '3176', 1, 'kxhxy4YAtE:APA91bGoxKGAGe1bdaXm1szNbAYtG9XKyQ0gcrKdsSrRBq4YgTW_nyMBrbjMwFaw9i_bNY_IktyvyduaeJXb7nfHGr0bzGO4MXPYFX_IZ_n49ryNL4EkC', '8e30522c692036312ae0127afc47dc3d', '2018-10-27 14:28:32'), (37, 'عماد السيد بدير حمزة', 'emad.elsayzzed@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '656565675', 'active', '4104', 1, 'kxhxy4YAtE:APA91bGoxKGAGe1bdaXm1szNbAYtG9XKyQ0gcrKdsSrRBq4YgTW_nyMBrbjMwFaw9i_bNY_IktyvyduaeJXb7nfHGr0bzGO4MXPYFX_IZ_n49ryNL4EkC', '7b6cd6130b137ac2d007f7cd6e7cdfdc', '2018-10-30 23:38:17'), (67, 'jkgkjh', 'kjhg@rgdfg.fdg', 'e10adc3949ba59abbe56e057f20f883e', '587657657', 'deactive', '7492', 1, '1546614651004', '34fabd1da738613f0087749936f4efeb', '2019-01-04 15:10:54'), (40, 'Sara ', 'sara.khate44r@gmail.com', 'dcddb75469b4b4875094e14561e573d8', '010637794301', 'active', '5286', 0, 'APA91bGoxKGAGe1bdaXm1szNbAYtG9XKyQ0gcrKdsSrRBq4YgTW_nyMBrbjMwFaw9i_bNY_IktyvyduaeJXb7nfHGr0bzGO4MXPYFX_IZ_n49ryNL4EkC', 'cead9f3484ce016cfcdb6fde046e8b22', '2018-11-10 19:10:41'), (41, 'Sara ', 'sara.khater6565@gmail.com', 'dcddb75469b4b4875094e14561e573d8', '0106377935601', 'active', '7165', 0, 'APA91bGoxKGAGe1bdaXm1szNbAYtG9XKyQ0gcrKdsSrRBq4YgTW_nyMBrbjMwFaw9i_bNY_IktyvyduaeJXb7nfHGr0bzGO4MXPYFX_IZ_n49ryNL4EkC', '17c1ae9befaeabb411c354236058d62d', '2018-11-10 20:53:51'), (42, 'Sara ', 'sara.khate144r@gmail.com', 'dcddb75469b4b4875094e14561e573d8', '0106377914301', 'active', '9579', 0, 'APA91bGoxKGAGe1bdaXm1szNbAYtG9XKyQ0gcrKdsSrRBq4YgTW_nyMBrbjMwFaw9i_bNY_IktyvyduaeJXb7nfHGr0bzGO4MXPYFX_IZ_n49ryNL4EkC', '7ffcfcbe7cf45136729da02eb28abb9d', '2018-11-10 21:02:30'), (43, 'Sara ', 'sara.khater199@gmail.com', 'dcddb75469b4b4875094e14561e573d8', '0106377935655', 'active', '8586', 0, 'APA91bGoxKGAGe1bdaXm1szNbAYtG9XKyQ0gcrKdsSrRBq4YgTW_nyMBrbjMwFaw9i_bNY_IktyvyduaeJXb7nfHGr0bzGO4MXPYFX_IZ_n49ryNL4EkC', '0630895427b66f756144c3812f7e78b2', '2018-11-10 21:08:35'), (44, 'Sara ', 'sara.khatkker@gmail.com', 'dcddb75469b4b4875094e14561e573d8', '0109779301', 'active', '9569', 0, 'sljdfjsdkjflks00', 'd4c9bcf0dc6f81e53a6e0425e9b39e26', '2018-11-16 09:09:16'), (59, 'aliali', 'ali@ali.ali', '7620a9e9628e55159954d6cd3dab8672', '0123123', 'active', '6974', 0, 'dlsN-PNQ7Mk:APA91bHZUO3KBLSXHPCFQ1SjjHfTQjqGQ5Ic8o1AHxoGPkBLVJXknM-FV3RO3xRJYTuiLyjuDX_J6Hs0ZlAxGBvOOSrn8WcBYKpefCFu26ODBJqk9DllRnsF3W4lg5-UsEGeXVkjKBLh', '3701b6b76ec6f37651cf505d83fde183', '2018-12-09 22:36:49'), (45, 'Sara ', 'sartkker@gmail.com', 'dcddb75469b4b4875094e14561e573d8', '0100009779301', 'deactive', '0163', 1, 'APA91bGoxKGAGe1bdaXm1szNbAYtG9XKyQ0gcrKdsSrRBq4YgTW_nyMBrbjMwFaw9i_bNY_IktyvyduaeJXb7nfHGr0bzGO4MXPYFX_IZ_n49ryNL4EkC', '126e31d05a0098f6a11292942fd6a130', '2018-11-16 13:32:17'), (46, 'Sara ', 'sartnnkker@gmail.com', 'dcddb75469b4b4875094e14561e573d8', '0009779301', 'deactive', '9200', 1, 'APA91bGoxKGAGe1bdaXm1szNbAYtG9XKyQ0gcrKdsSrRBq4YgTW_nyMBrbjMwFaw9i_bNY_IktyvyduaeJXb7nfHGr0bzGO4MXPYFX_IZ_n49ryNL4EkC', 'a0c0980c8c61c92e7d4c9643ac9d83a3', '2018-11-16 13:39:58'), (47, 'sara.kr@gmail.com', 'sar.kr@gmail.com', '670b14728ad9902aecba32e22fa4f6bd', '000665444', 'deactive', '1751', 1, 'c1R_QsnTu50:APA91bGwK0O4yMzYMxjIAWdwfU1GLBfCbxuVNg53X-d93qNZIFBgSZ4IWRcDUiVD__W1deD2-PsOLVUDhHKa7dWvpLe1qAlVbvHyRPt170sy0XCeSmXrbJE0rWx7iHLllKKaFTkew-T5', '6683ae73e7cc92288536fe2ccfa15b8a', '2018-11-16 13:43:17'), (48, 'Sara ', 'sara.khater@gmail.', 'dcddb75469b4b4875094e14561e573d8', '020027762129', 'deactive', '9170', 1, 'APA91bGoxKGAGe1bdaXm1szNbAYtG9XKyQ0gcrKdsSrRBq4YgTW_nyMBrbjMwFaw9i_bNY_IktyvyduaeJXb7nfHGr0bzGO4MXPYFX_IZ_n49ryNL4EkC', '420cacfc1b5d3713240fc54166891fbc', '2018-11-16 13:43:44'), (49, 'hi the', 'the@ksjsjs.sskk', '670b14728ad9902aecba32e22fa4f6bd', '07979494', 'deactive', '7760', 1, 'c1R_QsnTu50:APA91bGwK0O4yMzYMxjIAWdwfU1GLBfCbxuVNg53X-d93qNZIFBgSZ4IWRcDUiVD__W1deD2-PsOLVUDhHKa7dWvpLe1qAlVbvHyRPt170sy0XCeSmXrbJE0rWx7iHLllKKaFTkew-T5', '31554e422ed944c9286125697552b8ba', '2018-11-16 13:48:32'), (50, 'hi the following', 'zjxjdjdj@nxndn.xxx', '670b14728ad9902aecba32e22fa4f6bd', '076767976', 'active', '2887', 0, 'c1R_QsnTu50:APA91bGwK0O4yMzYMxjIAWdwfU1GLBfCbxuVNg53X-d93qNZIFBgSZ4IWRcDUiVD__W1deD2-PsOLVUDhHKa7dWvpLe1qAlVbvHyRPt170sy0XCeSmXrbJE0rWx7iHLllKKaFTkew-T5', '2e2fcc4b23310b9218e5c425c5b21619', '2018-11-16 13:55:09'), (51, 'fdsgfdg', 'sdfsd@fdbnndf.dvf', 'e10adc3949ba59abbe56e057f20f883e', '68766836748', 'deactive', '3229', 1, 'kjhkj', '7deb1dea1797a239e2d98a01bdd1ce88', '2018-11-17 10:06:16'), (52, 'ali(+++++', 'ali@ali.ali', '670b14728ad9902aecba32e22fa4f6bd', '08099666', 'active', '9247', 0, 'c1R_QsnTu50:APA91bGwK0O4yMzYMxjIAWdwfU1GLBfCbxuVNg53X-d93qNZIFBgSZ4IWRcDUiVD__W1deD2-PsOLVUDhHKa7dWvpLe1qAlVbvHyRPt170sy0XCeSmXrbJE0rWx7iHLllKKaFTkew-T5', '35410fe7ece298768d1ae2b95c93cb27', '2018-11-17 10:58:40'), (53, 'kjnkjn', 'hjhk@fdf.dfjh', 'e10adc3949ba59abbe56e057f20f883e', '8687576876', 'deactive', '2849', 1, '1542451380129', 'b1ea23dbd52eb69ebf579bf43836c02d', '2018-11-17 14:03:27'), (54, 'kjnkjn', 'hjhk@fdf.dfjhff', 'e10adc3949ba59abbe56e057f20f883e', '8687576876434', 'deactive', '4725', 1, '15424513801294gfd', '9e194d9bf8cc04f0140cc7d74b92dcf2', '2018-11-17 14:08:20'), (55, 'kjnkjn', 'hjhdfdk@fdffdff.dfgfg', 'e10adc3949ba59abbe56e057f20f883e', '542462436345', 'deactive', '5996', 1, 'sdkjfhkjfsdk', '6d9b300b40307b3c4e8f85073eb94035', '2018-11-17 14:10:41'), (56, 'سارة ابراهيم عباس محمد خاطر', 'sara.khater.1993@gmail.com', '140f6969d5213fd0ece03148e62e461e', '01063779301', 'deactive', '1045', 1, '0', '6da7e327a8d83df6a99bdbe5f586daa1', '2018-12-07 07:56:08'), (61, 'jkjkljk', 'DSFKLJDSLKFKLDJFKLSDJ@dflksdjf.com', 'e10adc3949ba59abbe56e057f20f883e', '331121325', 'deactive', '8513', 1, '0', '3f42a6a74698976bd5d03f04997f25c7', '2018-12-22 18:31:03'), (58, 'shady', 'a@a.aaa', '000000', '01063779301', 'deactive', '0852', 1, '0', '332905a9f43ec87d30d97eb66906ff71', '2018-12-07 08:20:16'), (60, 'Sara ', 'sara.khate1r@gmail.com', 'dcddb75469b4b4875094e14561e573d8', '010637719301', 'deactive', '1341', 1, 'APA91bGoxKGAGe1bdaXm1szNbAYtG9XK11yQ0gcrKdsSrRBq4YgTW_nyMBrbjMwFaw9i_bNY_IktyvyduaeJXb7nfHGr0bzGO4MXPYFX_IZ_n49ryNL4EkC', 'e6cf5f02f31f4621eba873aa3ce91988', '2018-12-10 16:16:44'), (62, 'سارة ابراهيم عباس محمد خاطر', ',mmmmmmm', 'e10adc3949ba59abbe56e057f20f883e', '112211221', 'deactive', '3448', 1, '0', '21849283a410bfa3bcd1ca6caa3ae18c', '2018-12-22 18:34:11'), (63, 'abc', 'abc', 'c20ad4d76fe97759aa27a0c99bff6710', '00', 'deactive', '1862', 1, '0', '4e79ab942cb1d8f5f911bd1206a1d973', '2018-12-30 09:41:19'), (64, 'abc', 'abc', '900150983cd24fb0d6963f7d28e17f72', 'abc', 'deactive', '8883', 1, '0', '64e5a0812715e6204ad3857be98ae2ed', '2018-12-30 09:41:52'), (65, 'abc', 'abc', '900150983cd24fb0d6963f7d28e17f72', 'abc', 'deactive', '2213', 1, '0', '72e44f5ea6091dbdd25cc6c26042d72a', '2018-12-30 09:42:12'), (66, 'gfgh', 'dasdasd', 'b3f81d24969cb406938be5962ec5b7a2', 'asdasd', 'deactive', '9496', 1, '0', '13a60b27366cbfa8072087a5f4a78b4d', '2018-12-30 11:17:40'), (68, 'ali Ahmed khan', 'a@a.a', 'e10adc3949ba59abbe56e057f20f883e', '01021164799', 'active', '6137', 1, 'fRovNbDDGzM:APA91bGTk40KAz4ZJU_GItIuNkKLnjGHr-22unaYOh6AmDrZ7_KcBDURZ9SstpoQp0r6HVmtgeUQHLyajYHYL0XALlJYVd0Fvwe-mvgJbAEwZ9yFZv8rfeBi4EDk46P-i0_JKA1V0Ren', '83558f07deac723e1cf3d947a5ddde6a', '2019-01-04 15:15:32'), (69, 'fdsgf', 'aaa@aaa.aaa', 'e10adc3949ba59abbe56e057f20f883e', '12345678', 'deactive', '6713', 1, 'dscasd', '43d13412f0e6794a854568af30fc5765', '2019-01-04 15:28:20'), (70, 'dwarfs', 'lhkj@dgsg.dgf', 'e10adc3949ba59abbe56e057f20f883e', '9457348759', 'deactive', '1463', 1, '1546620598412', '7dd7461a12fa8c845c4674b0792399ae', '2019-01-04 16:50:00'), (80, 'omda', 'eastsindbad@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '0000000', 'active', '2319', 0, 'faLVIGzckNM:APA91bE2VHILyhuHL1XvGdVMZ8ASAQDef5pexqyouS-59_EsNTjbzHjOwrL7I_qpIRM_ab7Ab1FsIx6sEIY90_CvOWaX0_weiltZUjqHpMkT0Ji1R3rKmZlf-GNWfP7zwEEAMIEt3yhJ', '47dae83bcec1fe1523f5de83b89a2dd5', '2019-01-28 11:54:20'), (71, 'ةبةبةبةب', 'ةبةبةبةب', '861282481fb18842e2ab942b5063db9e', 'ةبةبةبة', 'deactive', '9578', 1, '0', '4ac23e549f6d34e49e6fe1ea024d981d', '2019-01-05 19:22:11'), (72, 'سارة ابراهيم عباس محمد خاطر', 'sara@gmail.com', '7cec85c75537840dad40251576e5b757', '010235665988', 'deactive', '8853', 1, '0', 'cf792ac5809106bd5734b1b6868fa797', '2019-01-05 21:41:25'), (73, 'معاذ فتحى النشاوى', 'moaaz@epic.com', '4e7f25a06c7dde7efa0f5d7f8d1f11a9', '01063779301', 'active', '8054', 1, '0', '4ee31fabc6dbda672cfca7669510e883', '2019-01-06 08:57:49'), (74, 'mmmm', 'moaaz@gmail.com', '96e79218965eb72c92a549dd5a330112', '123456841', 'deactive', '0891', 1, '0', 'cea687fc8c3b9854ee6154c4a738d9ef', '2019-01-06 20:13:08'), (75, 'شسي', 'moaaz@gmail.com', 'dcddb75469b4b4875094e14561e573d8', '01226073054', 'active', '2115', 0, 'eoTNquVj2rM:APA91bHJmxKz4dCJ9z_t6g_hZQNsxXLbCsSwJ4UxyDhMzpJEvF2gcwkakLI237jQ7w9kzVVrRILxwOyllkR4Px6CLNZythSWGx8WanxQX1I-XlYKThxzFtML_BMYG0tfvUWH8OYBAbzj', '4d3705797b4a50dec0fbbc6bbfc75ba7', '2019-01-06 20:18:59'), (76, 'سارة إبراهيم عباس محمد', 'sara@epicsyst.net', '4c93008615c2d041e33ebac605d14b5b', '01004468111', 'active', '6505', 0, 'f508-PIIddc:APA91bGfjbqHtjJtr3uCVZZgQfkpsJ-rvhEJJdk8t9M94rZCpRmAXcu3uEwRF9w55KqbvcG8uuh3SCZQmqPKecd_lWktAzGHU1jj5IuafLTogFIQGkZDESj3faYsYBM17oFCOjCbxPbe', '8a697dd29f388c95639025309888d463', '2019-01-20 21:15:04'), (78, 'mo', 'm.elneshawy@gmail.com', '670b14728ad9902aecba32e22fa4f6bd', '12359870871', 'active', '0958', 0, 'eoTNquVj2rM:APA91bHJmxKz4dCJ9z_t6g_hZQNsxXLbCsSwJ4UxyDhMzpJEvF2gcwkakLI237jQ7w9kzVVrRILxwOyllkR4Px6CLNZythSWGx8WanxQX1I-XlYKThxzFtML_BMYG0tfvUWH8OYBAbzj', '1d5438a330ffa445938b0f429d712cf9', '2019-01-21 13:30:22'), (79, 'emad', 'eastsindbad@msn.com', 'e10adc3949ba59abbe56e057f20f883e', '0548430412', 'active', '5727', 0, 'faLVIGzckNM:APA91bE2VHILyhuHL1XvGdVMZ8ASAQDef5pexqyouS-59_EsNTjbzHjOwrL7I_qpIRM_ab7Ab1FsIx6sEIY90_CvOWaX0_weiltZUjqHpMkT0Ji1R3rKmZlf-GNWfP7zwEEAMIEt3yhJ', 'b8247992fddedb5f3858386d113c629b', '2019-01-23 18:31:11'), (81, 'Emad', 'omda@omda.com', 'e10adc3949ba59abbe56e057f20f883e', '056056056056', 'active', '3161', 0, 'd3s7d26QMRk:APA91bFCNIdS8ib8VZ53HqwqmedDep3pv80ww5sMxxnFxdIw1P4u4w3SsRK5N1agVl8I_Y5OStIG-DKgqIOfW5o4g2USRvNPiXnNll89p09IhPJsyd4thhBsyS_CrF1KyIEJT8hxypNJ', '51362154f867ad6f1abe329d4b65fff5', '2019-01-30 13:42:37'), (82, 'emad', 'eastsindbad1@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '0548430413', 'active', '9225', 0, 'dvPJWWBje4w:APA91bEK4XFCyeytORJ6viK7zzLCT0uX4f4gjWFGbaZXQAyoahKIt6sYF2tv4-aAVbKjJhXptzCHSuLQJranHQpMux_SDJ-puY0P6Lw7HsNdegaZri-LP2622B4INayIr9Xm_J6qspJr', 'b4381bdeebbef9ed37d62c9f28da6cf7', '2019-02-11 10:23:19'); -- -------------------------------------------------------- -- -- Table structure for table `teacher_plan` -- CREATE TABLE `teacher_plan` ( `plan_id` int(20) NOT NULL, `plan_day_id` varchar(20) NOT NULL, `plan_day` varchar(20) NOT NULL, `plan_period` varchar(20) NOT NULL, `plan_period_start` varchar(20) NOT NULL, `plan_period_end` varchar(20) NOT NULL, `plan_subject` varchar(20) NOT NULL, `plan_class` varchar(20) NOT NULL, `plan_classroom` varchar(20) NOT NULL, `plan_teacher_id` varchar(20) NOT NULL, `plan_school_id` varchar(20) NOT NULL, `plan_school_name` varchar(250) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `teacher_plan` -- INSERT INTO `teacher_plan` (`plan_id`, `plan_day_id`, `plan_day`, `plan_period`, `plan_period_start`, `plan_period_end`, `plan_subject`, `plan_class`, `plan_classroom`, `plan_teacher_id`, `plan_school_id`, `plan_school_name`) VALUES (1, '1', 'الأحد ', 'الفترة الأولى ', '06:45', '07:30', 'علوم ', 'خامس', 'ب', '68', '23', 'ابتدائية أجيال الرموك الأهلية الابتدائية'), (2, '1', 'الأحد ', 'الفترة الثالثة', '08:35', '09:15', 'رياضيات', 'أول ', 'ب', '68', '23', 'ابتدائية أجيال الرموك الأهلية الابتدائية'), (3, '1', 'الأحد ', 'الفترة الرابعة', '09:15', '09:55', 'رياضيات', 'أول ', 'ج', '68', '23', 'ابتدائية أجيال الرموك الأهلية الابتدائية'), (4, '1', 'الأحد ', 'الفترة السادسة ', '10:50', '11:30', 'رياضيات', 'أول ', 'أ', '68', '23', 'ابتدائية أجيال الرموك الأهلية الابتدائية'), (5, '1', 'الأحد', 'الفترة السابعة', '11:30', '12:15', 'علوم', 'ثانى', 'ب', '68', '23', 'ابتدائية أجيال الرموك الأهلية الابتدائية'), (31, '2', 'الاثنين', 'الفترة السادسة ', '10:50', '11:30', 'رياضيات', 'أول ', 'أ', '68', '23', 'ابتدائية أجيال الرموك الأهلية الابتدائية'), (32, '3', 'الثلاثاء', 'الفترة السادسة ', '10:50', '11:30', 'رياضيات', 'أول ', 'أ', '68', '23', 'ابتدائية أجيال الرموك الأهلية الابتدائية'), (33, '4', 'الأربعاء', 'الفترة السادسة ', '10:50', '11:30', 'رياضيات', 'أول ', 'أ', '68', '23', 'ابتدائية أجيال الرموك الأهلية الابتدائية'), (34, '5', 'الخميس', 'الفترة السادسة ', '10:50', '11:30', 'رياضيات', 'أول ', 'أ', '68', '23', 'ابتدائية أجيال الرموك الأهلية الابتدائية'), (35, '3', 'الثلاتاء', 'الخامسة', '01:30', '02:15', 'علوم', 'خامس ', 'ب', '68', '23', 'ابتدائية أجيال الرموك الأهلية الابتدائية'), (36, '1', 'الأحد', 'ااولي', '8:36', '11:36', 'العربيه', 'الثاني', 'ج', '68', '23', 'ابتدائية أجيال الرموك الأهلية الابتدائية'), (37, '1', 'الأحد', 'الفتره الاولى الاولى', '5:41', '7:25', 'انجليزي', 'الصف الثالث الاعدادي', 'ب', '68', '49', 'hi the following information'), (38, '1', 'الأحد', 'الحصة الأولى', '6:45', '7:30', 'رياضيات', 'أول', '1', '82', '52', 'اجيال اليرموك'), (39, '2', 'الاثنين', 'ughv', '14:43', '17:43', 'yhgd', 'ggg', '1hg', '78', '53', 'hgccc'); -- -------------------------------------------------------- -- -- Structure for view `new_tabs_sub` -- DROP TABLE IF EXISTS `new_tabs_sub`; -- Error reading structure for table takieidl_takiem.new_tabs_sub: #1356 - View 'takieidl_takiem.new_tabs_sub' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them -- -- Indexes for dumped tables -- -- -- Indexes for table `classes` -- ALTER TABLE `classes` ADD PRIMARY KEY (`class_id`); -- -- Indexes for table `classes-table` -- ALTER TABLE `classes-table` ADD PRIMARY KEY (`Id`); -- -- Indexes for table `c_plan` -- ALTER TABLE `c_plan` ADD PRIMARY KEY (`c_plan_id`); -- -- Indexes for table `evaluation` -- ALTER TABLE `evaluation` ADD PRIMARY KEY (`evaluation_id`); -- -- Indexes for table `evaluations` -- ALTER TABLE `evaluations` ADD PRIMARY KEY (`e_id`); -- -- Indexes for table `father` -- ALTER TABLE `father` ADD PRIMARY KEY (`parent_id`); -- -- Indexes for table `government` -- ALTER TABLE `government` ADD PRIMARY KEY (`government_id`); -- -- Indexes for table `group_student` -- ALTER TABLE `group_student` ADD PRIMARY KEY (`plan_student_group_id`); -- -- Indexes for table `group_student_c` -- ALTER TABLE `group_student_c` ADD PRIMARY KEY (`plan_student_group_id`); -- -- Indexes for table `group_student_old` -- ALTER TABLE `group_student_old` ADD PRIMARY KEY (`group_student_id`); -- -- Indexes for table `group_takiem` -- ALTER TABLE `group_takiem` ADD PRIMARY KEY (`plan_group_id`); -- -- Indexes for table `group_takiem_old` -- ALTER TABLE `group_takiem_old` ADD PRIMARY KEY (`group_id`); -- -- Indexes for table `holiday` -- ALTER TABLE `holiday` ADD PRIMARY KEY (`holiday_id`); -- -- Indexes for table `homework` -- ALTER TABLE `homework` ADD PRIMARY KEY (`homework_id`); -- -- Indexes for table `main_tab` -- ALTER TABLE `main_tab` ADD PRIMARY KEY (`main_tab_id`); -- -- Indexes for table `main_tab_new` -- ALTER TABLE `main_tab_new` ADD PRIMARY KEY (`main_tab_id`); -- -- Indexes for table `messages` -- ALTER TABLE `messages` ADD PRIMARY KEY (`message_id`); -- -- Indexes for table `new_plans` -- ALTER TABLE `new_plans` ADD PRIMARY KEY (`plan_id`); -- -- Indexes for table `notes` -- ALTER TABLE `notes` ADD PRIMARY KEY (`note_id`); -- -- Indexes for table `notification_father` -- ALTER TABLE `notification_father` ADD PRIMARY KEY (`notif_id`); -- -- Indexes for table `notification_teacher` -- ALTER TABLE `notification_teacher` ADD PRIMARY KEY (`notif_id`); -- -- Indexes for table `period` -- ALTER TABLE `period` ADD PRIMARY KEY (`period_id`); -- -- Indexes for table `plan` -- ALTER TABLE `plan` ADD PRIMARY KEY (`plan_week_id`); -- -- Indexes for table `plans_teacher` -- ALTER TABLE `plans_teacher` ADD PRIMARY KEY (`plan_id`); -- -- Indexes for table `report` -- ALTER TABLE `report` ADD PRIMARY KEY (`report_id`); -- -- Indexes for table `reports` -- ALTER TABLE `reports` ADD PRIMARY KEY (`report_id`); -- -- Indexes for table `school` -- ALTER TABLE `school` ADD PRIMARY KEY (`school_id`); -- -- Indexes for table `studentnew` -- ALTER TABLE `studentnew` ADD PRIMARY KEY (`student_id`); -- -- Indexes for table `students` -- ALTER TABLE `students` ADD PRIMARY KEY (`student_id`); -- -- Indexes for table `students_tabs` -- ALTER TABLE `students_tabs` ADD PRIMARY KEY (`student_tab_id`); -- -- Indexes for table `subjects` -- ALTER TABLE `subjects` ADD PRIMARY KEY (`subject_id`); -- -- Indexes for table `sub_tab` -- ALTER TABLE `sub_tab` ADD PRIMARY KEY (`sub_tab_id`); -- -- Indexes for table `tabs` -- ALTER TABLE `tabs` ADD PRIMARY KEY (`tab_id`); -- -- Indexes for table `teacher` -- ALTER TABLE `teacher` ADD PRIMARY KEY (`teacher_id`); -- -- Indexes for table `teacher_plan` -- ALTER TABLE `teacher_plan` ADD PRIMARY KEY (`plan_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `classes` -- ALTER TABLE `classes` MODIFY `class_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `classes-table` -- ALTER TABLE `classes-table` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `c_plan` -- ALTER TABLE `c_plan` MODIFY `c_plan_id` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `evaluation` -- ALTER TABLE `evaluation` MODIFY `evaluation_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `evaluations` -- ALTER TABLE `evaluations` MODIFY `e_id` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19; -- -- AUTO_INCREMENT for table `father` -- ALTER TABLE `father` MODIFY `parent_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=41; -- -- AUTO_INCREMENT for table `government` -- ALTER TABLE `government` MODIFY `government_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `group_student` -- ALTER TABLE `group_student` MODIFY `plan_student_group_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23; -- -- AUTO_INCREMENT for table `group_student_c` -- ALTER TABLE `group_student_c` MODIFY `plan_student_group_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18; -- -- AUTO_INCREMENT for table `group_student_old` -- ALTER TABLE `group_student_old` MODIFY `group_student_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28; -- -- AUTO_INCREMENT for table `group_takiem` -- ALTER TABLE `group_takiem` MODIFY `plan_group_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `group_takiem_old` -- ALTER TABLE `group_takiem_old` MODIFY `group_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `holiday` -- ALTER TABLE `holiday` MODIFY `holiday_id` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16; -- -- AUTO_INCREMENT for table `homework` -- ALTER TABLE `homework` MODIFY `homework_id` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `main_tab` -- ALTER TABLE `main_tab` MODIFY `main_tab_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21; -- -- AUTO_INCREMENT for table `main_tab_new` -- ALTER TABLE `main_tab_new` MODIFY `main_tab_id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `messages` -- ALTER TABLE `messages` MODIFY `message_id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `new_plans` -- ALTER TABLE `new_plans` MODIFY `plan_id` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22; -- -- AUTO_INCREMENT for table `notes` -- ALTER TABLE `notes` MODIFY `note_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `notification_father` -- ALTER TABLE `notification_father` MODIFY `notif_id` int(40) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27; -- -- AUTO_INCREMENT for table `notification_teacher` -- ALTER TABLE `notification_teacher` MODIFY `notif_id` int(40) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=73; -- -- AUTO_INCREMENT for table `period` -- ALTER TABLE `period` MODIFY `period_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `plan` -- ALTER TABLE `plan` MODIFY `plan_week_id` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `plans_teacher` -- ALTER TABLE `plans_teacher` MODIFY `plan_id` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `report` -- ALTER TABLE `report` MODIFY `report_id` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `reports` -- ALTER TABLE `reports` MODIFY `report_id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `school` -- ALTER TABLE `school` MODIFY `school_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=54; -- -- AUTO_INCREMENT for table `studentnew` -- ALTER TABLE `studentnew` MODIFY `student_id` int(40) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22; -- -- AUTO_INCREMENT for table `students` -- ALTER TABLE `students` MODIFY `student_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1334; -- -- AUTO_INCREMENT for table `students_tabs` -- ALTER TABLE `students_tabs` MODIFY `student_tab_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `subjects` -- ALTER TABLE `subjects` MODIFY `subject_id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `sub_tab` -- ALTER TABLE `sub_tab` MODIFY `sub_tab_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `tabs` -- ALTER TABLE `tabs` MODIFY `tab_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `teacher` -- ALTER TABLE `teacher` MODIFY `teacher_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=83; -- -- AUTO_INCREMENT for table `teacher_plan` -- ALTER TABLE `teacher_plan` MODIFY `plan_id` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
69168f95b3bdd26170c1a5b0af18e55ec7ff5008
SQL
ninetysec/laravel-foodxl
/sql/2018-09-10.sql
UTF-8
14,299
3
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.8.0 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: 2018-05-21 10:40:21 -- 服务器版本: 5.7.21-log -- PHP Version: 7.1.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `shop` -- -- -------------------------------------------------------- -- -- 表的结构 `fx_admins` -- CREATE TABLE `fx_admins` ( `adminid` int(10) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `account_number` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL, `password` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `create_time` int(11) NOT NULL, `update_time` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 转存表中的数据 `fx_admins` -- INSERT INTO `fx_admins` (`adminid`, `name`, `account_number`, `password`, `remember_token`, `create_time`, `update_time`) VALUES (1, 'admin', '13111111111', '$2y$10$lRqatYiIItSUFdGu06zS1.sMfhxZsyeksZVg.sJ31MYrkFnjNJJIO', 'rFw3LkiOT3sY7t1tQO32RDnNXlf54KAXyhBMzmjU15BLVcTR3ARUZh8Cpqup', 1523669854, 1523669854), (2, 'admini', '13222222222', '$2y$10$o9i5bQeqDqwq2XhQS/UFcOK1UXc3C0Q2E1f//OzdR3B5Hf2zN9LeC', '5uPi3lzgbEDaUZD9zKtXZ3nKAgLLyPR6dJ7okdRF1g2VmpP5wYHuxLnQyOUo', 1523669895, 1523669895); -- -------------------------------------------------------- -- -- 表的结构 `fx_cart` -- CREATE TABLE `fx_cart` ( `id` int(11) NOT NULL, `goods_id` int(11) NOT NULL, `goods_name` varchar(255) DEFAULT NULL, `price` decimal(7,2) NOT NULL DEFAULT '0.00', `attr_value` varchar(255) DEFAULT NULL, `attr_id` int(11) NOT NULL DEFAULT '0', `number` int(11) NOT NULL DEFAULT '1', `contact_id` int(11) NOT NULL DEFAULT '0', `skey` varchar(32) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- 转存表中的数据 `fx_cart` -- INSERT INTO `fx_cart` (`id`, `goods_id`, `goods_name`, `price`, `attr_value`, `attr_id`, `number`, `contact_id`, `skey`) VALUES (6, 1, '测试333', '0.00', '', 0, 1, 0, 'd3459da4c9496763749f0aeb9a69fd87'), (7, 1, '测试333', '0.00', '', 0, 2, 0, 'cf6c7e3361fe7bb22617d220c981f001'), (8, 1, '测试333', '0.00', '', 0, 2, 0, '1ccfa09c87f47ae0359dd24f837931f0'), (9, 3, '测试333', '0.00', '', 0, 6, 0, '1ccfa09c87f47ae0359dd24f837931f0'), (15, 1, '测试333', '0.00', '', 0, 2, 0, '5c83c3ff4dac60717c1b101257235356'), (16, 5, '测试333', '1.00', '', 0, 1, 0, '9bc1a060d3793cc91c359cd573bf4106'), (17, 1, '测试333', '0.00', '', 0, 3, 0, 'd56b9defdf7ebbc48fd6ac871e1bfe39'), (18, 5, '测试333', '1.00', '', 0, 4, 0, 'd56b9defdf7ebbc48fd6ac871e1bfe39'), (19, 1, '测试333', '0.00', '', 0, 1, 0, '81e76d0d793336abee17d49e7d0e1d48'), (20, 5, '测试333', '1.00', '', 0, 1, 0, '81e76d0d793336abee17d49e7d0e1d48'), (21, 1, '测试333', '0.00', '', 0, 2, 5, '2a1db702e914d7035cbac135d12c28b3'), (22, 5, '测试333', '1.00', '', 0, 2, 5, '2a1db702e914d7035cbac135d12c28b3'), (38, 6, '好吃的菜', '99.00', '', 0, 1, 0, 'd0da333f2a8936b9abf941cf3bfcd030'), (39, 4, '测试333', '0.00', '', 0, 1, 0, 'd0da333f2a8936b9abf941cf3bfcd030'); -- -------------------------------------------------------- -- -- 表的结构 `fx_category` -- CREATE TABLE `fx_category` ( `cat_id` int(11) NOT NULL, `cat_name` varchar(255) NOT NULL, `cat_desc` varchar(255) NOT NULL, `parent_id` int(11) NOT NULL DEFAULT '0', `sort_order` int(11) NOT NULL DEFAULT '0' ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- 转存表中的数据 `fx_category` -- INSERT INTO `fx_category` (`cat_id`, `cat_name`, `cat_desc`, `parent_id`, `sort_order`) VALUES (1, '测试333', '111112', 0, 2), (2, '分类2', '分类1的子类', 1, 0), (3, '测试11', '分类1的子类', 1, 0), (4, '测试11', '', 0, 0), (5, '首页', '在首页显示的菜单', 0, 0), (6, '测试112', '11111', 5, 0), (7, 'qqqq', 'qqq', 2, 0); -- -------------------------------------------------------- -- -- 表的结构 `fx_contact` -- CREATE TABLE `fx_contact` ( `id` int(11) NOT NULL, `name` varchar(60) DEFAULT NULL, `phone` bigint(20) NOT NULL, `email` varchar(60) DEFAULT NULL, `address` varchar(255) DEFAULT NULL, `add_time` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- 转存表中的数据 `fx_contact` -- INSERT INTO `fx_contact` (`id`, `name`, `phone`, `email`, `address`, `add_time`) VALUES (2, 'kafu', 13111111111, 'root@scar1et.org', '创意产业园', 1523532164), (3, 'test', 131211111111, NULL, 'asjgfjkhsdkahskjdh', 1523532178), (4, 'test', 133211111111, NULL, 'asjgfjkhsdkahskjdh', 1523532206), (5, 'admini', 15532370009, 'root@scar1et.org', 'sadasdasd', 1525675456), (6, 'juhao', 13046230834, 'ces@163.com', '测试地址', 1526286679), (7, 'admin', 768310988, 'qfdk@vip.qq.com', '去', 1526728585); -- -------------------------------------------------------- -- -- 表的结构 `fx_goods` -- CREATE TABLE `fx_goods` ( `goods_id` int(11) NOT NULL, `cat_id` int(11) NOT NULL DEFAULT '0', `goods_name` varchar(255) NOT NULL, `goods_desc` varchar(255) NOT NULL, `shop_price` decimal(7,2) NOT NULL, `goods_img` varchar(255) DEFAULT NULL, `add_time` int(11) NOT NULL, `is_on_sale` int(11) NOT NULL DEFAULT '1', `sort_order` int(11) NOT NULL DEFAULT '0' ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- 转存表中的数据 `fx_goods` -- INSERT INTO `fx_goods` (`goods_id`, `cat_id`, `goods_name`, `goods_desc`, `shop_price`, `goods_img`, `add_time`, `is_on_sale`, `sort_order`) VALUES (9, 1, '测试1', '测试1的备注', '1.00', '/uploads/images/goods/goods_1526820031.jpg', 1526819671, 1, 1), (10, 1, '测试2', '测试2的备注', '2.00', '', 1526820076, 1, 2); -- -------------------------------------------------------- -- -- 表的结构 `fx_goods_attr` -- CREATE TABLE `fx_goods_attr` ( `goods_attr_id` int(11) NOT NULL, `goods_id` int(11) NOT NULL, `attr_id` int(11) NOT NULL DEFAULT '0', `attr_value` varchar(255) NOT NULL, `attr_price` decimal(7,2) NOT NULL DEFAULT '0.00' ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- 转存表中的数据 `fx_goods_attr` -- INSERT INTO `fx_goods_attr` (`goods_attr_id`, `goods_id`, `attr_id`, `attr_value`, `attr_price`) VALUES (1, 1, 0, 'test', '0.00'), (2, 1, 0, 'test', '0.00'), (3, 3, 0, 'test', '0.00'), (4, 3, 0, 'test', '0.00'); -- -------------------------------------------------------- -- -- 表的结构 `fx_migrations` -- CREATE TABLE `fx_migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 转存表中的数据 `fx_migrations` -- INSERT INTO `fx_migrations` (`id`, `migration`, `batch`) VALUES (1, '2018_04_14_004933_create_admins_table', 1); -- -------------------------------------------------------- -- -- 表的结构 `fx_order_goods` -- CREATE TABLE `fx_order_goods` ( `id` int(11) NOT NULL, `order_id` int(11) NOT NULL DEFAULT '0', `goods_id` int(11) NOT NULL DEFAULT '0', `goods_name` varchar(255) DEFAULT NULL, `goods_number` int(11) NOT NULL DEFAULT '1', `goods_price` decimal(7,2) NOT NULL, `goods_attr` varchar(255) DEFAULT NULL, `goods_attr_id` int(11) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- 转存表中的数据 `fx_order_goods` -- INSERT INTO `fx_order_goods` (`id`, `order_id`, `goods_id`, `goods_name`, `goods_number`, `goods_price`, `goods_attr`, `goods_attr_id`) VALUES (8, 9, 1, '产品1', 3, '1.00', '', 0), (9, 10, 1, '测试333', 1, '0.00', '', 0), (10, 10, 5, '测试333', 2, '1.00', '', 0), (11, 11, 1, '测试333', 1, '0.00', '', 0), (12, 11, 5, '测试333', 1, '1.00', '', 0), (13, 12, 1, '测试333', 3, '0.00', '', 0), (14, 12, 5, '测试333', 3, '1.00', '', 0), (15, 13, 1, '测试333', 4, '0.00', '', 0), (16, 13, 5, '测试333', 4, '1.00', '', 0), (17, 14, 1, '测试333', 5, '0.00', '', 0), (18, 14, 5, '测试333', 5, '1.00', '', 0), (19, 15, 5, '测试333', 1, '1.00', '', 0), (20, 16, 5, '测试333', 1, '1.00', '', 0), (21, 17, 5, '测试333', 1, '1.00', '', 0), (22, 18, 6, '好吃的菜', 1, '99.00', '', 0), (23, 19, 5, '测试333', 1, '1.00', '', 0), (24, 20, 5, '测试333', 3, '1.00', '', 0), (25, 20, 6, '好吃的菜', 1, '99.00', '', 0), (26, 21, 9, '测试1', 2, '1.00', '', 0), (27, 22, 9, '测试1', 3, '1.00', '', 0), (28, 23, 9, '测试1', 1, '1.00', '', 0), (29, 24, 9, '测试1', 4, '1.00', '', 0), (30, 25, 9, '测试1', 4, '1.00', '', 0), (31, 26, 9, '测试1', 4, '1.00', '', 0), (32, 27, 9, '测试1', 4, '1.00', '', 0), (33, 28, 9, '测试1', 5, '1.00', '', 0), (34, 29, 9, '测试1', 3, '1.00', '', 0); -- -------------------------------------------------------- -- -- 表的结构 `fx_order_info` -- CREATE TABLE `fx_order_info` ( `order_id` int(11) NOT NULL, `order_sn` bigint(20) NOT NULL, `order_status` int(11) NOT NULL DEFAULT '0', `user_id` int(11) NOT NULL DEFAULT '0', `pay_status` int(11) NOT NULL DEFAULT '0', `order_amount` decimal(7,2) NOT NULL DEFAULT '0.00', `add_time` int(11) NOT NULL DEFAULT '0', `pay_time` int(11) NOT NULL DEFAULT '0', `contact_id` int(11) NOT NULL DEFAULT '0', `skey` varchar(32) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- 转存表中的数据 `fx_order_info` -- INSERT INTO `fx_order_info` (`order_id`, `order_sn`, `order_status`, `user_id`, `pay_status`, `order_amount`, `add_time`, `pay_time`, `contact_id`, `skey`) VALUES (9, 2018041206448, 0, 0, 0, '3.00', 1523539749, 0, 4, '92dcac0b8ec5c2d6458c4c20adfa086e'), (10, 2018051442329, 0, 0, 0, '1.00', 1526285249, 0, 5, '9fa85fb29612e3e4a5e1e1edfc91ddbe'), (11, 2018051438148, 0, 0, 0, '1.00', 1526286682, 0, 6, '9fa85fb29612e3e4a5e1e1edfc91ddbe'), (12, 2018051471455, 0, 0, 0, '3.00', 1526286797, 0, 2, '9fa85fb29612e3e4a5e1e1edfc91ddbe'), (13, 2018051463527, 0, 0, 0, '1.00', 1526289607, 0, 6, '9fa85fb29612e3e4a5e1e1edfc91ddbe'), (14, 2018051453382, 0, 0, 0, '5.00', 1526289716, 0, 6, '9fa85fb29612e3e4a5e1e1edfc91ddbe'), (15, 2018051933346, 0, 0, 0, '1.00', 1526728493, 0, 0, '1fcec6cb03a64fcdaab9738734941c56'), (16, 2018051948381, 0, 0, 0, '1.00', 1526728598, 0, 7, '1fcec6cb03a64fcdaab9738734941c56'), (17, 2018051990664, 0, 0, 0, '1.00', 1526728768, 0, 7, '1fcec6cb03a64fcdaab9738734941c56'), (18, 2018051955612, 0, 0, 0, '99.00', 1526730375, 0, 7, '1fcec6cb03a64fcdaab9738734941c56'), (19, 2018051951773, 0, 0, 0, '1.00', 1526730527, 0, 7, '1fcec6cb03a64fcdaab9738734941c56'), (20, 2018051972082, 0, 0, 0, '102.00', 1526740390, 0, 0, '16f9e95a035c4622251cbe166ddfc2d7'), (21, 2018052104637, 0, 0, 0, '2.00', 1526864330, 0, 5, '7684241a05c60c7db8e846eb61005949'), (22, 2018052182628, 0, 0, 0, '3.00', 1526866872, 0, 0, '7684241a05c60c7db8e846eb61005949'), (23, 2018052101468, 0, 0, 0, '1.00', 1526867032, 0, 0, '7684241a05c60c7db8e846eb61005949'), (24, 2018052177647, 0, 0, 0, '4.00', 1526867278, 0, 5, '7684241a05c60c7db8e846eb61005949'), (25, 2018052132170, 0, 0, 0, '4.00', 1526867653, 0, 5, '7684241a05c60c7db8e846eb61005949'), (26, 2018052123081, 0, 0, 0, '4.00', 1526867699, 0, 5, '7684241a05c60c7db8e846eb61005949'), (27, 2018052142155, 0, 0, 0, '4.00', 1526868056, 0, 5, '7684241a05c60c7db8e846eb61005949'), (28, 2018052123917, 0, 0, 0, '5.00', 1526869348, 0, 6, '7684241a05c60c7db8e846eb61005949'), (29, 2018052197196, 0, 0, 0, '3.00', 1526870211, 0, 5, '7684241a05c60c7db8e846eb61005949'); -- -- Indexes for dumped tables -- -- -- Indexes for table `fx_admins` -- ALTER TABLE `fx_admins` ADD PRIMARY KEY (`adminid`); -- -- Indexes for table `fx_cart` -- ALTER TABLE `fx_cart` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); -- -- Indexes for table `fx_category` -- ALTER TABLE `fx_category` ADD PRIMARY KEY (`cat_id`), ADD UNIQUE KEY `cat_id` (`cat_id`); -- -- Indexes for table `fx_contact` -- ALTER TABLE `fx_contact` ADD UNIQUE KEY `id` (`id`); -- -- Indexes for table `fx_goods` -- ALTER TABLE `fx_goods` ADD PRIMARY KEY (`goods_id`), ADD UNIQUE KEY `goods_id` (`goods_id`); -- -- Indexes for table `fx_goods_attr` -- ALTER TABLE `fx_goods_attr` ADD PRIMARY KEY (`goods_attr_id`), ADD UNIQUE KEY `goods_attr_id` (`goods_attr_id`); -- -- Indexes for table `fx_migrations` -- ALTER TABLE `fx_migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `fx_order_goods` -- ALTER TABLE `fx_order_goods` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); -- -- Indexes for table `fx_order_info` -- ALTER TABLE `fx_order_info` ADD PRIMARY KEY (`order_id`), ADD UNIQUE KEY `order_id` (`order_id`); -- -- 在导出的表使用AUTO_INCREMENT -- -- -- 使用表AUTO_INCREMENT `fx_admins` -- ALTER TABLE `fx_admins` MODIFY `adminid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- 使用表AUTO_INCREMENT `fx_cart` -- ALTER TABLE `fx_cart` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=52; -- -- 使用表AUTO_INCREMENT `fx_category` -- ALTER TABLE `fx_category` MODIFY `cat_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- 使用表AUTO_INCREMENT `fx_contact` -- ALTER TABLE `fx_contact` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- 使用表AUTO_INCREMENT `fx_goods` -- ALTER TABLE `fx_goods` MODIFY `goods_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- 使用表AUTO_INCREMENT `fx_goods_attr` -- ALTER TABLE `fx_goods_attr` MODIFY `goods_attr_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- 使用表AUTO_INCREMENT `fx_migrations` -- ALTER TABLE `fx_migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- 使用表AUTO_INCREMENT `fx_order_goods` -- ALTER TABLE `fx_order_goods` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=35; -- -- 使用表AUTO_INCREMENT `fx_order_info` -- ALTER TABLE `fx_order_info` MODIFY `order_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
bb55d0f74a9c1a12f8a5a38d35f67a1f8def255c
SQL
Enterprise-System-Management-Solutions/Analytics
/dwhnode02/database/procedures/R_MKT_ZONE_WISE_VOICE_DATA_USAGE_NEW.sql
UTF-8
820
3.015625
3
[]
no_license
-- -- R_MKT_ZONE_WISE_VOICE_DATA_USAGE_NEW (Procedure) -- CREATE OR REPLACE PROCEDURE DWH_USER.R_MKT_ZONE_WISE_VOICE_DATA_USAGE_NEW IS VDATE_KEY NUMBER; BEGIN SELECT DATE_KEY INTO VDATE_KEY FROM DATE_DIM WHERE TO_CHAR(DATE_VALUE,'RRRRMMDD')=TO_CHAR(SYSDATE-1,'RRRRMMDD'); --EXECUTE IMMEDIATE 'TRUNCATE TABLE PKPI DROP STORAGE'; --EXECUTE IMMEDIATE 'ALTER TABLE PKPI TRUNCATE PARTITION PKPI_||VDATE_KEY DROP STORAGE'; --DELETE MKT_ZONE_WISE_VOICE_DATA_USAGE WHERE PDR_DATE_KEY=VDATE_KEY; --COMMIT; INSERT INTO MKT_ZONE_WISE_VOICE_DATA_USAGE_NEW SELECT/*+PARALLEL(P,15)*/ MSISDN, PRODUCT_NAME, DATE_VALUE, CGI, SITE_ID, UPAZILA, DISTRICT, DIVISION, DATA_VOLUME_MB, MOC_DURATION, CHARGING_HOUR, CHARGING_MINUTE,PDR_DATE_KEY FROM MKT_ZONE_WISE_VOICE_DATA_USAGE P ; COMMIT; END; /
true
2704cae25daaae29523139550a6383fe4f268bae
SQL
dkhakha9/DealerTracker
/dealerDDL.sql
UTF-8
28,033
3.6875
4
[]
no_license
/*==============================================================*/ /* DDL */ /*==============================================================*/ /* DEALERWEB DROP */ alter table DEALERWEB drop constraint PK_DEALERWEB; alter table DEALERWEB drop constraint FK_WEB_PROVIDED_BY; alter table DEALERWEB drop constraint FK_HAS_WEBPARAMS; drop index WEB_PROVIDED_BY_FK; drop table DEALERWEB cascade constraints; /*=================*/ /* DEALERWEB CREATE */ create table DEALERWEB ( DEALER_ID NUMBER(7) not null, DEALER_NAME VARCHAR2(40) not null, URL VARCHAR2(80) not null, WEB_ENGINE VARCHAR2(20) not null, MIN_NEW NUMBER(3) not null, ZIP VARCHAR2(10) not null, MONO_BRAND CHAR(1) not null, LAST_UPD DATE, PARAM_ID VARCHAR2(20) not null, constraint PK_DEALERWEB primary key (DEALER_ID) ); create index WEB_PROVIDED_BY_FK on DEALERWEB ( WEB_ENGINE ASC ); /*alter table DEALERWEB add constraint FK_WEB_PROVIDED_BY foreign key (WEB_ENGINE) references WEBENGINE (WEB_ENGINE);*/ alter table DEALERWEB add constraint FK_HAS_WEBPARAMS foreign key (PARAM_ID) references WEBPARAMS (PARAM_ID); /*=================*/ /* WEBENGINE DROP */ /*alter table WEBENGINE drop constraint PK_WEBENGINE; drop table WEBENGINE cascade constraints;*/ /*=================*/ /* WEBENGINE CREATE */ /* *** DEPRECATED *** */ /*create table WEBENGINE ( WEB_ENGINE VARCHAR2(20) not null, URL_NEW VARCHAR2(60) not null, URL_USED VARCHAR2(60) not null, URL_NEXTPAGE VARCHAR2(20) not null, TTL_KEY_NEW VARCHAR2(40) not null, TTL_KEY_USED VARCHAR2(40) not null, constraint PK_WEBENGINE primary key (WEB_ENGINE) );*/ /*=================*/ /* WEBPARAMS DROP */ alter table WEBPARAMS drop constraint PK_WEBPARAMS; drop table WEBPARAMS cascade constraints; /*=================*/ /* WEBPARAMS CREATE */ create table WEBPARAMS ( PARAM_ID VARCHAR2(20) not null, URL_NEW VARCHAR2(60) not null, URL_USED VARCHAR2(60) not null, URL_NEXTPAGE VARCHAR2(60) not null, TTL_KEY_NEW VARCHAR2(60) not null, TTL_KEY_USED VARCHAR2(60) not null, STARTPAGENEW NUMBER(2) not null, PAGEINCNEW NUMBER(2) not null, STARTPAGEUSED NUMBER(2) not null, PAGEINCUSED NUMBER(2) not null, constraint PK_WEBPARAMS primary key (PARAM_ID) ); /*=================*/ create table NEWCARS ( VIN CHAR(17) not null, DEALER_ID NUMBER(7) not null, DATE_ARRIVED DATE not null, DATE_SOLD DATE, SELL_PRICE NUMBER(6,2), constraint PK_NEWCARS primary key (VIN) ); alter table NEWCARS add constraint FK_NEW_LOCATED_AT foreign key (DEALER_ID) references DEALERWEB (DEALER_ID); create index NEW_LOCATED_AT_FK on NEWCARS ( DEALER_ID ASC ); create table USEDCARS ( VIN CHAR(17) not null, DEALER_ID NUMBER(7) not null, DATE_ARRIVED DATE not null, DATE_SOLD DATE, AQUIS_PRICE NUMBER(6,2), SELL_PRICE NUMBER(6,2), constraint PK_USEDCARS primary key (VIN, DEALER_ID, DATE_ARRIVED) /* A car can be possessed by multiple dealers over the life span. */ /* It can also return to the dealer who owned it in the past. */ ); alter table USEDCARS add constraint FK_USED_LOCATED_AT foreign key (DEALER_ID) references DEALERWEB (DEALER_ID); create index USED_LOCATED_AT_FK on USEDCARS ( DEALER_ID ASC ); /*=== END OF USEDCARS ===*/ /* FRANCHISE CREATE */ create table FRANCHISE ( DEALER_ID NUMBER(7) not null, MANUF VARCHAR2(30) not null, BRAND VARCHAR2(30) not null, constraint PK_FRANCHISE primary key (DEALER_ID, BRAND) ) /* === END OF FRANCHISE === */ /* VEHICLES DROP */ alter table VEHICLES drop constraint PK_MODELS; drop table VEHICLES cascade constraints; /* VEHICLES CREATE */ create table VEHICLES ( VIN CHAR(17) not null, MODELYEAR CHAR(4) not null, MAKE VARCHAR2(25) not null, MODEL VARCHAR2(25) not null, ADDLINFO VARCHAR2(50) , COLOR VARCHAR2(45) , constraint PK_MODELS primary key (VIN) ); /* === END OF VEHICLES === */ /* DEALERSWAP CREATE */ create table DEALERSWAP ( VIN CHAR(17) not null, DEALER_ID_FROM NUMBER(7) not null, DEALER_ID_TO NUMBER(7) not null, DATE_SWAPPED DATE not null, constraint PK_DEALERSWAP primary key (VIN, DATE_SWAPPED) ); alter table DEALERSWAP add constraint FK_TRANSFERED_FROM foreign key (DEALER_ID_FROM) references DEALERWEB (DEALER_ID); alter table DEALERSWAP add constraint FK_TRANSFERED_TO foreign key (DEALER_ID_TO) references DEALERWEB (DEALER_ID); alter table DEALERSWAP add constraint CH_DEALERS_DIFF check (DEALER_ID_FROM != DEALER_ID_TO); /* === END OF DEALERSWAP === */ /*==============================================================*/ /* DATA */ /*==============================================================*/ /*Insert into WEBENGINE Values ('DEALERCOM' , '/new-inventory/index.htm', '/used-inventory/index.htm', '?start=', 'Vehicles matching', 'Vehicles matching'); Insert into WEBENGINE Values ('DEALERFIRE', '/new-toyota-burnsville-mn', '/used-cars-burnsville-mn', '?page=', 'New Toyota Burnsville Minnesota', 'Used cars in Burnsville MN'); Insert into WEBENGINE Values ('EBIZAUTOS' , '/honda.aspx', '/used-cars.aspx', '?_page=', 'Hondas Found', 'Vehicles Found');*/ Insert into WEBPARAMS Values ('DCDEFAULT' , '/new-inventory/index.htm', '/used-inventory/index.htm', '?start=', 'Vehicles matching', 'Vehicles matching', 0, 16, 0, 16); Insert into WEBPARAMS Values ('DFTB', '/new-toyota-burnsville-mn', '/used-cars-burnsville-mn', '?page=', 'New Toyota Burnsville Minnesota', 'Used cars in Burnsville MN', 1, 1, 1, 1); Insert into WEBPARAMS Values ('DFSTCLT', '/new-toyota-st-cloud-mn', '/used-cars-st-cloud-mn', '?page=', 'New Toyota St. Cloud Minnesota', 'Used cars in St. Cloud MN', 1, 1, 1, 1); Insert into WEBPARAMS Values ('DFVIGH', '/new-volkswagen-inver-grove-heights-mn', '/used-cars-inver-grove-heights-mn', '?page=', 'New Volkswagen Inver Grove Heights Minnesota', 'Pre-Owned cars in Inver Grove Heights MN', 1, 1, 1, 1); Insert into WEBPARAMS Values ('EARBH' , '/honda.aspx', '/used-cars.aspx', '?_page=', 'Hondas Found', 'Vehicles Found', 1, 1, 1, 1); Insert into WEBPARAMS Values ('DCBH' , '/new-inventory/honda-minneapolis.htm', '/used-inventory/index.htm', '?start=', 'Vehicles matching', 'Vehicles matching', 0, 16, 0, 16); Insert into WEBPARAMS Values ('DCIGT' , '/new-inventory/index.htm', '/used-inventory/index.htm', '?start=', 'Items Matching', 'Items Matching', 0, 16, 0, 35); Insert into WEBPARAMS Values ('DODEFAULT' , '/searchnew.aspx?pn=1000', '/searchused.aspx?pn=1000', '&pt=', 'Vehicles)', 'Vehicles)', 1, 1, 1, 1); Insert into WEBPARAMS Values ('DIDEFAULT' , '/new-vehicles/', '/used-vehicles/', 'NA', 'Matching Vehicles', 'Matching Vehicles', 1, 1, 1, 1); Insert into WEBPARAMS Values ('DFHEC', '/new-cars-eau-claire-wi', '/used-cars-eau-claire-wi', '?page=', 'New cars in Eau Claire WI', 'Pre-Owned cars in Eau Claire WI', 1, 1, 1, 1); Insert into WEBPARAMS Values ('DCLKB' , '/new-inventory/index.htm', '/used-inventory/index.htm', '?start=', 'Vehicles matching', 'Items Matching', 0, 16, 0, 16); Insert into WEBPARAMS Values ('DCLKIG' , '/new-inventory/index.htm', '/used-inventory/index.htm', '?start=', 'Items Matching', 'Items Matching', 0, 16, 0, 16); Insert into WEBPARAMS Values ('DCMS' , '/new-inventory/index.htm', '/used-inventory/index.htm', '?start=', 'Vehicles matching', 'Vehicles matching', 0, 35, 0, 35); Insert into WEBPARAMS Values ('DCLBH' , '/new-inventory/index.htm?accountId=lutherbrookdalehonda', '/used-inventory/index.htm?accountId=lutherbrookdalehonda', '&start=', 'Vehicles matching', 'Vehicles matching', 0, 16, 0, 16); Insert into WEBPARAMS Values ('DCLWVW' , '/new-inventory/index.htm', '/used-inventory/index.htm', '?start=', 'Vehicles matching', 'Vehicles matching', 0, 16, 0, 35); Insert into WEBPARAMS Values ('AWDEFAULT' , '/inventory/New/', '/inventory/Used/', '?page=', 'Vehicles Found', 'Vehicles Found', 1, 1, 1, 1); Insert into WEBPARAMS Values ('DCDWNB' , '/new-inventory/index.htm?', '/used-inventory/index.htm?accountId=walsernissan', '&start=', 'Vehicles matching', 'Vehicles matching', 0, 16, 0, 16); Insert into WEBPARAMS Values ('DCDWNCR' , '/new-inventory/index.htm?', '/used-inventory/index.htm?accountId=coonrapidsnissan', '&start=', 'Vehicles matching', 'Vehicles matching', 0, 16, 0, 16); Insert into WEBPARAMS Values ('DCDWNW' , '/new-inventory/index.htm?', '/used-inventory/index.htm?accountId=walserwayzatanissan', '&start=', 'Vehicles matching', 'Vehicles matching', 0, 16, 0, 16); Insert into DEALERWEB Values (1 , 'Walser Honda', 'http://www.walserhonda.com', 'DEALERCOM', 450, '55306', 'Y', null, 'DCDEFAULT'); Insert into DEALERWEB Values (2 , 'Burnsville Toyota', 'https://www.burnsvilletoyota.com', 'DEALERFIRE', 380, '55306', 'Y', null, 'DFTB'); Insert into DEALERWEB Values (3 , 'Richfield Bloomington Honda', 'http://www.richfieldbloomingtonhonda.com', 'EBIZAUTOS', 380, '55423', 'Y', null, 'EARBH'); Insert into DEALERWEB Values (4 , 'Hopkins Honda', 'https://www.lutherhopkinshonda.com', 'DEALERCOM', 380, '55343', 'Y', null, 'DCDEFAULT'); Insert into DEALERWEB Values (5 , 'Walser Toyota', 'http://www.walsertoyota.com', 'DEALERCOM', 400, '55437', 'Y', null, 'DCDEFAULT'); Insert into DEALERWEB Values (6 , 'VW Inver Grove', 'http://www.vwinvergrove.com', 'DEALERFIRE', 80, '55077', 'Y', null, 'DFVIGH'); Insert into DEALERWEB Values (7 , 'Buerkle Honda', 'https://www.buerklehonda.com', 'AUTOWEBING', 160, '55110', 'Y', null, 'AWDEFAULT'); Insert into DEALERWEB Values (8 , 'Luther Brookdale Toyota', 'https://www.lutherbrookdaletoyota.com', 'DEALERCOM', 420, '55429', 'Y', null, 'DCDEFAULT'); Insert into DEALERWEB Values (9 , 'Inver Grove Toyota', 'http://www.invergrovetoyota.com', 'DEALERCOM', 300, '55077', 'Y', null, 'DCIGT'); Insert into DEALERWEB Values (10, 'Rudy Luther Toyota', 'https://www.rudyluthertoyota.com', 'DEALERCOM', 600, '55426', 'Y', null, 'DCDEFAULT'); Insert into DEALERWEB Values (11, 'Luther Brookdale Honda', 'http://www.lutherauto.com', 'DEALERCOM', 450, '55429', 'Y', null, 'DCLBH'); Insert into DEALERWEB Values (12, 'Maplewood Toyota', 'https://www.maplewoodtoyota.com', 'DEALERON', 480, '55109', 'Y', null, 'DODEFAULT'); Insert into DEALERWEB Values (13, 'Luther St Cloud Honda', 'https://www.lutherhondaofstcloud.com', 'DEALERCOM', 60, '56387', 'Y', null, 'DCDEFAULT'); Insert into DEALERWEB Values (14, 'Mills Honda', 'https://www.millshonda.com', 'DEALERON', 60, '56425', 'Y', null, 'DODEFAULT'); Insert into DEALERWEB Values (15, 'Carlson Toyota', 'http://www.carlsontoyota.com', 'DEALERCOM', 260, '55448', 'Y', null, 'DCDEFAULT'); Insert into DEALERWEB Values (16, 'Inver Grove Honda', 'http://www.invergrovehonda.com', 'DEALERINSPIRE', 500, '55077', 'Y', null, 'DIDEFAULT'); Insert into DEALERWEB Values (17, 'Heintz Toyota', 'http://www.heintztoyota.com', 'DEALERCOM', 60, '56001', 'Y', null, 'DCDEFAULT'); Insert into DEALERWEB Values (18, 'St Cloud Toyota', 'https://www.stcloudtoyota.com', 'DEALERFIRE', 100, '56387', 'Y', null, 'DFSTCLT'); Insert into DEALERWEB Values (19, 'Luther Mankato Honda', 'https://www.luthermankatohonda.com', 'DEALERCOM', 100, '56001', 'Y', null, 'DCDEFAULT'); Insert into DEALERWEB Values (20, 'Ken Vance Honda', 'http://www.kenvancehonda.com', 'DEALERFIRE', 70, '54701', 'Y', null, 'DFHEC'); Insert into DEALERWEB Values (21, 'Luther Kia Bloomington', 'https://www.lutherkiaofbloomington.com', 'DEALERCOM', 100, '55431', 'Y', null, 'DCLKB'); Insert into DEALERWEB Values (22, 'Luther Kia Inver Grove', 'https://www.lutherkiamn.com', 'DEALERCOM', 100, '55077', 'Y', null, 'DCLKIG'); Insert into DEALERWEB Values (23, 'Tom Kadlec Honda', 'https://www.tomkadlec.com', 'DEALERON', 60, '55901', 'Y', null, 'DODEFAULT'); Insert into DEALERWEB Values (24, 'Morries Minnetonka Subaru', 'http://www.minnetonkasubaru.com', 'DEALERCOM', 100, '55305', 'Y', null, 'DCMS'); Insert into DEALERWEB Values (25, 'Walser Subaru', 'http://www.walsersubaru.com', 'DEALERCOM', 100, '55337', 'Y', null, 'DCDEFAULT'); Insert into DEALERWEB Values (26, 'Morries Brooklyn Park Subaru', 'http://www.brooklynparksubaru.com', 'DEALERCOM', 100, '55445', 'Y', null, 'DCMS'); Insert into DEALERWEB Values (27, 'Luther Bloomington Subaru', 'https://www.bloomingtonsubaru.com', 'DEALERCOM', 100, '55420', 'Y', null, 'DCMS'); Insert into DEALERWEB Values (28, 'Luther White Bear Subaru', 'https://www.whitebearsubaru.com', 'DEALERCOM', 100, '55110', 'Y', null, 'DCMS'); Insert into DEALERWEB Values (29, 'Luther Burnsville VW', 'https://www.burnsvillevw.com', 'DEALERCOM', 100, '55306', 'Y', null, 'DCMS'); Insert into DEALERWEB Values (30, 'Luther Westside VW', 'https://www.westsidevw.com', 'DEALERCOM', 200, '55306', 'Y', null, 'DCLWVW'); Insert into DEALERWEB Values (31, 'Luther Brookdale VW', 'https://www.lutherbrookdalevw.com', 'DEALERCOM', 100, '55429', 'Y', null, 'DCMS'); Insert into DEALERWEB Values (32, 'Schmelz VW', 'https://www.schmelzvw.com', 'DEALERON', 80, '55109', 'Y', null, 'DODEFAULT'); Insert into DEALERWEB Values (33, 'Walser Nissan', 'http://www.walsernissanburnsville.com', 'DEALERCOM', 250, '55306', 'Y', null, 'DCDWNB'); Insert into DEALERWEB Values (34, 'Eden Prairie Nissan', 'https://www.edenprairienissan.com', 'DEALERINSPIRE', 50, '55344', 'Y', null, 'DIDEFAULT'); Insert into DEALERWEB Values (35, 'Wayzata Nissan', 'http://www.walsernissanwayzata.com', 'DEALERCOM', 350, '55391', 'Y', null, 'DCDWNW'); Insert into DEALERWEB Values (36, 'Luther Nissan', 'https://www.luthernissan.com', 'DEALERCOM', 150, '55077', 'Y', null, 'DCDEFAULT'); Insert into DEALERWEB Values (37, 'Kline Nissan', 'http://www.klinenissan.com', 'DEALERCOM', 150, '55109', 'Y', null, 'DCDEFAULT'); Insert into DEALERWEB Values (38, 'Morries Nissan', 'https://www.morriesbrooklynparknissan.com', 'DEALERINSPIRE', 150, '55445', 'Y', null, 'DIDEFAULT'); Insert into DEALERWEB Values (39, 'Coon Rapids Nissan', 'http://www.coonrapidsnissan.com', 'DEALERCOM', 150, '55448', 'Y', null, 'DCDWNCR'); Insert into DEALERWEB Values (40, 'Walser Mazda', 'http://www.walser-mazda.com', 'DEALERCOM', 250, '55306', 'Y', null, 'DCDEFAULT'); Insert into DEALERWEB Values (41, 'Morries IG Mazda', 'https://www.morriesinvergrovemazda.com', 'DEALERINSPIRE', 150, '55077', 'Y', null, 'DIDEFAULT'); Insert into DEALERWEB Values (42, 'Morries Minnetonka Mazda', 'https://www.morriesmazda.com', 'DEALERINSPIRE', 250, '55305', 'Y', null, 'DIDEFAULT'); Insert into DEALERWEB Values (43, 'Luther Brookdale Mazda', 'https://www.luthermazda.com', 'DEALERCOM', 250, '55429', 'Y', null, 'DCDEFAULT'); Insert into DEALERWEB Values (44, 'Polar Mazda', 'http://www.polarmazda.com', 'DEALERCOM', 250, '55110', 'Y', null, 'DCDEFAULT'); Insert into NEWCARS Values ('1HGCT1B88GA003361', 1, TO_DATE('2017/02/05', 'yyyy/mm/dd'), null, null); Insert into NEWCARS Values ('1HGCT1B88GA003111', 1, TO_DATE('2017/01/05', 'yyyy/mm/dd'), TO_DATE('2017/02/05', 'yyyy/mm/dd'), null); Insert into NEWCARS Values ('1HGCT1B88GA003222', 1, TO_DATE('2017/02/05', 'yyyy/mm/dd'), null, null); /*==============================================================*/ /* QUERIES */ /*==============================================================*/ set linesize 380; set pagesize 1064; set echo on; spool C:\xaxa\DBMS\autohelper\results.txt select dealer_id, url, min_new, web_engine, url_new, url_used, url_nextpage, ttl_key_new, ttl_key_used, startpagenew, pageincnew, startpageused, pageinused from DEALERWEB left outer join WEBPARAMS on lower(WEBPARAMS.param_id) = lower(DEALERWEB.param_id); spool off; UPDATE WEBENGINE SET URL_NEXTPAGE='?_page=' WHERE upper(WEBENGINE.web_engine)='EBIZAUTOS'; select VIN from NEWCARS where dealer_id = 1 and DATE_SOLD is null; /* Used vehicle return */ delete from usedcars where vin = 'KM8SMDHF5FU099621' and date_sold is null; update usedcars set date_sold = null where vin = 'KM8SMDHF5FU099621'; delete from usedcars where vin = '5FRYD4H43EB011815' and date_sold = '28-feb-17'; /* New to Used return */ delete from newcars where vin = '5J6RM4H70GL030669'; update usedcars set date_arrived = '28-feb-17' where vin = '5J6RM4H70GL030669'; /* Number of units sold */ select DEALER_NAME, count (vin) as SOLD_NEW from newcars left outer join dealerweb on newcars.dealer_id = dealerweb.dealer_id where date_sold > '01-may-17' and lower(dealer_name) like '%honda%' group by DEALER_NAME order by count(vin) ASC; select DEALER_NAME, count (vin) as SALE_MINUS from dealerswap left outer join dealerweb on dealerswap.dealer_id_from = dealerweb.dealer_id where date_swapped > '01-apr-17' and lower(dealer_name) like '%honda%' group by DEALER_NAME; select DEALER_NAME, count (vin) as SALE_PLUS from dealerswap left outer join dealerweb on dealerswap.dealer_id_to = dealerweb.dealer_id where date_swapped > '01-apr-17' and lower(dealer_name) like '%honda%' group by DEALER_NAME; /* TOTAL SOLD NEW with dealerswap */ select DEALER_NAME, sum ( (select count(vin) from newcars where dlr.dealer_id = newcars.dealer_id and date_sold > '01-may-17') + (select count(vin) from dealerswap where dlr.dealer_id = dealerswap.dealer_id_to and date_swapped > '01-may-17') - (select count(vin) from dealerswap where dlr.dealer_id = dealerswap.dealer_id_from and date_swapped > '01-may-17') ) as TOTAL_SOLD_NEW from dealerweb dlr where lower(dealer_name) like '%honda%' group by dealer_name order by TOTAL_SOLD_NEW ASC; /* same with var */ var start_date varchar2(9); exec :start_date := '01-sep-17'; select DEALER_NAME, sum ( (select count(vin) from newcars where dlr.dealer_id = newcars.dealer_id and date_sold > :start_date) + (select count(vin) from dealerswap where dlr.dealer_id = dealerswap.dealer_id_to and date_swapped > :start_date) - (select count(vin) from dealerswap where dlr.dealer_id = dealerswap.dealer_id_from and date_swapped > :start_date) ) as TOTAL_SOLD_NEW from dealerweb dlr where lower(dealer_name) like '%honda%' group by dealer_name order by TOTAL_SOLD_NEW ASC; /* date range */ select DEALER_NAME, sum ( (select count(vin) from newcars where dlr.dealer_id = newcars.dealer_id and date_sold > '01-may-17' and date_sold < '21-may-17') + (select count(vin) from dealerswap where dlr.dealer_id = dealerswap.dealer_id_to and date_swapped > '01-may-17' and date_swapped < '21-may-17') - (select count(vin) from dealerswap where dlr.dealer_id = dealerswap.dealer_id_from and date_swapped > '01-may-17' and date_swapped < '21-may-17') ) as TOTAL_SOLD_NEW from dealerweb dlr where lower(dealer_name) like '%honda%' group by dealer_name order by TOTAL_SOLD_NEW ASC; /* Model SOLD NEW with dealerswap */ var car varchar2(20); exec :car := 'odyssey'; select DEALER_NAME, sum ( (select count(newcars.vin) from newcars, vehicles where dlr.dealer_id = newcars.dealer_id and newcars.vin = vehicles.vin and date_sold > '01-may-17' and lower(model) = :car) + (select count(dealerswap.vin) from dealerswap, vehicles where dlr.dealer_id = dealerswap.dealer_id_to and date_swapped > '01-may-17' and dealerswap.vin = vehicles.vin and lower(model) = :car) - (select count(dealerswap.vin) from dealerswap, vehicles where dlr.dealer_id = dealerswap.dealer_id_from and date_swapped > '01-may-17' and dealerswap.vin = vehicles.vin and lower(model) = :car) ) as MODEL_SOLD_NEW from dealerweb dlr where lower(dealer_name) like '%honda%' group by dealer_name order by MODEL_SOLD_NEW ASC; exec :car := 'fit'; select sum ( (select count(newcars.vin) from newcars, vehicles where dlr.dealer_id = newcars.dealer_id and newcars.vin = vehicles.vin and date_sold > '14-may-17' and lower(model) = :car) + (select count(dealerswap.vin) from dealerswap, vehicles where dlr.dealer_id = dealerswap.dealer_id_to and date_swapped > '14-may-17' and dealerswap.vin = vehicles.vin and lower(model) = :car) - (select count(dealerswap.vin) from dealerswap, vehicles where dlr.dealer_id = dealerswap.dealer_id_from and date_swapped > '14-may-17' and dealerswap.vin = vehicles.vin and lower(model) = :car) ) as MODEL_SOLD_NEW from dealerweb dlr where lower(dealer_name) like '%honda%'; select DEALER_NAME, sum ( (select count(newcars.vin) from newcars, vehicles where dlr.dealer_id = newcars.dealer_id and newcars.vin = vehicles.vin and date_sold > '01-apr-17' and date_sold < '03-may-17' and lower(model) = 'odyssey') + (select count(dealerswap.vin) from dealerswap, vehicles where dlr.dealer_id = dealerswap.dealer_id_to and date_swapped > '01-apr-17' and date_swapped < '03-may-17' and dealerswap.vin = vehicles.vin and lower(model) = 'odyssey') - (select count(dealerswap.vin) from dealerswap, vehicles where dlr.dealer_id = dealerswap.dealer_id_from and date_swapped > '01-apr-17' and date_swapped < '03-may-17' and dealerswap.vin = vehicles.vin and lower(model) = 'odyssey') ) as MODEL_SOLD_NEW from dealerweb dlr where lower(dealer_name) like '%honda%' group by dealer_name order by MODEL_SOLD_NEW ASC; /* Current stock new */ set echo on; spool C:\xaxa\DBMS\autohelper\results.txt select dealer_name, date_arrived, newcars.vin, modelyear, ADDLINFO from newcars, vehicles, dealerweb where lower(newcars.vin) = lower(vehicles.vin) and lower(model) = 'odyssey' and dealerweb.dealer_id = newcars.dealer_id and date_sold is null and modelyear = '2016' order by date_arrived ASC; spool off; /* Current stock new with dealerswap */ set linesize 380; set pagesize 64; set echo on; spool C:\xaxa\DBMS\autohelper\results.txt select date_swapped, dealer_name, date_arrived, new_vin, modelyear, ADDLINFO from (select dealer_name, newcars.dealer_id as d_id, date_arrived, newcars.vin as new_vin, modelyear, ADDLINFO from newcars, vehicles, dealerweb where lower(newcars.vin) = lower(vehicles.vin) and lower(model) = 'pilot' and dealerweb.dealer_id = newcars.dealer_id and date_sold is null /*and modelyear = '2017'*/) all_cars left outer join dealerswap on lower(all_cars.new_vin) = lower(dealerswap.vin) and all_cars.d_id = dealerswap.dealer_id_to order by date_arrived ASC; spool off; /* Current stock new by model*/ set echo on; spool C:\xaxa\DBMS\autohelper\results.txt select dealer_name, count(newcars.vin) from newcars, vehicles, dealerweb where lower(newcars.vin) = lower(vehicles.vin) and lower(model) = 'pilot' and dealerweb.dealer_id = newcars.dealer_id and date_sold is null-- and modelyear = '2016' group by dealer_name order by count(newcars.vin) ASC; spool off; /* date range */ select dealer_name, count(newcars.vin) from newcars, vehicles, dealerweb where lower(newcars.vin) = lower(vehicles.vin) and lower(model) = 'odyssey' and dealerweb.dealer_id = newcars.dealer_id and date_arrived < '20-may-17' and ((date_sold is null) or (date_sold > '21-may-17')) group by dealer_name order by count(newcars.vin) ASC; /* Current stock used */ select dealer_name, date_arrived, usedcars.vin, modelyear, ADDLINFO from usedcars, vehicles, dealerweb where lower(usedcars.vin) = lower(vehicles.vin) and lower(model) = 'odyssey' and dealerweb.dealer_id = usedcars.dealer_id and date_sold is null and modelyear = '2016' order by date_arrived ASC; /*==============================================================*/ /* SAND BOX */ /*==============================================================*/ create table SBNEWCARS ( VIN CHAR(17) not null, DEALER_ID NUMBER(7) not null, DATE_ARRIVED DATE not null, DATE_SOLD DATE, SELL_PRICE NUMBER(6,2), constraint PK_SBNEWCARS primary key (VIN) ); Insert into SBNEWCARS Values ('1HGCT1B88GA003361', 1, TO_DATE('2017/02/05', 'yyyy/mm/dd'), null, null); Insert into SBNEWCARS Values ('1HGCT1B88GA003111', 1, TO_DATE('2017/01/05', 'yyyy/mm/dd'), TO_DATE('2017/02/05', 'yyyy/mm/dd'), null); Insert into SBNEWCARS Values ('1HGCT1B88GA003222', 1, TO_DATE('2017/02/05', 'yyyy/mm/dd'), null, null); Insert into SBUSEDCARS Values ('1GCVKREC4FZ298516', 9, TO_DATE('2017/09/30', 'yyyy/mm/dd'), null, null, null); Insert into SBUSEDCARS Values ('1GCVKREC4FZ298516', 7, TO_DATE('2017/09/12', 'yyyy/mm/dd'), TO_DATE('2017/09/28', 'yyyy/mm/dd'), null, null); Insert into SBUSEDCARS Values ('1GCVKREC4FZ298516', 5, TO_DATE('2017/08/1', 'yyyy/mm/dd'), TO_DATE('2017/08/19', 'yyyy/mm/dd'), null, null); create table SBVEHICLES ( VIN CHAR(17) not null, MODELYEAR CHAR(4) not null, MAKE VARCHAR2(25) not null, MODEL VARCHAR2(25) not null, ADDLINFO VARCHAR2(50) , COLOR VARCHAR2(35) , constraint PK_SBMODELS primary key (VIN) ); create table SBUSEDCARS ( VIN CHAR(17) not null, DEALER_ID NUMBER(7) not null, DATE_ARRIVED DATE not null, DATE_SOLD DATE, AQUIS_PRICE NUMBER(6,2), SELL_PRICE NUMBER(6,2), constraint PK_SBUSEDCARS primary key (VIN, DEALER_ID, DATE_ARRIVED) /* A car can be possessed by multiple dealers over the life span. */ /* It can also return to the dealer who owned it in the past. */ ); create table SBDEALERSWAP ( VIN CHAR(17) not null, DEALER_ID_FROM NUMBER(7) not null, DEALER_ID_TO NUMBER(7) not null, DATE_SWAPPED DATE not null, constraint PK_SBDEALERSWAP primary key (VIN, DATE_SWAPPED) ); Insert into SBVEHICLES Values ('1HGCT1B88GA003361', '2017', 'Honda', 'Accord', null); Insert into SBVEHICLES Values ('1HGCT1B88GA003111', '2017', 'Honda', 'Accord', null); Insert into SBVEHICLES Values ('1HGCT1B88GA003222', '2017', 'Honda', 'Accord', null); --Insert into SBVEHICLES Values ('1HGCT1B88GA003244', '2017', 'Honda', 'Accord', null);--duplicate vin test delete from sbnewcars; delete from sbusedcars; delete from sbvehicles; delete from sbdealerswap; alter table webparams add (STARTPAGENEW NUMBER(2) not null, PAGEINCNEW NUMBER(2) not null, STARTPAGEUSED NUMBER(2) not null, PAGEINCUSED NUMBER(2) not null);
true
f328482c852d9feffd9147349311c2f6e2a6341e
SQL
jpomfret/demos
/DataCompression/01_Page_Internals_ObjectSizeAndCompression.sql
UTF-8
777
3.703125
4
[]
no_license
Use CompressTest SELECT schema_name(obj.SCHEMA_ID) as SchemaName, obj.name as TableName, ind.name as IndexName, ind.type_desc as IndexType, pas.row_count as NumberOfRows, pas.used_page_count as UsedPageCount, (pas.used_page_count * 8)/1024 as SizeUsedMB, par.data_compression_desc as DataCompression, (pas.reserved_page_count * 8)/1024 as SizeReservedMB FROM sys.objects obj INNER JOIN sys.indexes ind ON obj.object_id = ind.object_id INNER JOIN sys.partitions par ON par.index_id = ind.index_id AND par.object_id = obj.object_id INNER JOIN sys.dm_db_partition_stats pas ON pas.partition_id = par.partition_id WHERE obj.schema_id <> 4 --AND schema_name(obj.schema_id) = 'schemaName' --AND obj.name = 'SalesOrderDetail' ORDER BY SizeUsedMB desc -- End of Demo 1
true
be1eb738bfc2f461785455d5aafb04ba34f559d3
SQL
lisasce/LMSCF-LisaScelli-CodeReview-09
/cr09_lisa_scelli_delivery.sql
UTF-8
14,861
3.28125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Mar 14, 2020 at 03:58 PM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `cr09_lisa_scelli_delivery` -- -- -------------------------------------------------------- -- -- Table structure for table `contact` -- CREATE TABLE `contact` ( `contact_id` int(11) NOT NULL, `house_nb` int(8) NOT NULL, `street` varchar(80) NOT NULL, `city` varchar(80) NOT NULL, `ZIP` int(5) NOT NULL, `country` varchar(3) NOT NULL DEFAULT 'AT' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `contact` -- INSERT INTO `contact` (`contact_id`, `house_nb`, `street`, `city`, `ZIP`, `country`) VALUES (1, 28, 'prinzgasse', 'Vienna', 1100, 'AT'), (2, 8, 'kingstreet', 'london', 55555, 'UK'), (3, 2, 'rue des rois', 'Paris', 91300, 'FR'), (4, 7, 'prinzessinstrasse', 'Steyr', 4400, 'AT'), (5, 3, 'rue des princesses', 'Paris', 95000, 'FR'), (6, 17, 'princess street', 'London', 32486, 'UK'), (7, 6, 'katzengasse', 'Vienna', 1200, 'AT'), (8, 75, 'cat street', 'London', 44444, 'UK'), (9, 7, 'rue des gros chats noirs', 'Paris', 92000, 'FR'); -- -------------------------------------------------------- -- -- Table structure for table `customer` -- CREATE TABLE `customer` ( `customer_id` int(11) NOT NULL, `first_name` varchar(50) NOT NULL, `last_name` varchar(50) NOT NULL, `tel` bigint(20) NOT NULL, `fk_contact_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `customer` -- INSERT INTO `customer` (`customer_id`, `first_name`, `last_name`, `tel`, `fk_contact_id`) VALUES (1, 'lisa', 'scelli', 436706061313, 7), (2, 'nihad', 'abou-zid', 436706042683, 7), (3, 'nihad', 'abou-zid', 436706042683, 7), (4, 'guizmo', 'scelli', 0, 7), (5, 'caecilia', 'levraut', 447706061313, 8), (6, 'elodie', 'mous', 336788061313, 9); -- -------------------------------------------------------- -- -- Table structure for table `department` -- CREATE TABLE `department` ( `department_id` int(11) NOT NULL, `dep_name` varchar(50) NOT NULL, `dep_nb` tinyint(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `department` -- INSERT INTO `department` (`department_id`, `dep_name`, `dep_nb`) VALUES (1, 'DELIVERY', 1), (2, 'RECEPTION', 2), (3, 'WAREHOUSE', 3), (4, 'PICKUP', 4); -- -------------------------------------------------------- -- -- Table structure for table `description` -- CREATE TABLE `description` ( `description_id` int(11) NOT NULL, `customs_nb` int(50) NOT NULL, `mail_category` enum('letter','package') DEFAULT 'letter', `content_category` varchar(80) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `description` -- INSERT INTO `description` (`description_id`, `customs_nb`, `mail_category`, `content_category`) VALUES (1, 2415345, 'letter', 'small book'), (2, 2475645, 'package', 'parfum'), (3, 2414535, 'letter', 'documents'), (4, 7535645, 'package', 'cakes'), (5, 1255345, 'letter', 'love letter'), (6, 2474535, 'package', 'souvenir'); -- -------------------------------------------------------- -- -- Table structure for table `employee` -- CREATE TABLE `employee` ( `employee_id` int(11) NOT NULL, `first_name` varchar(50) NOT NULL, `last_name` varchar(50) NOT NULL, `bithdate` date NOT NULL, `hire_date` date NOT NULL, `fk_contact_id` int(11) NOT NULL, `fk_department_id` int(11) NOT NULL, `fk_processing_system_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `employee` -- INSERT INTO `employee` (`employee_id`, `first_name`, `last_name`, `bithdate`, `hire_date`, `fk_contact_id`, `fk_department_id`, `fk_processing_system_id`) VALUES (1, 'ghiath', 'serri', '1990-05-23', '2018-10-23', 1, 1, 1), (2, 'nadine', 'abou-zid', '1994-03-05', '2019-08-01', 1, 2, 1), (3, 'adam', 'abou-zid', '1999-04-05', '2006-02-01', 9, 2, 2), (4, 'valeria', 'ignaz', '1990-12-17', '2019-08-01', 5, 3, 3); -- -------------------------------------------------------- -- -- Table structure for table `firm_info` -- CREATE TABLE `firm_info` ( `firm_info_id` int(11) NOT NULL, `corporate_form` varchar(15) NOT NULL DEFAULT 'GmbH', `commercial_registration` varchar(25) NOT NULL, `VAT_nb` int(25) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `firm_info` -- INSERT INTO `firm_info` (`firm_info_id`, `corporate_form`, `commercial_registration`, `VAT_nb`) VALUES (1, 'GmbH', ' 180219d', 46674503), (2, 'AG', ' 185319d', 42854503), (3, 'KG', ' 127219d', 4286842); -- -------------------------------------------------------- -- -- Table structure for table `location` -- CREATE TABLE `location` ( `location_id` int(11) NOT NULL, `name` varchar(50) NOT NULL, `fk_contact_id` int(11) NOT NULL, `fk_firm_info_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `location` -- INSERT INTO `location` (`location_id`, `name`, `fk_contact_id`, `fk_firm_info_id`) VALUES (1, 'post office 1', 1, 1), (2, 'post office 2', 1, 1), (3, 'post office 3', 2, 2), (4, 'post office 4', 3, 3); -- -------------------------------------------------------- -- -- Table structure for table `mail` -- CREATE TABLE `mail` ( `mail_id` int(11) NOT NULL, `weight_gr` int(11) NOT NULL DEFAULT 30, `date_sent` datetime NOT NULL, `date_received` datetime NOT NULL, `fk_description_id` int(11) NOT NULL, `fk_location_id` int(11) NOT NULL, `fk_sender_id` int(11) NOT NULL, `fk_receiver_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `mail` -- INSERT INTO `mail` (`mail_id`, `weight_gr`, `date_sent`, `date_received`, `fk_description_id`, `fk_location_id`, `fk_sender_id`, `fk_receiver_id`) VALUES (1, 10, '2020-02-02 00:00:00', '2020-02-08 00:00:00', 1, 1, 1, 2), (2, 10, '2020-02-02 00:00:00', '2020-02-08 00:00:00', 3, 1, 3, 4), (3, 500, '2020-02-02 00:00:00', '2020-02-08 00:00:00', 2, 2, 5, 6), (4, 1000, '2020-02-02 00:00:00', '2020-02-08 00:00:00', 4, 2, 6, 1), (5, 50, '2020-03-02 00:00:00', '2020-03-08 00:00:00', 5, 2, 2, 5), (6, 1000, '2020-03-02 00:00:00', '2020-03-08 00:00:00', 6, 2, 4, 2), (7, 10, '2020-02-02 00:00:00', '2020-02-08 00:00:00', 3, 1, 3, 5), (8, 1000, '2020-02-02 00:00:00', '2020-02-08 00:00:00', 4, 2, 3, 4), (9, 20, '2020-02-02 00:00:00', '2020-02-08 00:00:00', 5, 3, 2, 1), (10, 1000, '2020-02-02 00:00:00', '2020-02-08 00:00:00', 6, 3, 2, 5), (11, 50, '2020-03-02 00:00:00', '2020-03-08 00:00:00', 5, 2, 2, 5), (12, 1000, '2020-03-02 00:00:00', '2020-03-08 00:00:00', 6, 2, 4, 2); -- -------------------------------------------------------- -- -- Table structure for table `processing_system` -- CREATE TABLE `processing_system` ( `processing_system_id` int(11) NOT NULL, `name` varchar(50) NOT NULL, `capacity_package` int(11) DEFAULT NULL, `fk_contact_id` int(11) NOT NULL, `fk_firm_info_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `processing_system` -- INSERT INTO `processing_system` (`processing_system_id`, `name`, `capacity_package`, `fk_contact_id`, `fk_firm_info_id`) VALUES (1, 'post warehouse 1', 500, 4, 1), (2, 'post warehouse 2', 1500, 5, 2), (3, 'post warehouse 3', 500, 6, 3); -- -------------------------------------------------------- -- -- Table structure for table `send_receive` -- CREATE TABLE `send_receive` ( `send_receive_id` int(11) NOT NULL, `status` enum('received','sent') DEFAULT 'received', `fk_location_id` int(11) DEFAULT NULL, `fk_processing_system_id` int(11) DEFAULT NULL, `fk_receiver_id` int(11) DEFAULT NULL, `fk_mail_id` int(11) NOT NULL, `fk_employee_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `send_receive` -- INSERT INTO `send_receive` (`send_receive_id`, `status`, `fk_location_id`, `fk_processing_system_id`, `fk_receiver_id`, `fk_mail_id`, `fk_employee_id`) VALUES (1, 'sent', 1, 1, NULL, 1, 1), (2, 'sent', 2, 1, NULL, 2, 2), (3, 'sent', 3, 1, NULL, 3, 3), (4, 'sent', 1, 1, NULL, 4, 4), (6, 'sent', 1, 1, NULL, 1, 2), (7, 'sent', 2, 1, NULL, 2, 3), (8, 'sent', 3, 1, NULL, 3, 4), (9, 'sent', 1, 1, NULL, 4, 1), (10, 'received', 1, 1, NULL, 5, 1), (11, 'received', 2, 1, NULL, 6, 2), (12, 'received', 3, 1, NULL, 7, 3), (13, 'received', 1, 1, NULL, 8, 4), (14, 'received', NULL, 1, 1, 9, 1), (15, 'received', NULL, 1, 2, 10, 2), (16, 'received', NULL, 2, 3, 11, 3), (17, 'received', NULL, 3, 4, 12, 4); -- -- Indexes for dumped tables -- -- -- Indexes for table `contact` -- ALTER TABLE `contact` ADD PRIMARY KEY (`contact_id`); -- -- Indexes for table `customer` -- ALTER TABLE `customer` ADD PRIMARY KEY (`customer_id`), ADD KEY `fk_contact_id` (`fk_contact_id`); -- -- Indexes for table `department` -- ALTER TABLE `department` ADD PRIMARY KEY (`department_id`), ADD UNIQUE KEY `dep_nb` (`dep_nb`); -- -- Indexes for table `description` -- ALTER TABLE `description` ADD PRIMARY KEY (`description_id`); -- -- Indexes for table `employee` -- ALTER TABLE `employee` ADD PRIMARY KEY (`employee_id`), ADD KEY `fk_contact_id` (`fk_contact_id`), ADD KEY `fk_department_id` (`fk_department_id`), ADD KEY `fk_processing_system_id` (`fk_processing_system_id`); -- -- Indexes for table `firm_info` -- ALTER TABLE `firm_info` ADD PRIMARY KEY (`firm_info_id`); -- -- Indexes for table `location` -- ALTER TABLE `location` ADD PRIMARY KEY (`location_id`), ADD KEY `fk_contact_id` (`fk_contact_id`), ADD KEY `fk_firm_info_id` (`fk_firm_info_id`); -- -- Indexes for table `mail` -- ALTER TABLE `mail` ADD PRIMARY KEY (`mail_id`), ADD KEY `fk_description_id` (`fk_description_id`), ADD KEY `fk_location_id` (`fk_location_id`), ADD KEY `fk_sender_id` (`fk_sender_id`), ADD KEY `fk_receiver_id` (`fk_receiver_id`); -- -- Indexes for table `processing_system` -- ALTER TABLE `processing_system` ADD PRIMARY KEY (`processing_system_id`), ADD KEY `fk_contact_id` (`fk_contact_id`), ADD KEY `fk_firm_info_id` (`fk_firm_info_id`); -- -- Indexes for table `send_receive` -- ALTER TABLE `send_receive` ADD PRIMARY KEY (`send_receive_id`), ADD KEY `fk_location_id` (`fk_location_id`), ADD KEY `fk_processing_system_id` (`fk_processing_system_id`), ADD KEY `fk_receiver_id` (`fk_receiver_id`), ADD KEY `fk_mail_id` (`fk_mail_id`), ADD KEY `fk_employee_id` (`fk_employee_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `contact` -- ALTER TABLE `contact` MODIFY `contact_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `customer` -- ALTER TABLE `customer` MODIFY `customer_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `department` -- ALTER TABLE `department` MODIFY `department_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `description` -- ALTER TABLE `description` MODIFY `description_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `employee` -- ALTER TABLE `employee` MODIFY `employee_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `firm_info` -- ALTER TABLE `firm_info` MODIFY `firm_info_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `location` -- ALTER TABLE `location` MODIFY `location_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `mail` -- ALTER TABLE `mail` MODIFY `mail_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `processing_system` -- ALTER TABLE `processing_system` MODIFY `processing_system_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `send_receive` -- ALTER TABLE `send_receive` MODIFY `send_receive_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18; -- -- Constraints for dumped tables -- -- -- Constraints for table `customer` -- ALTER TABLE `customer` ADD CONSTRAINT `customer_ibfk_1` FOREIGN KEY (`fk_contact_id`) REFERENCES `contact` (`contact_id`); -- -- Constraints for table `employee` -- ALTER TABLE `employee` ADD CONSTRAINT `employee_ibfk_1` FOREIGN KEY (`fk_contact_id`) REFERENCES `contact` (`contact_id`), ADD CONSTRAINT `employee_ibfk_2` FOREIGN KEY (`fk_department_id`) REFERENCES `department` (`department_id`), ADD CONSTRAINT `employee_ibfk_3` FOREIGN KEY (`fk_processing_system_id`) REFERENCES `processing_system` (`processing_system_id`); -- -- Constraints for table `location` -- ALTER TABLE `location` ADD CONSTRAINT `location_ibfk_1` FOREIGN KEY (`fk_contact_id`) REFERENCES `contact` (`contact_id`), ADD CONSTRAINT `location_ibfk_2` FOREIGN KEY (`fk_firm_info_id`) REFERENCES `firm_info` (`firm_info_id`); -- -- Constraints for table `mail` -- ALTER TABLE `mail` ADD CONSTRAINT `mail_ibfk_1` FOREIGN KEY (`fk_description_id`) REFERENCES `description` (`description_id`), ADD CONSTRAINT `mail_ibfk_2` FOREIGN KEY (`fk_location_id`) REFERENCES `location` (`location_id`), ADD CONSTRAINT `mail_ibfk_3` FOREIGN KEY (`fk_sender_id`) REFERENCES `customer` (`customer_id`), ADD CONSTRAINT `mail_ibfk_4` FOREIGN KEY (`fk_receiver_id`) REFERENCES `customer` (`customer_id`); -- -- Constraints for table `processing_system` -- ALTER TABLE `processing_system` ADD CONSTRAINT `processing_system_ibfk_1` FOREIGN KEY (`fk_contact_id`) REFERENCES `contact` (`contact_id`), ADD CONSTRAINT `processing_system_ibfk_2` FOREIGN KEY (`fk_firm_info_id`) REFERENCES `firm_info` (`firm_info_id`); -- -- Constraints for table `send_receive` -- ALTER TABLE `send_receive` ADD CONSTRAINT `send_receive_ibfk_1` FOREIGN KEY (`fk_location_id`) REFERENCES `location` (`location_id`), ADD CONSTRAINT `send_receive_ibfk_2` FOREIGN KEY (`fk_processing_system_id`) REFERENCES `processing_system` (`processing_system_id`), ADD CONSTRAINT `send_receive_ibfk_3` FOREIGN KEY (`fk_receiver_id`) REFERENCES `customer` (`customer_id`), ADD CONSTRAINT `send_receive_ibfk_4` FOREIGN KEY (`fk_mail_id`) REFERENCES `mail` (`mail_id`), ADD CONSTRAINT `send_receive_ibfk_5` FOREIGN KEY (`fk_employee_id`) REFERENCES `employee` (`employee_id`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
31324f7d99379d29785751c598a0ad3f05b9f951
SQL
hayyuelha/IF3110-01-Simple-Blog
/simpleblog.sql
UTF-8
2,114
2.953125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.0.4.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Oct 14, 2014 at 09:40 PM -- Server version: 5.5.32 -- PHP Version: 5.4.16 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `simpleblog` -- CREATE DATABASE IF NOT EXISTS `simpleblog` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `simpleblog`; -- -------------------------------------------------------- -- -- Table structure for table `blogitem` -- CREATE TABLE IF NOT EXISTS `blogitem` ( `pid` int(4) NOT NULL AUTO_INCREMENT, `posttitle` text NOT NULL, `postdate` date NOT NULL, `postcontent` text NOT NULL, PRIMARY KEY (`pid`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ; -- -- Dumping data for table `blogitem` -- INSERT INTO `blogitem` (`pid`, `posttitle`, `postdate`, `postcontent`) VALUES (10, 'pamungkas', '2014-10-15', 'kasih error message lah untuk menangani field kosong'), (11, 'check', '2014-10-15', 'tes field kosong'); -- -------------------------------------------------------- -- -- Table structure for table `komentar` -- CREATE TABLE IF NOT EXISTS `komentar` ( `kid` int(4) NOT NULL AUTO_INCREMENT, `pid` int(4) NOT NULL, `c_name` text NOT NULL, `c_email` text NOT NULL, `comment` text NOT NULL, `c_date` datetime NOT NULL, PRIMARY KEY (`kid`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=19 ; -- -- Dumping data for table `komentar` -- INSERT INTO `komentar` (`kid`, `pid`, `c_name`, `c_email`, `comment`, `c_date`) VALUES (15, 10, 'hay', 'hayyu94@yahoo.com', 'udah yaaa', '2014-10-15 02:31:58'), (16, 11, 'Luthfi', 'luthfi2007@yahoo.com', 'dummy', '2014-10-15 02:35:23'); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
5ef39ddd16799890a3841bc415d8c8306772fe9e
SQL
ASCIT/donut
/sql/donut.sql
UTF-8
8,460
3.59375
4
[ "MIT" ]
permissive
-- TODO: Add CASCADEs -- TODO: Better comments DROP TABLE IF EXISTS news; DROP VIEW IF EXISTS current_position_holders; DROP VIEW IF EXISTS current_direct_position_holders; DROP TABLE IF EXISTS position_relations; DROP VIEW IF EXISTS house_positions; DROP VIEW IF EXISTS house_groups; DROP TABLE IF EXISTS position_holders; DROP TABLE IF EXISTS positions; DROP TABLE IF EXISTS groups; DROP TABLE IF EXISTS users; DROP TABLE IF EXISTS member_options; DROP TABLE IF EXISTS options; DROP VIEW IF EXISTS members_full_name; DROP TABLE IF EXISTS members; DROP TABLE IF EXISTS buildings; DROP TABLE IF EXISTS newsgroup_posts; DROP TABLE IF EXISTS group_applications; -- Residential Buildings CREATE TABLE buildings ( building_id INT NOT NULL AUTO_INCREMENT, building_name VARCHAR(100) NOT NULL, PRIMARY KEY (building_id), UNIQUE (building_name) ); -- Members Table CREATE TABLE members ( user_id INT NOT NULL AUTO_INCREMENT, uid CHAR(7) NOT NULL, last_name VARCHAR(255) NOT NULL, first_name VARCHAR(255) NOT NULL, preferred_name VARCHAR(255) DEFAULT NULL, middle_name VARCHAR(255) DEFAULT NULL, email VARCHAR(255) NOT NULL, phone VARCHAR(64) DEFAULT NULL, gender TINYINT DEFAULT NULL, -- Numerical code that will be -- stored in code gender_custom VARCHAR(32) DEFAULT NULL, birthday DATE DEFAULT NULL, entry_year YEAR(4) DEFAULT NULL, graduation_year YEAR(4) DEFAULT NULL, msc SMALLINT DEFAULT NULL, building_id INT DEFAULT NULL, room VARCHAR(5) DEFAULT NULL, address VARCHAR(255) DEFAULT NULL, city VARCHAR(64) DEFAULT NULL, state VARCHAR(64) DEFAULT NULL, zip VARCHAR(10) DEFAULT NULL, country VARCHAR(64) DEFAULT NULL, timezone INT DEFAULT NULL, -- Offset from GMT in minutes -- TODO: remove after COVID create_account_key CHAR(32) DEFAULT NULL, PRIMARY KEY (user_id), FOREIGN KEY (building_id) REFERENCES buildings(building_id), UNIQUE (uid) ); -- Member Full Name View CREATE VIEW members_full_name AS ( SELECT user_id, CONCAT(IFNULL(preferred_name, first_name), ' ', last_name) AS full_name FROM members ); -- Major Option Table CREATE TABLE options ( option_id INT NOT NULL AUTO_INCREMENT, option_name VARCHAR(50) NOT NULL, PRIMARY KEY (option_id), UNIQUE (option_name) ); -- Option to Member Table -- Many to many relationship between members and options CREATE TABLE member_options ( user_id INT, option_id INT, option_type VARCHAR(8) NOT NULL, PRIMARY KEY (user_id, option_id), FOREIGN KEY (user_id) REFERENCES members(user_id), FOREIGN KEY (option_id) REFERENCES options(option_id) ); -- Users Table CREATE TABLE users ( user_id INT, username VARCHAR(32) NOT NULL, last_login DATETIME DEFAULT NULL, password_hash VARCHAR(255) NOT NULL, password_reset_key CHAR(32) DEFAULT NULL, password_reset_expiration DATETIME DEFAULT NULL, PRIMARY KEY (user_id), FOREIGN KEY (user_id) REFERENCES members(user_id), UNIQUE (username) ); -- Groups Table -- Groups of members. Used for mailing lists, etc. -- Groups are used for any internal/external groupings of users. -- Used for groups on campus -- Examples: Blacker Hovse, IHC, CRC, ug-list, ug-2020 CREATE TABLE groups ( group_id INT NOT NULL AUTO_INCREMENT, group_name VARCHAR(64) NOT NULL, group_desc VARCHAR(255) DEFAULT NULL, type VARCHAR(255) NOT NULL, -- Controls if this is an email group newsgroups BOOLEAN NOT NULL DEFAULT FALSE, -- Controls whether or not anyone can send emails to the group anyone_can_send BOOLEAN NOT NULL DEFAULT FALSE, -- Controls if everyone can see this group visible BOOLEAN NOT NULL DEFAULT FALSE, PRIMARY KEY (group_id), UNIQUE (group_name) ); CREATE TABLE newsgroup_posts ( newsgroup_post_id INT NOT NULL AUTO_INCREMENT, group_id INT NOT NULL, -- Which group was it to subject TEXT NOT NULL, message TEXT NOT NULL, post_as VARCHAR(32) DEFAULT NULL, user_id INT NOT NULL, -- Who sent this message -- When was the message sent time_sent TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (newsgroup_post_id), FOREIGN KEY (group_id) REFERENCES groups(group_id), FOREIGN KEY (user_id) REFERENCES members(user_id) ); -- Positions Table CREATE TABLE positions ( group_id INT NOT NULL, pos_id INT NOT NULL AUTO_INCREMENT, pos_name VARCHAR(64) NOT NULL, -- Whether this position can send emails to group send BOOLEAN NOT NULL DEFAULT FALSE, -- Whether this position has admin control over group control BOOLEAN NOT NULL DEFAULT FALSE, -- Whether this position receives emails from this group receive BOOLEAN NOT NULL DEFAULT TRUE, PRIMARY KEY (pos_id), FOREIGN KEY (group_id) REFERENCES groups(group_id) ON DELETE CASCADE, UNIQUE (group_id, pos_name) ); -- Position to Member Table CREATE TABLE position_holders ( hold_id INT NOT NULL AUTO_INCREMENT, pos_id INT NOT NULL, user_id INT NOT NULL, start_date DATE DEFAULT NULL, end_date DATE DEFAULT NULL, -- Whether user is subscribed to newsgroup subscribed BOOLEAN NOT NULL DEFAULT TRUE, PRIMARY KEY (hold_id), FOREIGN KEY (pos_id) REFERENCES positions(pos_id) ON DELETE CASCADE, FOREIGN KEY (user_id) REFERENCES members(user_id) ); -- Houses View -- Because houses are used so much, make a view separate from the groups -- table. CREATE VIEW house_groups AS ( SELECT group_id, group_name FROM groups WHERE type = 'house' ); -- House Positions View -- House membership positions are special, -- so make a view separate from the positions table. CREATE VIEW house_positions AS ( SELECT group_id, group_name, pos_id, pos_name FROM house_groups NATURAL JOIN positions WHERE pos_name IN ('Full Member', 'Social Member') ); -- Position to position table CREATE TABLE position_relations ( pos_id_from INT NOT NULL, pos_id_to INT NOT NULL, PRIMARY KEY (pos_id_from, pos_id_to), FOREIGN KEY (pos_id_from) REFERENCES positions(pos_id) ON DELETE CASCADE, FOREIGN KEY (pos_id_to) REFERENCES positions(pos_id) ON DELETE CASCADE ); -- Filters the position_holders table to only list holds that are active CREATE VIEW current_direct_position_holders AS ( SELECT * FROM position_holders WHERE (start_date IS NULL OR start_date <= CURRENT_DATE) AND (end_date IS NULL OR CURRENT_DATE <= end_date) ); -- All direct and indirect position holds that are currently active. -- This should be used in general for querying held positions. CREATE VIEW current_position_holders AS ( SELECT * FROM current_direct_position_holders UNION ALL SELECT current_direct_position_holders.hold_id, position_relations.pos_id_to AS pos_id, current_direct_position_holders.user_id, current_direct_position_holders.start_date, current_direct_position_holders.end_date, current_direct_position_holders.subscribed FROM current_direct_position_holders JOIN position_relations ON pos_id = pos_id_from ); -- News items to show on the homepage CREATE TABLE news ( news_id INT NOT NULL AUTO_INCREMENT, news_date DATE NOT NULL DEFAULT CURRENT_DATE, news_text TEXT NOT NULL, PRIMARY KEY (news_id) ); CREATE TABLE group_applications ( user_id INT NOT NULL, group_id INT NOT NULL, PRIMARY KEY (user_id, group_id), FOREIGN KEY (user_id) REFERENCES members(user_id), FOREIGN KEY (group_id) REFERENCES groups(group_id) );
true
0491069ba31355111bc793dd1a8d56f53f5a3685
SQL
kentwang/CassandraToy
/cql/problem.cql
UTF-8
359
3.703125
4
[]
no_license
-- problem 1 SELECT votes FROM movies WHERE title = 'The Matrix (1999)'; -- problem 2 (Very complicated) Create multiple table and join SELECT title FROM movies WHERE rank < 8.3 AND votes >= 400000; -- problem 3 SELECT COUNT(*) FROM movies WHERE rank = 8.9 ALLOW FILTERING; -- problem 4 (Very Complicated) Create Join CREATE INDEX ON literature(bookauthor);
true
c77033522c32552e0ef459e3247ffa3af0fd279c
SQL
RobPajor/WPostBoard-git-test
/schema.sql
UTF-8
735
3.671875
4
[]
no_license
DROP TABLE IF EXISTS user; DROP TABLE IF EXISTS post; CREATE TABLE User ( id INTEGER PRIMARY KEY AUTOINCREMENT, username TEXT UNIQUE NOT NULL, bio TEXT, password TEXT NOT NULL, joindate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, avatar_id INTEGER DEFAULT = 1 ); CREATE TABLE post ( id INTEGER PRIMARY KEY AUTOINCREMENT, author_id INTEGER NOT NULL, created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, title TEXT NOT NULL, body TEXT NOT NULL, likes INTEGER DEFAULT 0, FOREIGN KEY (author_id) REFERENCES user (id) ); CREATE TABLE likes ( user_id INTEGER, post_id INTEGER, ) CREATE TABLE dislikes ( user_id INTEGER, post_id INTEGER, ) CREATE TABLE pictures ( picture_id INTEGER PRIMARY KEY AUTOINCREMENT, picture_path TEXT, )
true
f7500e402384b28738c8b173a8663c1bd302e137
SQL
maronfranc/rust-sqlx-grpc-nestjs
/rust_server_grpc/migrations/000_create_users.sql
UTF-8
307
3.234375
3
[ "MIT" ]
permissive
CREATE TABLE IF NOT EXISTS users ( id SERIAL PRIMARY KEY, email VARCHAR NOT NULL CONSTRAINT unique_email_constraint UNIQUE, username VARCHAR NOT NULL CONSTRAINT unique_username_constraint UNIQUE, password VARCHAR NOT NULL, id_person SERIAL REFERENCES users(id) );
true
d3a435fec7d3cf84839ea7e4fa2d45ca68e6b535
SQL
nirooj56/opencart-News-Event
/install.sql
UTF-8
1,035
3.15625
3
[ "MIT" ]
permissive
CREATE TABLE IF NOT EXISTS `oc_cyco_news_article` ( `article_id` INT(11) NOT NULL AUTO_INCREMENT, `sort_order` INT(11) NOT NULL DEFAULT '0', `status` TINYINT(1) NOT NULL DEFAULT '0', `date_modified` DATETIME NOT NULL, `viewed` INT(5) NOT NULL DEFAULT '0', PRIMARY KEY (`article_id`) ) DEFAULT COLLATE=utf8_general_ci; CREATE TABLE IF NOT EXISTS `oc_cyco_news_article_description` ( `article_id` INT(11) NOT NULL, `language_id` INT(11) NOT NULL, `name` VARCHAR(255) NOT NULL, `description` TEXT NOT NULL, `intro_text` TEXT NOT NULL, `meta_title` VARCHAR(255) NOT NULL, `meta_description` VARCHAR(255) NOT NULL, `meta_keyword` VARCHAR(255) NOT NULL, `author` VARCHAR(255) NOT NULL, `tag` TEXT, PRIMARY KEY (`article_id`, `language_id`), INDEX `name` (`name`) ) DEFAULT COLLATE=utf8_general_ci;
true
d5fb8f9c23e54efe3b3693b81959174ac23f15ec
SQL
Sheridan/workflow
/sql/task_зкщпкуыы_view.sql
UTF-8
303
3.5
4
[]
no_license
CREATE OR REPLACE VIEW task_progress as select now() > tasks.control_timestamp as overtime_control_time, tasks.id as task_id, cast(EXTRACT(EPOCH FROM age(tasks.control_timestamp, tasks.start_timestamp)) as int), cast(EXTRACT(EPOCH FROM age(now(), tasks.start_timestamp)) as int) from tasks
true
cedae888e3b5f83261f30b95b1f4d0562b74188e
SQL
Martin1987/myTestCode
/Pro_Oracle_SQL/chapter05_scripts/lst-05-02.sql
UTF-8
229
3.296875
3
[]
no_license
/* Listing 5-2 */ select employee_id, count(*) job_ct from ( select e.employee_id, e.job_id from employees e union all select j.employee_id, j.job_id from job_history j ) group by employee_id having count(*) > 1;
true
db773e0407a00f00e19869899f767c471d19a772
SQL
Jilroge7/holbertonschool-web_back_end
/0x0C-MySQL_Advanced/3-glam_rock.sql
UTF-8
219
3.28125
3
[]
no_license
-- lists all bands with glam rock as main style, -- ranked by their longevity SELECT band_name AS band_name, ifnull(split, 2020)-formed AS lifespan FROM metal_bands WHERE style LIKE '%Glam rock%' ORDER BY lifespan DESC;
true
4d1b28af79bed3591923b216626c1712c42ec5e8
SQL
amojohn/ETL
/07_BI_DEPLOY/2_DW/TABLES/DW_STR_STOCKDEPART.sql
UTF-8
6,730
2.71875
3
[]
no_license
DROP TABLE IF EXISTS DW.DW_STR_STOCKDEPART; CREATE TABLE IF NOT EXISTS DW.DW_STR_STOCKDEPART( PERIOD_WID BIGINT COMMENT '日期维ID(到达日)', SEQNO BIGINT COMMENT '序号', PROCDATE STRING COMMENT '业务日期', PROCBILLNO STRING COMMENT '业务单号', PROCTYPE STRING COMMENT '业务类型', PLAN_TRANSPORTMODE_ID STRING COMMENT '计划运输方式', TRANSPORTMODE_ID STRING COMMENT '运输方式', GDLR_ID STRING COMMENT '全局经销商代码', DLR_ID STRING COMMENT '经销商代码', DLR_NAME STRING COMMENT '经销商名称', DEST_LOCATION_TYPE STRING COMMENT '目的地代码', DEST_LOCATION_ID STRING COMMENT '目的地代码', DEST_LOCATION_NAME STRING COMMENT '目的地名称', VIN STRING COMMENT 'vin', MODEL_ID STRING COMMENT '车型ID', BRAND_ID STRING COMMENT '品牌ID', OPT_CODE STRING COMMENT '配置', COL_CODE STRING COMMENT '颜色', SYMBOL STRING COMMENT '标识', DEPLOY STRING COMMENT '调配标识', STATE1 STRING COMMENT '当前状态', STATE2 STRING COMMENT '上次状态', GHIRERID STRING COMMENT '全局货主代码', HIRERID STRING COMMENT '货物代码', HIRERNAME STRING COMMENT '货主名称', FACTORY_ID STRING COMMENT '工厂代码', OC_ID STRING COMMENT '运营中心ID', OC_NAME STRING COMMENT '运营中心', RGN_ID STRING COMMENT '大区ID', RGN_NAME STRING COMMENT '大区', BASE_TYPE STRING COMMENT '基地类型', BASE_ID STRING COMMENT '基地ID', BASE_NAME STRING COMMENT '基地', STR_TYPE STRING COMMENT '仓库类型', STR_ID STRING COMMENT '仓库ID', STR_NAME STRING COMMENT '仓库', LOCATIONID1 STRING COMMENT '当前库位', LOCATIONID2 STRING COMMENT '上次库位', DRIVERID STRING COMMENT '驾驶员代码', DRIVERNAME STRING COMMENT '驾驶员名称', INSPECTORID STRING COMMENT '检验员代码', INSPECTORNAME STRING COMMENT '检验员名称', USERID STRING COMMENT '操作员帐号', USERNAME STRING COMMENT '操作员名称', PURCHASENO STRING COMMENT '采购订单号', SALESNO STRING COMMENT '销售订单号', SALESDATE STRING COMMENT '销售订单日期', VDRNO STRING COMMENT '发运订单号', ALLOTDATE STRING COMMENT '发运订单日期', MOVETOOGID STRING COMMENT '移库目的组织代码', MOVETOWHID STRING COMMENT '移库目的库房代码', REQRECEIVEDATE STRING COMMENT '要求收车日期', SCHRECEIVEDATE STRING COMMENT '计划收车日期', RECEIVEDATE STRING COMMENT '收车日期', INSTOCKDATE STRING COMMENT '入库日期', OUTSTOCKDATE STRING COMMENT '出库时间', REQSHIPPINGDATE STRING COMMENT '要求发运日期', SCHSHIPPINGDATE STRING COMMENT '计划发运日期', SHIPPINGDATE STRING COMMENT '发运日期', REQARRIVEDATE STRING COMMENT '要求交付日期', SCHARRIVEDATE STRING COMMENT '计划交付日期', ARRIVEDATE STRING COMMENT '交付日期', RFID STRING COMMENT 'rfid标签', SHIPNO STRING, SHIPNUMBER decimal(32,8) , PROJECTID STRING, CARGOID STRING, DEALERADD STRING, SOURCE_CODE STRING COMMENT '源系统标识', INTEGRATION_ID STRING COMMENT '记录唯一标识', AUX1_CHANGED_ON_DT STRING COMMENT '原系统记录创建时间', W_INSERT_DT STRING COMMENT '数据仓库插入时间', W_UPDATE_DT STRING COMMENT '数据仓库修改时间' ) COMMENT '仓库出入库记录' PARTITIONED BY(PART_SC STRING COMMENT '数据来源',PART_DT STRING COMMENT '分区时间') ROW FORMAT DELIMITED FIELDS TERMINATED BY '\036' STORED AS PARQUET;
true
74c9c6ef024726a92faddc57781c7934cc135994
SQL
VizualAbstract/NostalgiaEQ-Database
/character_expedition_lockouts.sql
UTF-8
1,765
2.96875
3
[]
no_license
-- -------------------------------------------------------- -- Host: 127.0.0.1 -- Server version: 10.0.21-MariaDB - mariadb.org binary distribution -- Server OS: Win64 -- HeidiSQL Version: 11.3.0.6295 -- -------------------------------------------------------- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET NAMES utf8 */; /*!50503 SET NAMES utf8mb4 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- Dumping structure for table peq.character_expedition_lockouts CREATE TABLE IF NOT EXISTS `character_expedition_lockouts` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `character_id` int(10) unsigned NOT NULL, `expedition_name` varchar(128) NOT NULL, `event_name` varchar(256) NOT NULL, `expire_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `duration` int(10) unsigned NOT NULL DEFAULT '0', `from_expedition_uuid` varchar(36) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `character_id_expedition_name_event_name` (`character_id`,`expedition_name`,`event_name`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- Dumping data for table peq.character_expedition_lockouts: ~0 rows (approximately) /*!40000 ALTER TABLE `character_expedition_lockouts` DISABLE KEYS */; /*!40000 ALTER TABLE `character_expedition_lockouts` ENABLE KEYS */; /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; /*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
true
79b08b8d33412fd002d4371b520d1e3817861e44
SQL
pm11prince/App-Repo
/V1__change.sql
UTF-8
610
3.046875
3
[]
no_license
-- ----------------------------------------------------- -- Create 2 tables people and states -- ----------------------------------------------------- create table people ( person_id int not null auto_increment primary key, first_name varchar(20), last_name varchar(20), phone_number varchar(20), address_line_1 varchar(20), address_line_2 varchar(100), city varchar(20), state varchar(2), zip_code varchar(5) ); create table states ( state varchar(2) not null primary key, description varchar(20) );
true
bd930b17606641a05358cb49752c341f290df9b8
SQL
silence-do-good/stress-test-Postgres-and-MySQL
/dump/low/day24/select0030.sql
UTF-8
178
2.625
3
[]
no_license
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o WHERE timestamp>'2017-11-23T00:30:00Z' AND timestamp<'2017-11-24T00:30:00Z' AND temperature>=31 AND temperature<=51
true
80c90e8a1e8a90f5ae40dc8b4cf66d062cb41afa
SQL
waroyhz/mhjServer
/MHJServerSharedMySql/database/migration/MHJDatabase-006-pre.sql
UTF-8
929
3.109375
3
[]
no_license
/* This file was generated by ODB, object-relational mapping (ORM) * compiler for C++. */ ALTER TABLE `user_entity` ADD COLUMN `UserTitle` LONGTEXT NULL; CREATE TABLE `MHJDeviceChild` ( `id` BIGINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, `device` BIGINT UNSIGNED NOT NULL, `keyID` BIGINT UNSIGNED NOT NULL, `Name` TEXT NOT NULL, `user` INT(11) NOT NULL, `KyeDefine` INT UNSIGNED NULL) ENGINE=InnoDB; CREATE INDEX `device_i` ON `MHJDeviceChild` (`device`); CREATE INDEX `keyID_i` ON `MHJDeviceChild` (`keyID`); CREATE INDEX `user_i` ON `MHJDeviceChild` (`user`); /* ALTER TABLE `MHJDeviceChild` ADD CONSTRAINT `MHJDeviceChild_device_fk` FOREIGN KEY (`device`) REFERENCES `MHJDeviceBase` (`id`), ADD CONSTRAINT `MHJDeviceChild_user_fk` FOREIGN KEY (`user`) REFERENCES `user_entity` (`id`) */ UPDATE `schema_version` SET `version` = 6, `migration` = 1 WHERE `name` = '';
true
566feb169e3c1aa7fceb35028274327455d184e4
SQL
xapegr/ajax-4.1
/Company.sql
UTF-8
3,905
3.0625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.6.4deb1 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Apr 21, 2017 at 09:12 AM -- Server version: 5.7.17-0ubuntu0.16.10.1 -- PHP Version: 7.0.15-0ubuntu0.16.10.4 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; -- -- Database: `company` -- drop database company; create database company; use company; CREATE USER 'dax'@'localhost' IDENTIFIED BY 'dax'; GRANT ALL PRIVILEGES ON * . * TO 'dax'@'localhost'; -- -------------------------------------------------------- -- -- Table structure for table `EmpApp` -- CREATE TABLE `EmpApp` ( `id` int(11) NOT NULL, `idUser` int(11) NOT NULL, `position` varchar(30) NOT NULL, `startDate` date NOT NULL, `web` varchar(200) NOT NULL, `salary` int(7) NOT NULL, `hobbies` varchar(150) NOT NULL, `relocate` tinyint(1) NOT NULL, `reasons` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `review` -- CREATE TABLE `review` ( `id` int(11) NOT NULL, `idUser` int(11) NOT NULL, `rate` int(2) NOT NULL, `opinion` varchar(150) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `review` -- INSERT INTO `review` (`id`, `idUser`, `rate`, `opinion`) VALUES (1, 1, 5, 'desc1'), (2, 2, 4, 'desc2'), (3, 1, 3, 'desc3'), (4, 3, 2, 'desc4'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) NOT NULL, `name` varchar(150) NOT NULL, `surname1` varchar(150) NOT NULL, `nick` varchar(150) NOT NULL, `password` varchar(150) NOT NULL, `rol` varchar(40) NOT NULL, `address` varchar(150) NOT NULL, `telephone` int(11) DEFAULT NULL, `mail` varchar(150) NOT NULL, `birthDate` varchar(150) NOT NULL, `entryDate` varchar(150) NOT NULL, `dropOutDate` varchar(150) NOT NULL, `active` tinyint(1) NOT NULL, `image` varchar(150) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `name`, `surname1`, `nick`, `password`, `rol`, `address`, `telephone`, `mail`, `birthDate`, `entryDate`, `dropOutDate`, `active`, `image`) VALUES (1, 'Jhon', 'Peterson', 'user1', '123456', 'user', 'Address1', 933333333, 'r1@r.com', '1975-01-01', '2014-01-01', '0000-00-00', 1, 'images/usersImages/user1.jpeg'), (2, 'Jhon1', 'Peterson1', 'user2', '123456', 'admin', 'Address2', 933333333, 'r2@r.com', '1975-01-01', '2014-01-01', '0000-00-00', 1, 'images/usersImages/user2.jpeg'), (3, 'Jhon2', 'Peterson2', 'user3', '123456', 'user', 'Address3', 933333333, 'r3@r.com', '1975-01-01', '2014-01-01', '0000-00-00', 1, 'images/usersImages/user3.jpeg'); (4, 'pedro', 'pedrp', 'admin', '123456', 'admin', 'Address3', 933333333, 'r3@r.com', '1975-01-01', '2014-01-01', '0000-00-00', 0, 'images/usersImages/user3.jpeg'); -- -- Indexes for dumped tables -- -- -- Indexes for table `EmpApp` -- ALTER TABLE `EmpApp` ADD PRIMARY KEY (`id`), ADD KEY `idUser` (`idUser`); -- -- Indexes for table `review` -- ALTER TABLE `review` ADD PRIMARY KEY (`id`), ADD KEY `idUser` (`idUser`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `EmpApp` -- ALTER TABLE `EmpApp` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `review` -- ALTER TABLE `review` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- Constraints for dumped tables -- -- -- Constraints for table `EmpApp` -- ALTER TABLE `EmpApp` ADD CONSTRAINT `FK_idUser` FOREIGN KEY (`idUser`) REFERENCES `users` (`id`) ON DELETE CASCADE;
true
b77dac318a5326f004636e3176c7e66a5aa775f5
SQL
Sligowebworks/ferret
/SQL/QUERY_hispanic_survey_keys.sql
UTF-8
497
3.65625
4
[]
no_license
SELECT g.ID, Q2_text, Q1_radio, Q1_Other , flagged.flag as `Spanish Lang. Interview` FROM guardian_concatenated g LEFT JOIN (SELECT ID, 1 as flag FROM guardian_concatenated WHERE ID IN (235, 279, 280, 282, 283, 286, 287, 288, 289, 290) ) flagged on g.ID = flagged.ID WHERE Q1_radio = 'HISPANIC AMERICAN' OR ( Q1_radio = 'OTHER' AND Q1_OTHER NOT LIKE '%Africa%' AND Q1_OTHER NOT LIKE '%Ethiopia%' AND Q1_OTHER NOT LIKE 'Turk%' ) ORDER BY g.ID DESC --flagged.flag DESC, Q2_text ;
true
2383415f638bd86744ec3578c4b4aa5d3e0a79c4
SQL
ahSOLO/BootcampX
/4_queries/9_cohort_average_assistance_duration.sql
UTF-8
306
3.90625
4
[]
no_license
SELECT AVG(total_duration) as average_total_duration FROM ( SELECT SUM(completed_at - started_at) as total_duration FROM cohorts JOIN students ON cohorts.id = cohort_id JOIN assistance_requests ON students.id = student_id GROUP BY cohorts.name ORDER BY total_duration ) AS total_duration_table;
true
697ee44d4b918132b537aba766696852ec98457e
SQL
GabrielAbdul/holbertonschool-higher_level_programming
/0x0E-SQL_more_queries/15-comedy_only.sql
UTF-8
181
3.53125
4
[]
no_license
-- script SELECT ts.title FROM tv_shows ts LEFT JOIN tv_show_genres tsg ON ts.id=tsg.show_id LEFT JOIN tv_genres tg ON tg.id=tsg.genre_id WHERE name='Comedy' ORDER BY ts.title ASC;
true
bcad6a5a0da72478837ee9a977fea28e4caa1996
SQL
andresfborrero/Sistema_SolicitudesTelefonia
/ArchivosSQL/Paquetes Nivel 1/pkSolicitud.sql
UTF-8
2,968
3.453125
3
[]
no_license
--Paquete tabla SOLICITUD CREATE OR REPLACE PACKAGE pkSolicitud AS PROCEDURE pInsertar(ivId IN NUMBER, ivEstado IN VARCHAR2, ivObservacion IN VARCHAR2, ivFechaInicio IN DATE, ivFechaFin IN DATE, ivProducto_Id IN NUMBER, ivTipoProducto_Id IN NUMBER, ivTipoAnomalia_Id IN NUMBER, ivFuncionario_Cedula IN VARCHAR2, ivTipoSolicitud_Id IN NUMBER, ivCclienteCedula IN VARCHAR2); PROCEDURE pBorrar (ivId IN NUMBER); PROCEDURE pModificar (ivId IN NUMBER, ivEstado IN VARCHAR2, ivObservacion IN VARCHAR2, ivFechaInicio IN DATE, ivFechaFin IN DATE, ivProducto_Id IN NUMBER, ivTipoProducto_Id IN NUMBER, ivTipoAnomalia_Id IN NUMBER, ivFuncionario_Cedula IN VARCHAR2, ivTipoSolicitud_Id IN NUMBER, ivCclienteCedula IN VARCHAR2); FUNCTION fConsultar (ivId IN NUMBER) return SOLICITUD%rowtype; END pkSolicitud; / CREATE OR REPLACE PACKAGE BODY pkSolicitud AS --Procedimiento insertar PROCEDURE pInsertar(ivId IN NUMBER, ivEstado IN VARCHAR2, ivObservacion IN VARCHAR2, ivFechaInicio IN DATE, ivFechaFin IN DATE, ivProducto_Id IN NUMBER, ivTipoProducto_Id IN NUMBER, ivTipoAnomalia_Id IN NUMBER, ivFuncionario_Cedula IN VARCHAR2, ivTipoSolicitud_Id IN NUMBER, ivCclienteCedula IN VARCHAR2) IS BEGIN INSERT INTO SOLICITUD VALUES (ivId, ivEstado, ivObservacion, ivFechaInicio, ivFechaFin, ivProducto_Id, ivTipoProducto_Id, ivTipoAnomalia_Id, ivFuncionario_Cedula, ivTipoSolicitud_Id, ivCclienteCedula); EXCEPTION WHEN OTHERS THEN RAISE_APPLICATION_ERROR(-20000, 'Error al insertar la solicitud'||SQLCODE); END pInsertar; --Procedimiento borrar PROCEDURE pBorrar (ivId IN NUMBER) IS BEGIN DELETE FROM SOLICITUD WHERE ID = ivId; EXCEPTION WHEN OTHERS THEN RAISE_APPLICATION_ERROR(-20000, 'Error al borrar la solicitud'||SQLCODE); END pBorrar; --Procedimiento modificar PROCEDURE pModificar (ivId IN NUMBER, ivEstado IN VARCHAR2, ivObservacion IN VARCHAR2, ivFechaInicio IN DATE, ivFechaFin IN DATE, ivProducto_Id IN NUMBER, ivTipoProducto_Id IN NUMBER, ivTipoAnomalia_Id IN NUMBER, ivFuncionario_Cedula IN VARCHAR2, ivTipoSolicitud_Id IN NUMBER, ivCclienteCedula IN VARCHAR2) IS BEGIN UPDATE SOLICITUD SET ID = ivId, ESTADO = ivEstado, OBSERVACION = ivObservacion, FECHAINICIO = ivFechaInicio, FECHAFIN = ivFechaFin, PRODUCTO_ID = ivProducto_Id, TIPOPRODUCTO_ID = ivTipoProducto_Id, TIPOANOMALIA_ID = ivTipoAnomalia_Id, FUNCIONARIO_CEDULA = ivFuncionario_Cedula, TIPOSOLICITUD_ID = ivTipoSolicitud_Id, CLIENTE_CEDULA = ivCclienteCedula WHERE ID = ivId; EXCEPTION WHEN OTHERS THEN RAISE_APPLICATION_ERROR(-20000, 'Error al modificar la solicitud'||SQLCODE); END pModificar; --Funcion consultar FUNCTION fConsultar (ivId IN NUMBER) return SOLICITUD%rowtype IS tabla SOLICITUD%rowtype; BEGIN SELECT * INTO tabla FROM SOLICITUD WHERE ID = ivId; EXCEPTION WHEN OTHERS THEN RAISE_APPLICATION_ERROR(-20000, 'Error al consultar la solicitud'||SQLCODE); END fConsultar; END pkSolicitud;
true
db2f4247edcbc39d9bb73fa6382ea88ba3f3d595
SQL
WilliamRayJohnson/kanjiStudyTool
/sql/statQueries/SELECT_ALL_KANJI_WITH_ALL_WORDS_AND_READINGS.sql
UTF-8
172
3.53125
4
[ "MIT" ]
permissive
SELECT k.kanji, w.word, w.reading FROM kanji k LEFT JOIN kanji_in_word kiw ON k.id = kiw.kanji_id LEFT JOIN word w ON kiw.word_id = w.id ORDER BY k.id desc;
true
0d3913240d30a26c2f4ff623d9abbcf507948790
SQL
SeaAroundUs/web-database
/view_cmsy.sql
UTF-8
7,771
3.8125
4
[]
no_license
--New views for cmsy --M.Nevado --10.8.2020 --v_biomass_window CREATE OR REPLACE VIEW cmsy.v_biomass_window AS WITH mini(stock_description, year, biomass_window) AS ( SELECT b.stock_description, b.year, min(b.biomass_window) AS bw_lower FROM cmsy.raw_biomass_window b GROUP BY b.stock_description, b.year ), maxi(stock_description, year, biomass_window) AS ( SELECT b.stock_description, b.year, max(b.biomass_window) AS bw_upper FROM cmsy.raw_biomass_window b GROUP BY b.stock_description, b.year ), main(stock_description, year, bw_lower, bw_upper) AS ( SELECT mi.stock_description, mi.year, mi.biomass_window AS bw_lower, mx.biomass_window AS bw_upper FROM mini mi JOIN maxi mx ON mi.stock_description::text = mx.stock_description::text AND mi.year = mx.year ) SELECT s.stock_id, m.stock_description, m.year, m.bw_lower, m.bw_upper FROM main m JOIN cmsy.stock s ON m.stock_description::text = s.stock_description::text WHERE s.is_active = true; --v_catch_input CREATE OR REPLACE VIEW cmsy.v_catch_input AS SELECT t.ref_id, t.stock_name, t.year, t.catch, t.biomass, t.date_ref FROM ( SELECT ci.ref_id, ci.stock_name, ci.year, ci.catch, ci.biomass, ci.date_ref, row_number() OVER (PARTITION BY ci.stock_name, ci.year ORDER BY ci.date_ref DESC) AS r FROM cmsy.raw_catch_id ci) t WHERE t.r = 1; --v_cmsy_ref CREATE OR REPLACE VIEW cmsy.v_cmsy_ref AS SELECT concat(ma.main_area_id, si.taxon_key) AS id, array_accum(ARRAY[r.pdf_file]) AS "values" FROM cmsy.stock si JOIN cmsy.ref_content rc ON si.stock_id::text = rc.stock_id::text JOIN cmsy.reference r ON rc.ref_id = r.ref_id JOIN cmsy.stock_marine_area ma ON si.stock_id::text = ma.stock_id::text WHERE ma.marine_layer_id = 19 AND si.is_active = true GROUP BY ma.main_area_id, si.taxon_key; --v_eez_species_total CREATE OR REPLACE VIEW cmsy.v_eez_species_total AS SELECT vfd.main_area_id AS eez, count(DISTINCT vfd.taxon_key) AS count, sum(vfd.catch_sum) AS sum FROM v_fact_data vfd WHERE vfd.marine_layer_id = 1 AND vfd.taxon_key > 600000 GROUP BY vfd.main_area_id; --v_me_species_total CREATE OR REPLACE VIEW cmsy.v_me_species_total AS SELECT b.eez, b.eez_id, count(DISTINCT b.taxon_key) AS count, sum(b.catch_sum) AS sum FROM cmsy.b_bmsy_averages b GROUP BY b.eez, b.eez_id; --v_msy CREATE OR REPLACE VIEW cmsy.v_msy AS SELECT msy.cmsy_graph_id::integer AS id, msy.meow AS key, msy.scientific_name AS s_name, msy.common_name AS c_name, array_accum(ARRAY[ARRAY[msy.year::numeric, msy.catch::numeric(20,3), msy.msy::numeric(20,3), msy.lower_msy::numeric(20,3), msy.upper_msy::numeric(20,3), msy.biomass::numeric(20,3), msy.bmsy::numeric(20,3), msy.halfbmsy::numeric(20,3), msy.lower_bmsy::numeric(20,3), msy.upper_bmsy::numeric(20,3), msy.exploitation::numeric(20,3), msy.fmsy::numeric(20,3), msy.lower_fmsy::numeric(20,3), msy.upper_fmsy::numeric(20,3), msy.bw_lower::numeric(20,3), msy.bw_upper::numeric(20,3), msy.b_cpue::numeric(20,3), msy.b_lower_cpue::numeric(20,3), msy.b_upper_cpue::numeric(20,3), msy.f_cpue::numeric(20,3), msy.f_lower_cpue::numeric(20,3), msy.f_upper_cpue::numeric(20,3), msy.uncertainty_score::numeric(20,3)]] ORDER BY msy.year) AS "values" FROM cmsy.mv_output_bmsy msy GROUP BY msy.cmsy_graph_id, msy.meow, msy.scientific_name, msy.common_name ORDER BY msy.common_name, msy.scientific_name; --v_stock_id_reference CREATE OR REPLACE VIEW cmsy.v_stock_id_reference AS WITH base(stock_name, scientific_name, marine_layer_id, main_area_id, meow_id) AS ( SELECT s.stock_name, o_1.sciname, s.marine_layer_id, s.main_area_id, s.meow_id FROM cmsy.stock_marine_area s JOIN cmsy.raw_outputfile o_1 ON s.stock_name::text = o_1.stock::text ), stock_name(stock_name, taxon_key, scientific_name, common_name, marine_layer_id, main_area_id, meow_id) AS ( SELECT DISTINCT b.stock_name, c.taxon_key, c.scientific_name, c.common_name, b.marine_layer_id, b.main_area_id, b.meow_id FROM base b JOIN cube_dim_taxon c ON c.scientific_name::text = b.scientific_name::text ), main(stock_name, stock_id_area, taxon_kay, scientific_name, common_name) AS ( SELECT DISTINCT s.stock_name, concat(s.taxon_key, '_', s.marine_layer_id, '_', s.main_area_id) AS stock_id_area, s.taxon_key, s.scientific_name, s.common_name FROM stock_name s ) SELECT DISTINCT m.stock_name, concat(m.common_name, ' in ', o.subregion) AS stock_description, m.stock_id_area, m.taxon_kay, m.scientific_name FROM main m JOIN cmsy.raw_outputfile o ON m.stock_name::text = o.stock::text; --v_stock_inuput CREATE OR REPLACE VIEW cmsy.v_stock_input AS SELECT t.region, t.subregion, t.stock_name, t."group", t.stock_description, t.englishname, t.scientific_name, t.resilience_source, t.r_source, t.cpue_source, t.biomass_window_source, t.stock_resource, t.minofyear, t.maxofyear, t.startyear, t.endyear, t.resilience, t.r_low, t.r_hi, t.stb_low, t.stb_hi, t.int_yr, t.intb_low, t.intb_hi, t.endb_low, t.endb_hi, t.q_start, t.q_end, t.btype, t.e_creep, t.force_cmsy, t.comment, t.notes, t.date_ref FROM ( SELECT si.region, si.subregion, si.stock_name, si."group", si.stock_description, si.englishname, si.scientific_name, si.resilience_source, si.r_source, si.cpue_source, si.biomass_window_source, si.stock_resource, si.minofyear, si.maxofyear, si.startyear, si.endyear, si.resilience, si.r_low, si.r_hi, si.stb_low, si.stb_hi, si.int_yr, si.intb_low, si.intb_hi, si.endb_low, si.endb_hi, si.q_start, si.q_end, si.btype, si.e_creep, si.force_cmsy, si.comment, si.notes, si.date_ref, row_number() OVER (PARTITION BY si.subregion, si.stock_name, si."group", si.stock_description, si.scientific_name ORDER BY si.date_ref DESC) AS r FROM cmsy.raw_stock_id si) t WHERE t.r = 1; --v_stock_meow_reference CREATE OR REPLACE VIEW cmsy.v_stock_meow_reference AS SELECT smr.meow_id, json_agg(json_build_object('meow_id', smr.meow_id, 'meow', me.name, 'taxon_key', st.taxon_key, 'scientific_name', cdt.scientific_name, 'stock', st.stock_name, 'url', smr.pdf_url, 'common_name', cdt.common_name, 'group_type', smr.group_type, 'graph_url', smr.graph_url)) AS pdf FROM cmsy.stock_meow_reference smr JOIN meow me ON me.meow_id = smr.meow_id JOIN cmsy.stock st ON smr.stock_id::text = st.stock_id::text JOIN cube_dim_taxon cdt ON st.taxon_key = cdt.taxon_key GROUP BY smr.meow_id ORDER BY smr.meow_id; --v_stock_strad CREATE OR REPLACE VIEW cmsy.v_stock_strad AS SELECT s.stock_id, s.stock_description, s.stock_num, s.taxon_key, s.is_stradling, s.is_active, s.date_modified FROM cmsy.stock s WHERE s.is_stradling = true;
true
d0125d75027df6ffd99a3b70511b2c0b68b4aafb
SQL
Syed47/sql-labs
/lab3.sql
UTF-8
1,203
3.21875
3
[]
no_license
SELECT COUNT(*) FROM public.cs130lab3 WHERE custname SIMILAR TO '% M______'; SELECT COUNT(booktitle) FROM public.cs130lab3 WHERE bookpages % 2 = 0 AND bookpages >= 100 AND bookpages <= 200; SELECT COUNT(bookisbn) FROM public.cs130lab3 WHERE bookisbn SIMILAR TO '(0|7)%' AND bookisbn SIMILAR TO '%-(0|7)'; SELECT COUNT(booktitle) FROM public.cs130lab3 WHERE booktitle ~ '.*\d+.*'; SELECT COUNT(booktitle) FROM public.cs130lab3 WHERE booktitle LIKE '%Operative web-enabled%'; SELECT COUNT(custiban) FROM public.cs130lab3 WHERE custiban ~ '^(IE|CH|ES)' AND char_length(custiban) >= 26; SELECT COUNT(custiban) FROM public.cs130lab3 WHERE custiban ~ '.*\s\d{3}$'; SELECT COUNT(custiban) FROM public.cs130lab3 WHERE custiban ~ '.*(\s\d{4}){3}.*'; SELECT COUNT(custiban) FROM public.cs130lab3 WHERE custiban ~ '.*(\s\d{4}){6}.*'; SELECT COUNT(*) FROM public.cs130lab3 WHERE custregion ~ '^(IE|UK).*' AND (bookprice * 1.12) > 60.00 AND bookpages >= 100; SELECT booktitle, booktext FROM public.cs130lab3 WHERE booktext ~ '.*CS130\s.*CS130+.*'; SELECT COUNT(*) FROM ( SELECT booktitle, bookpages, LOG(bookpages) AS output FROM public.cs130lab3 ) AS ModifiedTable WHERE output >= 2.2227 AND output <= 2.285555;
true
32226a74e8d38f80e4bbb653ea1e141058642ca0
SQL
CUBRID/cubrid-testcases
/sql/_19_apricot/_04_multi-table_update/cases/virtual_class_02.sql
UTF-8
1,343
3.328125
3
[ "BSD-3-Clause" ]
permissive
set system parameters 'create_table_reuseoid=no'; --CLIENT create table t1(i int); insert into t1 values (1), (2), (3), (4), (5); create table t2(i int); insert into t2 values (1), (2), (3), (4), (5); create table t3(i int, j int); insert into t3 values (1, 1), (2, 2), (3, 3), (4, 4), (5, 5); create view v1 as select * from t1 where i >= 3; create view v2 as select * from t2 where i <= 5 with check option; create view v3 as select * from t3 where i mod 2 = 0 with check option; update v1 inner join v2 on v1.i=v2.i set v1.i=v1.i + 1, v2.i=v2.i - 1; select * from t1 order by 1; select * from t2 order by 1; select * from t3 order by 1; select * from v1 order by 1; select * from v2 order by 1; update v1 inner join v2 on v1.i=v2.i set v1.i=v1.i + 1, v2.i=v2.i + 2; select * from t1 order by 1; select * from t2 order by 1; select * from t3 order by 1; select * from v1 order by 1; select * from v2 order by 1; update v1 inner join v2 on v1.i=v2.i inner join v3 on v2.i=v3.i set v3.i=v2.i, v1.i=v1.i + 1, v2.i=v2.i + 2; select * from t1 order by 1; select * from t2 order by 1; select * from t3 order by 1; select * from v1 order by 1; select * from v2 order by 1; select * from v3 order by 1; drop view v1; drop view v2; drop view v3; drop table t1; drop table t2; drop table t3; set system parameters 'create_table_reuseoid=yes';
true
b0075bd37d8e6d94b4b893dd2336e3306e8d4338
SQL
yurgenMU/InformationalSystem
/src/main/resources/init.sql
UTF-8
2,385
3.625
4
[]
no_license
CREATE DATABASE IF NOT EXISTS MOBILEOPERATOR DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; USE MOBILEOPERATOR; CREATE TABLE IF NOT EXISTS Tariffs ( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(100) NOT NULL UNIQUE, price INT NOT NULL, PRIMARY KEY (Id) ) ENGINE = InnoDB; CREATE TABLE IF NOT EXISTS Options ( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(100) NOT NULL UNIQUE, price INT NOT NULL, connection_cost INT NOT NULL, PRIMARY KEY (id) ) ENGINE = InnoDB; CREATE TABLE IF NOT EXISTS Tariffs_Options( tariff_id int NOT NULL, option_id int NOT NULL, FOREIGN KEY (tariff_id) REFERENCES Tariffs (Id), FOREIGN KEY (option_id) REFERENCES Options (Id) ) ENGINE = InnoDB; CREATE TABLE IF NOT EXISTS Clients( id INT NOT NULL AUTO_INCREMENT, first_name VARCHAR(100) NOT NULL, last_name VARCHAR(100) NOT NULL, birth DATE NOT NULL, passport_data VARCHAR(1000) NOT NULL, address VARCHAR(200) NOT NULL, email VARCHAR(100) NOT NULL UNIQUE, role VARCHAR(20) NOT NULL, password VARCHAR(100) NOT NULL, PRIMARY KEY (id) ) ENGINE = InnoDB; CREATE TABLE IF NOT EXISTS Contracts( id INT NOT NULL AUTO_INCREMENT, number VARCHAR(100) NOT NULL UNIQUE, tariff_id INT NOT NULL, client_id INT NOT NULL, is_active BOOLEAN NOT NULL, blocked_by INT, PRIMARY KEY (id), FOREIGN KEY (client_id) REFERENCES Clients(id), FOREIGN KEY (tariff_id) REFERENCES Tariffs(id), FOREIGN KEY (blocked_by) REFERENCES Clients(id) ) ENGINE = InnoDB; CREATE TABLE IF NOT EXISTS Contract_Option( contract_id INT NOT NULL, option_id INT NOT NULL, FOREIGN KEY (contract_id) REFERENCES Contracts (Id), FOREIGN KEY (option_id) REFERENCES Options (Id) ) ENGINE = InnoDB; CREATE TABLE IF NOT EXISTS Options_Compatibility( first_option_id INT NOT NULL, second_option_id INT NOT NULL, FOREIGN KEY (first_option_id) REFERENCES Options (Id), FOREIGN KEY (second_option_id) REFERENCES Options (Id) ) ENGINE = InnoDB; INSERT INTO Clients VALUES (0, 'admin', 'admin', '1966.12.11','passport data','home address', 'administrator', 'ROLE_ADMIN', '$2a$11$pcMQeOxvn7Scj3lt00B84.CYRvnxpVSL/JpvPdG9jKLJIFmsNARDO'); INSERT into Options VALUES (1,'first option',300,100); insert into tariffs VALUES (1, 'first tariff', 123); INSERT INTO Contracts VALUES (1, '911', 1, 1,0,null);
true
308959858471f216140f3cfcc797f1947ff7a3fa
SQL
kingsoff/mvc_crud
/crud.sql
UTF-8
1,646
2.984375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.9.0.1 -- https://www.phpmyadmin.net/ -- -- Хост: 127.0.0.1:3306 -- Время создания: Окт 18 2019 г., 19:14 -- Версия сервера: 5.6.43 -- Версия PHP: 7.0.33 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- База данных: `crud` -- -- -------------------------------------------------------- -- -- Структура таблицы `record` -- CREATE TABLE `record` ( `id` int(11) NOT NULL, `birth_year` varchar(33) NOT NULL, `nationality` varchar(32) NOT NULL, `name` varchar(32) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Дамп данных таблицы `record` -- INSERT INTO `record` (`id`, `birth_year`, `nationality`, `name`) VALUES (16, '4996xxx', 'xx', 'Name'); -- -- Индексы сохранённых таблиц -- -- -- Индексы таблицы `record` -- ALTER TABLE `record` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT для сохранённых таблиц -- -- -- AUTO_INCREMENT для таблицы `record` -- ALTER TABLE `record` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
b67a143beff4b6973292bbd219d03e11e1eba0e6
SQL
samdlcong/MVC_INSTANCE_CMS
/dbcreate.sql
UTF-8
457
2.96875
3
[]
no_license
create table if not exists news( id int not null auto_increment key, title char(50) not null, author varchar(20) not null, `from` varchar(20) not null, content text not null, dateline int not null default 0 ); create table if not exists user( id int(11) not null auto_increment key, username varchar(50) not null, password varchar(32) not null, email varchar(50), membership varchar(20) not null,default 'user'; regtime int not null default 0);
true
517782d9701313aa5266d01b1f6352e758f49165
SQL
tahmid200/cmpt391V2
/CMPT391Database/CMPT391Database/dbo/Scripts/AssignDeptHead.sql
UTF-8
149
2.875
3
[]
no_license
UPDATE department SET department.dept_head = ( SELECT TOP 1 id FROM instructor WHERE instructor.dept = department.dept_name ORDER BY NEWID());
true
2658d6233e43b273c1263f418f9eea3c69662044
SQL
aspineonxyz/java-leetcode
/src/main/java/com/github/chen0040/leetcode/day01/easy/BigCountries.sql
UTF-8
349
3.4375
3
[ "MIT" ]
permissive
-- A country is big if it has an area of bigger than 3 million square km or a population of more than 25 million. -- Write a SQL solution to output big countries' name, population and area. -- link: https://leetcode.com/problems/big-countries/tabs/description select name, population, area from World where area >= 3000000 or population >= 25000000
true
268b8c5228df1bc70aa4d367adab34bc51ad6ebf
SQL
Maur025/Facial_Recognition_System_c_sharp
/db_reconocimiento.sql
UTF-8
2,728
3.015625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 04-11-2019 a las 00:08:46 -- Versión del servidor: 10.1.39-MariaDB -- Versión de PHP: 7.3.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de datos: `db_reconocimiento` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `buscar` -- CREATE TABLE `buscar` ( `cib` int(9) NOT NULL, `nombreb` varchar(30) NOT NULL, `ubicacionimage` varchar(200) NOT NULL, `apepatb` varchar(15) DEFAULT NULL, `apematb` varchar(15) DEFAULT NULL, `edadb` int(3) DEFAULT NULL, `generob` varchar(1) DEFAULT NULL, `id_us` varchar(8) NOT NULL, `buscado` varchar(2) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Volcado de datos para la tabla `buscar` -- INSERT INTO `buscar` (`cib`, `nombreb`, `ubicacionimage`, `apepatb`, `apematb`, `edadb`, `generob`, `id_us`, `buscado`) VALUES (13693505, 'mauro', '/TrainedFaces/face1.bmp', '', '', 0, '', '1369mau', NULL); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `usuario` -- CREATE TABLE `usuario` ( `id_us` varchar(8) NOT NULL, `nombre_p` varchar(30) NOT NULL, `ap_pat` varchar(15) DEFAULT NULL, `ap_mat` varchar(15) DEFAULT NULL, `nuci` int(9) NOT NULL, `nombre_us` varchar(25) NOT NULL, `pass` varchar(32) NOT NULL, `nivel` int(1) NOT NULL, `cargo` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Volcado de datos para la tabla `usuario` -- INSERT INTO `usuario` (`id_us`, `nombre_p`, `ap_pat`, `ap_mat`, `nuci`, `nombre_us`, `pass`, `nivel`, `cargo`) VALUES ('1369mau', 'Mauro Eduardo', 'Moya', 'Palli', 13693505, 'mauro', '827ccb0eea8a706c4c34a16891f84e7b', 0, 'empleado'); -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `buscar` -- ALTER TABLE `buscar` ADD PRIMARY KEY (`cib`), ADD KEY `id_us` (`id_us`); -- -- Indices de la tabla `usuario` -- ALTER TABLE `usuario` ADD PRIMARY KEY (`id_us`); -- -- Restricciones para tablas volcadas -- -- -- Filtros para la tabla `buscar` -- ALTER TABLE `buscar` ADD CONSTRAINT `buscar_ibfk_1` FOREIGN KEY (`id_us`) REFERENCES `usuario` (`id_us`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
502bf3047216f7eb0b09dc51cd33208c6284520b
SQL
hyunsooDii/TIL_Source
/mariadb/chapter07_exam.sql
UTF-8
249
3.9375
4
[]
no_license
USE employees; SELECT U.first_name, DP.dept_name, D.from_date, D.to_date FROM employees U INNER JOIN dept_emp D ON U.emp_no = D.emp_no INNER JOIN departments DP ON DP.dept_no = D.dept_no WHERE D.to_date = '9999-01-01' ORDER BY U.first_name
true
571240c6e91af3c2fabcf01289b8f5dd580a5ce1
SQL
gaurav46/Kylin
/query/src/test/resources/query/sql/query71.sql
UTF-8
341
2.90625
3
[ "Apache-2.0" ]
permissive
select lstg_format_name, sum(price) as GMV, count(1) as TRANS_CNT from test_kylin_fact where "TEST_KYLIN_FACT"."LSTG_FORMAT_NAME" in ('Auction', 'ABIN') and (CASE WHEN ("TEST_KYLIN_FACT"."LSTG_FORMAT_NAME" IN ('Auction', 'FP-GTC')) THEN 'Auction' ELSE "TEST_KYLIN_FACT"."LSTG_FORMAT_NAME" END) = 'Auction' group by lstg_format_name
true
38b0c7f1902bf29b0fe9b3ecca3cfa71b13ef955
SQL
jwstyler/nicerdicer
/filmverwaltung/SQL/PlayQuery.sql
UTF-8
548
3.421875
3
[]
no_license
use filmverwaltung; select * from filmtitel order by launchDate; select ft.filmtitel ,date_format(ft.launchDate, '%d.%m.%Y') as launchDate -- ,ft.launchDate ,fs.filmstudio from filmstudio fs join filmtitel ft on ft.idFilmstudio = fs.idFilmstudio where fs.filmstudio like '%%' order by ft.launchDate asc; call getFirstOrLastname('i'); select firstname ,lastname from schauspieler where firstname like '%i%' union all select firstname ,lastname from schauspieler where lastname like '%i%';
true
e4c40d974d06683d9adae6f98d46caf67a7458a7
SQL
fouedbrahim/Hope-and-care-Cancer-association
/gfp (1).sql
UTF-8
5,268
3.328125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 3.5.1 -- http://www.phpmyadmin.net -- -- Client: localhost -- Généré le: Mar 08 Avril 2014 à 16:14 -- Version du serveur: 5.5.24-log -- Version de PHP: 5.3.13 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Base de données: `gfp` -- -- -------------------------------------------------------- -- -- Structure de la table `contactes` -- CREATE TABLE IF NOT EXISTS `contactes` ( `nom` varchar(20) NOT NULL, `prenom` varchar(20) NOT NULL, `email` varchar(30) NOT NULL, `sujet` varchar(30) NOT NULL, `message` longtext NOT NULL, PRIMARY KEY (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Contenu de la table `contactes` -- INSERT INTO `contactes` (`nom`, `prenom`, `email`, `sujet`, `message`) VALUES ('', '', '', '', ''), ('Azouzi', 'Yahya', 'azouziya7ya@hotmail.fr', 'essai', 'messa'); -- -------------------------------------------------------- -- -- Structure de la table `don` -- CREATE TABLE IF NOT EXISTS `don` ( `id_donateur` int(5) NOT NULL AUTO_INCREMENT, `civilite` varchar(10) NOT NULL, `nom` varchar(15) NOT NULL, `prenom` varchar(15) NOT NULL, `email` varchar(30) NOT NULL, `nature_email` varchar(15) NOT NULL, `date_naissance` varchar(10) NOT NULL, `num_tel` varchar(10) NOT NULL, `adresse` text NOT NULL, `pays` varchar(15) NOT NULL, `deja_donateur` varchar(5) NOT NULL, `r_fiscale` varchar(15) NOT NULL, `montant_direct` int(5) NOT NULL, `mode_paiment_direct` varchar(15) NOT NULL, `montant_reg` int(5) NOT NULL, `mode_paiment_reg` varchar(15) NOT NULL, `jour_prelevement` varchar(20) NOT NULL, `periodicite` varchar(15) NOT NULL, PRIMARY KEY (`id_donateur`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=24 ; -- -- Contenu de la table `don` -- INSERT INTO `don` (`id_donateur`, `civilite`, `nom`, `prenom`, `email`, `nature_email`, `date_naissance`, `num_tel`, `adresse`, `pays`, `deja_donateur`, `r_fiscale`, `montant_direct`, `mode_paiment_direct`, `montant_reg`, `mode_paiment_reg`, `jour_prelevement`, `periodicite`) VALUES (19, 'Madame', 'amira ', 'gg', 'fsqf', 'Professionnel', 'ddddd', '7777777777', 'hjjjjjjkjjj', 'TUNISIE', 'oui', 'courrier', 100, 'cheque', 10, 'prélèvement a', 'Le 20 du mois', 'Mensuelle'), (20, 'Mademoisel', 'fffff', 'gfgf', 'fgfgfg', 'Professionnel', '', 'fgfgf', 'fgfg', 'TUNISIE', 'oui', 'email', 50, 'carte 3 fois', 8, 'prélèvement a', '', 'Mensuelle'), (23, 'Madame', 'dfgdf', 'dfgdfg', 'fgdfgdfg@ddd.fff', 'Personnel', 'khkkhkkh', '55555', 'fdfdfd', 'TONGA', 'oui', 'non', 150, 'carte 3 fois', 10, 'carte', 'Le 20 du mois', 'Trimestrielle'); -- -------------------------------------------------------- -- -- Structure de la table `evenement` -- CREATE TABLE IF NOT EXISTS `evenement` ( `id_evenement` int(11) NOT NULL AUTO_INCREMENT, `nom` varchar(100) NOT NULL, `type` varchar(100) NOT NULL, `lieu` varchar(100) NOT NULL, `date` date NOT NULL, `description` varchar(200) NOT NULL, PRIMARY KEY (`id_evenement`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ; -- -- Contenu de la table `evenement` -- INSERT INTO `evenement` (`id_evenement`, `nom`, `type`, `lieu`, `date`, `description`) VALUES (4, 'test3', 'test2', 'test2fqsfqfqfq', '2014-03-02', 'test 2 test 2'), (5, 'test4', 'test4', 'test4', '2014-03-07', 'test4 test 888'), (12, 'test8', 'test8', 'test88888888', '2014-07-08', 'teest'); -- -------------------------------------------------------- -- -- Structure de la table `panier` -- CREATE TABLE IF NOT EXISTS `panier` ( `id` tinyint(4) NOT NULL AUTO_INCREMENT, `nom_produit` varchar(12) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `utilisateur` -- CREATE TABLE IF NOT EXISTS `utilisateur` ( `nom` varchar(30) NOT NULL, `prenom` varchar(30) NOT NULL, `sexe` varchar(5) NOT NULL, `daten` varchar(10) NOT NULL, `adresse` varchar(30) NOT NULL, `tel` varchar(12) NOT NULL, `email` varchar(35) NOT NULL, `pass` varchar(16) NOT NULL, `photo` varchar(10) NOT NULL, `type` varchar(10) NOT NULL, PRIMARY KEY (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Contenu de la table `utilisateur` -- INSERT INTO `utilisateur` (`nom`, `prenom`, `sexe`, `daten`, `adresse`, `tel`, `email`, `pass`, `photo`, `type`) VALUES ('Azouzi', 'Yahya', 'homme', '08/06/1991', 'tunis', '21984501', 'azouziya7ya@hotmail.fr', '123456', 'img.jpg', 'admin'), ('Azouzi', 'Yahya', 'homme', '08/06/1991', 'kairouan', '+21621870804', 'azouziya@hotmail.fr', '123456', 'img.jpg', 'admin'), ('Azouzi', 'Yahya', 'homme', '12/02/1980', 'tunis', '+21621984501', 'yahya.azouzi@esprit.tn', 'azerty', 'NULL', 'volontaire'), ('mahfoudhi', 'amel', 'femme', '08/06/1965', 'tunisfs', '+21621984501', 'yahya_amin@live.com', 'azerty', 'NULL', 'medecin'); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
c485d24019585d9b0770611394c58db0f84ebb1b
SQL
Luckyrk/DBO
/dbo/Views/FullPanellist.sql
UTF-8
795
3.546875
4
[]
no_license
Create View FullPanellist As SELECT c.CountryISO2A ,d.PanelCode ,d.Name as PanelName ,d.Type ,e.Sequence as GroupId ,f.IndividualId ,b.Code as IncentiveCode ,b.Description as IncentiveDescription ,g.Code as StateCode ,h.Code as StockCode ,h.Name as KitName FROM [Panelist] a Join IncentiveLevel b on b.GUIDReference = a.IncentiveLevel_Id Join Country c on c.CountryId = a.Country_Id Join Panel d on d.GUIDReference = a.Panel_Id Left Join Collective e on e.GUIDReference = a.PanelMember_Id Left Join Individual f on f.GUIDReference = a.PanelMember_Id Join StateDefinition g on g.Id = a.State_Id Left join StockKit h on h.GUIDReference = a.ExpectedKit_Id
true
66b12c0893001d06963a0b0b9b1d91378eaa9a9d
SQL
adwaitasathe/Leetcode
/Database/Medium/1193. Monthly Transactions I.sql
UTF-8
369
3.78125
4
[]
no_license
select format(trans_date , 'yyyy-MM') as month, country, count(*) as trans_count, sum(case when state = 'approved' then 1 else 0 end ) as approved_count, sum(amount) as trans_total_amount, sum(case when state = 'approved' then amount else 0 end ) as approved_total_amount from transactions group by format(trans_date , 'yyyy-MM') , country
true
166c3bc32857bc080d292b5746a82e0b8b607ef4
SQL
gaufung/Leetcode-solutions
/Algorithm/175.组合两个表.sql
UTF-8
1,435
3.34375
3
[ "MIT" ]
permissive
-- -- @lc app=leetcode.cn id=175 lang=mysql -- -- [175] 组合两个表 -- -- https://leetcode-cn.com/problems/combine-two-tables/description/ -- -- database -- Easy (68.41%) -- Likes: 370 -- Dislikes: 0 -- Total Accepted: 45.2K -- Total Submissions: 66K -- Testcase Example: '{"headers": {"Person": ["PersonId", "LastName", "FirstName"], "Address": ["AddressId", "PersonId", "City", "State"]}, "rows": {"Person": [[1, "Wang", "Allen"]], "Address": [[1, 2, "New York City", "New York"]]}}' -- -- 表1: Person -- -- +-------------+---------+ -- | 列名 | 类型 | -- +-------------+---------+ -- | PersonId | int | -- | FirstName | varchar | -- | LastName | varchar | -- +-------------+---------+ -- PersonId 是上表主键 -- -- -- 表2: Address -- -- +-------------+---------+ -- | 列名 | 类型 | -- +-------------+---------+ -- | AddressId | int | -- | PersonId | int | -- | City | varchar | -- | State | varchar | -- +-------------+---------+ -- AddressId 是上表主键 -- -- -- -- -- 编写一个 SQL 查询,满足条件:无论 person 是否有地址信息,都需要基于上述两表提供 person 的以下信息: -- -- -- -- FirstName, LastName, City, State -- -- -- # Write your MySQL query statement below select FirstName, LastName, City, State from Person left join Address on Person.PersonId = Address.PersonId
true
f3bacf5a180b17b251dacb2444cb50bed833faf9
SQL
tkreienbuehl/Forrest_Game
/DatabaseScript.sql
UTF-8
3,535
3.359375
3
[]
no_license
-- MySQL Script generated by MySQL Workbench -- Thu Aug 17 14:32:35 2017 -- Model: New Model Version: 1.0 -- MySQL Workbench Forward Engineering SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; -- ----------------------------------------------------- -- Schema forestGameDb -- ----------------------------------------------------- DROP SCHEMA IF EXISTS `forestGameDb` ; -- ----------------------------------------------------- -- Schema forestGameDb -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `forestGameDb` DEFAULT CHARACTER SET utf8 ; USE `forestGameDb` ; -- ----------------------------------------------------- -- Table `forestGameDb`.`FACTION` -- ----------------------------------------------------- DROP TABLE IF EXISTS `forestGameDb`.`FACTION` ; CREATE TABLE IF NOT EXISTS `forestGameDb`.`FACTION` ( `FACTION_ID` INT NOT NULL AUTO_INCREMENT, `DESCRIPTION` VARCHAR(45) NOT NULL, `PICTURE_FILE` VARCHAR(45) NOT NULL, PRIMARY KEY (`FACTION_ID`), UNIQUE INDEX `DESCRIPTION_UNIQUE` (`DESCRIPTION` ASC), UNIQUE INDEX `PICTURE_FILE_UNIQUE` (`PICTURE_FILE` ASC)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `forestGameDb`.`DECISION` -- ----------------------------------------------------- DROP TABLE IF EXISTS `forestGameDb`.`DECISION` ; CREATE TABLE IF NOT EXISTS `forestGameDb`.`DECISION` ( `DECISION_ID` INT NOT NULL AUTO_INCREMENT, `TEXT` VARCHAR(265) NOT NULL, `fk_FACTION_ID` INT NOT NULL, PRIMARY KEY (`DECISION_ID`), UNIQUE INDEX `TEXT_UNIQUE` (`TEXT` ASC)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `forestGameDb`.`INFLUENCE_TYPE` -- ----------------------------------------------------- DROP TABLE IF EXISTS `forestGameDb`.`INFLUENCE_TYPE` ; CREATE TABLE IF NOT EXISTS `forestGameDb`.`INFLUENCE_TYPE` ( `INFLUENCE_TYPE_ID` INT NOT NULL AUTO_INCREMENT, `NAME` VARCHAR(45) NOT NULL, PRIMARY KEY (`INFLUENCE_TYPE_ID`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `forestGameDb`.`INFLUENCE` -- ----------------------------------------------------- DROP TABLE IF EXISTS `forestGameDb`.`INFLUENCE` ; CREATE TABLE IF NOT EXISTS `forestGameDb`.`INFLUENCE` ( `INFLUENCE_ID` INT NOT NULL, `VALUE` INT NOT NULL, `fk_INFLUENCE_TYPE` INT NOT NULL, PRIMARY KEY (`INFLUENCE_ID`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `forestGameDb`.`ANSWER` -- ----------------------------------------------------- DROP TABLE IF EXISTS `forestGameDb`.`ANSWER` ; CREATE TABLE IF NOT EXISTS `forestGameDb`.`ANSWER` ( `ANSWER_ID` INT NOT NULL, `ANSWER` VARCHAR(45) NOT NULL, PRIMARY KEY (`ANSWER_ID`), UNIQUE INDEX `ANSWER_UNIQUE` (`ANSWER` ASC)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `forestGameDb`.`CONNECTED_INFLUENCE` -- ----------------------------------------------------- DROP TABLE IF EXISTS `forestGameDb`.`CONNECTED_INFLUENCE` ; CREATE TABLE IF NOT EXISTS `forestGameDb`.`CONNECTED_INFLUENCE` ( `fk_DECISION_ID` INT NOT NULL, `fk_ANSWER_ID` INT NOT NULL, `fk_INFLUENCE_ID` INT NOT NULL, PRIMARY KEY (`fk_DECISION_ID`, `fk_ANSWER_ID`)) ENGINE = InnoDB; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
true
9192e6770802f46b3742d3d9ce358f88e2547b20
SQL
Cristiane-Pereira/Projeto-Ecommerce-React.js
/src/Join/Join.sql
UTF-8
3,509
3.09375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Tempo de geração: 03-Dez-2020 às 16:51 -- Versão do servidor: 8.0.21 -- versão do PHP: 7.3.21 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Banco de dados: `mob` -- -- -------------------------------------------------------- -- -- Estrutura da tabela `tabela_cliente` -- DROP TABLE IF EXISTS `tabela_cliente`; CREATE TABLE IF NOT EXISTS `tabela_cliente` ( `Id_cliente` int NOT NULL, `Nome_cliente` varchar(255) DEFAULT NULL, `Cpf` varchar(11) DEFAULT NULL, `Data_nasc` varchar(10) DEFAULT NULL, PRIMARY KEY (`Id_cliente`) ) ENGINE=MyISAM DEFAULT CHARSET=latin2; -- -- Extraindo dados da tabela `tabela_cliente` -- INSERT INTO `tabela_cliente` (`Id_cliente`, `Nome_cliente`, `Cpf`, `Data_nasc`) VALUES (1, 'Stefany', '112233445', '23072001'), (2, 'Vanessa', '112233446', '25072002'), (3, 'Cristiane', '112233447', '13111990'), (4, 'Gisele', '112233448', '05011997'), (7, 'Flávia', '1122334451', '10051992'), (5, 'Roberto', '112233449', '11101890'), (6, 'Felipe', '112233440', '06021991'), (8, 'Mauricio', '1122334452', '10031987'); -- -------------------------------------------------------- -- -- Estrutura da tabela `tabela_produtos` -- DROP TABLE IF EXISTS `tabela_produtos`; CREATE TABLE IF NOT EXISTS `tabela_produtos` ( `Id_produto` int NOT NULL, `Nome_produto` varchar(30) DEFAULT NULL, `Categoria` varchar(40) DEFAULT NULL, `Preço_produto` varchar(20) DEFAULT NULL, PRIMARY KEY (`Id_produto`) ) ENGINE=MyISAM DEFAULT CHARSET=latin2; -- -- Extraindo dados da tabela `tabela_produtos` -- INSERT INTO `tabela_produtos` (`Id_produto`, `Nome_produto`, `Categoria`, `Preço_produto`) VALUES (555, 'Vestido Manga Longa Floral', 'Vestido', '75.99'), (455, 'Saia Blogueirinha', 'Saia', '86.01'), (655, 'Vestido Rosa com Coraçao', 'Vestido', '120.01'), (755, 'Headphone One Black', 'Acessório', '29.01'), (855, 'Aple Air Pods', 'Acessorio', '112,90'), (355, 'Vestido Mob Inverno', 'Vestido', '112.90'), (255, 'Bolsa de Couro Original', 'Acessório', '156.01'), (155, 'Smartwatch f9 negro', 'Acessório', '756.00'); -- -------------------------------------------------------- -- -- Estrutura da tabela `tabela_vendas` -- DROP TABLE IF EXISTS `tabela_vendas`; CREATE TABLE IF NOT EXISTS `tabela_vendas` ( `Id_venda` int NOT NULL, `Id_cliente` int DEFAULT NULL, `Id_produto` int DEFAULT NULL, `Quantidade` int DEFAULT NULL, `Data_venda` date DEFAULT NULL, PRIMARY KEY (`Id_venda`), KEY `Id_cliente` (`Id_cliente`), KEY `Id_produto` (`Id_produto`) ) ENGINE=MyISAM DEFAULT CHARSET=latin2; -- -- Extraindo dados da tabela `tabela_vendas` -- INSERT INTO `tabela_vendas` (`Id_venda`, `Id_cliente`, `Id_produto`, `Quantidade`, `Data_venda`) VALUES (1, 1, 155, 1, '2020-05-01'), (2, 2, 355, 2, '2020-09-11'), (3, 3, 455, 4, '2020-11-13'), (4, 4, 855, 1, '2020-09-24'), (5, 5, 855, 3, '2020-01-15'), (6, 6, 155, 1, '2020-12-02'), (7, 7, 255, 5, '2020-10-20'), (8, 8, 755, 2, '2020-09-09'); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
56c681397bb38a80f66f49a25e1a602cd79690ec
SQL
ektha4903/oraclesource
/hr.sql
UHC
12,770
4.34375
4
[]
no_license
-- hr ִ ̺ Ȯ select * from tab; --employees ̺ Ȯ select * from employees; --employees ̺ first_name,last_name,j0b_id ȸ select first_name,last_name,job_id from employees; --ȣ 176 LAST_NAME μȣ ȸѴ select last_name,department_id from employees where employee_id=176; -- 12000 ̻Ǵ LAST_NAME ȸѴ. select last_name,salary from employees where salary>=12000; -- 5000 12000 ̿ LAST_NAME ȸѴ. select last_name,salary from employees where salary<5000 or salary>12000; --20, 50 μ ٹϴ LAST_NAME μȣ ĺ ȸ() SELECT LAST_NAME,DEPARTMENT_ID FROM employees WHERE department_id IN (20, 50) ORDER BY LAST_NAME,department_id; --Ŀ̼(COMMISSION) LAST_NAME,SALARY,COMMISSION_PCT ȸ --SALARY,COMMISSION_PCT SELECT LAST_NAME,SALARY,COMMISSION_PCT FROM employees WHERE COMMISSION_PCT>=0 ORDER BY SALARY,COMMISSION_PCT DESC; --SALARY 2500,3500,7000 ƴϸ SA-REP Ȥ ST_CLERK ȸ SELECT * FROM employees WHERE SALARY NOT IN (2500, 3500, 7000) AND JOB_ID IN ('SA-REP', 'ST_CLERK'); --ڰ 2008-02-20 ~ 2008-05-01 ̿ LAST_NAME,EMPLOYEE_ID,HIRE_DATE ȸ --(¥ ʹ ''̿ ־ ó) SELECT LAST_NAME,EMPLOYEE_ID,HIRE_DATE FROM employees WHERE '2008-02-20'<= hire_date AND hire_date<='2008-05-01' ORDER BY hire_date DESC; --2004⵵ LAST_NAME,HIRE_DATE ȸ Ի SELECT LAST_NAME,HIRE_DATE FROM employees WHERE hire_date>='2004-01-01' AND hire_date<'2005-01-01' ORDER BY hire_date; --BETWEEN --20,50 μ ٹϴ LAST_NAME,SALARY ȸ , ޿ 5000~12000 ȸѴ. SELECT LAST_NAME,SALARY FROM EMPLOYEES WHERE DEPARTMENT_ID IN (20,50) AND SALARY BETWEEN 5000 AND 12000; -- 5000~12000 ̿ LAST_NAME,SALARY ȸ SELECT LAST_NAME,SALARY FROM employees WHERE SALARY NOT BETWEEN 5000 AND 12000; --ڰ 2008-02-20 ~ 2008-05-01 ̿ LAST_NAME,EMPLOYEE_ID,HIRE_DATE ȸ --(¥ ʹ ''̿ ־ ó) SELECT LAST_NAME,EMPLOYEE_ID,HIRE_DATE FROM employees WHERE hire_date BETWEEN '2008-02-20' AND '2008-05-01' ORDER BY hire_date DESC; --2004⵵ LAST_NAME,HIRE_DATE ȸ Ի SELECT LAST_NAME,HIRE_DATE FROM employees WHERE hire_date BETWEEN '2004-01-01' AND '2004-12-31' ORDER BY hire_date; --LIKE --2004⵵ LAST_NAME HIRE_DATE ȸϿ Ի SELECT LAST_NAME,HIRE_DATE FROM employees WHERE hire_date LIKE '04%' ORDER BY hire_date; --LAST_NAME u ԵǴ EMPLOYEE_ID,LAST_NAME ȸѴ SELECT EMPLOYEE_ID,LAST_NAME FROM employees WHERE LAST_NAME LIKE '%u%'; --LAST_NAME ° ڰ a LAST_NAME ȸ SELECT LAST_NAME FROM employees WHERE LAST_NAME LIKE '___a%'; --LAST_NAME A Ȥ E ڰ ִ LAST_NAME ȸϿ LAST_NAME SELECT LAST_NAME FROM employees WHERE LAST_NAME LIKE '%a%' OR LAST_NAME LIKE '%e%' ORDER BY LAST_NAME; --LAST_NAME A E ڰ ִ LAST_NAME ȸϿ LAST_NAME SELECT LAST_NAME FROM employees WHERE LAST_NAME LIKE '%a%e' or LAST_NAME LIKE '%e%a%' ORDER BY LAST_NAME DESC; --IS NULL --Ŵ LAST_NAME,JOB_ID ȸ SELECT LAST_NAME,JOB_ID FROM employees WHERE MANAGER_ID IS NULL; --ST_CLERK JOB_ID μID ȸ, μȣ NULL SELECT DISTINCT DEPARTMENT_ID FROM employees WHERE JOB_ID NOT IN('ST_SLERK') AND DEPARTMENT_ID IS NOT NULL; --COMMISSION_PCT NULL ƴ ߿ COMMISSION=SALARY*COMMISSION_PCT Ͽ EMPLOYEE_ID,FIRST_NAME,JOB_ID SELECT EMPLOYEE_ID,FIRST_NAME,JOB_ID,SALARY*COMMISSION_PCT AS COMMISSION FROM employees WHERE COMMISSION_PCT IS NOT NULL; --ڿ Լ --FIRST_NAME Curtis FIRST_NAME,LAST_NAME,PHONE_NUMBER,JOB_ID ȸ ,JOB_ID ҹڷ SELECT FIRST_NAME, LAST_NAME, phone_number, LOWER(JOB_ID) FROM employees WHERE FIRST_NAME='Curtis'; --μ ȣ 60,70,80,90 EMPLOYEE_ID,FIRST_NAME,HIRE_DATE,JOB_ID ȸ --, JOB_ID IT_PROG α׷ӷ ȯؼ SELECT EMPLOYEE_ID,FIRST_NAME,HIRE_DATE,REPLACE(job_id,'IT_PROG','α׷') FROM employees WHERE DEPARTMENT_ID IN (60,70,80,90); --JOB_ID AD_PRES,PU_CLERK EMPLOYEE_ID,FIRST_NAME,LAST_NAME,DEPARTMENT_ID,JOB_ID ȸ,\ --, FIRST_NAME LAST_NAME Ͽ . SELECT employee_id,FIRST_NAME||' '||LAST_NAME,DEPARTMENT_ID,JOB_ID FROM employees WHERE JOB_ID IN ('AD_PRES','PU_CLERK'); --ǽ4 SELECT LAST_NAME,SALARY,DECODE(TRUNC(SALARY/2000,0),0,0.00,1,0.09,2,0.20,3,0.30,4,0.40,5,0.42,6,0.44,0.45) AS TEX_RATE FROM employees WHERE DEPARTMENT_ID=80; --ȸ ִ ּ ȸ SELECT MAX(SALARY)-MIN(SALARY) AS SAL_GAP FROM employees; --Ŵ ٹϴ ȸ SELECT COUNT(DISTINCT MANAGER_ID) AS Ŵ FROM employees; --μ Ͽ, μȣ SELECT DEPARTMENT_ID FROM employees; SELECT DEPARTMENT_ID, COUNT(*) FROM employees GROUP BY DEPARTMENT_ID ORDER BY DEPARTMENT_ID; --μ ޿ ϱ(μȣ, ϰ μȣ ȸ SELECT DEPARTMENT_ID, ROUND(AVG(SALARY)) FROM employees GROUP BY DEPARTMENT_ID ORDER BY DEPARTMENT_ID; -- ȸ SELECT JOB_ID,COUNT(employee_id) FROM employees GROUP BY JOB_ID ORDER BY JOB_ID; --)Ŵ ּ ޴ ȸ, Ŵ /ּ 6000̸ / SELECT MANAGER_ID,MIN(SALARY) FROM employees WHERE MANAGER_ID IS NOT NULL GROUP BY MANAGER_ID HAVING MIN(SALARY)>=6000 ORDER BY MIN(SALARY) DESC; SELECT MANAGER_ID,MIN(SALARY) FROM employees GROUP BY MANAGER_ID HAVING MANAGER_ID IS NOT NULL AND MIN(SALARY)>=6000 ORDER BY MIN(SALARY) DESC; --JOIN ǽ SELECT * FROM locations; SELECT * FROM departments; SELECT * FROM employees; --Q) ڽ Ŵ Ϻ Իڸ ã HIRE_DATE, LAST_NAME, MANAGER_ID EMPLOYEES ̺ SELF JOIN SELECT E1.HIRE_DATE, E1.LAST_NAME, E1.MANAGER_ID FROM employees E1, employees E2 WHERE e1.manager_id = e2.employee_id AND E1.HIRE_DATE<E2.HIRE_DATE; SELECT E1.HIRE_DATE, E1.LAST_NAME, E1.MANAGER_ID FROM employees E1 JOIN employees E2 ON e1.manager_id = e2.employee_id AND E1.HIRE_DATE<E2.HIRE_DATE; --Q) ̸ T ϴ EMPLOYEE_ID, LAST_NAME, DEPARTMENT_ID --(DEPARTMENTS LOCATION_ID LOCATIONS LOCATION_ID CITY ˾Ƴ) SELECT E.EMPLOYEE_ID, E.LAST_NAME, E.DEPARTMENT_ID, l.city FROM employees E, LOCATIONS L, departments D WHERE d.location_id = l.location_id AND E.DEPARTMENT_ID = D.DEPARTMENT_ID AND L.CITY LIKE 'T%'; --Q) ġ ID 1700̰, EMPLOYEE_ID, LAST_NAME, DEPARTMENT_ID, SALARY ȸ DEPARTMENTS ̺ EMPLOYEES SELECT E.EMPLOYEE_ID, E.LAST_NAME, E.DEPARTMENT_ID, E.SALARY FROM employees E, departments D WHERE E.DEPARTMENT_ID = D.DEPARTMENT_ID AND d.location_id=1700; SELECT E.EMPLOYEE_ID, E.LAST_NAME, E.DEPARTMENT_ID, E.SALARY FROM employees E JOIN departments D ON E.DEPARTMENT_ID = D.DEPARTMENT_ID AND d.location_id=1700; --Q) DEPARTMENT_NAME, LOCATION_ID, μ , μ ȸϱ, Ҽ 2ڸ ǥ SELECT DEPARTMENT_NAME, LOCATION_ID, COUNT(*), ROUND(AVG(SALARY),2) FROM employees E, departments D WHERE E.DEPARTMENT_ID = D.DEPARTMENT_ID GROUP BY DEPARTMENT_NAME, LOCATION_ID ORDER BY LOCATION_ID; SELECT DEPARTMENT_NAME, LOCATION_ID, COUNT(*), ROUND(AVG(SALARY),2) FROM employees E JOIN departments D ON E.DEPARTMENT_ID = D.DEPARTMENT_ID GROUP BY DEPARTMENT_NAME, LOCATION_ID ORDER BY LOCATION_ID; --Q) EXECUTIVE μ ٹϴ DEPARTMENT_ID, LAST_NAME, JOB_ID ȸ SELECT E.DEPARTMENT_ID, E.LAST_NAME, E.JOB_ID FROM employees E, departments D WHERE E.DEPARTMENT_ID = D.DEPARTMENT_ID AND D.DEPARTMENT_NAME = 'Executive'; --Q) Ҽ μ ڽź ʰ Ǿ ޴ ϴ DEPARTMENT_ID, FIRST_NAME LAST_NAME ȸ -- FIRST_NAME LAST_NAME ؼ ϳ Ѵ. SELECT E1.DEPARTMENT_ID, E1.FIRST_NAME||' '||E1.LAST_NAME AS NAME FROM employees E1, employees E2 WHERE e1.DEPARTMENT_id = e2.department_id AND e1.salary<e2.salary AND e1.hire_date<e2.hire_date ORDER BY e1.department_id; -- --Q) LAST_NAME u ԵǴ μ ٹϴ LAST_NAME,EMPLOYEE_ID ȸ SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE department_id IN (SELECT DEPARTMENT_ID FROM employees WHERE LAST_NAME LIKE '%u%'); --Q) EXEUTIVE μ ٹϴ DEPARTMENT_ID, LAST_NAME, JOB_ID ȸ SELECT E.DEPARTMENT_ID, LAST_NAME, JOB_ID FROM employees E WHERE (e.department_id,'Executive') IN (SELECT e.department_id,DEPARTMENT_NAME FROM departments); --Q) Ҽ μ LAST_NAME, տ, μȣ, ޿ ȸ, μȣ,޿ -- ζ ó(μȣ, μ տ) SELECT LAST_NAME,AVG_SAL,E1.DEPARTMENT_ID,E1.SALARY FROM EMPLOYEES E1,(SELECT DEPARTMENT_ID, ROUND(AVG(SALARY)) AS AVG_SAL FROM EMPLOYEES GROUP BY DEPARTMENT_ID) E2 WHERE E1.DEPARTMENT_ID = E2.DEPARTMENT_ID AND E1.SALARY<E2.AVG_SAL; --Q) JOB_ID 'SA_MAN' ִ ޴ LAST_NAME,JOB_ID,SALARY ȸ SELECT LAST_NAME,JOB_ID,SALARY FROM employees WHERE SALARY>(SELECT MAX(SALARY) FROM employees WHERE JOB_ID = 'SA_MAN'); --Q) Ŀ̼ ޴ μ LAST_NAME,DEPARTMENT_ID,SALARY ȸ, ߿ ۼ SELECT LAST_NAME,DEPARTMENT_ID,SALARY FROM employees WHERE (DEPARTMENT_ID,SALARY) IN (SELECT DEPARTMENT_ID,SALARY FROM employees WHERE COMMISSION_PCT IS NOT NULL); --Q) LAST_NAME 'Davies' ߿ LAST_NAME,HIRE_DATE ȸ SELECT LAST_NAME,HIRE_DATE FROM employees WHERE hire_date > (SELECT hire_date FROM employees WHERE LAST_NAME = 'Davies'); --Q) LAST_NAME 'King' ų ΰ ִ LAST_NAME,SALARY ȸ SELECT LAST_NAME, SALARY FROM employees WHERE manager_id IN (SELECT employee_id FROM employees WHERE LAST_NAME = 'King'); --Q) LAST_NAME 'Zlotkey' μ ٹϴ EMPLOYEE_ID,HIRE_DATE ȸ SELECT EMPLOYEE_ID, HIRE_DATE FROM employees WHERE DEPARTMENT_ID IN (SELECT department_id FROM employees WHERE LAST_NAME = 'Zlotkey'); --Q) LAST_NAME 'Kochhar' Ŀ̼ LAST_NAME, DEPARTMENT_ID,SALARY,COMMISSION_PCT ȸ --, 'Kochhar' Ѵ. SELECT E.LAST_NAME, E.DEPARTMENT_ID,E.SALARY,E.COMMISSION_PCT FROM employees E WHERE (SALARY,NVL(commission_pct,0)) IN (SELECT SALARY,NVL(commission_pct,0) FROM employees WHERE LAST_NAME = 'Kochhar') AND LAST_NAME!='Kochhar'; --INDEX --1) ̺ : employees ̺ FIRST_NAME,LAST_NAME,HIRE_DATE ؼ INDEXTBL̶ ̸ CREATE TABLE INDEXTBL AS SELECT FIRST_NAME,LAST_NAME,HIRE_DATE FROM employees; SELECT * FROM INDEXTBL WHERE FIRST_NAME='Jack'; --2) ε : CREATE INDEX_ε ON ̺(ε ÷) CREATE INDEX IDX_INDEXTBL_FIRSTNAME ON INDEXTBL(FIRST_NAME); DROP INDEX INDEXTBL;
true
9759d9df17542da5ae6317a8f9dcdf24a5b05b0e
SQL
Rachel-Ba/SQL-LDD-FILM
/ExerciceFilmLDD.sql
UTF-8
1,383
4.0625
4
[]
no_license
CREATE DATABASE IF NOT EXISTS `film` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */; USE `film`; DROP TABLE IF EXISTS `film`; CREATE TABLE `film` ( `ident_film` int(10) DEFAULT NULL, `titre` varchar(10) DEFAULT NULL, `genre1` varchar(10) DEFAULT NULL, `recette` int(10) DEFAULT NULL, `date_sortie` date DEFAULT NULL, `pays` smallint(6) DEFAULT NULL, `nb_entree` int(10) DEFAULT NULL, `date_et_heure_de_saisie` timestamp DEFAULT NULL); CREATE UNIQUE INDEX index_unique ON film(ident_film); CREATE INDEX index_non_unique ON film(genre1,pays); -- -- Exercice 2 -- DROP TABLE IF EXISTS `realisateur`; CREATE TABLE `realisateur`( `num_real` int(10) NOT NULL, CONSTRAINT C1 PRIMARY KEY (`num_real`) ); ALTER TABLE film ADD num_real INTEGER; ALTER TABLE film ADD CONSTRAINT K1 FOREIGN KEY (num_real) REFERENCES realisateur(num_real); ALTER TABLE film MODIFY recette float default 0; ALTER TABLE film MODIFY titre integer NOT NULL; ALTER TABLE film MODIFY pays integer NOT NULL; ALTER TABLE film DROP foreign key K1; -- -- Exercice 3 -- ALTER TABLE film ADD RESUMER VARCHAR(50); DROP VIEW IF EXISTS `film2`; CREATE VIEW film2 AS SELECT ident_film, titre, genre1, recette, resumer FROM film; DROP VIEW film2; -- -- Exercice 4 -- alter table film rename to filmold; CREATE TABLE film LIKE filmold; DROP TABLE film; DROP TABLE filmold;
true
b0a4131eb6e734edf786643456153fbe1221d7a5
SQL
regap4693/PostgresSQL
/Problem 1/Solution.sql
UTF-8
9,432
4.21875
4
[]
no_license
create database rrp; \c rrp \qecho 'Question 1' create database assignment1; \c assignment1 create table Sailor (Sid INTEGER Primary key,Sname varchar(200),Rating integer,Age integer); create table Boat (Bid integer primary key,Bname varchar(200),Color varchar(200)); create table Reserves(Sid integer,Bid integer,Day varchar(200),foreign key(Sid) references Sailor(sid),foreign key(Bid) references Boat(Bid)); select * from sailor; select * from boat; select * from reserves; INSERT INTO sailor VALUES(22, 'Dustin', 7, 45),(29, 'Brutus', 1, 33),(31, 'Lubber', 8, 55),(32, 'Andy', 8, 25),(58, 'Rusty', 10, 35),(64, 'Horatio', 7, 35),(71, 'Zorba', 10, 16),(74, 'Horatio', 9, 35),(85, 'Art', 3, 25),(95, 'Bob', 3, 63); INSERT INTO boat VALUES(101,'Interlake','blue'),(102,'Sunset','red'),(103,'Clipper','green'),(104,'Marine','red'),(105, 'SunShine', 'blue'); INSERT INTO reserves VALUES(22,101,'Monday'),(22,102,'Tuesday'),(22,103,'Wednesday'),(31,102,'Thursday'),(31,103,'Friday'),(31, 104,'Saturday'),(64,101,'Sunday'),(64,102,'Monday'),(74,102,'Saturday'); select * from sailor; select * from boat; select * from reserves; drop table reserves; drop table boat; drop table sailor; \qecho 'Question 2' --not null constraint due to primary key does not allow null values in the column, unique constraint due to primary key does not allow dupplicate values: --table boat created with no primary key constraints create table Boat (Bid integer ,Bname varchar(200),Color varchar(200)); --null values are inserted in Bid column INSERT INTO boat VALUES(101,'Interlake','blue'),(null,'Sunset','red'); --dupplicate values are inserted in Bid column INSERT INTO boat VALUES(101,'Interlake','blue'),(101,'Sunset','red'); drop table boat; --table boat with primary key constraints create table Boat (Bid integer primary key,Bname varchar(200),Color varchar(200)); --the null constraint due to Primary Key does not allow insertion of null values in column Bid: INSERT INTO boat VALUES(101,'Interlake','blue'),(null,'Sunset','red'); --the unique constraint due to Primary Key, does not allow dupplicate values in column Bid: INSERT INTO boat VALUES(101,'Interlake','blue'),(101,'Sunset','red'); drop table boat; --table Sailor with no primary key constraints create table Sailor (Sid INTEGER, Sname varchar(200),Rating integer,Age integer); --null values are inserted in Sid column INSERT INTO sailor VALUES(null, 'Dustin', 7, 45),(29, 'Brutus', 1, 33); --dupplicate values are inserted in Sid column INSERT INTO sailor VALUES(29, 'Dustin', 7, 45),(29, 'Brutus', 1, 33); drop table sailor; --table Sailor with primary key constraints create table Sailor (Sid INTEGER Primary Key,Sname varchar(200),Rating integer,Age integer); --the null constraint due to Primary Key does not allow insertion of null values in column Sid: INSERT INTO sailor VALUES(null, 'Dustin', 7, 45),(29, 'Brutus', 1, 33); --the unique constraint due to Primary Key, does not allow dupplicate values in column Sid: INSERT INTO sailor VALUES(29, 'Dustin', 7, 45),(29, 'Brutus', 1, 33); drop table sailor; --Recreate proper tables create table Sailor (Sid INTEGER Primary key,Sname varchar(200),Rating integer,Age integer); create table Boat (Bid integer primary key,Bname varchar(200),Color varchar(200)); INSERT INTO boat VALUES(101,'Interlake','blue'),(102,'Sunset','red'),(103,'Clipper','green'),(104,'Marine','red'),(105, 'SunShine', 'blue'); INSERT INTO sailor VALUES(22, 'Dustin', 7, 45),(29, 'Brutus', 1, 33),(31, 'Lubber', 8, 55),(32, 'Andy', 8, 25),(58, 'Rusty', 10, 35),(64, 'Horatio', 7, 35),(71, 'Zorba', 10, 16),(74, 'Horatio', 9, 35),(85, 'Art', 3, 25),(95, 'Bob', 3, 63); --foreign key constraint- does not allow insertion of values not present in the parent table,does not allow deletion of primary key values in parent table: --without foreign key constraint on Sid and Bid, the values are inserted in Sid and Bid: create table Reserves(Sid integer,Bid integer,Day varchar(200)); INSERT INTO reserves VALUES(22,101,'Monday'),(2234,3453,'Tuesday'); INSERT INTO reserves VALUES(22,101,'Monday'),(22,102,'Tuesday'); --without foreign key constraint on Sid and Bid, row is deleted from the referenced parent table: delete from boat where bid=101; drop table reserves; drop table boat; create table Boat (Bid integer primary key,Bname varchar(200),Color varchar(200)); INSERT INTO boat VALUES(101,'Interlake','blue'),(102,'Sunset','red'),(103,'Clipper','green'),(104,'Marine','red'),(105, 'SunShine', 'blue'); --table reserves with foreign key constraint create table Reserves(Sid integer,Bid integer,Day varchar(200),foreign key(Sid) references Sailor(sid),foreign key(Bid) references Boat(Bid)); --throws error when inserting values not in parent table INSERT INTO reserves VALUES(22,101,'Monday'),(2234,3453,'Tuesday'); INSERT INTO reserves VALUES(22,101,'Monday'),(22,102,'Tuesday'); --throws error when deleting row from the referenced parent table: delete from boat where bid=101; drop table reserves; --on using cascade however, the deletion from the parent table is allowed: create table Reserves(Sid integer,Bid integer,Day varchar(200),foreign key(Sid) references Sailor(sid),foreign key(Bid) references Boat(Bid) ON DELETE CASCADE); INSERT INTO reserves VALUES(22,101,'Monday'),(22,102,'Tuesday'),(22,103,'Wednesday'),(31,102,'Thursday'),(31,103,'Friday'),(31, 104,'Saturday'),(64,101,'Sunday'),(64,102,'Monday'),(74,102,'Saturday'); delete from boat where bid=105; delete from sailor where sid =22;-- still throws error since cascade is not defined for Sid column drop table reserves; --without foreign key constraint on Bid, values are inserted in Bid but error thrown on Sid which has foreign key defined: create table Reserves(Sid integer,Bid integer,Day varchar(200),foreign key(Sid) references Sailor(sid)); INSERT INTO reserves VALUES(22,101,'Monday'),(22,13402,'Tuesday'); INSERT INTO reserves VALUES(22,101,'Monday'),(2234,102,'Tuesday'); --recreate proper tables drop table reserves; drop table boat; drop table sailor; create table Boat (Bid integer primary key,Bname varchar(200),Color varchar(200)); INSERT INTO boat VALUES(101,'Interlake','blue'),(102,'Sunset','red'),(103,'Clipper','green'),(104,'Marine','red'),(105, 'SunShine', 'blue'); create table Sailor (Sid INTEGER Primary key,Sname varchar(200),Rating integer,Age integer); INSERT INTO sailor VALUES(22, 'Dustin', 7, 45),(29, 'Brutus', 1, 33),(31, 'Lubber', 8, 55),(32, 'Andy', 8, 25),(58, 'Rusty', 10, 35),(64, 'Horatio', 7, 35),(71, 'Zorba', 10, 16),(74, 'Horatio', 9, 35),(85, 'Art', 3, 25),(95, 'Bob', 3, 63); create table Reserves(Sid integer,Bid integer,Day varchar(200),foreign key(Sid) references Sailor(sid),foreign key(Bid) references Boat(Bid)); INSERT INTO reserves VALUES(22,101,'Monday'),(22,102,'Tuesday'),(22,103,'Wednesday'),(31,102,'Thursday'),(31,103,'Friday'),(31, 104,'Saturday'),(64,101,'Sunday'),(64,102,'Monday'),(74,102,'Saturday'); \qecho 'Question 3 (a)' select distinct bname from boat; --distinct not needed since we sid is primary key and is unique in sailor \qecho 'Question 3 (b)' select sid,rating from sailor; \qecho 'Question 3 (c)' select sid,sname,rating from sailor where not (rating>=7 and rating<=9); \qecho 'Question 3 (d)' --We use distinct because a boat can be reserved with multiple sailors select distinct b.bid,b.bname from boat b, reserves r,sailor s where r.bid=b.bid and r.sid=s.sid and b.color='red' and s.rating<9; \qecho 'Question 3 (e)' select distinct b.bid,b.bname from boat b,reserves r1, reserves r2 where b.bid=r1.bid and r1.bid=r2.bid and r1.sid<>r2.sid and r1.day='Monday' and r2.day='Tuesday'; \qecho 'Question 3 (f)' SELECT S.Sid FROM Sailor S WHERE S.Sid NOT IN (SELECT DISTINCT Sid FROM Reserves WHERE Day IN ('Monday', 'Wednesday', 'Thursday')); \qecho 'Question 3 (g)' select distinct b.bid,b.bname from boat b, reserves r1,reserves r2 where b.bid=r1.bid and r1.bid=r2.bid and r1.sid<>r2.sid; \qecho 'Question 3 (h)' select distinct r1.bid,r2.bid from reserves r1,reserves r2 where r1.sid=r2.sid and r1.bid<>r2.bid order by 1; \qecho 'Question 3 (i)' select r.sid,r.bid from reserves r,boat b,sailor s where r.bid=b.bid and r.sid=s.sid and b.color<>'red' and s.rating>7; \qecho 'Question 3 (j)' SELECT R.Sid FROM Boat B, Reserves R WHERE B.Bid = R.Bid AND B.Color = 'red' AND R.Sid NOT IN (SELECT DISTINCT S.Sid FROM Sailor S, Reserves R1, Reserves R2, Boat B1, Boat B2 WHERE S.Sid = R1.Sid AND S.Sid = R2.Sid AND R1.Sid = R2.Sid AND R1.Bid <> R2.Bid AND R1.Bid = B1.Bid AND R2.Bid = B2.Bid AND B1.Color = 'red' AND B2.Color = 'red'); \qecho 'Question 3 (k)' select bid from boat where bid not in (select r1.bid from reserves r1, reserves r2 where r1.bid=r2.bid and r1.sid<>r2.sid); \c postgres; --Drop database created DROP DATABASE assignment1; --Drop database created DROP DATABASE rrp;
true
0a91611d981ce2d193d8f64470778feb05490788
SQL
marcosd94/trabajo
/pases/111/02_create_Vencimientos.sql
UTF-8
620
3.09375
3
[]
no_license
-- Table: remuneracion.vencimientos -- DROP TABLE remuneracion.vencimientos; CREATE TABLE remuneracion.vencimientos ( id_vencimiento bigserial NOT NULL, anho integer, mes integer, vencimiento timestamp without time zone NOT NULL, prorroga timestamp without time zone, activo boolean NOT NULL, usu_alta character varying(50) NOT NULL, fecha_alta timestamp without time zone NOT NULL, usu_mod character varying(50), fecha_mod timestamp without time zone, CONSTRAINT vencimientos_pk PRIMARY KEY (id_vencimiento) ) WITH ( OIDS=FALSE ); ALTER TABLE remuneracion.vencimientos OWNER TO postgres;
true
68cdad696554844a0a96679933f7af47964ea987
SQL
bhumo/StyleTwo
/db/tables.sql
UTF-8
377
3.203125
3
[]
no_license
create table city ( code int primary key generated always as identity (start with 1,increment by 1), name char(50) not null unique ) ; create table student ( roll_number int primary key, name char(50) not null, address varchar(300) not null, city_code int not null, gender char(1) not null, indian boolean not null, date_of_birth date not null ) ;
true
72892b87ba1616aef4932b5c99f6d2078dbd9eae
SQL
cwedwards9/company-management-system
/db/schema.sql
UTF-8
721
3.734375
4
[ "MIT" ]
permissive
DROP DATABASE IF EXISTS company; CREATE DATABASE company; USE company; CREATE TABLE department ( dept_id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(30) ); CREATE TABLE role ( role_id INT AUTO_INCREMENT PRIMARY KEY, title VARCHAR(30), salary DECIMAL(8,2), department_id INT, FOREIGN KEY (department_id) REFERENCES department (dept_id) ON DELETE CASCADE ); CREATE TABLE employee ( employee_id INT AUTO_INCREMENT PRIMARY KEY, first_name VARCHAR(30), last_name VARCHAR(30), role_id INT, manager_id INT DEFAULT NULL, FOREIGN KEY (role_id) REFERENCES role (role_id) ON DELETE CASCADE, FOREIGN KEY (manager_id) REFERENCES employee (employee_id) ON DELETE CASCADE );
true
b2428ef3cd3e64e3513d7cd29292155e751bbe2b
SQL
Level0r0s/JSC-Cross-Compiler
/examples/php/SimpleMySQLiConsole/SimpleMySQLiConsole/Schema/History/create.sql
UTF-8
313
2.53125
3
[]
no_license
create table if not exists History1( /* http://stackoverflow.com/questions/7337882/sqlite-and-integer-types-int-integer-bigint */ id INTEGER PRIMARY KEY AUTOINCREMENT, -- sqlite vs mysql -- http://www.sqlite.org/datatype3.html query text not null, context text not null )
true
3f6e695ca505b7328f5345459472b034d86c9e57
SQL
jimoh9324/M151ToDo
/database/todolist.sql
UTF-8
845
3.59375
4
[]
no_license
CREATE DATABASE IF NOT EXISTS `151todolist`; USE `151todolist`; CREATE TABLE IF NOT EXISTS `users` ( `userid` INT NOT NULL AUTO_INCREMENT, `firstname` VARCHAR(30) NOT NULL, `lastname` VARCHAR(30) NOT NULL, `username` VARCHAR(30) NOT NULL, `password` VARCHAR(255) NOT NULL, `email` VARCHAR(100) NOt NULL, PRIMARY KEY (`userid`) ); CREATE TABLE IF NOT EXISTS `todo` ( `todoid` INT NOT NULL AUTO_INCREMENT, `task` VARCHAR(100) NOT NULL, `userid` INT NOT NULL, `target` DATE NOT NULL, `priority` TINYINT(4) NOT NULL, `status` VARCHAR(50) NOt NULL, PRIMARY KEY (`todoid`), FOREIGN KEY (`userid`) REFERENCES `users`(`userid`) ); CREATE USER IF NOT EXISTS 'todouser'@'localhost' IDENTIFIED BY '4TcKZm8ZDm$WuHcAX?9^x'; GRANT SELECT, INSERT, UPDATE, DELETE ON `151todolist`.* TO 'todouser'@'localhost';
true
563ccac23e1d9abe852d932ac6da0297b39a3de8
SQL
FaithMandela/QuestionThree
/projects/bunson/database/data/update.sql
UTF-8
2,674
3.234375
3
[]
no_license
ALTER TABLE transfer_assignments ADD time_out time; ALTER TABLE transfer_assignments ADD time_in time; ALTER TABLE transfer_assignments ADD closed boolean default false; ALTER TABLE transfer_assignments ADD last_update timestamp default CURRENT_TIMESTAMP; CREATE OR REPLACE VIEW vw_transfer_assignments AS SELECT drivers.driver_id, drivers.driver_name, drivers.mobile_number, cars.car_type_id, cars.registration_number, car_types.car_type_name, car_types.car_type_code, passangers.passanger_id, passangers.passanger_name, passangers.transfer_id, passangers.passanger_mobile,passangers.passanger_email, passangers.pickup_time, passangers.pickup, passangers.dropoff, passangers.other_preference , transfer_assignments.transfer_assignment_id, transfer_assignments.car_id, transfer_assignments.kms_out, transfer_assignments.kms_in, transfer_assignments.time_out, transfer_assignments.time_in, transfer_assignments.closed, transfer_assignments.last_update FROM transfer_assignments INNER JOIN drivers ON transfer_assignments.driver_id = drivers.driver_id INNER JOIN cars ON cars.car_id = transfer_assignments.car_id INNER JOIN car_types ON car_types.car_type_id = cars.car_type_id INNER JOIN passangers ON transfer_assignments.passanger_id = passangers.passanger_id; var kmsout = $('#txtKmsOut').val(); var timeout = $('#txt_time_out').val(); var kmsin = $('#txtKmsIn').val(); var timein = $('#txt_time_in').val(); var submit = false; var ok = true; if(reference == ''){ swal("", "No Reference Selected"); ok = false; return false; } if(kmsout == ''){ swal("", "Enter Kms Out"); ok = false; return false; } if(kmsin == ''){ swal("", "Enter Kms In"); ok = false; return false; } if(ok){ $.post('driverrequest', { tag:'save', reference:reference, kmsout:kmsout, kmsin:kmsin, timeout:timeout, timein:timein, submit:submit} , function(data){ if(data.success == '1'){ swal("Success", data.message); $('#txtRef,#txtKmsOut, #txtKmsIn').val(''); $('#panel').addClass('hidden'); $('#panelHeading,#panelBody').html(''); $('#btnSave').removeAttr('data-ref'); }else{ swal("Error!", data.message); } },"JSON"); }
true
5ee855d0114e837fbac9a0a1a61713edad35810f
SQL
bunuli12138/2019_summer_coding
/MySQL(Phase 8)/Task2/2019summer.sql
UTF-8
5,600
3.140625
3
[]
no_license
-- MySQL dump 10.13 Distrib 8.0.15, for Win64 (x86_64) -- -- Host: localhost Database: 2019summer -- ------------------------------------------------------ -- Server version 8.0.15 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; SET NAMES utf8 ; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `bash` -- DROP TABLE IF EXISTS `bash`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `bash` ( `id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `bash` -- LOCK TABLES `bash` WRITE; /*!40000 ALTER TABLE `bash` DISABLE KEYS */; /*!40000 ALTER TABLE `bash` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `cinema` -- DROP TABLE IF EXISTS `cinema`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `cinema` ( `id` int(11) NOT NULL, `name` varchar(32) DEFAULT NULL, `description` varchar(64) DEFAULT NULL, `rating` double DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `cinema` -- LOCK TABLES `cinema` WRITE; /*!40000 ALTER TABLE `cinema` DISABLE KEYS */; INSERT INTO `cinema` VALUES (1,'War','great 3D',8.9),(2,'Science','fiction',8.5),(3,'irish','boring',6.2),(4,'Ice song','Fantacy',8.6),(5,'House card','Interesting',9.1); /*!40000 ALTER TABLE `cinema` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `courses` -- DROP TABLE IF EXISTS `courses`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `courses` ( `student` varchar(8) NOT NULL, `class` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `courses` -- LOCK TABLES `courses` WRITE; /*!40000 ALTER TABLE `courses` DISABLE KEYS */; INSERT INTO `courses` VALUES ('A','Math'),('B','English'),('C','Math'),('D','Math'),('E','English'),('F','Math'),('G','Math'),('H','English'),('I','Math'),('A','Math'); /*!40000 ALTER TABLE `courses` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `email` -- DROP TABLE IF EXISTS `email`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `email` ( `ID` int(11) NOT NULL, `Email` varchar(255) DEFAULT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `email` -- LOCK TABLES `email` WRITE; /*!40000 ALTER TABLE `email` DISABLE KEYS */; INSERT INTO `email` VALUES (1,'a@b.com'),(2,'c@d.com'),(3,'a@b.com'); /*!40000 ALTER TABLE `email` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `salary` -- DROP TABLE IF EXISTS `salary`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `salary` ( `id` int(11) NOT NULL, `name` varchar(8) DEFAULT NULL, `sex` varchar(8) DEFAULT NULL, `salary` double DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `salary` -- LOCK TABLES `salary` WRITE; /*!40000 ALTER TABLE `salary` DISABLE KEYS */; INSERT INTO `salary` VALUES (1,'A','m',2500),(2,'B','f',1500),(3,'C','m',5500),(4,'D','f',500); /*!40000 ALTER TABLE `salary` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `world` -- DROP TABLE IF EXISTS `world`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `world` ( `name` varchar(50) NOT NULL, `continent` varchar(50) NOT NULL, `area` int(11) NOT NULL, `population` int(11) NOT NULL, `gdp` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `world` -- LOCK TABLES `world` WRITE; /*!40000 ALTER TABLE `world` DISABLE KEYS */; INSERT INTO `world` VALUES ('Afghanistan','Asia',652230,25500100,20343000),('Albania','Europe',28748,2831741,12960000),('Algeria','Africa',2381741,37100000,188681000),('Andorra','Europe',468,78115,3712000),('Angola','Africa',1246700,20609294,100990000); /*!40000 ALTER TABLE `world` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2019-08-11 20:14:39
true
43bf4eda42c9152acca331a2bb7ae2fba71c0801
SQL
KamranJabiyev/P213-07.01.2020
/SQLQuery-07-01-2020.sql
UTF-8
2,030
4.21875
4
[]
no_license
use P213; create table Students( Id int, [Name] nvarchar(100), Surname nvarchar(100) ) drop table Students alter table Students add Email nvarchar(250) alter table Students drop column Email insert into Students values(1,'Memmed','Lazimli','memmedBomba@gmail.com') select * from Students select Name,Surname from Students insert into Students values (2,'Rafiq','Qasimov','rafig@code.az'), (3,'Elgiz','Memmedli','elgiz@code.az') insert into Students (Id,Name) values(4,'Nesib') create table Students( Id int identity, [Name] nvarchar(100) not null, Surname nvarchar(100), Email nvarchar(250) unique ) insert into Students (Name) values('Kamran') select * from Students update Students set Surname='Jabiyev',Email='kamran@code.edu.az' where Id=1 Delete from Students where Name='Kamran' insert into Students values('Memmed','Necefov','Bomba@gmail.com'), ('Elman','Elko','elko@code.az'), ('Zeynal','Zey','zey@code.az') insert into Students values('Rafiq','Qasimov','bomba2@gmail.com') Select Surname 'Lastname' from Students --where Id<10 --where Id<=8 And Id>=4 --where Id=8 OR Id=3 --where Id Between 4 and 8 where Id in(8,3) Select SUBSTRING(Email,0,CHARINDEX('@',Email)) 'Email' from Students Select lower(Name) 'Lower Name',lower(Surname) 'Lower Lastname' from Students alter table Students add Address nvarchar(200) select * from Students select Email from Students where Email Like '%code%' select * from Students where Address is null select distinct Address from Students where Address is not null select Name,Surname from Students where Id in( select Id from Students where Address is null ) drop table Students create table Groups( Id int primary key identity, [Name] nvarchar(50) not null ) create table Student( Id int primary key identity, Firstname nvarchar(100) not null, Surname nvarchar(100), GroupId int references Groups(Id) ) select Firstname,Surname,Groups.Name 'Group' from Student join Groups on Student.GroupId=Groups.Id
true
979394b7a52b145b08908a289c854a4835806262
SQL
jordanengstrom/keepr
/Users.sql
UTF-8
626
3.375
3
[]
no_license
-- CREATE TABLE users ( -- id VARCHAR(255) NOT NULL, -- username VARCHAR(20) NOT NULL, -- email VARCHAR(255) NOT NULL, -- password VARCHAR(255) NOT NULL, -- PRIMARY KEY (id), -- UNIQUE KEY email (email) -- ); -- ADD ITEM TO DB_TABLE -- INSERT INTO users ( -- id, -- username, -- email, -- password -- ) VALUES ( -- "12osfd", -- "testUser1", -- "test@test.com", -- "2200password" -- ); -- -- EDIT RECORD -- UPDATE users SET -- password = "password2200" -- WHERE id = "12osfd"; -- REMOVE RECORD -- DELETE FROM users WHERE id = "13osfd"; -- -- GET FROM DB_TABLE -- SELECT * FROM users;
true
1a2f08c25d264ea23c1c053199c5e5e95e4dc8fe
SQL
freddy36/PostNAS
/import/atkis_rp_rendering/processing/sql/stehendesgewaesser_prep.sql
UTF-8
786
3.125
3
[]
no_license
DROP TABLE IF EXISTS map_stehendesgewaesser_g0; DROP SEQUENCE IF EXISTS map_stehendesgewaesser_g0_gid_seq; -- SELECT wkb_geometry, widmung INTO map_stehendesgewaesser_g0 FROM ( SELECT (ST_Dump( ST_Union( ax_stehendesgewaesser.wkb_geometry ))).geom AS wkb_geometry, unverschluesselt as widmung FROM ax_stehendesgewaesser GROUP BY widmung ) AS wrapper; -- CREATE INDEX map_stehendesgewaesser_g0_gidx ON map_stehendesgewaesser_g0 USING GIST ( wkb_geometry ); CREATE SEQUENCE map_stehendesgewaesser_g0_gid_seq; ALTER TABLE map_stehendesgewaesser_g0 ADD COLUMN gid INTEGER; UPDATE map_stehendesgewaesser_g0 SET gid = nextval('map_stehendesgewaesser_g0_gid_seq'); ALTER TABLE map_stehendesgewaesser_g0 ALTER COLUMN gid SET DEFAULT nextval('map_stehendesgewaesser_g0_gid_seq'); ----
true
dac26062bc8333dce995d58f303bb18481753dd9
SQL
estafette/estafette-ci-api
/pkg/clients/database/queries/migrate_build_logs.sql
UTF-8
685
3.875
4
[ "MIT" ]
permissive
UPSERT INTO build_logs ( id, repo_source, repo_owner, repo_name, repo_branch, repo_revision, inserted_at, build_id, migrated_from ) SELECT (2000000000000000000 + build_logs.id) AS id, builds.repo_source, builds.repo_owner, builds.repo_name, build_logs.repo_branch, build_logs.repo_revision, build_logs.inserted_at, builds.id AS build_id, build_logs.id AS migrated_from FROM build_logs JOIN builds ON build_logs.build_id = builds.migrated_from WHERE build_logs.repo_source = @fromSource AND build_logs.repo_owner = @fromOwner AND build_logs.repo_name = @fromName;
true
8830cc94047df599adb3d26c635349e8fc57b017
SQL
vasavdave/sql-challenge
/EmployeeSQL/DBSchema.sql
UTF-8
1,299
3.828125
4
[]
no_license
CREATE TABLE titles ( title_id VARCHAR NOT NULL, title VARCHAR NOT NULL, PRIMARY KEY (title_id) ); CREATE TABLE employees ( emp_no INT NOT NULL, emp_title_id VARCHAR NOT NULL, birth_date DATE NOT NULL, first_name VARCHAR NOT NULL, last_name VARCHAR NOT NULL, sex VARCHAR NOT NULL, hire_date DATE NOT NULL, FOREIGN KEY (emp_title_id) REFERENCES titles (title_id), PRIMARY KEY (emp_no) ); CREATE TABLE departments ( dept_no VARCHAR NOT NULL, dept_name VARCHAR NOT NULL, PRIMARY KEY (dept_no) ); CREATE TABLE dept_manager ( dept_no VARCHAR NOT NULL, emp_no INT NOT NULL, FOREIGN KEY (dept_no) REFERENCES departments (dept_no), FOREIGN KEY (emp_no) REFERENCES employees (emp_no), PRIMARY KEY (dept_no, emp_no) ); CREATE TABLE dept_emp ( emp_no INT NOT NULL, dept_no VARCHAR NOT NULL, FOREIGN KEY (emp_no) REFERENCES employees (emp_no), FOREIGN KEY (dept_no) REFERENCES departments (dept_no), PRIMARY KEY (emp_no, dept_no) ); CREATE TABLE salaries ( emp_no INT NOT NULL, salary INT NOT NULL, FOREIGN KEY (emp_no) REFERENCES employees (emp_no), PRIMARY KEY (emp_no) );
true
d35b0edbb0d126a93622178aa7e09e3a087ee43f
SQL
nopparat231/t-shirt-shop
/shopping-cart-with-paypal-integration-in-php/db/shopping.sql
UTF-8
2,602
3.25
3
[]
no_license
--------------------------shop_products------------------------------ CREATE TABLE `shop_products` ( `id` int(11) NOT NULL, `product_name` varchar(60) NOT NULL, `product_desc` text NOT NULL, `product_code` varchar(60) NOT NULL, `product_image` varchar(60) NOT NULL, `product_price` int(11) NOT NULL ) ; INSERT INTO `shop_products` (`id`, `product_name`, `product_desc`, `product_code`, `product_image`, `product_price`) VALUES (1, 'Apple iPhone', 'The iPhone 7, with its amazing features and drool-worthy design, looks every bit as efficient as it is. With a powerful processor and ample internal storage, this smartphone offers you a seamless performance.', 'APPM01', 'apple-iphone-7.jpeg', 39999), (2, 'Samsung On5', 'With a leathery feel, the Samsung Galaxy On5 has a classy look with a thin frame that provides you a comfortable steady grip. The quick launch feature in the phone lets you capture moments easily by pushing the home button twice. With a Palm Gesture Selfie feature, a wide viewing angle and the Beauty Shot mode, the camera gives you rewarding selfie experiences.', 'SAMM01', 'samsung-galaxy-on5.jpeg', 7990), (3, 'OPPO F3 Plus', '\r\nFeaturing a 1.95 GHz Qualcomm Snapdragon MSM8976 Pro processor, an Adreno 510 GPU and 4 GB of RAM, the OPPO F3 Plus offers fast and fluid multitasking. It comes with a 4000-mAh battery that won’t call it a day until you do.', 'OPPM01', 'oppo-f3-plus.jpeg', 24595), (4, 'Asus Zenfone', 'Asus Zenfone 3s Max (Gold, 32 GB) (3 GB RAM)', 'AUSM01', 'asus-zenfone-3s-max.jpeg', 8984); ALTER TABLE `shop_products` ADD PRIMARY KEY (`id`); ----------------------------shop_order------------------------------ CREATE TABLE `shop_order` ( `id` int(11) NOT NULL, `member_id` int(11) NOT NULL, `name` varchar(100) NOT NULL, `address` varchar(100) NOT NULL, `mobile` int(11) NOT NULL, `email` varchar(100) NOT NULL, `order_status` varchar(255) NOT NULL, `order_at` datetime NOT NULL, `payment_type` varchar(255) NOT NULL ) ; ----------------------------shop_order_item------------------------------ CREATE TABLE `shop_order_item` ( `id` int(11) NOT NULL, `order_id` int(11) NOT NULL, `product_id` int(11) NOT NULL, `item_price` double NOT NULL, `quantity` int(11) NOT NULL ) ; ----------------------------shop_payment------------------------------ CREATE TABLE `shop_payment` ( `id` int(11) NOT NULL, `order_id` int(11) NOT NULL, `payment_status` varchar(255) NOT NULL, `payment_response` text NOT NULL, `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ;
true
4b3e56800d42c665931f1b8e0a4f8ea62d8a2c84
SQL
codeformeaning/data-analysis-sql
/07.统计每个性别用户等级的分布情况.sql
WINDOWS-1252
132
3.015625
3
[]
no_license
select sex, if (level >5 "", ""), count(distinct user_name) from user_info group by sex, if (level >5 "", "");
true
5e84248b6974f646e667eb7ac2c43f3bf092a579
SQL
komissarex/snaql-migration
/snaql_migration/tests/countries/migrations/001-create-countries.apply.sql
UTF-8
137
2.625
3
[ "MIT" ]
permissive
{% sql 'create_countries' %} CREATE TABLE countries ( id INT NOT NULL, name VARCHAR(100), PRIMARY KEY (id) ) {% endsql %}
true
b047f0af63214f4a6992320a40a44468e012865a
SQL
ivaneyvieira/engAtacado
/src/main/resources/sql/processaPedido.sql
UTF-8
11,330
3.109375
3
[]
no_license
/**************************************************************************** Parametros ****************************************************************************/ DO @LOJA := :storeno; DO @PEDIDO := :ordno; DO @SERIE := 66; DO @TIPO := :tipo; DO @FATOR := IF(@TIPO = 'E', 1, - 1); DO @DOC := IF(@TIPO = 'E', ' AJUS ENT ', ' AJUS SAI '); /**************************************************************************** Dados do pedido ****************************************************************************/ DROP TABLE IF EXISTS T; CREATE TEMPORARY TABLE T SELECT E.storeno, E.ordno, E.prdno, E.grade, qtty, ROUND(IF(I.last_cost = 0, I.cm_varejo_otn, I.last_cost)) / 100 AS cost, V.no AS vendno, C.no AS custno, E.empno, V.sname AS vsname, C.id_sname AS csname FROM sqldados.eoprd AS E INNER JOIN sqldados.eord AS O ON O.ordno = E.ordno AND O.storeno = E.storeno INNER JOIN sqldados.stk AS I ON I.storeno = E.storeno AND I.prdno = E.prdno AND I.grade = E.grade INNER JOIN sqldados.store AS S ON S.no = E.storeno INNER JOIN sqldados.vend AS V ON V.cgc = S.cgc INNER JOIN sqldados.custp AS C ON C.cpf_cgc = S.cgc WHERE E.storeno = @LOJA AND E.ordno = @PEDIDO; /**************************************************************************** Nota de Entrada ****************************************************************************/ UPDATE sqldados.stk INNER JOIN T USING (storeno, prdno, grade) SET longReserva1 = qtty_atacado WHERE longReserva2 <> T.ordno; UPDATE sqldados.stk INNER JOIN T USING (storeno, prdno, grade) SET qtty_atacado = qtty_atacado + @FATOR * T.qtty, last_date = CURRENT_DATE * 1 WHERE longReserva2 <> T.ordno; UPDATE sqldados.stk INNER JOIN T USING (storeno, prdno, grade) SET longReserva2 = T.ordno; DO @INVDEL := (SELECT MAX(invno) FROM sqldados.inv WHERE ordno = @PEDIDO AND storeno = @LOJA AND invse = @SERIE AND c1 = @DOC); DO @INVNO := (SELECT MAX(invno) + 1 FROM sqldados.inv); DO @NFNO := IFNULL((SELECT MAX(NO) + 1 FROM lastno WHERE se = @SERIE AND storeno = @LOJA), 1); INSERT INTO sqldados.inv(invno, vendno, ordno, xfrno, issue_date, DATE, comp_date, ipi, icm, freight, netamt, grossamt, subst_trib, discount, prdamt, despesas, base_ipi, aliq, cfo, nfNfno, auxLong1, auxLong2, auxMoney1, auxMoney2, dataSaida, amtServicos, amtIRRF, amtINSS, amtISS, auxMoney3, auxMoney4, auxMoney5, auxLong3, auxLong4, auxLong5, auxLong6, auxLong7, auxLong8, auxLong9, auxLong10, auxLong11, auxLong12, auxMoney6, auxMoney7, auxMoney8, auxMoney9, auxMoney10, auxMoney11, auxMoney12, auxMoney13, l1, l2, l3, l4, l5, l6, l7, l8, m1, m2, m3, m4, m5, m6, m7, m8, weight, carrno, packages, storeno, indxno, book_bits, TYPE, usernoFirst, usernoLast, nfStoreno, bits, padbyte, auxShort1, auxShort2, auxShort3, auxShort4, auxShort5, auxShort6, auxShort7, auxShort8, auxShort9, auxShort10, auxShort11, auxShort12, auxShort13, auxShort14, bits2, bits3, bits4, bits5, s1, s2, s3, s4, s5, s6, s7, s8, nfname, invse, account, remarks, contaCredito, contaDebito, nfNfse, auxStr1, auxStr2, auxStr3, auxStr4, auxStr5, auxStr6, c1, c2) SELECT @INVNO AS invno, vendno, ordno, 0 AS xfrno, CURRENT_DATE * 1 AS issue_date, CURRENT_DATE * 1 AS DATE, CURRENT_DATE * 1 AS comp_date, 0 AS ipi, 0 AS icm, 0 AS freight, 0 AS netamt, SUM(qtty * cost / 1000) AS grossamt, 0 AS subst_trib, 0 AS discount, SUM(qtty * cost / 1000) AS prdamt, 0 AS despesas, 0 AS base_ipi, 0 AS aliq, 1949 AS cfo, 0 AS nfNfno, 0 /*Valor desconhecido*/ AS auxLong1, 0 AS auxLong2, 0 AS auxMoney1, 0 AS auxMoney2, 0 AS dataSaida, 0 AS amtServicos, 0 AS amtIRRF, 0 AS amtINSS, 0 AS amtISS, 0 AS auxMoney3, 0 AS auxMoney4, 0 AS auxMoney5, 0 AS auxLong3, 0 AS auxLong4, 0 AS auxLong5, 0 AS auxLong6, 0 AS auxLong7, CURRENT_DATE * 1 AS auxLong8, 0 AS auxLong9, 0 AS auxLong10, 0 AS auxLong11, 0 AS auxLong12, 0 AS auxMoney6, 0 AS auxMoney7, 0 AS auxMoney8, 0 AS auxMoney9, 0 AS auxMoney10, 0 AS auxMoney11, 0 AS auxMoney12, 0 AS auxMoney13, 0 AS l1, 0 AS l2, 0 AS l3, 0 AS l4, 0 AS l5, CURRENT_DATE * 1 AS l6, 0 AS l7, 0 AS l8, 0 AS m1, 0 AS m2, 0 AS m3, 0 AS m4, 0 AS m5, 0 AS m6, 0 AS m7, 0 AS m8, 0 AS weight, 0 AS carrno, 0 AS packages, storeno, 0 AS indxno, 9 AS book_bits, 8 AS TYPE, 1 AS usernoFirst, 1 AS usernoLast, 0 AS nfStoreno, 3 AS bits, 0 AS padbyte, storeno AS auxShort1, 0 AS auxShort2, 0 AS auxShort3, 0 AS auxShort4, 0 AS auxShort5, 0 AS auxShort6, 0 AS /*valor desconhecido*/ auxShort7, 0 AS /*valor desconhecido*/ auxShort8, 0 AS auxShort9, 0 AS auxShort10, 0 AS auxShort11, 0 AS auxShort12, 0 AS auxShort13, 0 AS auxShort14, 0 AS bits2, 0 AS bits3, 0 AS bits4, 0 AS bits5, 0 AS s1, 0 AS s2, 0 AS s3, 0 AS s4, 0 AS s5, 0 AS s6, 0 AS s7, 0 AS s8, @NFNO AS nfname, @SERIE AS invse, 2 AS account, CONCAT(T.custno, ' ', T.csname) AS remarks, '' AS contaCredito, '' AS contaDebito, '' AS nfNfse, '' AS auxStr1, '' AS auxStr2, '' AS auxStr3, '' AS auxStr4, '' AS auxStr5, '' AS auxStr6, @DOC AS c1, '' AS c2 FROM T WHERE @TIPO = 'E' GROUP BY storeno, ordno; INSERT INTO sqldados.iprd(invno, qtty, fob, cost, DATE, ipi, auxLong1, auxLong2, frete, seguro, despesas, freteIpi, qttyRessar, baseIcmsSubst, icmsSubst, icms, discount, fob4, cost4, icmsAliq, cfop, auxLong3, auxLong4, auxLong5, auxMy1, auxMy2, auxMy3, baseIcms, baseIpi, ipiAmt, reducaoBaseIcms, lucroTributado, l1, l2, l3, l4, l5, l6, l7, l8, m1, m2, m3, m4, m5, m6, m7, m8, storeno, bits, auxShort1, auxShort2, taxtype, auxShort3, auxShort4, auxShort5, seqno, bits2, bits3, bits4, s1, s2, s3, s4, s5, s6, s7, s8, prdno, grade, auxChar, auxChar2, cstIcms, cstIpi, c1) SELECT @INVNO AS invno, qtty, cost AS fob, cost, CURRENT_DATE * 1 AS DATE, 0 AS ipi, 0 AS auxLong1, 0 AS auxLong2, 0 AS frete, 0 AS seguro, 0 AS despesas, 0 AS freteIpi, 0 AS qttyRessar, 0 AS baseIcmsSubst, 0 AS icmsSubst, 0 AS icms, 0 AS discount, cost * 100 AS fob4, cost * 100 AS cost4, 0 AS icmsAliq, 1949 AS cfop, 0 AS auxLong3, 0 AS auxLong4, 0 AS auxLong5, 0 AS auxMy1, 0 AS auxMy2, 0 AS auxMy3, 0 AS baseIcms, 0 AS baseIpi, 0 AS ipiAmt, 0 AS reducaoBaseIcms, 0 AS lucroTributado, 0 AS l1, 0 AS l2, 0 AS l3, 0 AS l4, 0 AS l5, 0 AS l6, 0 AS l7, 0 AS l8, 0 AS m1, 0 AS m2, 0 AS m3, 0 AS m4, 0 AS m5, 0 AS m6, 0 AS m7, 0 AS m8, storeno, 32 AS bits, 0 AS auxShort1, 0 AS auxShort2, 0 AS taxtype, 0 AS auxShort3, 0 AS auxShort4, 0 AS auxShort5, 0 AS seqno, 0 AS bits2, 0 AS bits3, 0 AS bits4, 0 AS s1, 0 AS s2, 0 AS s3, 0 AS s4, 0 AS s5, 0 AS s6, 0 AS s7, 0 AS s8, prdno, grade, '' AS auxChar, '' AS auxChar2, '000' AS cstIcms, '' AS cstIpi, '' AS c1 FROM T WHERE @TIPO = 'E'; UPDATE sqldados.stk INNER JOIN T USING (storeno, prdno, grade) SET last_doc = CONCAT(@NFNO, ' 66 ') WHERE @TIPO = 'E'; /**************************************************************************** Nota de Saida ****************************************************************************/ DO @XANO := IFNULL((SELECT MAX(xano) + 1 FROM sqldados.nf WHERE pdvno = 0 AND storeno = @LOJA), 1); INSERT INTO sqldados.nf(xano, nfno, custno, issuedate, delivdate, sec_amt, fre_amt, netamt, grossamt, discount, icms_amt, tax_paid, ipi_amt, base_calculo_ipi, iss_amt, base_iss_amt, isento_amt, subst_amt, baseIcmsSubst, icmsSubst, vol_no, vol_qtty, cfo, invno, cfo2, auxLong1, auxLong2, auxLong3, auxLong4, auxMy1, auxMy2, auxMy3, auxMy4, eordno, l1, l2, l3, l4, l5, l6, l7, l8, m1, m2, m3, m4, m5, m6, m7, m8, vol_gross, vol_net, mult, storeno, pdvno, carrno, empno, status, natopno, xatype, storeno_from, tipo, padbits, bits, usernoCancel, custno_addno, empnoDiscount, auxShort1, auxShort2, auxShort3, auxShort4, auxShort5, paymno, s1, s2, s3, s4, s5, s6, s7, s8, nfse, ship_by, vol_make, vol_kind, remarks, padbyte, print_remarks, remarksCancel, c1, c2, wshash) SELECT @XANO AS xano, @NFNO AS nfno, custno, CURRENT_DATE * 1 AS issuedate, CURRENT_DATE * 1 AS delivdate, 0 AS sec_amt, 0 AS fre_amt, 0 AS netamt, SUM(qtty * cost / 1000) AS grossamt, 0 AS discount, 0 AS icms_amt, 0 AS tax_paid, 0 AS ipi_amt, 0 AS base_calculo_ipi, 0 AS iss_amt, 0 AS base_iss_amt, 0 AS isento_amt, 0 AS subst_amt, 0 AS baseIcmsSubst, 0 AS icmsSubst, 0 AS vol_no, 0 AS vol_qtty, 5949 AS cfo, 0 AS invno, 0 AS cfo2, 0 AS auxLong1, 0 AS auxLong2, 0 AS auxLong3, 0 AS auxLong4, 0 AS auxMy1, 0 AS auxMy2, 0 AS auxMy3, 0 AS auxMy4, ordno AS eordno, 0 AS l1, 0 AS l2, 0 AS l3, 0 AS l4, 0 AS l5, 0 AS l6, 0 AS l7, 0 AS l8, 0 AS m1, 0 AS m2, 0 AS m3, 0 AS m4, 0 AS m5, 0 AS m6, 0 AS m7, 0 AS m8, 0 AS vol_gross, 0 AS vol_net, 1 AS mult, storeno, 0 AS pdvno, 0 AS carrno, 900 + storeno AS empno, 0 AS status, 14 AS natopno, 0 AS xatype, 0 AS storeno_from, 9 AS tipo, 0 AS padbits, 0 AS bits, 0 AS usernoCancel, 0 AS custno_addno, 0 AS empnoDiscount, 0 AS auxShort1, 0 AS auxShort2, 0 AS auxShort3, 0 AS auxShort4, 0 AS auxShort5, 0 AS paymno, 0 AS s1, 0 AS s2, 0 AS s3, 0 AS s4, 0 AS s5, 0 AS s6, 0 AS s7, 0 AS s8, @SERIE AS nfse, '' AS ship_by, '' AS vol_make, '' AS vol_kind, CONCAT(T.custno, ' ', T.csname) AS remarks, '' AS padbyte, '' AS print_remarks, '' AS remarksCancel, @DOC AS c1, '' AS c2, '' AS wshash FROM T WHERE @TIPO = 'S' GROUP BY storeno, ordno; INSERT INTO sqldados.xaprd(xano, nfno, price, DATE, qtty, storeno, pdvno, prdno, grade, nfse, padbyte, wshash) SELECT @XANO AS xano, @NFNO AS nfno, cost AS price, CURRENT_DATE * 1 AS DATE, qtty / 1000 AS qtty, storeno, 0 AS pdvno, prdno, grade, @SERIE AS nfse, '' AS padbyte, @DOC AS wshash FROM T WHERE @TIPO = 'S'; UPDATE sqldados.stk INNER JOIN T USING (storeno, prdno, grade) SET last_doc = CONCAT(@NFNO, ' 66 ') WHERE @TIPO = 'S'; UPDATE sqldados.eord AS E SET status = 4 /*Expirado*/ WHERE E.storeno = @LOJA AND E.ordno = @PEDIDO; UPDATE sqldados.stk INNER JOIN T USING (storeno, prdno, grade) SET last_doc = ''; INSERT INTO sqldados.lastno(NO, storeno, dupse, se, padbyte) VALUES (@NFNO, @LOJA, 0, @SERIE, '')
true
a3e8385544895247276233ba3c56d5f25e7d1490
SQL
zpiao1/CZ4031
/query_visualizer/sample9b.sql
UTF-8
311
4.40625
4
[]
no_license
SELECT C.name, COUNT(D.pubid) FROM author AS C, publication_author AS D, ( SELECT DISTINCT A.authorid FROM publication_author AS A, publication AS B WHERE A.pubid = B.pubid AND B.year = (SELECT MIN(year) FROM publication) ) AS E WHERE C.authorid = D.authorid AND C.authorid = E.authorid GROUP BY C.authorid;
true
674d7352a847bf76b24ef3567a56b7e2d1f0b762
SQL
unsurecoder/MySQL
/The Report.sql
UTF-8
432
2.75
3
[]
no_license
/* Enter your query here. */ select students.name,grades.grade,students.marks from students inner join grades on students.marks>=min_mark and students.marks<=max_mark where grades.grade>7 order by grades.grade desc,students.name asc; select "NULL",grades.grade,students.marks from students inner join grades on students.marks>=min_mark and students.marks<=max_mark where grades.grade<=7 order by grades.grade desc,students.name asc;
true
88c82940f907b6a6e233df6682a2a9046c49f604
SQL
josepitteloud/VESPA
/ad_hoc/V250 - Sports Rights Analysis/Final Project Code/v250 Sports rights Part 14 - Days right Viewable metrics by right per account.sql
UTF-8
529,161
3.890625
4
[]
no_license
/*----------------------------------------------------------------------------------------------------------------- Project:V250 - Sports right Analysis Profiling Part - Part 14 Viewing summary Analyst: Dan Barnett SK Prod: 5 Create Summary viewable per right for each account also with Live/Non Live version as well as overall Due to size issues accounts split into several tables, code run and results joined back together */------------------------------------------------------------------------------------------------------------------ alter table dbarnett.v250_days_viewing_by_account add account_weight real; update dbarnett.v250_days_viewing_by_account set account_weight=case when b.account_weight is null then 0 else b.account_weight end from dbarnett.v250_days_viewing_by_account as a left outer join dbarnett.v250_annualised_activity_table_for_workshop as b on a.account_number = b.account_number ; commit; --select count (distinct account_number) from dbarnett.v250_days_viewing_by_account where account_weight>0 --select count (*) from dbarnett.v250_days_viewing_by_account delete from dbarnett.v250_days_viewing_by_account where account_weight = 0; commit; --drop table dbarnett.v250_days_viewing_by_account_00_to_04; select * into dbarnett.v250_days_viewing_by_account_00_to_02 from dbarnett.v250_days_viewing_by_account where right(account_number,1) in ('0','1','2') ; commit; commit; CREATE HG INDEX idx1 ON dbarnett.v250_days_viewing_by_account_00_to_02 (account_number); CREATE LF INDEX idx3 ON dbarnett.v250_days_viewing_by_account_00_to_02 (viewing_date); commit; select a.account_number ,b.analysis_right ,sum(days_with_viewing) as days_right_viewable into dbarnett.v250_days_right_viewable_by_account_00_to_02 from dbarnett.v250_rights_broadcast_overall as b left outer join dbarnett.v250_days_viewing_by_account_00_to_02 as a on b.broadcast_date=a.viewing_date group by a.account_number ,b.analysis_right ; commit; --drop table dbarnett.v250_days_viewing_by_account_03_to_06; select * into dbarnett.v250_days_viewing_by_account_03_to_06 from dbarnett.v250_days_viewing_by_account where right(account_number,1) in ('3','4','5') ; commit; commit; CREATE HG INDEX idx1 ON dbarnett.v250_days_viewing_by_account_03_to_06 (account_number); CREATE LF INDEX idx3 ON dbarnett.v250_days_viewing_by_account_03_to_06 (viewing_date); commit; delete from dbarnett.v250_days_viewing_by_account_03_to_06 where right(account_number,1) in ('6') commit; drop table dbarnett.v250_days_right_viewable_by_account_03_to_06; select a.account_number ,b.analysis_right ,sum(days_with_viewing) as days_right_viewable into dbarnett.v250_days_right_viewable_by_account_03_to_06 from dbarnett.v250_rights_broadcast_overall as b left outer join dbarnett.v250_days_viewing_by_account_03_to_06 as a on b.broadcast_date=a.viewing_date group by a.account_number ,b.analysis_right ; commit; drop table dbarnett.v250_days_viewing_by_account_03_to_06; --select count(*) from dbarnett.v250_days_viewing_by_account_03_to_06 select a.account_number ,b.analysis_right ,sum(days_with_viewing) as days_right_viewable into dbarnett.v250_days_right_viewable_by_account_v09 from dbarnett.v250_rights_broadcast_overall as b left outer join dbarnett.v250_days_viewing_by_account as a on b.broadcast_date=a.viewing_date where right(account_number,1)='9' group by a.account_number ,b.analysis_right ; commit; select a.account_number ,b.analysis_right ,sum(days_with_viewing) as days_right_viewable into dbarnett.v250_days_right_viewable_by_account_v08 from dbarnett.v250_rights_broadcast_overall as b left outer join dbarnett.v250_days_viewing_by_account as a on b.broadcast_date=a.viewing_date where right(account_number,1)='8' group by a.account_number ,b.analysis_right ; commit; --drop table dbarnett.v250_days_viewing_by_account_04_to_09; select * into dbarnett.v250_days_viewing_by_account_06_to_07 from dbarnett.v250_days_viewing_by_account where right(account_number,1) in ('6','7') ; commit; commit; CREATE HG INDEX idx1 ON dbarnett.v250_days_viewing_by_account_06_to_07 (account_number); CREATE LF INDEX idx3 ON dbarnett.v250_days_viewing_by_account_06_to_07 (viewing_date); commit; select a.account_number ,b.analysis_right ,sum(days_with_viewing) as days_right_viewable into dbarnett.v250_days_right_viewable_by_account_06_to_07 from dbarnett.v250_rights_broadcast_overall as b left outer join dbarnett.v250_days_viewing_by_account_06_to_07 as a on b.broadcast_date=a.viewing_date group by a.account_number ,b.analysis_right ; commit; drop table dbarnett.v250_days_viewing_by_account_06_to_07; commit; ---Append together--- insert into dbarnett.v250_days_right_viewable_by_account_v09 (select * from dbarnett.v250_days_right_viewable_by_account_v08) ; commit; insert into dbarnett.v250_days_right_viewable_by_account_v09 (select * from dbarnett.v250_days_right_viewable_by_account_06_to_07) ; commit; insert into dbarnett.v250_days_right_viewable_by_account_v09 (select * from dbarnett.v250_days_right_viewable_by_account_00_to_02) ; commit; --select right(account_number,1) as acno ,count(*) from dbarnett.v250_days_right_viewable_by_account_v09 group by acno order by acno; drop table dbarnett.v250_days_right_viewable_by_account_03_to_06; select a.account_number ,b.analysis_right ,sum(days_with_viewing) as days_right_viewable into dbarnett.v250_days_right_viewable_by_account_03_to_06 from dbarnett.v250_rights_broadcast_overall as b left outer join dbarnett.v250_days_viewing_by_account_03_to_06 as a on b.broadcast_date=a.viewing_date group by a.account_number ,b.analysis_right ; commit; insert into dbarnett.v250_days_right_viewable_by_account_v09 (select * from dbarnett.v250_days_right_viewable_by_account_03_to_06) ; commit; commit; CREATE HG INDEX idx1 ON dbarnett.v250_days_right_viewable_by_account_v09 (account_number); CREATE LF INDEX idx2 ON dbarnett.v250_days_right_viewable_by_account_v09 (analysis_right); commit; --select days_right_viewable,count(*) from dbarnett.v250_days_right_viewable_by_account_v09 where analysis_right = 'Premier League Football - Sky Sports (MNF)' group by days_right_viewable order by days_right_viewable; --select count(*) from dbarnett.v250_rights_broadcast_overall; ---Calculate Number of Days each right (and Live non/Live split broadcast)--- commit; CREATE LF INDEX idx1 ON dbarnett.v250_rights_broadcast_by_live_status (broadcast_date); CREATE HG INDEX idx2 ON dbarnett.v250_rights_broadcast_by_live_status (analysis_right); CREATE LF INDEX idx3 ON dbarnett.v250_rights_broadcast_by_live_status (live); commit; --drop table dbarnett.v250_days_right_viewable_by_account_by_live_status; select a.account_number ,b.analysis_right ,b.live ,count(*) as days_right_viewable into dbarnett.v250_days_right_viewable_by_account_by_live_status from dbarnett.v250_days_viewing_by_account as a left outer join dbarnett.v250_rights_broadcast_by_live_status as b on a.viewing_date=b.broadcast_date group by a.account_number ,b.analysis_right ,b.live ; commit; --select top 100 * from dbarnett.v250_days_viewing_by_account; --select count(*) from dbarnett.v250_rights_broadcast_overall; ---Calculate Number of Days each right (and Live non/Live split broadcast)--- --select distinct analysis_right from dbarnett.v250_days_right_viewable_by_account_by_live_status order by analysis_right --select * from dbarnett.v250_sports_rights_epg_data_for_analysis where analysis_right='NFL - BBC' order by live and live=1 --select top 100 * from dbarnett.v250_days_right_viewable_by_account_by_live_status; ---Match Days Viewable to Days broadcast to get % of Content Accounting returning data for each right/account --select top 100 * from dbarnett.v250_rights_broadcast_overall; --drop table #summary_by_analysis_right; select analysis_right ,count(distinct broadcast_date) as days_broadcast ,sum(total_broadcast) as right_broadcast_duration ,sum(programmes_broadcast) as total_programmes_broadcast into #summary_by_analysis_right from dbarnett.v250_rights_broadcast_overall group by analysis_right ; commit; --select * from #summary_by_analysis_right; CREATE HG INDEX idx1 ON #summary_by_analysis_right (analysis_right); commit; --drop table #summary_by_analysis_right_by_live_status; select analysis_right ,live ,count(distinct broadcast_date) as days_broadcast ,sum(total_broadcast) as right_broadcast_duration ,sum(programmes_broadcast) as total_programmes_broadcast into #summary_by_analysis_right_by_live_status from dbarnett.v250_rights_broadcast_by_live_status group by analysis_right ,live ; commit; --select * from dbarnett.v250_rights_broadcast_by_live_status where analysis_right='NFL - BBC' --select * from #summary_by_analysis_right_by_live_status; --select top 100 * from dbarnett.v250_days_right_viewable_by_account commit; --select count(*) from dbarnett.v250_days_right_viewable_by_account_v09; alter table dbarnett.v250_days_right_viewable_by_account_v09 add days_right_broadcast integer; alter table dbarnett.v250_days_right_viewable_by_account_v09 add right_broadcast_duration integer; alter table dbarnett.v250_days_right_viewable_by_account_v09 add right_broadcast_programmes integer; update dbarnett.v250_days_right_viewable_by_account_v09 set days_right_broadcast=b.days_broadcast ,right_broadcast_duration=b.right_broadcast_duration ,right_broadcast_programmes=b.total_programmes_broadcast from dbarnett.v250_days_right_viewable_by_account_v09 as a left outer join #summary_by_analysis_right as b on a.analysis_right=b.analysis_right; --select top 100 * from dbarnett.v250_days_right_viewable_by_account_by_live_status; commit; --select * from dbarnett.v250_days_right_viewable_by_account where analysis_right = 'World Club Championship - BBC'; ---Edited 2nd Feb 2014 alter table dbarnett.v250_days_right_viewable_by_account_by_live_status add days_right_broadcast integer; alter table dbarnett.v250_days_right_viewable_by_account_by_live_status add right_broadcast_duration integer; alter table dbarnett.v250_days_right_viewable_by_account_by_live_status add right_broadcast_programmes integer; update dbarnett.v250_days_right_viewable_by_account_by_live_status set days_right_broadcast=b.days_broadcast ,right_broadcast_duration=b.right_broadcast_duration ,right_broadcast_programmes=b.total_programmes_broadcast from dbarnett.v250_days_right_viewable_by_account_by_live_status as a left outer join #summary_by_analysis_right_by_live_status as b on a.analysis_right=b.analysis_right and a.live=b.live; commit; --select top 100 * from dbarnett.v250_master_account_list as a --select top 100 * from dbarnett.v250_unannualised_right_activity as a --select top 100 * from dbarnett.v250_days_right_viewable_by_account as a --,cast(total_viewing_duration_all as real) * 365 / cast(total_days_with_viewing as real) as annualised_total_viewing_duration_seconds --pt4 --dbarnett.v250_days_right_viewable_by_account dbarnett.v250_days_right_viewable_by_account_by_live_status commit; CREATE HG INDEX idx1 ON dbarnett.v250_days_right_viewable_by_account (account_number); commit; --select top 100 * from dbarnett.v250_days_right_viewable_by_account ; ----Convert dbarnett.v250_days_right_viewable_by_account to one record per account---- drop table dbarnett.v250_right_viewable_account_summary; select account_number ,sum(case when analysis_right ='Africa Cup of Nations - Eurosport' then days_right_viewable else 0 end) as AFCEUR_days_right_viewable ,sum(case when analysis_right ='Africa Cup of Nations - ITV' then days_right_viewable else 0 end) as AFCITV_days_right_viewable ,sum(case when analysis_right ='Americas Cup - BBC' then days_right_viewable else 0 end) as AMCBBC_days_right_viewable ,sum(case when analysis_right ='Asian Tour Golf 2012-2013 Sky Sports' then days_right_viewable else 0 end) as ATGSS_days_right_viewable ,sum(case when analysis_right ='ATP Tennis Masters Series 2011-2013 Sky Sports' then days_right_viewable else 0 end) as ATPSS_days_right_viewable ,sum(case when analysis_right ='Australia Home Cricket 2012-2016 Sky Sports' then days_right_viewable else 0 end) as AHCSS_days_right_viewable ,sum(case when analysis_right ='Australian Football - BT Sport' then days_right_viewable else 0 end) as AUFBTS_days_right_viewable ,sum(case when analysis_right ='Australian Open Tennis - BBC' then days_right_viewable else 0 end) as AOTBBC_days_right_viewable ,sum(case when analysis_right ='Australian Open Tennis - Eurosport' then days_right_viewable else 0 end) as AOTEUR_days_right_viewable ,sum(case when analysis_right ='Aviva Premiership - ESPN' then days_right_viewable else 0 end) as AVPSS_days_right_viewable ,sum(case when analysis_right ='BBC American Football' then days_right_viewable else 0 end) as AFBBC_days_right_viewable ,sum(case when analysis_right ='BBC Athletics' then days_right_viewable else 0 end) as ATHBBC_days_right_viewable ,sum(case when analysis_right ='BBC Boxing' then days_right_viewable else 0 end) as BOXBBC_days_right_viewable ,sum(case when analysis_right ='BBC Darts' then days_right_viewable else 0 end) as DRTBBC_days_right_viewable ,sum(case when analysis_right ='BBC Equestrian' then days_right_viewable else 0 end) as EQUBBC_days_right_viewable ,sum(case when analysis_right ='BBC Football' then days_right_viewable else 0 end) as FOOTBBC_days_right_viewable ,sum(case when analysis_right ='BBC Golf' then days_right_viewable else 0 end) as GOLFBBC_days_right_viewable ,sum(case when analysis_right ='BBC Motor Sport' then days_right_viewable else 0 end) as MSPBBC_days_right_viewable ,sum(case when analysis_right ='BBC Rugby' then days_right_viewable else 0 end) as RUGBBC_days_right_viewable ,sum(case when analysis_right ='BBC Snooker/Pool' then days_right_viewable else 0 end) as SNPBBC_days_right_viewable ,sum(case when analysis_right ='BBC Tennis' then days_right_viewable else 0 end) as TENBBC_days_right_viewable ,sum(case when analysis_right ='BBC Unknown' then days_right_viewable else 0 end) as UNKBBC_days_right_viewable ,sum(case when analysis_right ='BBC Watersports' then days_right_viewable else 0 end) as WATBBC_days_right_viewable ,sum(case when analysis_right ='BBC Wintersports' then days_right_viewable else 0 end) as WINBBC_days_right_viewable ,sum(case when analysis_right ='Boxing - Channel 5' then days_right_viewable else 0 end) as BOXCH5_days_right_viewable ,sum(case when analysis_right ='Boxing - Matchroom 2012-2014 Sky Sports' then days_right_viewable else 0 end) as BOXMSS_days_right_viewable ,sum(case when analysis_right ='Brazil Football - BT Sport' then days_right_viewable else 0 end) as BFTBTS_days_right_viewable ,sum(case when analysis_right ='British & Irish Lions 2013 - Sky Sports' then days_right_viewable else 0 end) as BILSS_days_right_viewable ,sum(case when analysis_right ='British Open Golf - BBC' then days_right_viewable else 0 end) as BOGSS_days_right_viewable ,sum(case when analysis_right ='BT Sport American Football' then days_right_viewable else 0 end) as AFBTS_days_right_viewable ,sum(case when analysis_right ='BT Sport Athletics' then days_right_viewable else 0 end) as ATHBTS_days_right_viewable ,sum(case when analysis_right ='BT Sport Baseball' then days_right_viewable else 0 end) as BASEBTS_days_right_viewable ,sum(case when analysis_right ='BT Sport Basketball' then days_right_viewable else 0 end) as BASKBTS_days_right_viewable ,sum(case when analysis_right ='BT Sport Boxing' then days_right_viewable else 0 end) as BOXBTS_days_right_viewable ,sum(case when analysis_right ='BT Sport Cricket' then days_right_viewable else 0 end) as CRIBTS_days_right_viewable ,sum(case when analysis_right ='BT Sport Equestrian' then days_right_viewable else 0 end) as EQUBTS_days_right_viewable ,sum(case when analysis_right ='BT Sport Extreme' then days_right_viewable else 0 end) as EXTBTS_days_right_viewable ,sum(case when analysis_right ='BT Sport Football' then days_right_viewable else 0 end) as FOOTBTS_days_right_viewable ,sum(case when analysis_right ='BT Sport Motor Sport' then days_right_viewable else 0 end) as MSPBTS_days_right_viewable ,sum(case when analysis_right ='BT Sport Rugby' then days_right_viewable else 0 end) as RUGBTS_days_right_viewable ,sum(case when analysis_right ='BT Sport Tennis' then days_right_viewable else 0 end) as TENBTS_days_right_viewable ,sum(case when analysis_right ='BT Sport Unknown' then days_right_viewable else 0 end) as UNKBTS_days_right_viewable ,sum(case when analysis_right ='BT Sport Wintersports' then days_right_viewable else 0 end) as WINBTS_days_right_viewable ,sum(case when analysis_right ='Bundesliga - BT Sport' then days_right_viewable else 0 end) as BUNBTS_days_right_viewable ,sum(case when analysis_right ='Bundesliga- ESPN' then days_right_viewable else 0 end) as BUNESPN_days_right_viewable ,sum(case when analysis_right ='Challenge Darts' then days_right_viewable else 0 end) as DRTCHA_days_right_viewable ,sum(case when analysis_right ='Challenge Extreme' then days_right_viewable else 0 end) as EXTCHA_days_right_viewable ,sum(case when analysis_right ='Challenge Unknown' then days_right_viewable else 0 end) as UNKCHA_days_right_viewable ,sum(case when analysis_right ='Challenge Wrestling' then days_right_viewable else 0 end) as WRECHA_days_right_viewable ,sum(case when analysis_right ='Champions League - ITV' then days_right_viewable else 0 end) as CHLITV_days_right_viewable ,sum(case when analysis_right ='Champions Trophy - I C C Cricket Deal 2012-2015 Sky Sports' then days_right_viewable else 0 end) as ICCSS_days_right_viewable ,sum(case when analysis_right ='Channel 4 American Football' then days_right_viewable else 0 end) as AMCH4_days_right_viewable ,sum(case when analysis_right ='Channel 4 Athletics' then days_right_viewable else 0 end) as ATHCH4_days_right_viewable ,sum(case when analysis_right ='Channel 4 Boxing' then days_right_viewable else 0 end) as BOXCH4_days_right_viewable ,sum(case when analysis_right ='Channel 4 Equestrian' then days_right_viewable else 0 end) as EQUCH4_days_right_viewable ,sum(case when analysis_right ='Channel 4 Extreme' then days_right_viewable else 0 end) as EXTCH4_days_right_viewable ,sum(case when analysis_right ='Channel 4 Football' then days_right_viewable else 0 end) as FOOTCH4_days_right_viewable ,sum(case when analysis_right ='Channel 4 Motor Sport' then days_right_viewable else 0 end) as MSPCH4_days_right_viewable ,sum(case when analysis_right ='Channel 4 Racing' then days_right_viewable else 0 end) as RACCH4_days_right_viewable ,sum(case when analysis_right ='Channel 4 Unknown' then days_right_viewable else 0 end) as UNKCH4_days_right_viewable ,sum(case when analysis_right ='Channel 4 Watersports' then days_right_viewable else 0 end) as WATCH4_days_right_viewable ,sum(case when analysis_right ='Channel 4 Wintersports' then days_right_viewable else 0 end) as WINCH4_days_right_viewable ,sum(case when analysis_right ='Channel 5 Athletics' then days_right_viewable else 0 end) as ATHCH5_days_right_viewable ,sum(case when analysis_right ='Channel 5 Boxing' then days_right_viewable else 0 end) as BOXOCH5_days_right_viewable ,sum(case when analysis_right ='Channel 5 Cricket' then days_right_viewable else 0 end) as CRICH5_days_right_viewable ,sum(case when analysis_right ='Channel 5 Motor Sport' then days_right_viewable else 0 end) as MSPCH5_days_right_viewable ,sum(case when analysis_right ='Channel 5 Unknown' then days_right_viewable else 0 end) as UNKCH5_days_right_viewable ,sum(case when analysis_right ='Channel 5 Wrestling' then days_right_viewable else 0 end) as WRECH5_days_right_viewable ,sum(case when analysis_right ='Cheltenham Festival - Channel 4' then days_right_viewable else 0 end) as CHELCH4_days_right_viewable ,sum(case when analysis_right ='Community Shield - ITV' then days_right_viewable else 0 end) as CMSITV_days_right_viewable ,sum(case when analysis_right ='Confederations Cup - BBC' then days_right_viewable else 0 end) as CONCBBC_days_right_viewable ,sum(case when analysis_right ='Conference - BT Sport' then days_right_viewable else 0 end) as CONFBTS_days_right_viewable ,sum(case when analysis_right ='Cycling - La Vuelta ITV' then days_right_viewable else 0 end) as CLVITV_days_right_viewable ,sum(case when analysis_right ='Cycling - U C I World Tour Sky Sports' then days_right_viewable else 0 end) as CUCISS_days_right_viewable ,sum(case when analysis_right ='Cycling Tour of Britain - Eurosport' then days_right_viewable else 0 end) as CTBEUR_days_right_viewable ,sum(case when analysis_right ='Cycling: tour of britain ITV4' then days_right_viewable else 0 end) as CTCITV_days_right_viewable ,sum(case when analysis_right ='Derby - Channel 4' then days_right_viewable else 0 end) as DERCH4_days_right_viewable ,sum(case when analysis_right ='ECB (highlights) - Channel 5' then days_right_viewable else 0 end) as ECBHCH5_days_right_viewable ,sum(case when analysis_right ='ECB Cricket Sky Sports' then days_right_viewable else 0 end) as GECRSS_days_right_viewable ,sum(case when analysis_right ='ECB non-Test Cricket Sky Sports' then days_right_viewable else 0 end) as ECBNSS_days_right_viewable ,sum(case when analysis_right ='ECB Test Cricket Sky Sports' then days_right_viewable else 0 end) as ECBTSS_days_right_viewable ,sum(case when analysis_right ='England Football Internationals - ITV' then days_right_viewable else 0 end) as GENGITV_days_right_viewable ,sum(case when analysis_right ='England Friendlies (Football) - ITV' then days_right_viewable else 0 end) as EFRITV_days_right_viewable ,sum(case when analysis_right ='England Rugby Internationals 2010-2015 - Sky Sports' then days_right_viewable else 0 end) as ENRSS_days_right_viewable ,sum(case when analysis_right ='England World Cup Qualifying (Away) - ITV' then days_right_viewable else 0 end) as EWQAITV_days_right_viewable ,sum(case when analysis_right ='England World Cup Qualifying (Home) - ITV' then days_right_viewable else 0 end) as EWQHITV_days_right_viewable ,sum(case when analysis_right ='ESPN American Football' then days_right_viewable else 0 end) as AMESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Athletics' then days_right_viewable else 0 end) as ATHESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Baseball' then days_right_viewable else 0 end) as BASEESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Basketball' then days_right_viewable else 0 end) as BASKESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Boxing' then days_right_viewable else 0 end) as BOXESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Cricket' then days_right_viewable else 0 end) as CRIESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Darts' then days_right_viewable else 0 end) as DARTESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Equestrian' then days_right_viewable else 0 end) as EQUESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Extreme' then days_right_viewable else 0 end) as EXTESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Football' then days_right_viewable else 0 end) as FOOTESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Golf' then days_right_viewable else 0 end) as GOLFESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Ice Hockey' then days_right_viewable else 0 end) as IHESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Motor Sport' then days_right_viewable else 0 end) as MSPESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Racing' then days_right_viewable else 0 end) as RACESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Rugby' then days_right_viewable else 0 end) as RUGESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Snooker/Pool' then days_right_viewable else 0 end) as SNPESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Tennis' then days_right_viewable else 0 end) as TENESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Unknown' then days_right_viewable else 0 end) as UNKESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Watersports' then days_right_viewable else 0 end) as WATESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Wintersports' then days_right_viewable else 0 end) as WINESPN_days_right_viewable ,sum(case when analysis_right ='ESPN Wrestling' then days_right_viewable else 0 end) as WREESPN_days_right_viewable ,sum(case when analysis_right ='Europa League - BT Sport' then days_right_viewable else 0 end) as ELBTSP_days_right_viewable ,sum(case when analysis_right ='Europa League - ESPN' then days_right_viewable else 0 end) as ELESPN_days_right_viewable ,sum(case when analysis_right ='Europa League - ITV' then days_right_viewable else 0 end) as ELITV_days_right_viewable ,sum(case when analysis_right ='European Tour Golf - Sky Sports' then days_right_viewable else 0 end) as ETGSS_days_right_viewable ,sum(case when analysis_right ='Eurosport American Football' then days_right_viewable else 0 end) as AMEUR_days_right_viewable ,sum(case when analysis_right ='Eurosport Athletics' then days_right_viewable else 0 end) as ATHEUR_days_right_viewable ,sum(case when analysis_right ='Eurosport Baseball' then days_right_viewable else 0 end) as BASEEUR_days_right_viewable ,sum(case when analysis_right ='Eurosport Basketball' then days_right_viewable else 0 end) as BASKEUR_days_right_viewable ,sum(case when analysis_right ='Eurosport Boxing' then days_right_viewable else 0 end) as BOXEUR_days_right_viewable ,sum(case when analysis_right ='Eurosport Cricket' then days_right_viewable else 0 end) as CRIEUR_days_right_viewable ,sum(case when analysis_right ='Eurosport Darts' then days_right_viewable else 0 end) as DARTEUR_days_right_viewable ,sum(case when analysis_right ='Eurosport Equestrian' then days_right_viewable else 0 end) as EQUEUR_days_right_viewable ,sum(case when analysis_right ='Eurosport Extreme' then days_right_viewable else 0 end) as EXTEUR_days_right_viewable ,sum(case when analysis_right ='Eurosport Football' then days_right_viewable else 0 end) as FOOTEUR_days_right_viewable ,sum(case when analysis_right ='Eurosport Golf' then days_right_viewable else 0 end) as GOLFEUR_days_right_viewable ,sum(case when analysis_right ='Eurosport Ice Hockey' then days_right_viewable else 0 end) as IHEUR_days_right_viewable ,sum(case when analysis_right ='Eurosport Motor Sport' then days_right_viewable else 0 end) as MSPEUR_days_right_viewable ,sum(case when analysis_right ='Eurosport Racing' then days_right_viewable else 0 end) as RACEUR_days_right_viewable ,sum(case when analysis_right ='Eurosport Snooker/Pool' then days_right_viewable else 0 end) as SNPEUR_days_right_viewable ,sum(case when analysis_right ='Eurosport Tennis' then days_right_viewable else 0 end) as TENEUR_days_right_viewable ,sum(case when analysis_right ='Eurosport Unknown' then days_right_viewable else 0 end) as UNKEUR_days_right_viewable ,sum(case when analysis_right ='Eurosport Watersports' then days_right_viewable else 0 end) as WATEUR_days_right_viewable ,sum(case when analysis_right ='Eurosport Wintersports' then days_right_viewable else 0 end) as WINEUR_days_right_viewable ,sum(case when analysis_right ='F1 - BBC' then days_right_viewable else 0 end) as GF1BBC_days_right_viewable ,sum(case when analysis_right ='F1 - Sky Sports' then days_right_viewable else 0 end) as GF1SS_days_right_viewable ,sum(case when analysis_right ='F1 (non-Live)- BBC' then days_right_viewable else 0 end) as F1NBBC_days_right_viewable ,sum(case when analysis_right ='F1 (Practice Live)- BBC' then days_right_viewable else 0 end) as F1PBBC_days_right_viewable ,sum(case when analysis_right ='F1 (Qualifying Live)- BBC' then days_right_viewable else 0 end) as F1QBBC_days_right_viewable ,sum(case when analysis_right ='F1 (Race Live)- BBC' then days_right_viewable else 0 end) as F1RBBC_days_right_viewable ,sum(case when analysis_right ='FA Cup - ESPN' then days_right_viewable else 0 end) as FACESPN_days_right_viewable ,sum(case when analysis_right ='FA Cup - ITV' then days_right_viewable else 0 end) as FACITV_days_right_viewable ,sum(case when analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - Capital 1 Cup' then days_right_viewable else 0 end) as FLCCSS_days_right_viewable ,sum(case when analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - others' then days_right_viewable else 0 end) as FLOTSS_days_right_viewable ,sum(case when analysis_right ='Formula One 2012-2018 - (non-Live) Sky Sports' then days_right_viewable else 0 end) as F1NSS_days_right_viewable ,sum(case when analysis_right ='Formula One 2012-2018 - (Practice Live) Sky Sports' then days_right_viewable else 0 end) as F1PSS_days_right_viewable ,sum(case when analysis_right ='Formula One 2012-2018 - (Qualifying Live) Sky Sports' then days_right_viewable else 0 end) as F1QSS_days_right_viewable ,sum(case when analysis_right ='Formula One 2012-2018 - (Race Live) Sky Sports' then days_right_viewable else 0 end) as F1RSS_days_right_viewable ,sum(case when analysis_right ='French Open Tennis - Eurosport' then days_right_viewable else 0 end) as FOTEUR_days_right_viewable ,sum(case when analysis_right ='French Open Tennis - ITV' then days_right_viewable else 0 end) as FOTITV_days_right_viewable ,sum(case when analysis_right ='Grand National - Channel 4' then days_right_viewable else 0 end) as GDNCH4_days_right_viewable ,sum(case when analysis_right ='Heineken Cup 2010/11 To 2013/14- Sky Sports' then days_right_viewable else 0 end) as HECSS_days_right_viewable ,sum(case when analysis_right ='I R B Sevens 2008/09 -2014/15 - Sky Sports' then days_right_viewable else 0 end) as IRBSS_days_right_viewable ,sum(case when analysis_right ='IAAF World Athletics Championship - Eurosport' then days_right_viewable else 0 end) as WACEUR_days_right_viewable ,sum(case when analysis_right ='India Home Cricket 2012-2018 Sky Sports' then days_right_viewable else 0 end) as IHCSS_days_right_viewable ,sum(case when analysis_right ='India Premier League - ITV' then days_right_viewable else 0 end) as IPLITV_days_right_viewable ,sum(case when analysis_right ='International Freindlies - ESPN' then days_right_viewable else 0 end) as IFESPN_days_right_viewable ,sum(case when analysis_right ='International Friendlies - BT Sport' then days_right_viewable else 0 end) as IFBTS_days_right_viewable ,sum(case when analysis_right ='ITV1 Boxing' then days_right_viewable else 0 end) as BOXITV1_days_right_viewable ,sum(case when analysis_right ='ITV1 Football' then days_right_viewable else 0 end) as FOOTITV1_days_right_viewable ,sum(case when analysis_right ='ITV1 Motor Sport' then days_right_viewable else 0 end) as MOTSITV1_days_right_viewable ,sum(case when analysis_right ='ITV1 Rugby' then days_right_viewable else 0 end) as RUGITV1_days_right_viewable ,sum(case when analysis_right ='ITV1 Snooker/Pool' then days_right_viewable else 0 end) as SNPITV1_days_right_viewable ,sum(case when analysis_right ='ITV1 Unknown' then days_right_viewable else 0 end) as UNKITV1_days_right_viewable ,sum(case when analysis_right ='ITV4 Boxing' then days_right_viewable else 0 end) as BOXITV4_days_right_viewable ,sum(case when analysis_right ='ITV4 Cricket' then days_right_viewable else 0 end) as CRIITV4_days_right_viewable ,sum(case when analysis_right ='ITV4 Darts' then days_right_viewable else 0 end) as DARTITV4_days_right_viewable ,sum(case when analysis_right ='ITV4 Extreme' then days_right_viewable else 0 end) as EXTITV4_days_right_viewable ,sum(case when analysis_right ='ITV4 Football' then days_right_viewable else 0 end) as FOOTITV4_days_right_viewable ,sum(case when analysis_right ='ITV4 Motor Sport' then days_right_viewable else 0 end) as MSPITV4_days_right_viewable ,sum(case when analysis_right ='ITV4 Rugby' then days_right_viewable else 0 end) as RUGITV4_days_right_viewable ,sum(case when analysis_right ='ITV4 Snooker/Pool' then days_right_viewable else 0 end) as SNPITV4_days_right_viewable ,sum(case when analysis_right ='ITV4 Tennis' then days_right_viewable else 0 end) as TENITV4_days_right_viewable ,sum(case when analysis_right ='ITV4 Unknown' then days_right_viewable else 0 end) as UNKITV4_days_right_viewable ,sum(case when analysis_right ='Ligue 1 - BT Sport' then days_right_viewable else 0 end) as L1BTS_days_right_viewable ,sum(case when analysis_right ='Ligue 1 - ESPN' then days_right_viewable else 0 end) as L1ESPN_days_right_viewable ,sum(case when analysis_right ='Match of the day - BBC' then days_right_viewable else 0 end) as MOTDBBC_days_right_viewable ,sum(case when analysis_right ='Matchroom Output Deal 2010-2012 (Other)- Sky Sports' then days_right_viewable else 0 end) as MROSS_days_right_viewable ,sum(case when analysis_right ='Matchroom Output Deal 2010-2012 (Pool)- Sky Sports' then days_right_viewable else 0 end) as MRPSS_days_right_viewable ,sum(case when analysis_right ='Matchroom Output Deal 2010-2012 (Snooker)- Sky Sports' then days_right_viewable else 0 end) as MRSSS_days_right_viewable ,sum(case when analysis_right ='Moto GP BBC' then days_right_viewable else 0 end) as MGPBBC_days_right_viewable ,sum(case when analysis_right ='NBA - Sky Sports' then days_right_viewable else 0 end) as NBASS_days_right_viewable ,sum(case when analysis_right ='NFL - BBC' then days_right_viewable else 0 end) as NFLBBC_days_right_viewable ,sum(case when analysis_right ='NFL - Channel 4' then days_right_viewable else 0 end) as NFLCH4_days_right_viewable ,sum(case when analysis_right ='NFL Seasons 2012-2015 - Sky Sports' then days_right_viewable else 0 end) as NFLSS_days_right_viewable ,sum(case when analysis_right ='Northern Ireland Football Association 2012-2014 - Sky Sports' then days_right_viewable else 0 end) as NIFSS_days_right_viewable ,sum(case when analysis_right ='Oaks - Channel 4' then days_right_viewable else 0 end) as OAKCH4_days_right_viewable ,sum(case when analysis_right ='Other American Football' then days_right_viewable else 0 end) as AMOTH_days_right_viewable ,sum(case when analysis_right ='Other Athletics' then days_right_viewable else 0 end) as ATHOTH_days_right_viewable ,sum(case when analysis_right ='Other Baseball' then days_right_viewable else 0 end) as BASEOTH_days_right_viewable ,sum(case when analysis_right ='Other Basketball' then days_right_viewable else 0 end) as BASKOTH_days_right_viewable ,sum(case when analysis_right ='Other Boxing' then days_right_viewable else 0 end) as BOXOTH_days_right_viewable ,sum(case when analysis_right ='Other Cricket' then days_right_viewable else 0 end) as CRIOTH_days_right_viewable ,sum(case when analysis_right ='Other Darts' then days_right_viewable else 0 end) as DARTOTH_days_right_viewable ,sum(case when analysis_right ='Other Equestrian' then days_right_viewable else 0 end) as EQUOTH_days_right_viewable ,sum(case when analysis_right ='Other Extreme' then days_right_viewable else 0 end) as EXTOTH_days_right_viewable ,sum(case when analysis_right ='Other Fishing' then days_right_viewable else 0 end) as FSHOTH_days_right_viewable ,sum(case when analysis_right ='Other Football' then days_right_viewable else 0 end) as FOOTOTH_days_right_viewable ,sum(case when analysis_right ='Other Golf' then days_right_viewable else 0 end) as GOLFOTH_days_right_viewable ,sum(case when analysis_right ='Other Ice Hockey' then days_right_viewable else 0 end) as IHOTH_days_right_viewable ,sum(case when analysis_right ='Other Motor Sport' then days_right_viewable else 0 end) as MSPOTH_days_right_viewable ,sum(case when analysis_right ='Other Racing' then days_right_viewable else 0 end) as RACOTH_days_right_viewable ,sum(case when analysis_right ='Other Rugby' then days_right_viewable else 0 end) as RUGOTH_days_right_viewable ,sum(case when analysis_right ='Other Rugby Internationals - ESPN' then days_right_viewable else 0 end) as ORUGESPN_days_right_viewable ,sum(case when analysis_right ='Other Snooker/Pool' then days_right_viewable else 0 end) as OTHSNP_days_right_viewable ,sum(case when analysis_right ='Other Tennis' then days_right_viewable else 0 end) as OTHTEN_days_right_viewable ,sum(case when analysis_right ='Other Unknown' then days_right_viewable else 0 end) as OTHUNK_days_right_viewable ,sum(case when analysis_right ='Other Watersports' then days_right_viewable else 0 end) as OTHWAT_days_right_viewable ,sum(case when analysis_right ='Other Wintersports' then days_right_viewable else 0 end) as OTHWIN_days_right_viewable ,sum(case when analysis_right ='Other Wrestling' then days_right_viewable else 0 end) as OTHWRE_days_right_viewable ,sum(case when analysis_right ='PGA Tour Golf 2010-2017 - Sky Sports' then days_right_viewable else 0 end) as PGASS_days_right_viewable ,sum(case when analysis_right ='Premier League - BT Sport' then days_right_viewable else 0 end) as PLBTS_days_right_viewable ,sum(case when analysis_right ='Premier League - ESPN' then days_right_viewable else 0 end) as PLESPN_days_right_viewable ,sum(case when analysis_right ='Premier League Darts 2010-2013 - Sky Sports' then days_right_viewable else 0 end) as PLDSS_days_right_viewable ,sum(case when analysis_right ='Premier League Football - Sky Sports' then days_right_viewable else 0 end) as GPLSS_days_right_viewable ,sum(case when analysis_right ='Premier League Football - Sky Sports (Match Choice)' then days_right_viewable else 0 end) as PLMCSS_days_right_viewable ,sum(case when analysis_right ='Premier League Football - Sky Sports (MNF)' then days_right_viewable else 0 end) as PLMNFSS_days_right_viewable ,sum(case when analysis_right ='Premier League Football - Sky Sports (non Live)' then days_right_viewable else 0 end) as PLNLSS_days_right_viewable ,sum(case when analysis_right ='Premier League Football - Sky Sports (other Live)' then days_right_viewable else 0 end) as PLOLSS_days_right_viewable ,sum(case when analysis_right ='Premier League Football - Sky Sports (Sat Lunchtime)' then days_right_viewable else 0 end) as PLSLSS_days_right_viewable ,sum(case when analysis_right ='Premier League Football - Sky Sports (Sat Night Live)' then days_right_viewable else 0 end) as PLSNSS_days_right_viewable ,sum(case when analysis_right ='Premier League Football - Sky Sports (Sun 4pm)' then days_right_viewable else 0 end) as PLS4SS_days_right_viewable ,sum(case when analysis_right ='Premier League Football - Sky Sports (Sun Lunchtime)' then days_right_viewable else 0 end) as PLSULSS_days_right_viewable ,sum(case when analysis_right ='Premiership Rugby - Sky Sports' then days_right_viewable else 0 end) as PRUSS_days_right_viewable ,sum(case when analysis_right ='Republic Of Ireland FA - 2010/11 To 2013/14 - Sky Sports' then days_right_viewable else 0 end) as ROISS_days_right_viewable ,sum(case when analysis_right ='Royal Ascot - Channel 4' then days_right_viewable else 0 end) as RASCH4_days_right_viewable ,sum(case when analysis_right ='Rugby Internationals (England) - BBC' then days_right_viewable else 0 end) as RIEBBC_days_right_viewable ,sum(case when analysis_right ='Rugby Internationals (Ireland) - BBC' then days_right_viewable else 0 end) as RIIBBC_days_right_viewable ,sum(case when analysis_right ='Rugby Internationals (Scotland) - BBC' then days_right_viewable else 0 end) as RISBBC_days_right_viewable ,sum(case when analysis_right ='Rugby Internationals (Wales) - BBC' then days_right_viewable else 0 end) as RIWBBC_days_right_viewable ,sum(case when analysis_right ='Rugby League Challenge Cup- BBC' then days_right_viewable else 0 end) as RLCCBBC_days_right_viewable ,sum(case when analysis_right ='Rugby League - Sky Sports' then days_right_viewable else 0 end) as RLGSS_days_right_viewable ,sum(case when analysis_right ='Rugby League World Cup- BBC' then days_right_viewable else 0 end) as RLWCBBC_days_right_viewable ,sum(case when analysis_right ='Sanzar Rugby Union 2011 - 2015 - Sky Sports' then days_right_viewable else 0 end) as SARUSS_days_right_viewable ,sum(case when analysis_right ='Scottish FA Deal - 2010/11 To 2013/14 - Sky Sports' then days_right_viewable else 0 end) as SFASS_days_right_viewable ,sum(case when analysis_right ='Serie A - BT Sport' then days_right_viewable else 0 end) as SABTS_days_right_viewable ,sum(case when analysis_right ='Serie A - ESPN' then days_right_viewable else 0 end) as SAESPN_days_right_viewable ,sum(case when analysis_right ='SFL - ESPN' then days_right_viewable else 0 end) as SFLESPN_days_right_viewable ,sum(case when analysis_right ='Six Nations - BBC' then days_right_viewable else 0 end) as SNRBBC_days_right_viewable ,sum(case when analysis_right ='Sky 1 and Sky 2 Boxing' then days_right_viewable else 0 end) as BOXS12_days_right_viewable ,sum(case when analysis_right ='Sky 1 and Sky 2 Football' then days_right_viewable else 0 end) as FOOTS12_days_right_viewable ,sum(case when analysis_right ='Sky 1 and Sky 2 Motor Sport' then days_right_viewable else 0 end) as MSPS12_days_right_viewable ,sum(case when analysis_right ='Sky 1 and Sky 2 Unknown' then days_right_viewable else 0 end) as UNKS12_days_right_viewable ,sum(case when analysis_right ='Sky 1 and Sky 2 Wrestling' then days_right_viewable else 0 end) as WRES12_days_right_viewable ,sum(case when analysis_right ='Sky Sports American Football' then days_right_viewable else 0 end) as AMSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Athletics' then days_right_viewable else 0 end) as ATHSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Baseball' then days_right_viewable else 0 end) as BASESS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Basketball' then days_right_viewable else 0 end) as BASKSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Boxing' then days_right_viewable else 0 end) as BOXSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Cricket' then days_right_viewable else 0 end) as CRISS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Darts' then days_right_viewable else 0 end) as DARTSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Equestrian' then days_right_viewable else 0 end) as EQUSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Extreme' then days_right_viewable else 0 end) as EXTSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Fishing' then days_right_viewable else 0 end) as FISHSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Football' then days_right_viewable else 0 end) as FOOTSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Golf' then days_right_viewable else 0 end) as GOLFSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Ice Hockey' then days_right_viewable else 0 end) as IHSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Motor Sport' then days_right_viewable else 0 end) as MSPSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Racing' then days_right_viewable else 0 end) as RACSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Rugby' then days_right_viewable else 0 end) as RUGSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Snooker/Pool' then days_right_viewable else 0 end) as SNPSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Tennis' then days_right_viewable else 0 end) as TENSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Unknown' then days_right_viewable else 0 end) as UNKSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Watersports' then days_right_viewable else 0 end) as WATSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Wintersports' then days_right_viewable else 0 end) as WINSS_days_right_viewable ,sum(case when analysis_right ='Sky Sports Wrestling' then days_right_viewable else 0 end) as WRESS_days_right_viewable ,sum(case when analysis_right ='Solheim Cup 2013 Ladies Golf - Sky Sports' then days_right_viewable else 0 end) as SOLSS_days_right_viewable ,sum(case when analysis_right ='South African Home Cricket 2012-2020 Sky Sports' then days_right_viewable else 0 end) as SACSS_days_right_viewable ,sum(case when analysis_right ='Spanish Football 2012/13 To 14/15 - Sky Sports' then days_right_viewable else 0 end) as SPFSS_days_right_viewable ,sum(case when analysis_right ='SPFL - BT Sport' then days_right_viewable else 0 end) as SPFLBTS_days_right_viewable ,sum(case when analysis_right ='SPL - ESPN' then days_right_viewable else 0 end) as SPLESPN_days_right_viewable ,sum(case when analysis_right ='SPL - Sky Sports' then days_right_viewable else 0 end) as SPLSS_days_right_viewable ,sum(case when analysis_right ='Sportfive World Cup 2014 Qualifers - Sky Sports' then days_right_viewable else 0 end) as SP5SS_days_right_viewable ,sum(case when analysis_right ='The boat race - BBC' then days_right_viewable else 0 end) as BTRBBC_days_right_viewable ,sum(case when analysis_right ='The football league show - BBC' then days_right_viewable else 0 end) as FLSBBC_days_right_viewable ,sum(case when analysis_right ='The Masters Golf - BBC' then days_right_viewable else 0 end) as MGBBC_days_right_viewable ,sum(case when analysis_right ='TNA Wrestling Challenge' then days_right_viewable else 0 end) as TNACHA_days_right_viewable ,sum(case when analysis_right ='Tour de France - Eurosport' then days_right_viewable else 0 end) as TDFEUR_days_right_viewable ,sum(case when analysis_right ='Tour de France - ITV' then days_right_viewable else 0 end) as TDFITV_days_right_viewable ,sum(case when analysis_right ='U S Masters Golf 2011-2014 Sky Sports' then days_right_viewable else 0 end) as USMGSS_days_right_viewable ,sum(case when analysis_right ='U.S Open Tennis 2013-2015 Sky Sports' then days_right_viewable else 0 end) as USOTSS_days_right_viewable ,sum(case when analysis_right ='U.S Open/Womens/Seniors/Amateur Golf Sky Sports' then days_right_viewable else 0 end) as USOGSS_days_right_viewable ,sum(case when analysis_right ='UEFA Champions League - Sky Sports' then days_right_viewable else 0 end) as CLASS_days_right_viewable ,sum(case when analysis_right ='UEFA Champions League - Sky Sports (non Live)' then days_right_viewable else 0 end) as CLNSS_days_right_viewable ,sum(case when analysis_right ='UEFA Champions League - Sky Sports (other Live)' then days_right_viewable else 0 end) as CLOSS_days_right_viewable ,sum(case when analysis_right ='UEFA Champions League - Sky Sports (Tue)' then days_right_viewable else 0 end) as CLTSS_days_right_viewable ,sum(case when analysis_right ='UEFA Champions League - Sky Sports (Wed)' then days_right_viewable else 0 end) as CLWSS_days_right_viewable ,sum(case when analysis_right ='US Open Tennis - Eurosport' then days_right_viewable else 0 end) as USOTEUR_days_right_viewable ,sum(case when analysis_right ='USA Football - BT Sport' then days_right_viewable else 0 end) as USFBTS_days_right_viewable ,sum(case when analysis_right ='USPGA Championship (2007-2016) Sky Sports' then days_right_viewable else 0 end) as USPGASS_days_right_viewable ,sum(case when analysis_right ='WCQ - ESPN' then days_right_viewable else 0 end) as WCQESPN_days_right_viewable ,sum(case when analysis_right ='Welsh Home International Football 2012-2014 Sky Sports' then days_right_viewable else 0 end) as WIFSS_days_right_viewable ,sum(case when analysis_right ='West Indies Home Cricket 2013-2020 Sky Sports' then days_right_viewable else 0 end) as WICSS_days_right_viewable ,sum(case when analysis_right ='Wimbledon - BBC' then days_right_viewable else 0 end) as WIMBBC_days_right_viewable ,sum(case when analysis_right ='Womens Cricket - I C C Cricket Deal 2012-2015 Sky Sports' then days_right_viewable else 0 end) as WICCSS_days_right_viewable ,sum(case when analysis_right ='World Athletics Championship - More 4' then days_right_viewable else 0 end) as WACMR4_days_right_viewable ,sum(case when analysis_right ='World Club Championship - BBC' then days_right_viewable else 0 end) as WCLBBBC_days_right_viewable ,sum(case when analysis_right ='World Cup Qualifiers - BT Sport' then days_right_viewable else 0 end) as WCQBTS_days_right_viewable ,sum(case when analysis_right ='World Darts Championship 2009-2012 Sky Sports' then days_right_viewable else 0 end) as WDCSS_days_right_viewable ,sum(case when analysis_right ='World snooker championship - BBC' then days_right_viewable else 0 end) as WSCBBC_days_right_viewable ,sum(case when analysis_right ='WWE Sky 1 and 2' then days_right_viewable else 0 end) as WWES12_days_right_viewable ,sum(case when analysis_right ='WWE Sky Sports' then days_right_viewable else 0 end) as WWESS_days_right_viewable ,sum(case when analysis_right ='Africa Cup of Nations - Eurosport' then days_right_broadcast else 0 end) as AFCEUR_days_right_broadcast ,sum(case when analysis_right ='Africa Cup of Nations - ITV' then days_right_broadcast else 0 end) as AFCITV_days_right_broadcast ,sum(case when analysis_right ='Americas Cup - BBC' then days_right_broadcast else 0 end) as AMCBBC_days_right_broadcast ,sum(case when analysis_right ='Asian Tour Golf 2012-2013 Sky Sports' then days_right_broadcast else 0 end) as ATGSS_days_right_broadcast ,sum(case when analysis_right ='ATP Tennis Masters Series 2011-2013 Sky Sports' then days_right_broadcast else 0 end) as ATPSS_days_right_broadcast ,sum(case when analysis_right ='Australia Home Cricket 2012-2016 Sky Sports' then days_right_broadcast else 0 end) as AHCSS_days_right_broadcast ,sum(case when analysis_right ='Australian Football - BT Sport' then days_right_broadcast else 0 end) as AUFBTS_days_right_broadcast ,sum(case when analysis_right ='Australian Open Tennis - BBC' then days_right_broadcast else 0 end) as AOTBBC_days_right_broadcast ,sum(case when analysis_right ='Australian Open Tennis - Eurosport' then days_right_broadcast else 0 end) as AOTEUR_days_right_broadcast ,sum(case when analysis_right ='Aviva Premiership - ESPN' then days_right_broadcast else 0 end) as AVPSS_days_right_broadcast ,sum(case when analysis_right ='BBC American Football' then days_right_broadcast else 0 end) as AFBBC_days_right_broadcast ,sum(case when analysis_right ='BBC Athletics' then days_right_broadcast else 0 end) as ATHBBC_days_right_broadcast ,sum(case when analysis_right ='BBC Boxing' then days_right_broadcast else 0 end) as BOXBBC_days_right_broadcast ,sum(case when analysis_right ='BBC Darts' then days_right_broadcast else 0 end) as DRTBBC_days_right_broadcast ,sum(case when analysis_right ='BBC Equestrian' then days_right_broadcast else 0 end) as EQUBBC_days_right_broadcast ,sum(case when analysis_right ='BBC Football' then days_right_broadcast else 0 end) as FOOTBBC_days_right_broadcast ,sum(case when analysis_right ='BBC Golf' then days_right_broadcast else 0 end) as GOLFBBC_days_right_broadcast ,sum(case when analysis_right ='BBC Motor Sport' then days_right_broadcast else 0 end) as MSPBBC_days_right_broadcast ,sum(case when analysis_right ='BBC Rugby' then days_right_broadcast else 0 end) as RUGBBC_days_right_broadcast ,sum(case when analysis_right ='BBC Snooker/Pool' then days_right_broadcast else 0 end) as SNPBBC_days_right_broadcast ,sum(case when analysis_right ='BBC Tennis' then days_right_broadcast else 0 end) as TENBBC_days_right_broadcast ,sum(case when analysis_right ='BBC Unknown' then days_right_broadcast else 0 end) as UNKBBC_days_right_broadcast ,sum(case when analysis_right ='BBC Watersports' then days_right_broadcast else 0 end) as WATBBC_days_right_broadcast ,sum(case when analysis_right ='BBC Wintersports' then days_right_broadcast else 0 end) as WINBBC_days_right_broadcast ,sum(case when analysis_right ='Boxing - Channel 5' then days_right_broadcast else 0 end) as BOXCH5_days_right_broadcast ,sum(case when analysis_right ='Boxing - Matchroom 2012-2014 Sky Sports' then days_right_broadcast else 0 end) as BOXMSS_days_right_broadcast ,sum(case when analysis_right ='Brazil Football - BT Sport' then days_right_broadcast else 0 end) as BFTBTS_days_right_broadcast ,sum(case when analysis_right ='British & Irish Lions 2013 - Sky Sports' then days_right_broadcast else 0 end) as BILSS_days_right_broadcast ,sum(case when analysis_right ='British Open Golf - BBC' then days_right_broadcast else 0 end) as BOGSS_days_right_broadcast ,sum(case when analysis_right ='BT Sport American Football' then days_right_broadcast else 0 end) as AFBTS_days_right_broadcast ,sum(case when analysis_right ='BT Sport Athletics' then days_right_broadcast else 0 end) as ATHBTS_days_right_broadcast ,sum(case when analysis_right ='BT Sport Baseball' then days_right_broadcast else 0 end) as BASEBTS_days_right_broadcast ,sum(case when analysis_right ='BT Sport Basketball' then days_right_broadcast else 0 end) as BASKBTS_days_right_broadcast ,sum(case when analysis_right ='BT Sport Boxing' then days_right_broadcast else 0 end) as BOXBTS_days_right_broadcast ,sum(case when analysis_right ='BT Sport Cricket' then days_right_broadcast else 0 end) as CRIBTS_days_right_broadcast ,sum(case when analysis_right ='BT Sport Equestrian' then days_right_broadcast else 0 end) as EQUBTS_days_right_broadcast ,sum(case when analysis_right ='BT Sport Extreme' then days_right_broadcast else 0 end) as EXTBTS_days_right_broadcast ,sum(case when analysis_right ='BT Sport Football' then days_right_broadcast else 0 end) as FOOTBTS_days_right_broadcast ,sum(case when analysis_right ='BT Sport Motor Sport' then days_right_broadcast else 0 end) as MSPBTS_days_right_broadcast ,sum(case when analysis_right ='BT Sport Rugby' then days_right_broadcast else 0 end) as RUGBTS_days_right_broadcast ,sum(case when analysis_right ='BT Sport Tennis' then days_right_broadcast else 0 end) as TENBTS_days_right_broadcast ,sum(case when analysis_right ='BT Sport Unknown' then days_right_broadcast else 0 end) as UNKBTS_days_right_broadcast ,sum(case when analysis_right ='BT Sport Wintersports' then days_right_broadcast else 0 end) as WINBTS_days_right_broadcast ,sum(case when analysis_right ='Bundesliga - BT Sport' then days_right_broadcast else 0 end) as BUNBTS_days_right_broadcast ,sum(case when analysis_right ='Bundesliga- ESPN' then days_right_broadcast else 0 end) as BUNESPN_days_right_broadcast ,sum(case when analysis_right ='Challenge Darts' then days_right_broadcast else 0 end) as DRTCHA_days_right_broadcast ,sum(case when analysis_right ='Challenge Extreme' then days_right_broadcast else 0 end) as EXTCHA_days_right_broadcast ,sum(case when analysis_right ='Challenge Unknown' then days_right_broadcast else 0 end) as UNKCHA_days_right_broadcast ,sum(case when analysis_right ='Challenge Wrestling' then days_right_broadcast else 0 end) as WRECHA_days_right_broadcast ,sum(case when analysis_right ='Champions League - ITV' then days_right_broadcast else 0 end) as CHLITV_days_right_broadcast ,sum(case when analysis_right ='Champions Trophy - I C C Cricket Deal 2012-2015 Sky Sports' then days_right_broadcast else 0 end) as ICCSS_days_right_broadcast ,sum(case when analysis_right ='Channel 4 American Football' then days_right_broadcast else 0 end) as AMCH4_days_right_broadcast ,sum(case when analysis_right ='Channel 4 Athletics' then days_right_broadcast else 0 end) as ATHCH4_days_right_broadcast ,sum(case when analysis_right ='Channel 4 Boxing' then days_right_broadcast else 0 end) as BOXCH4_days_right_broadcast ,sum(case when analysis_right ='Channel 4 Equestrian' then days_right_broadcast else 0 end) as EQUCH4_days_right_broadcast ,sum(case when analysis_right ='Channel 4 Extreme' then days_right_broadcast else 0 end) as EXTCH4_days_right_broadcast ,sum(case when analysis_right ='Channel 4 Football' then days_right_broadcast else 0 end) as FOOTCH4_days_right_broadcast ,sum(case when analysis_right ='Channel 4 Motor Sport' then days_right_broadcast else 0 end) as MSPCH4_days_right_broadcast ,sum(case when analysis_right ='Channel 4 Racing' then days_right_broadcast else 0 end) as RACCH4_days_right_broadcast ,sum(case when analysis_right ='Channel 4 Unknown' then days_right_broadcast else 0 end) as UNKCH4_days_right_broadcast ,sum(case when analysis_right ='Channel 4 Watersports' then days_right_broadcast else 0 end) as WATCH4_days_right_broadcast ,sum(case when analysis_right ='Channel 4 Wintersports' then days_right_broadcast else 0 end) as WINCH4_days_right_broadcast ,sum(case when analysis_right ='Channel 5 Athletics' then days_right_broadcast else 0 end) as ATHCH5_days_right_broadcast ,sum(case when analysis_right ='Channel 5 Boxing' then days_right_broadcast else 0 end) as BOXOCH5_days_right_broadcast ,sum(case when analysis_right ='Channel 5 Cricket' then days_right_broadcast else 0 end) as CRICH5_days_right_broadcast ,sum(case when analysis_right ='Channel 5 Motor Sport' then days_right_broadcast else 0 end) as MSPCH5_days_right_broadcast ,sum(case when analysis_right ='Channel 5 Unknown' then days_right_broadcast else 0 end) as UNKCH5_days_right_broadcast ,sum(case when analysis_right ='Channel 5 Wrestling' then days_right_broadcast else 0 end) as WRECH5_days_right_broadcast ,sum(case when analysis_right ='Cheltenham Festival - Channel 4' then days_right_broadcast else 0 end) as CHELCH4_days_right_broadcast ,sum(case when analysis_right ='Community Shield - ITV' then days_right_broadcast else 0 end) as CMSITV_days_right_broadcast ,sum(case when analysis_right ='Confederations Cup - BBC' then days_right_broadcast else 0 end) as CONCBBC_days_right_broadcast ,sum(case when analysis_right ='Conference - BT Sport' then days_right_broadcast else 0 end) as CONFBTS_days_right_broadcast ,sum(case when analysis_right ='Cycling - La Vuelta ITV' then days_right_broadcast else 0 end) as CLVITV_days_right_broadcast ,sum(case when analysis_right ='Cycling - U C I World Tour Sky Sports' then days_right_broadcast else 0 end) as CUCISS_days_right_broadcast ,sum(case when analysis_right ='Cycling Tour of Britain - Eurosport' then days_right_broadcast else 0 end) as CTBEUR_days_right_broadcast ,sum(case when analysis_right ='Cycling: tour of britain ITV4' then days_right_broadcast else 0 end) as CTCITV_days_right_broadcast ,sum(case when analysis_right ='Derby - Channel 4' then days_right_broadcast else 0 end) as DERCH4_days_right_broadcast ,sum(case when analysis_right ='ECB (highlights) - Channel 5' then days_right_broadcast else 0 end) as ECBHCH5_days_right_broadcast ,sum(case when analysis_right ='ECB Cricket Sky Sports' then days_right_broadcast else 0 end) as GECRSS_days_right_broadcast ,sum(case when analysis_right ='ECB non-Test Cricket Sky Sports' then days_right_broadcast else 0 end) as ECBNSS_days_right_broadcast ,sum(case when analysis_right ='ECB Test Cricket Sky Sports' then days_right_broadcast else 0 end) as ECBTSS_days_right_broadcast ,sum(case when analysis_right ='England Football Internationals - ITV' then days_right_broadcast else 0 end) as GENGITV_days_right_broadcast ,sum(case when analysis_right ='England Friendlies (Football) - ITV' then days_right_broadcast else 0 end) as EFRITV_days_right_broadcast ,sum(case when analysis_right ='England Rugby Internationals 2010-2015 - Sky Sports' then days_right_broadcast else 0 end) as ENRSS_days_right_broadcast ,sum(case when analysis_right ='England World Cup Qualifying (Away) - ITV' then days_right_broadcast else 0 end) as EWQAITV_days_right_broadcast ,sum(case when analysis_right ='England World Cup Qualifying (Home) - ITV' then days_right_broadcast else 0 end) as EWQHITV_days_right_broadcast ,sum(case when analysis_right ='ESPN American Football' then days_right_broadcast else 0 end) as AMESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Athletics' then days_right_broadcast else 0 end) as ATHESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Baseball' then days_right_broadcast else 0 end) as BASEESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Basketball' then days_right_broadcast else 0 end) as BASKESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Boxing' then days_right_broadcast else 0 end) as BOXESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Cricket' then days_right_broadcast else 0 end) as CRIESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Darts' then days_right_broadcast else 0 end) as DARTESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Equestrian' then days_right_broadcast else 0 end) as EQUESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Extreme' then days_right_broadcast else 0 end) as EXTESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Football' then days_right_broadcast else 0 end) as FOOTESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Golf' then days_right_broadcast else 0 end) as GOLFESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Ice Hockey' then days_right_broadcast else 0 end) as IHESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Motor Sport' then days_right_broadcast else 0 end) as MSPESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Racing' then days_right_broadcast else 0 end) as RACESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Rugby' then days_right_broadcast else 0 end) as RUGESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Snooker/Pool' then days_right_broadcast else 0 end) as SNPESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Tennis' then days_right_broadcast else 0 end) as TENESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Unknown' then days_right_broadcast else 0 end) as UNKESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Watersports' then days_right_broadcast else 0 end) as WATESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Wintersports' then days_right_broadcast else 0 end) as WINESPN_days_right_broadcast ,sum(case when analysis_right ='ESPN Wrestling' then days_right_broadcast else 0 end) as WREESPN_days_right_broadcast ,sum(case when analysis_right ='Europa League - BT Sport' then days_right_broadcast else 0 end) as ELBTSP_days_right_broadcast ,sum(case when analysis_right ='Europa League - ESPN' then days_right_broadcast else 0 end) as ELESPN_days_right_broadcast ,sum(case when analysis_right ='Europa League - ITV' then days_right_broadcast else 0 end) as ELITV_days_right_broadcast ,sum(case when analysis_right ='European Tour Golf - Sky Sports' then days_right_broadcast else 0 end) as ETGSS_days_right_broadcast ,sum(case when analysis_right ='Eurosport American Football' then days_right_broadcast else 0 end) as AMEUR_days_right_broadcast ,sum(case when analysis_right ='Eurosport Athletics' then days_right_broadcast else 0 end) as ATHEUR_days_right_broadcast ,sum(case when analysis_right ='Eurosport Baseball' then days_right_broadcast else 0 end) as BASEEUR_days_right_broadcast ,sum(case when analysis_right ='Eurosport Basketball' then days_right_broadcast else 0 end) as BASKEUR_days_right_broadcast ,sum(case when analysis_right ='Eurosport Boxing' then days_right_broadcast else 0 end) as BOXEUR_days_right_broadcast ,sum(case when analysis_right ='Eurosport Cricket' then days_right_broadcast else 0 end) as CRIEUR_days_right_broadcast ,sum(case when analysis_right ='Eurosport Darts' then days_right_broadcast else 0 end) as DARTEUR_days_right_broadcast ,sum(case when analysis_right ='Eurosport Equestrian' then days_right_broadcast else 0 end) as EQUEUR_days_right_broadcast ,sum(case when analysis_right ='Eurosport Extreme' then days_right_broadcast else 0 end) as EXTEUR_days_right_broadcast ,sum(case when analysis_right ='Eurosport Football' then days_right_broadcast else 0 end) as FOOTEUR_days_right_broadcast ,sum(case when analysis_right ='Eurosport Golf' then days_right_broadcast else 0 end) as GOLFEUR_days_right_broadcast ,sum(case when analysis_right ='Eurosport Ice Hockey' then days_right_broadcast else 0 end) as IHEUR_days_right_broadcast ,sum(case when analysis_right ='Eurosport Motor Sport' then days_right_broadcast else 0 end) as MSPEUR_days_right_broadcast ,sum(case when analysis_right ='Eurosport Racing' then days_right_broadcast else 0 end) as RACEUR_days_right_broadcast ,sum(case when analysis_right ='Eurosport Snooker/Pool' then days_right_broadcast else 0 end) as SNPEUR_days_right_broadcast ,sum(case when analysis_right ='Eurosport Tennis' then days_right_broadcast else 0 end) as TENEUR_days_right_broadcast ,sum(case when analysis_right ='Eurosport Unknown' then days_right_broadcast else 0 end) as UNKEUR_days_right_broadcast ,sum(case when analysis_right ='Eurosport Watersports' then days_right_broadcast else 0 end) as WATEUR_days_right_broadcast ,sum(case when analysis_right ='Eurosport Wintersports' then days_right_broadcast else 0 end) as WINEUR_days_right_broadcast ,sum(case when analysis_right ='F1 - BBC' then days_right_broadcast else 0 end) as GF1BBC_days_right_broadcast ,sum(case when analysis_right ='F1 - Sky Sports' then days_right_broadcast else 0 end) as GF1SS_days_right_broadcast ,sum(case when analysis_right ='F1 (non-Live)- BBC' then days_right_broadcast else 0 end) as F1NBBC_days_right_broadcast ,sum(case when analysis_right ='F1 (Practice Live)- BBC' then days_right_broadcast else 0 end) as F1PBBC_days_right_broadcast ,sum(case when analysis_right ='F1 (Qualifying Live)- BBC' then days_right_broadcast else 0 end) as F1QBBC_days_right_broadcast ,sum(case when analysis_right ='F1 (Race Live)- BBC' then days_right_broadcast else 0 end) as F1RBBC_days_right_broadcast ,sum(case when analysis_right ='FA Cup - ESPN' then days_right_broadcast else 0 end) as FACESPN_days_right_broadcast ,sum(case when analysis_right ='FA Cup - ITV' then days_right_broadcast else 0 end) as FACITV_days_right_broadcast ,sum(case when analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - Capital 1 Cup' then days_right_broadcast else 0 end) as FLCCSS_days_right_broadcast ,sum(case when analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - others' then days_right_broadcast else 0 end) as FLOTSS_days_right_broadcast ,sum(case when analysis_right ='Formula One 2012-2018 - (non-Live) Sky Sports' then days_right_broadcast else 0 end) as F1NSS_days_right_broadcast ,sum(case when analysis_right ='Formula One 2012-2018 - (Practice Live) Sky Sports' then days_right_broadcast else 0 end) as F1PSS_days_right_broadcast ,sum(case when analysis_right ='Formula One 2012-2018 - (Qualifying Live) Sky Sports' then days_right_broadcast else 0 end) as F1QSS_days_right_broadcast ,sum(case when analysis_right ='Formula One 2012-2018 - (Race Live) Sky Sports' then days_right_broadcast else 0 end) as F1RSS_days_right_broadcast ,sum(case when analysis_right ='French Open Tennis - Eurosport' then days_right_broadcast else 0 end) as FOTEUR_days_right_broadcast ,sum(case when analysis_right ='French Open Tennis - ITV' then days_right_broadcast else 0 end) as FOTITV_days_right_broadcast ,sum(case when analysis_right ='Grand National - Channel 4' then days_right_broadcast else 0 end) as GDNCH4_days_right_broadcast ,sum(case when analysis_right ='Heineken Cup 2010/11 To 2013/14- Sky Sports' then days_right_broadcast else 0 end) as HECSS_days_right_broadcast ,sum(case when analysis_right ='I R B Sevens 2008/09 -2014/15 - Sky Sports' then days_right_broadcast else 0 end) as IRBSS_days_right_broadcast ,sum(case when analysis_right ='IAAF World Athletics Championship - Eurosport' then days_right_broadcast else 0 end) as WACEUR_days_right_broadcast ,sum(case when analysis_right ='India Home Cricket 2012-2018 Sky Sports' then days_right_broadcast else 0 end) as IHCSS_days_right_broadcast ,sum(case when analysis_right ='India Premier League - ITV' then days_right_broadcast else 0 end) as IPLITV_days_right_broadcast ,sum(case when analysis_right ='International Freindlies - ESPN' then days_right_broadcast else 0 end) as IFESPN_days_right_broadcast ,sum(case when analysis_right ='International Friendlies - BT Sport' then days_right_broadcast else 0 end) as IFBTS_days_right_broadcast ,sum(case when analysis_right ='ITV1 Boxing' then days_right_broadcast else 0 end) as BOXITV1_days_right_broadcast ,sum(case when analysis_right ='ITV1 Football' then days_right_broadcast else 0 end) as FOOTITV1_days_right_broadcast ,sum(case when analysis_right ='ITV1 Motor Sport' then days_right_broadcast else 0 end) as MOTSITV1_days_right_broadcast ,sum(case when analysis_right ='ITV1 Rugby' then days_right_broadcast else 0 end) as RUGITV1_days_right_broadcast ,sum(case when analysis_right ='ITV1 Snooker/Pool' then days_right_broadcast else 0 end) as SNPITV1_days_right_broadcast ,sum(case when analysis_right ='ITV1 Unknown' then days_right_broadcast else 0 end) as UNKITV1_days_right_broadcast ,sum(case when analysis_right ='ITV4 Boxing' then days_right_broadcast else 0 end) as BOXITV4_days_right_broadcast ,sum(case when analysis_right ='ITV4 Cricket' then days_right_broadcast else 0 end) as CRIITV4_days_right_broadcast ,sum(case when analysis_right ='ITV4 Darts' then days_right_broadcast else 0 end) as DARTITV4_days_right_broadcast ,sum(case when analysis_right ='ITV4 Extreme' then days_right_broadcast else 0 end) as EXTITV4_days_right_broadcast ,sum(case when analysis_right ='ITV4 Football' then days_right_broadcast else 0 end) as FOOTITV4_days_right_broadcast ,sum(case when analysis_right ='ITV4 Motor Sport' then days_right_broadcast else 0 end) as MSPITV4_days_right_broadcast ,sum(case when analysis_right ='ITV4 Rugby' then days_right_broadcast else 0 end) as RUGITV4_days_right_broadcast ,sum(case when analysis_right ='ITV4 Snooker/Pool' then days_right_broadcast else 0 end) as SNPITV4_days_right_broadcast ,sum(case when analysis_right ='ITV4 Tennis' then days_right_broadcast else 0 end) as TENITV4_days_right_broadcast ,sum(case when analysis_right ='ITV4 Unknown' then days_right_broadcast else 0 end) as UNKITV4_days_right_broadcast ,sum(case when analysis_right ='Ligue 1 - BT Sport' then days_right_broadcast else 0 end) as L1BTS_days_right_broadcast ,sum(case when analysis_right ='Ligue 1 - ESPN' then days_right_broadcast else 0 end) as L1ESPN_days_right_broadcast ,sum(case when analysis_right ='Match of the day - BBC' then days_right_broadcast else 0 end) as MOTDBBC_days_right_broadcast ,sum(case when analysis_right ='Matchroom Output Deal 2010-2012 (Other)- Sky Sports' then days_right_broadcast else 0 end) as MROSS_days_right_broadcast ,sum(case when analysis_right ='Matchroom Output Deal 2010-2012 (Pool)- Sky Sports' then days_right_broadcast else 0 end) as MRPSS_days_right_broadcast ,sum(case when analysis_right ='Matchroom Output Deal 2010-2012 (Snooker)- Sky Sports' then days_right_broadcast else 0 end) as MRSSS_days_right_broadcast ,sum(case when analysis_right ='Moto GP BBC' then days_right_broadcast else 0 end) as MGPBBC_days_right_broadcast ,sum(case when analysis_right ='NBA - Sky Sports' then days_right_broadcast else 0 end) as NBASS_days_right_broadcast ,sum(case when analysis_right ='NFL - BBC' then days_right_broadcast else 0 end) as NFLBBC_days_right_broadcast ,sum(case when analysis_right ='NFL - Channel 4' then days_right_broadcast else 0 end) as NFLCH4_days_right_broadcast ,sum(case when analysis_right ='NFL Seasons 2012-2015 - Sky Sports' then days_right_broadcast else 0 end) as NFLSS_days_right_broadcast ,sum(case when analysis_right ='Northern Ireland Football Association 2012-2014 - Sky Sports' then days_right_broadcast else 0 end) as NIFSS_days_right_broadcast ,sum(case when analysis_right ='Oaks - Channel 4' then days_right_broadcast else 0 end) as OAKCH4_days_right_broadcast ,sum(case when analysis_right ='Other American Football' then days_right_broadcast else 0 end) as AMOTH_days_right_broadcast ,sum(case when analysis_right ='Other Athletics' then days_right_broadcast else 0 end) as ATHOTH_days_right_broadcast ,sum(case when analysis_right ='Other Baseball' then days_right_broadcast else 0 end) as BASEOTH_days_right_broadcast ,sum(case when analysis_right ='Other Basketball' then days_right_broadcast else 0 end) as BASKOTH_days_right_broadcast ,sum(case when analysis_right ='Other Boxing' then days_right_broadcast else 0 end) as BOXOTH_days_right_broadcast ,sum(case when analysis_right ='Other Cricket' then days_right_broadcast else 0 end) as CRIOTH_days_right_broadcast ,sum(case when analysis_right ='Other Darts' then days_right_broadcast else 0 end) as DARTOTH_days_right_broadcast ,sum(case when analysis_right ='Other Equestrian' then days_right_broadcast else 0 end) as EQUOTH_days_right_broadcast ,sum(case when analysis_right ='Other Extreme' then days_right_broadcast else 0 end) as EXTOTH_days_right_broadcast ,sum(case when analysis_right ='Other Fishing' then days_right_broadcast else 0 end) as FSHOTH_days_right_broadcast ,sum(case when analysis_right ='Other Football' then days_right_broadcast else 0 end) as FOOTOTH_days_right_broadcast ,sum(case when analysis_right ='Other Golf' then days_right_broadcast else 0 end) as GOLFOTH_days_right_broadcast ,sum(case when analysis_right ='Other Ice Hockey' then days_right_broadcast else 0 end) as IHOTH_days_right_broadcast ,sum(case when analysis_right ='Other Motor Sport' then days_right_broadcast else 0 end) as MSPOTH_days_right_broadcast ,sum(case when analysis_right ='Other Racing' then days_right_broadcast else 0 end) as RACOTH_days_right_broadcast ,sum(case when analysis_right ='Other Rugby' then days_right_broadcast else 0 end) as RUGOTH_days_right_broadcast ,sum(case when analysis_right ='Other Rugby Internationals - ESPN' then days_right_broadcast else 0 end) as ORUGESPN_days_right_broadcast ,sum(case when analysis_right ='Other Snooker/Pool' then days_right_broadcast else 0 end) as OTHSNP_days_right_broadcast ,sum(case when analysis_right ='Other Tennis' then days_right_broadcast else 0 end) as OTHTEN_days_right_broadcast ,sum(case when analysis_right ='Other Unknown' then days_right_broadcast else 0 end) as OTHUNK_days_right_broadcast ,sum(case when analysis_right ='Other Watersports' then days_right_broadcast else 0 end) as OTHWAT_days_right_broadcast ,sum(case when analysis_right ='Other Wintersports' then days_right_broadcast else 0 end) as OTHWIN_days_right_broadcast ,sum(case when analysis_right ='Other Wrestling' then days_right_broadcast else 0 end) as OTHWRE_days_right_broadcast ,sum(case when analysis_right ='PGA Tour Golf 2010-2017 - Sky Sports' then days_right_broadcast else 0 end) as PGASS_days_right_broadcast ,sum(case when analysis_right ='Premier League - BT Sport' then days_right_broadcast else 0 end) as PLBTS_days_right_broadcast ,sum(case when analysis_right ='Premier League - ESPN' then days_right_broadcast else 0 end) as PLESPN_days_right_broadcast ,sum(case when analysis_right ='Premier League Darts 2010-2013 - Sky Sports' then days_right_broadcast else 0 end) as PLDSS_days_right_broadcast ,sum(case when analysis_right ='Premier League Football - Sky Sports' then days_right_broadcast else 0 end) as GPLSS_days_right_broadcast ,sum(case when analysis_right ='Premier League Football - Sky Sports (Match Choice)' then days_right_broadcast else 0 end) as PLMCSS_days_right_broadcast ,sum(case when analysis_right ='Premier League Football - Sky Sports (MNF)' then days_right_broadcast else 0 end) as PLMNFSS_days_right_broadcast ,sum(case when analysis_right ='Premier League Football - Sky Sports (non Live)' then days_right_broadcast else 0 end) as PLNLSS_days_right_broadcast ,sum(case when analysis_right ='Premier League Football - Sky Sports (other Live)' then days_right_broadcast else 0 end) as PLOLSS_days_right_broadcast ,sum(case when analysis_right ='Premier League Football - Sky Sports (Sat Lunchtime)' then days_right_broadcast else 0 end) as PLSLSS_days_right_broadcast ,sum(case when analysis_right ='Premier League Football - Sky Sports (Sat Night Live)' then days_right_broadcast else 0 end) as PLSNSS_days_right_broadcast ,sum(case when analysis_right ='Premier League Football - Sky Sports (Sun 4pm)' then days_right_broadcast else 0 end) as PLS4SS_days_right_broadcast ,sum(case when analysis_right ='Premier League Football - Sky Sports (Sun Lunchtime)' then days_right_broadcast else 0 end) as PLSULSS_days_right_broadcast ,sum(case when analysis_right ='Premiership Rugby - Sky Sports' then days_right_broadcast else 0 end) as PRUSS_days_right_broadcast ,sum(case when analysis_right ='Republic Of Ireland FA - 2010/11 To 2013/14 - Sky Sports' then days_right_broadcast else 0 end) as ROISS_days_right_broadcast ,sum(case when analysis_right ='Royal Ascot - Channel 4' then days_right_broadcast else 0 end) as RASCH4_days_right_broadcast ,sum(case when analysis_right ='Rugby Internationals (England) - BBC' then days_right_broadcast else 0 end) as RIEBBC_days_right_broadcast ,sum(case when analysis_right ='Rugby Internationals (Ireland) - BBC' then days_right_broadcast else 0 end) as RIIBBC_days_right_broadcast ,sum(case when analysis_right ='Rugby Internationals (Scotland) - BBC' then days_right_broadcast else 0 end) as RISBBC_days_right_broadcast ,sum(case when analysis_right ='Rugby Internationals (Wales) - BBC' then days_right_broadcast else 0 end) as RIWBBC_days_right_broadcast ,sum(case when analysis_right ='Rugby League Challenge Cup- BBC' then days_right_broadcast else 0 end) as RLCCBBC_days_right_broadcast ,sum(case when analysis_right ='Rugby League - Sky Sports' then days_right_broadcast else 0 end) as RLGSS_days_right_broadcast ,sum(case when analysis_right ='Rugby League World Cup- BBC' then days_right_broadcast else 0 end) as RLWCBBC_days_right_broadcast ,sum(case when analysis_right ='Sanzar Rugby Union 2011 - 2015 - Sky Sports' then days_right_broadcast else 0 end) as SARUSS_days_right_broadcast ,sum(case when analysis_right ='Scottish FA Deal - 2010/11 To 2013/14 - Sky Sports' then days_right_broadcast else 0 end) as SFASS_days_right_broadcast ,sum(case when analysis_right ='Serie A - BT Sport' then days_right_broadcast else 0 end) as SABTS_days_right_broadcast ,sum(case when analysis_right ='Serie A - ESPN' then days_right_broadcast else 0 end) as SAESPN_days_right_broadcast ,sum(case when analysis_right ='SFL - ESPN' then days_right_broadcast else 0 end) as SFLESPN_days_right_broadcast ,sum(case when analysis_right ='Six Nations - BBC' then days_right_broadcast else 0 end) as SNRBBC_days_right_broadcast ,sum(case when analysis_right ='Sky 1 and Sky 2 Boxing' then days_right_broadcast else 0 end) as BOXS12_days_right_broadcast ,sum(case when analysis_right ='Sky 1 and Sky 2 Football' then days_right_broadcast else 0 end) as FOOTS12_days_right_broadcast ,sum(case when analysis_right ='Sky 1 and Sky 2 Motor Sport' then days_right_broadcast else 0 end) as MSPS12_days_right_broadcast ,sum(case when analysis_right ='Sky 1 and Sky 2 Unknown' then days_right_broadcast else 0 end) as UNKS12_days_right_broadcast ,sum(case when analysis_right ='Sky 1 and Sky 2 Wrestling' then days_right_broadcast else 0 end) as WRES12_days_right_broadcast ,sum(case when analysis_right ='Sky Sports American Football' then days_right_broadcast else 0 end) as AMSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Athletics' then days_right_broadcast else 0 end) as ATHSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Baseball' then days_right_broadcast else 0 end) as BASESS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Basketball' then days_right_broadcast else 0 end) as BASKSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Boxing' then days_right_broadcast else 0 end) as BOXSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Cricket' then days_right_broadcast else 0 end) as CRISS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Darts' then days_right_broadcast else 0 end) as DARTSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Equestrian' then days_right_broadcast else 0 end) as EQUSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Extreme' then days_right_broadcast else 0 end) as EXTSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Fishing' then days_right_broadcast else 0 end) as FISHSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Football' then days_right_broadcast else 0 end) as FOOTSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Golf' then days_right_broadcast else 0 end) as GOLFSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Ice Hockey' then days_right_broadcast else 0 end) as IHSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Motor Sport' then days_right_broadcast else 0 end) as MSPSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Racing' then days_right_broadcast else 0 end) as RACSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Rugby' then days_right_broadcast else 0 end) as RUGSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Snooker/Pool' then days_right_broadcast else 0 end) as SNPSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Tennis' then days_right_broadcast else 0 end) as TENSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Unknown' then days_right_broadcast else 0 end) as UNKSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Watersports' then days_right_broadcast else 0 end) as WATSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Wintersports' then days_right_broadcast else 0 end) as WINSS_days_right_broadcast ,sum(case when analysis_right ='Sky Sports Wrestling' then days_right_broadcast else 0 end) as WRESS_days_right_broadcast ,sum(case when analysis_right ='Solheim Cup 2013 Ladies Golf - Sky Sports' then days_right_broadcast else 0 end) as SOLSS_days_right_broadcast ,sum(case when analysis_right ='South African Home Cricket 2012-2020 Sky Sports' then days_right_broadcast else 0 end) as SACSS_days_right_broadcast ,sum(case when analysis_right ='Spanish Football 2012/13 To 14/15 - Sky Sports' then days_right_broadcast else 0 end) as SPFSS_days_right_broadcast ,sum(case when analysis_right ='SPFL - BT Sport' then days_right_broadcast else 0 end) as SPFLBTS_days_right_broadcast ,sum(case when analysis_right ='SPL - ESPN' then days_right_broadcast else 0 end) as SPLESPN_days_right_broadcast ,sum(case when analysis_right ='SPL - Sky Sports' then days_right_broadcast else 0 end) as SPLSS_days_right_broadcast ,sum(case when analysis_right ='Sportfive World Cup 2014 Qualifers - Sky Sports' then days_right_broadcast else 0 end) as SP5SS_days_right_broadcast ,sum(case when analysis_right ='The boat race - BBC' then days_right_broadcast else 0 end) as BTRBBC_days_right_broadcast ,sum(case when analysis_right ='The football league show - BBC' then days_right_broadcast else 0 end) as FLSBBC_days_right_broadcast ,sum(case when analysis_right ='The Masters Golf - BBC' then days_right_broadcast else 0 end) as MGBBC_days_right_broadcast ,sum(case when analysis_right ='TNA Wrestling Challenge' then days_right_broadcast else 0 end) as TNACHA_days_right_broadcast ,sum(case when analysis_right ='Tour de France - Eurosport' then days_right_broadcast else 0 end) as TDFEUR_days_right_broadcast ,sum(case when analysis_right ='Tour de France - ITV' then days_right_broadcast else 0 end) as TDFITV_days_right_broadcast ,sum(case when analysis_right ='U S Masters Golf 2011-2014 Sky Sports' then days_right_broadcast else 0 end) as USMGSS_days_right_broadcast ,sum(case when analysis_right ='U.S Open Tennis 2013-2015 Sky Sports' then days_right_broadcast else 0 end) as USOTSS_days_right_broadcast ,sum(case when analysis_right ='U.S Open/Womens/Seniors/Amateur Golf Sky Sports' then days_right_broadcast else 0 end) as USOGSS_days_right_broadcast ,sum(case when analysis_right ='UEFA Champions League - Sky Sports' then days_right_broadcast else 0 end) as CLASS_days_right_broadcast ,sum(case when analysis_right ='UEFA Champions League - Sky Sports (non Live)' then days_right_broadcast else 0 end) as CLNSS_days_right_broadcast ,sum(case when analysis_right ='UEFA Champions League - Sky Sports (other Live)' then days_right_broadcast else 0 end) as CLOSS_days_right_broadcast ,sum(case when analysis_right ='UEFA Champions League - Sky Sports (Tue)' then days_right_broadcast else 0 end) as CLTSS_days_right_broadcast ,sum(case when analysis_right ='UEFA Champions League - Sky Sports (Wed)' then days_right_broadcast else 0 end) as CLWSS_days_right_broadcast ,sum(case when analysis_right ='US Open Tennis - Eurosport' then days_right_broadcast else 0 end) as USOTEUR_days_right_broadcast ,sum(case when analysis_right ='USA Football - BT Sport' then days_right_broadcast else 0 end) as USFBTS_days_right_broadcast ,sum(case when analysis_right ='USPGA Championship (2007-2016) Sky Sports' then days_right_broadcast else 0 end) as USPGASS_days_right_broadcast ,sum(case when analysis_right ='WCQ - ESPN' then days_right_broadcast else 0 end) as WCQESPN_days_right_broadcast ,sum(case when analysis_right ='Welsh Home International Football 2012-2014 Sky Sports' then days_right_broadcast else 0 end) as WIFSS_days_right_broadcast ,sum(case when analysis_right ='West Indies Home Cricket 2013-2020 Sky Sports' then days_right_broadcast else 0 end) as WICSS_days_right_broadcast ,sum(case when analysis_right ='Wimbledon - BBC' then days_right_broadcast else 0 end) as WIMBBC_days_right_broadcast ,sum(case when analysis_right ='Womens Cricket - I C C Cricket Deal 2012-2015 Sky Sports' then days_right_broadcast else 0 end) as WICCSS_days_right_broadcast ,sum(case when analysis_right ='World Athletics Championship - More 4' then days_right_broadcast else 0 end) as WACMR4_days_right_broadcast ,sum(case when analysis_right ='World Club Championship - BBC' then days_right_broadcast else 0 end) as WCLBBBC_days_right_broadcast ,sum(case when analysis_right ='World Cup Qualifiers - BT Sport' then days_right_broadcast else 0 end) as WCQBTS_days_right_broadcast ,sum(case when analysis_right ='World Darts Championship 2009-2012 Sky Sports' then days_right_broadcast else 0 end) as WDCSS_days_right_broadcast ,sum(case when analysis_right ='World snooker championship - BBC' then days_right_broadcast else 0 end) as WSCBBC_days_right_broadcast ,sum(case when analysis_right ='WWE Sky 1 and 2' then days_right_broadcast else 0 end) as WWES12_days_right_broadcast ,sum(case when analysis_right ='WWE Sky Sports' then days_right_broadcast else 0 end) as WWESS_days_right_broadcast ,sum(case when analysis_right ='Africa Cup of Nations - Eurosport' then right_broadcast_duration else 0 end) as AFCEUR_right_broadcast_duration ,sum(case when analysis_right ='Africa Cup of Nations - ITV' then right_broadcast_duration else 0 end) as AFCITV_right_broadcast_duration ,sum(case when analysis_right ='Americas Cup - BBC' then right_broadcast_duration else 0 end) as AMCBBC_right_broadcast_duration ,sum(case when analysis_right ='Asian Tour Golf 2012-2013 Sky Sports' then right_broadcast_duration else 0 end) as ATGSS_right_broadcast_duration ,sum(case when analysis_right ='ATP Tennis Masters Series 2011-2013 Sky Sports' then right_broadcast_duration else 0 end) as ATPSS_right_broadcast_duration ,sum(case when analysis_right ='Australia Home Cricket 2012-2016 Sky Sports' then right_broadcast_duration else 0 end) as AHCSS_right_broadcast_duration ,sum(case when analysis_right ='Australian Football - BT Sport' then right_broadcast_duration else 0 end) as AUFBTS_right_broadcast_duration ,sum(case when analysis_right ='Australian Open Tennis - BBC' then right_broadcast_duration else 0 end) as AOTBBC_right_broadcast_duration ,sum(case when analysis_right ='Australian Open Tennis - Eurosport' then right_broadcast_duration else 0 end) as AOTEUR_right_broadcast_duration ,sum(case when analysis_right ='Aviva Premiership - ESPN' then right_broadcast_duration else 0 end) as AVPSS_right_broadcast_duration ,sum(case when analysis_right ='BBC American Football' then right_broadcast_duration else 0 end) as AFBBC_right_broadcast_duration ,sum(case when analysis_right ='BBC Athletics' then right_broadcast_duration else 0 end) as ATHBBC_right_broadcast_duration ,sum(case when analysis_right ='BBC Boxing' then right_broadcast_duration else 0 end) as BOXBBC_right_broadcast_duration ,sum(case when analysis_right ='BBC Darts' then right_broadcast_duration else 0 end) as DRTBBC_right_broadcast_duration ,sum(case when analysis_right ='BBC Equestrian' then right_broadcast_duration else 0 end) as EQUBBC_right_broadcast_duration ,sum(case when analysis_right ='BBC Football' then right_broadcast_duration else 0 end) as FOOTBBC_right_broadcast_duration ,sum(case when analysis_right ='BBC Golf' then right_broadcast_duration else 0 end) as GOLFBBC_right_broadcast_duration ,sum(case when analysis_right ='BBC Motor Sport' then right_broadcast_duration else 0 end) as MSPBBC_right_broadcast_duration ,sum(case when analysis_right ='BBC Rugby' then right_broadcast_duration else 0 end) as RUGBBC_right_broadcast_duration ,sum(case when analysis_right ='BBC Snooker/Pool' then right_broadcast_duration else 0 end) as SNPBBC_right_broadcast_duration ,sum(case when analysis_right ='BBC Tennis' then right_broadcast_duration else 0 end) as TENBBC_right_broadcast_duration ,sum(case when analysis_right ='BBC Unknown' then right_broadcast_duration else 0 end) as UNKBBC_right_broadcast_duration ,sum(case when analysis_right ='BBC Watersports' then right_broadcast_duration else 0 end) as WATBBC_right_broadcast_duration ,sum(case when analysis_right ='BBC Wintersports' then right_broadcast_duration else 0 end) as WINBBC_right_broadcast_duration ,sum(case when analysis_right ='Boxing - Channel 5' then right_broadcast_duration else 0 end) as BOXCH5_right_broadcast_duration ,sum(case when analysis_right ='Boxing - Matchroom 2012-2014 Sky Sports' then right_broadcast_duration else 0 end) as BOXMSS_right_broadcast_duration ,sum(case when analysis_right ='Brazil Football - BT Sport' then right_broadcast_duration else 0 end) as BFTBTS_right_broadcast_duration ,sum(case when analysis_right ='British & Irish Lions 2013 - Sky Sports' then right_broadcast_duration else 0 end) as BILSS_right_broadcast_duration ,sum(case when analysis_right ='British Open Golf - BBC' then right_broadcast_duration else 0 end) as BOGSS_right_broadcast_duration ,sum(case when analysis_right ='BT Sport American Football' then right_broadcast_duration else 0 end) as AFBTS_right_broadcast_duration ,sum(case when analysis_right ='BT Sport Athletics' then right_broadcast_duration else 0 end) as ATHBTS_right_broadcast_duration ,sum(case when analysis_right ='BT Sport Baseball' then right_broadcast_duration else 0 end) as BASEBTS_right_broadcast_duration ,sum(case when analysis_right ='BT Sport Basketball' then right_broadcast_duration else 0 end) as BASKBTS_right_broadcast_duration ,sum(case when analysis_right ='BT Sport Boxing' then right_broadcast_duration else 0 end) as BOXBTS_right_broadcast_duration ,sum(case when analysis_right ='BT Sport Cricket' then right_broadcast_duration else 0 end) as CRIBTS_right_broadcast_duration ,sum(case when analysis_right ='BT Sport Equestrian' then right_broadcast_duration else 0 end) as EQUBTS_right_broadcast_duration ,sum(case when analysis_right ='BT Sport Extreme' then right_broadcast_duration else 0 end) as EXTBTS_right_broadcast_duration ,sum(case when analysis_right ='BT Sport Football' then right_broadcast_duration else 0 end) as FOOTBTS_right_broadcast_duration ,sum(case when analysis_right ='BT Sport Motor Sport' then right_broadcast_duration else 0 end) as MSPBTS_right_broadcast_duration ,sum(case when analysis_right ='BT Sport Rugby' then right_broadcast_duration else 0 end) as RUGBTS_right_broadcast_duration ,sum(case when analysis_right ='BT Sport Tennis' then right_broadcast_duration else 0 end) as TENBTS_right_broadcast_duration ,sum(case when analysis_right ='BT Sport Unknown' then right_broadcast_duration else 0 end) as UNKBTS_right_broadcast_duration ,sum(case when analysis_right ='BT Sport Wintersports' then right_broadcast_duration else 0 end) as WINBTS_right_broadcast_duration ,sum(case when analysis_right ='Bundesliga - BT Sport' then right_broadcast_duration else 0 end) as BUNBTS_right_broadcast_duration ,sum(case when analysis_right ='Bundesliga- ESPN' then right_broadcast_duration else 0 end) as BUNESPN_right_broadcast_duration ,sum(case when analysis_right ='Challenge Darts' then right_broadcast_duration else 0 end) as DRTCHA_right_broadcast_duration ,sum(case when analysis_right ='Challenge Extreme' then right_broadcast_duration else 0 end) as EXTCHA_right_broadcast_duration ,sum(case when analysis_right ='Challenge Unknown' then right_broadcast_duration else 0 end) as UNKCHA_right_broadcast_duration ,sum(case when analysis_right ='Challenge Wrestling' then right_broadcast_duration else 0 end) as WRECHA_right_broadcast_duration ,sum(case when analysis_right ='Champions League - ITV' then right_broadcast_duration else 0 end) as CHLITV_right_broadcast_duration ,sum(case when analysis_right ='Champions Trophy - I C C Cricket Deal 2012-2015 Sky Sports' then right_broadcast_duration else 0 end) as ICCSS_right_broadcast_duration ,sum(case when analysis_right ='Channel 4 American Football' then right_broadcast_duration else 0 end) as AMCH4_right_broadcast_duration ,sum(case when analysis_right ='Channel 4 Athletics' then right_broadcast_duration else 0 end) as ATHCH4_right_broadcast_duration ,sum(case when analysis_right ='Channel 4 Boxing' then right_broadcast_duration else 0 end) as BOXCH4_right_broadcast_duration ,sum(case when analysis_right ='Channel 4 Equestrian' then right_broadcast_duration else 0 end) as EQUCH4_right_broadcast_duration ,sum(case when analysis_right ='Channel 4 Extreme' then right_broadcast_duration else 0 end) as EXTCH4_right_broadcast_duration ,sum(case when analysis_right ='Channel 4 Football' then right_broadcast_duration else 0 end) as FOOTCH4_right_broadcast_duration ,sum(case when analysis_right ='Channel 4 Motor Sport' then right_broadcast_duration else 0 end) as MSPCH4_right_broadcast_duration ,sum(case when analysis_right ='Channel 4 Racing' then right_broadcast_duration else 0 end) as RACCH4_right_broadcast_duration ,sum(case when analysis_right ='Channel 4 Unknown' then right_broadcast_duration else 0 end) as UNKCH4_right_broadcast_duration ,sum(case when analysis_right ='Channel 4 Watersports' then right_broadcast_duration else 0 end) as WATCH4_right_broadcast_duration ,sum(case when analysis_right ='Channel 4 Wintersports' then right_broadcast_duration else 0 end) as WINCH4_right_broadcast_duration ,sum(case when analysis_right ='Channel 5 Athletics' then right_broadcast_duration else 0 end) as ATHCH5_right_broadcast_duration ,sum(case when analysis_right ='Channel 5 Boxing' then right_broadcast_duration else 0 end) as BOXOCH5_right_broadcast_duration ,sum(case when analysis_right ='Channel 5 Cricket' then right_broadcast_duration else 0 end) as CRICH5_right_broadcast_duration ,sum(case when analysis_right ='Channel 5 Motor Sport' then right_broadcast_duration else 0 end) as MSPCH5_right_broadcast_duration ,sum(case when analysis_right ='Channel 5 Unknown' then right_broadcast_duration else 0 end) as UNKCH5_right_broadcast_duration ,sum(case when analysis_right ='Channel 5 Wrestling' then right_broadcast_duration else 0 end) as WRECH5_right_broadcast_duration ,sum(case when analysis_right ='Cheltenham Festival - Channel 4' then right_broadcast_duration else 0 end) as CHELCH4_right_broadcast_duration ,sum(case when analysis_right ='Community Shield - ITV' then right_broadcast_duration else 0 end) as CMSITV_right_broadcast_duration ,sum(case when analysis_right ='Confederations Cup - BBC' then right_broadcast_duration else 0 end) as CONCBBC_right_broadcast_duration ,sum(case when analysis_right ='Conference - BT Sport' then right_broadcast_duration else 0 end) as CONFBTS_right_broadcast_duration ,sum(case when analysis_right ='Cycling - La Vuelta ITV' then right_broadcast_duration else 0 end) as CLVITV_right_broadcast_duration ,sum(case when analysis_right ='Cycling - U C I World Tour Sky Sports' then right_broadcast_duration else 0 end) as CUCISS_right_broadcast_duration ,sum(case when analysis_right ='Cycling Tour of Britain - Eurosport' then right_broadcast_duration else 0 end) as CTBEUR_right_broadcast_duration ,sum(case when analysis_right ='Cycling: tour of britain ITV4' then right_broadcast_duration else 0 end) as CTCITV_right_broadcast_duration ,sum(case when analysis_right ='Derby - Channel 4' then right_broadcast_duration else 0 end) as DERCH4_right_broadcast_duration ,sum(case when analysis_right ='ECB (highlights) - Channel 5' then right_broadcast_duration else 0 end) as ECBHCH5_right_broadcast_duration ,sum(case when analysis_right ='ECB Cricket Sky Sports' then right_broadcast_duration else 0 end) as GECRSS_right_broadcast_duration ,sum(case when analysis_right ='ECB non-Test Cricket Sky Sports' then right_broadcast_duration else 0 end) as ECBNSS_right_broadcast_duration ,sum(case when analysis_right ='ECB Test Cricket Sky Sports' then right_broadcast_duration else 0 end) as ECBTSS_right_broadcast_duration ,sum(case when analysis_right ='England Football Internationals - ITV' then right_broadcast_duration else 0 end) as GENGITV_right_broadcast_duration ,sum(case when analysis_right ='England Friendlies (Football) - ITV' then right_broadcast_duration else 0 end) as EFRITV_right_broadcast_duration ,sum(case when analysis_right ='England Rugby Internationals 2010-2015 - Sky Sports' then right_broadcast_duration else 0 end) as ENRSS_right_broadcast_duration ,sum(case when analysis_right ='England World Cup Qualifying (Away) - ITV' then right_broadcast_duration else 0 end) as EWQAITV_right_broadcast_duration ,sum(case when analysis_right ='England World Cup Qualifying (Home) - ITV' then right_broadcast_duration else 0 end) as EWQHITV_right_broadcast_duration ,sum(case when analysis_right ='ESPN American Football' then right_broadcast_duration else 0 end) as AMESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Athletics' then right_broadcast_duration else 0 end) as ATHESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Baseball' then right_broadcast_duration else 0 end) as BASEESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Basketball' then right_broadcast_duration else 0 end) as BASKESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Boxing' then right_broadcast_duration else 0 end) as BOXESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Cricket' then right_broadcast_duration else 0 end) as CRIESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Darts' then right_broadcast_duration else 0 end) as DARTESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Equestrian' then right_broadcast_duration else 0 end) as EQUESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Extreme' then right_broadcast_duration else 0 end) as EXTESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Football' then right_broadcast_duration else 0 end) as FOOTESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Golf' then right_broadcast_duration else 0 end) as GOLFESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Ice Hockey' then right_broadcast_duration else 0 end) as IHESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Motor Sport' then right_broadcast_duration else 0 end) as MSPESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Racing' then right_broadcast_duration else 0 end) as RACESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Rugby' then right_broadcast_duration else 0 end) as RUGESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Snooker/Pool' then right_broadcast_duration else 0 end) as SNPESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Tennis' then right_broadcast_duration else 0 end) as TENESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Unknown' then right_broadcast_duration else 0 end) as UNKESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Watersports' then right_broadcast_duration else 0 end) as WATESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Wintersports' then right_broadcast_duration else 0 end) as WINESPN_right_broadcast_duration ,sum(case when analysis_right ='ESPN Wrestling' then right_broadcast_duration else 0 end) as WREESPN_right_broadcast_duration ,sum(case when analysis_right ='Europa League - BT Sport' then right_broadcast_duration else 0 end) as ELBTSP_right_broadcast_duration ,sum(case when analysis_right ='Europa League - ESPN' then right_broadcast_duration else 0 end) as ELESPN_right_broadcast_duration ,sum(case when analysis_right ='Europa League - ITV' then right_broadcast_duration else 0 end) as ELITV_right_broadcast_duration ,sum(case when analysis_right ='European Tour Golf - Sky Sports' then right_broadcast_duration else 0 end) as ETGSS_right_broadcast_duration ,sum(case when analysis_right ='Eurosport American Football' then right_broadcast_duration else 0 end) as AMEUR_right_broadcast_duration ,sum(case when analysis_right ='Eurosport Athletics' then right_broadcast_duration else 0 end) as ATHEUR_right_broadcast_duration ,sum(case when analysis_right ='Eurosport Baseball' then right_broadcast_duration else 0 end) as BASEEUR_right_broadcast_duration ,sum(case when analysis_right ='Eurosport Basketball' then right_broadcast_duration else 0 end) as BASKEUR_right_broadcast_duration ,sum(case when analysis_right ='Eurosport Boxing' then right_broadcast_duration else 0 end) as BOXEUR_right_broadcast_duration ,sum(case when analysis_right ='Eurosport Cricket' then right_broadcast_duration else 0 end) as CRIEUR_right_broadcast_duration ,sum(case when analysis_right ='Eurosport Darts' then right_broadcast_duration else 0 end) as DARTEUR_right_broadcast_duration ,sum(case when analysis_right ='Eurosport Equestrian' then right_broadcast_duration else 0 end) as EQUEUR_right_broadcast_duration ,sum(case when analysis_right ='Eurosport Extreme' then right_broadcast_duration else 0 end) as EXTEUR_right_broadcast_duration ,sum(case when analysis_right ='Eurosport Football' then right_broadcast_duration else 0 end) as FOOTEUR_right_broadcast_duration ,sum(case when analysis_right ='Eurosport Golf' then right_broadcast_duration else 0 end) as GOLFEUR_right_broadcast_duration ,sum(case when analysis_right ='Eurosport Ice Hockey' then right_broadcast_duration else 0 end) as IHEUR_right_broadcast_duration ,sum(case when analysis_right ='Eurosport Motor Sport' then right_broadcast_duration else 0 end) as MSPEUR_right_broadcast_duration ,sum(case when analysis_right ='Eurosport Racing' then right_broadcast_duration else 0 end) as RACEUR_right_broadcast_duration ,sum(case when analysis_right ='Eurosport Snooker/Pool' then right_broadcast_duration else 0 end) as SNPEUR_right_broadcast_duration ,sum(case when analysis_right ='Eurosport Tennis' then right_broadcast_duration else 0 end) as TENEUR_right_broadcast_duration ,sum(case when analysis_right ='Eurosport Unknown' then right_broadcast_duration else 0 end) as UNKEUR_right_broadcast_duration ,sum(case when analysis_right ='Eurosport Watersports' then right_broadcast_duration else 0 end) as WATEUR_right_broadcast_duration ,sum(case when analysis_right ='Eurosport Wintersports' then right_broadcast_duration else 0 end) as WINEUR_right_broadcast_duration ,sum(case when analysis_right ='F1 - BBC' then right_broadcast_duration else 0 end) as GF1BBC_right_broadcast_duration ,sum(case when analysis_right ='F1 - Sky Sports' then right_broadcast_duration else 0 end) as GF1SS_right_broadcast_duration ,sum(case when analysis_right ='F1 (non-Live)- BBC' then right_broadcast_duration else 0 end) as F1NBBC_right_broadcast_duration ,sum(case when analysis_right ='F1 (Practice Live)- BBC' then right_broadcast_duration else 0 end) as F1PBBC_right_broadcast_duration ,sum(case when analysis_right ='F1 (Qualifying Live)- BBC' then right_broadcast_duration else 0 end) as F1QBBC_right_broadcast_duration ,sum(case when analysis_right ='F1 (Race Live)- BBC' then right_broadcast_duration else 0 end) as F1RBBC_right_broadcast_duration ,sum(case when analysis_right ='FA Cup - ESPN' then right_broadcast_duration else 0 end) as FACESPN_right_broadcast_duration ,sum(case when analysis_right ='FA Cup - ITV' then right_broadcast_duration else 0 end) as FACITV_right_broadcast_duration ,sum(case when analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - Capital 1 Cup' then right_broadcast_duration else 0 end) as FLCCSS_right_broadcast_duration ,sum(case when analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - others' then right_broadcast_duration else 0 end) as FLOTSS_right_broadcast_duration ,sum(case when analysis_right ='Formula One 2012-2018 - (non-Live) Sky Sports' then right_broadcast_duration else 0 end) as F1NSS_right_broadcast_duration ,sum(case when analysis_right ='Formula One 2012-2018 - (Practice Live) Sky Sports' then right_broadcast_duration else 0 end) as F1PSS_right_broadcast_duration ,sum(case when analysis_right ='Formula One 2012-2018 - (Qualifying Live) Sky Sports' then right_broadcast_duration else 0 end) as F1QSS_right_broadcast_duration ,sum(case when analysis_right ='Formula One 2012-2018 - (Race Live) Sky Sports' then right_broadcast_duration else 0 end) as F1RSS_right_broadcast_duration ,sum(case when analysis_right ='French Open Tennis - Eurosport' then right_broadcast_duration else 0 end) as FOTEUR_right_broadcast_duration ,sum(case when analysis_right ='French Open Tennis - ITV' then right_broadcast_duration else 0 end) as FOTITV_right_broadcast_duration ,sum(case when analysis_right ='Grand National - Channel 4' then right_broadcast_duration else 0 end) as GDNCH4_right_broadcast_duration ,sum(case when analysis_right ='Heineken Cup 2010/11 To 2013/14- Sky Sports' then right_broadcast_duration else 0 end) as HECSS_right_broadcast_duration ,sum(case when analysis_right ='I R B Sevens 2008/09 -2014/15 - Sky Sports' then right_broadcast_duration else 0 end) as IRBSS_right_broadcast_duration ,sum(case when analysis_right ='IAAF World Athletics Championship - Eurosport' then right_broadcast_duration else 0 end) as WACEUR_right_broadcast_duration ,sum(case when analysis_right ='India Home Cricket 2012-2018 Sky Sports' then right_broadcast_duration else 0 end) as IHCSS_right_broadcast_duration ,sum(case when analysis_right ='India Premier League - ITV' then right_broadcast_duration else 0 end) as IPLITV_right_broadcast_duration ,sum(case when analysis_right ='International Freindlies - ESPN' then right_broadcast_duration else 0 end) as IFESPN_right_broadcast_duration ,sum(case when analysis_right ='International Friendlies - BT Sport' then right_broadcast_duration else 0 end) as IFBTS_right_broadcast_duration ,sum(case when analysis_right ='ITV1 Boxing' then right_broadcast_duration else 0 end) as BOXITV1_right_broadcast_duration ,sum(case when analysis_right ='ITV1 Football' then right_broadcast_duration else 0 end) as FOOTITV1_right_broadcast_duration ,sum(case when analysis_right ='ITV1 Motor Sport' then right_broadcast_duration else 0 end) as MOTSITV1_right_broadcast_duration ,sum(case when analysis_right ='ITV1 Rugby' then right_broadcast_duration else 0 end) as RUGITV1_right_broadcast_duration ,sum(case when analysis_right ='ITV1 Snooker/Pool' then right_broadcast_duration else 0 end) as SNPITV1_right_broadcast_duration ,sum(case when analysis_right ='ITV1 Unknown' then right_broadcast_duration else 0 end) as UNKITV1_right_broadcast_duration ,sum(case when analysis_right ='ITV4 Boxing' then right_broadcast_duration else 0 end) as BOXITV4_right_broadcast_duration ,sum(case when analysis_right ='ITV4 Cricket' then right_broadcast_duration else 0 end) as CRIITV4_right_broadcast_duration ,sum(case when analysis_right ='ITV4 Darts' then right_broadcast_duration else 0 end) as DARTITV4_right_broadcast_duration ,sum(case when analysis_right ='ITV4 Extreme' then right_broadcast_duration else 0 end) as EXTITV4_right_broadcast_duration ,sum(case when analysis_right ='ITV4 Football' then right_broadcast_duration else 0 end) as FOOTITV4_right_broadcast_duration ,sum(case when analysis_right ='ITV4 Motor Sport' then right_broadcast_duration else 0 end) as MSPITV4_right_broadcast_duration ,sum(case when analysis_right ='ITV4 Rugby' then right_broadcast_duration else 0 end) as RUGITV4_right_broadcast_duration ,sum(case when analysis_right ='ITV4 Snooker/Pool' then right_broadcast_duration else 0 end) as SNPITV4_right_broadcast_duration ,sum(case when analysis_right ='ITV4 Tennis' then right_broadcast_duration else 0 end) as TENITV4_right_broadcast_duration ,sum(case when analysis_right ='ITV4 Unknown' then right_broadcast_duration else 0 end) as UNKITV4_right_broadcast_duration ,sum(case when analysis_right ='Ligue 1 - BT Sport' then right_broadcast_duration else 0 end) as L1BTS_right_broadcast_duration ,sum(case when analysis_right ='Ligue 1 - ESPN' then right_broadcast_duration else 0 end) as L1ESPN_right_broadcast_duration ,sum(case when analysis_right ='Match of the day - BBC' then right_broadcast_duration else 0 end) as MOTDBBC_right_broadcast_duration ,sum(case when analysis_right ='Matchroom Output Deal 2010-2012 (Other)- Sky Sports' then right_broadcast_duration else 0 end) as MROSS_right_broadcast_duration ,sum(case when analysis_right ='Matchroom Output Deal 2010-2012 (Pool)- Sky Sports' then right_broadcast_duration else 0 end) as MRPSS_right_broadcast_duration ,sum(case when analysis_right ='Matchroom Output Deal 2010-2012 (Snooker)- Sky Sports' then right_broadcast_duration else 0 end) as MRSSS_right_broadcast_duration ,sum(case when analysis_right ='Moto GP BBC' then right_broadcast_duration else 0 end) as MGPBBC_right_broadcast_duration ,sum(case when analysis_right ='NBA - Sky Sports' then right_broadcast_duration else 0 end) as NBASS_right_broadcast_duration ,sum(case when analysis_right ='NFL - BBC' then right_broadcast_duration else 0 end) as NFLBBC_right_broadcast_duration ,sum(case when analysis_right ='NFL - Channel 4' then right_broadcast_duration else 0 end) as NFLCH4_right_broadcast_duration ,sum(case when analysis_right ='NFL Seasons 2012-2015 - Sky Sports' then right_broadcast_duration else 0 end) as NFLSS_right_broadcast_duration ,sum(case when analysis_right ='Northern Ireland Football Association 2012-2014 - Sky Sports' then right_broadcast_duration else 0 end) as NIFSS_right_broadcast_duration ,sum(case when analysis_right ='Oaks - Channel 4' then right_broadcast_duration else 0 end) as OAKCH4_right_broadcast_duration ,sum(case when analysis_right ='Other American Football' then right_broadcast_duration else 0 end) as AMOTH_right_broadcast_duration ,sum(case when analysis_right ='Other Athletics' then right_broadcast_duration else 0 end) as ATHOTH_right_broadcast_duration ,sum(case when analysis_right ='Other Baseball' then right_broadcast_duration else 0 end) as BASEOTH_right_broadcast_duration ,sum(case when analysis_right ='Other Basketball' then right_broadcast_duration else 0 end) as BASKOTH_right_broadcast_duration ,sum(case when analysis_right ='Other Boxing' then right_broadcast_duration else 0 end) as BOXOTH_right_broadcast_duration ,sum(case when analysis_right ='Other Cricket' then right_broadcast_duration else 0 end) as CRIOTH_right_broadcast_duration ,sum(case when analysis_right ='Other Darts' then right_broadcast_duration else 0 end) as DARTOTH_right_broadcast_duration ,sum(case when analysis_right ='Other Equestrian' then right_broadcast_duration else 0 end) as EQUOTH_right_broadcast_duration ,sum(case when analysis_right ='Other Extreme' then right_broadcast_duration else 0 end) as EXTOTH_right_broadcast_duration ,sum(case when analysis_right ='Other Fishing' then right_broadcast_duration else 0 end) as FSHOTH_right_broadcast_duration ,sum(case when analysis_right ='Other Football' then right_broadcast_duration else 0 end) as FOOTOTH_right_broadcast_duration ,sum(case when analysis_right ='Other Golf' then right_broadcast_duration else 0 end) as GOLFOTH_right_broadcast_duration ,sum(case when analysis_right ='Other Ice Hockey' then right_broadcast_duration else 0 end) as IHOTH_right_broadcast_duration ,sum(case when analysis_right ='Other Motor Sport' then right_broadcast_duration else 0 end) as MSPOTH_right_broadcast_duration ,sum(case when analysis_right ='Other Racing' then right_broadcast_duration else 0 end) as RACOTH_right_broadcast_duration ,sum(case when analysis_right ='Other Rugby' then right_broadcast_duration else 0 end) as RUGOTH_right_broadcast_duration ,sum(case when analysis_right ='Other Rugby Internationals - ESPN' then right_broadcast_duration else 0 end) as ORUGESPN_right_broadcast_duration ,sum(case when analysis_right ='Other Snooker/Pool' then right_broadcast_duration else 0 end) as OTHSNP_right_broadcast_duration ,sum(case when analysis_right ='Other Tennis' then right_broadcast_duration else 0 end) as OTHTEN_right_broadcast_duration ,sum(case when analysis_right ='Other Unknown' then right_broadcast_duration else 0 end) as OTHUNK_right_broadcast_duration ,sum(case when analysis_right ='Other Watersports' then right_broadcast_duration else 0 end) as OTHWAT_right_broadcast_duration ,sum(case when analysis_right ='Other Wintersports' then right_broadcast_duration else 0 end) as OTHWIN_right_broadcast_duration ,sum(case when analysis_right ='Other Wrestling' then right_broadcast_duration else 0 end) as OTHWRE_right_broadcast_duration ,sum(case when analysis_right ='PGA Tour Golf 2010-2017 - Sky Sports' then right_broadcast_duration else 0 end) as PGASS_right_broadcast_duration ,sum(case when analysis_right ='Premier League - BT Sport' then right_broadcast_duration else 0 end) as PLBTS_right_broadcast_duration ,sum(case when analysis_right ='Premier League - ESPN' then right_broadcast_duration else 0 end) as PLESPN_right_broadcast_duration ,sum(case when analysis_right ='Premier League Darts 2010-2013 - Sky Sports' then right_broadcast_duration else 0 end) as PLDSS_right_broadcast_duration ,sum(case when analysis_right ='Premier League Football - Sky Sports' then right_broadcast_duration else 0 end) as GPLSS_right_broadcast_duration ,sum(case when analysis_right ='Premier League Football - Sky Sports (Match Choice)' then right_broadcast_duration else 0 end) as PLMCSS_right_broadcast_duration ,sum(case when analysis_right ='Premier League Football - Sky Sports (MNF)' then right_broadcast_duration else 0 end) as PLMNFSS_right_broadcast_duration ,sum(case when analysis_right ='Premier League Football - Sky Sports (non Live)' then right_broadcast_duration else 0 end) as PLNLSS_right_broadcast_duration ,sum(case when analysis_right ='Premier League Football - Sky Sports (other Live)' then right_broadcast_duration else 0 end) as PLOLSS_right_broadcast_duration ,sum(case when analysis_right ='Premier League Football - Sky Sports (Sat Lunchtime)' then right_broadcast_duration else 0 end) as PLSLSS_right_broadcast_duration ,sum(case when analysis_right ='Premier League Football - Sky Sports (Sat Night Live)' then right_broadcast_duration else 0 end) as PLSNSS_right_broadcast_duration ,sum(case when analysis_right ='Premier League Football - Sky Sports (Sun 4pm)' then right_broadcast_duration else 0 end) as PLS4SS_right_broadcast_duration ,sum(case when analysis_right ='Premier League Football - Sky Sports (Sun Lunchtime)' then right_broadcast_duration else 0 end) as PLSULSS_right_broadcast_duration ,sum(case when analysis_right ='Premiership Rugby - Sky Sports' then right_broadcast_duration else 0 end) as PRUSS_right_broadcast_duration ,sum(case when analysis_right ='Republic Of Ireland FA - 2010/11 To 2013/14 - Sky Sports' then right_broadcast_duration else 0 end) as ROISS_right_broadcast_duration ,sum(case when analysis_right ='Royal Ascot - Channel 4' then right_broadcast_duration else 0 end) as RASCH4_right_broadcast_duration ,sum(case when analysis_right ='Rugby Internationals (England) - BBC' then right_broadcast_duration else 0 end) as RIEBBC_right_broadcast_duration ,sum(case when analysis_right ='Rugby Internationals (Ireland) - BBC' then right_broadcast_duration else 0 end) as RIIBBC_right_broadcast_duration ,sum(case when analysis_right ='Rugby Internationals (Scotland) - BBC' then right_broadcast_duration else 0 end) as RISBBC_right_broadcast_duration ,sum(case when analysis_right ='Rugby Internationals (Wales) - BBC' then right_broadcast_duration else 0 end) as RIWBBC_right_broadcast_duration ,sum(case when analysis_right ='Rugby League Challenge Cup- BBC' then right_broadcast_duration else 0 end) as RLCCBBC_right_broadcast_duration ,sum(case when analysis_right ='Rugby League - Sky Sports' then right_broadcast_duration else 0 end) as RLGSS_right_broadcast_duration ,sum(case when analysis_right ='Rugby League World Cup- BBC' then right_broadcast_duration else 0 end) as RLWCBBC_right_broadcast_duration ,sum(case when analysis_right ='Sanzar Rugby Union 2011 - 2015 - Sky Sports' then right_broadcast_duration else 0 end) as SARUSS_right_broadcast_duration ,sum(case when analysis_right ='Scottish FA Deal - 2010/11 To 2013/14 - Sky Sports' then right_broadcast_duration else 0 end) as SFASS_right_broadcast_duration ,sum(case when analysis_right ='Serie A - BT Sport' then right_broadcast_duration else 0 end) as SABTS_right_broadcast_duration ,sum(case when analysis_right ='Serie A - ESPN' then right_broadcast_duration else 0 end) as SAESPN_right_broadcast_duration ,sum(case when analysis_right ='SFL - ESPN' then right_broadcast_duration else 0 end) as SFLESPN_right_broadcast_duration ,sum(case when analysis_right ='Six Nations - BBC' then right_broadcast_duration else 0 end) as SNRBBC_right_broadcast_duration ,sum(case when analysis_right ='Sky 1 and Sky 2 Boxing' then right_broadcast_duration else 0 end) as BOXS12_right_broadcast_duration ,sum(case when analysis_right ='Sky 1 and Sky 2 Football' then right_broadcast_duration else 0 end) as FOOTS12_right_broadcast_duration ,sum(case when analysis_right ='Sky 1 and Sky 2 Motor Sport' then right_broadcast_duration else 0 end) as MSPS12_right_broadcast_duration ,sum(case when analysis_right ='Sky 1 and Sky 2 Unknown' then right_broadcast_duration else 0 end) as UNKS12_right_broadcast_duration ,sum(case when analysis_right ='Sky 1 and Sky 2 Wrestling' then right_broadcast_duration else 0 end) as WRES12_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports American Football' then right_broadcast_duration else 0 end) as AMSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Athletics' then right_broadcast_duration else 0 end) as ATHSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Baseball' then right_broadcast_duration else 0 end) as BASESS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Basketball' then right_broadcast_duration else 0 end) as BASKSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Boxing' then right_broadcast_duration else 0 end) as BOXSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Cricket' then right_broadcast_duration else 0 end) as CRISS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Darts' then right_broadcast_duration else 0 end) as DARTSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Equestrian' then right_broadcast_duration else 0 end) as EQUSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Extreme' then right_broadcast_duration else 0 end) as EXTSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Fishing' then right_broadcast_duration else 0 end) as FISHSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Football' then right_broadcast_duration else 0 end) as FOOTSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Golf' then right_broadcast_duration else 0 end) as GOLFSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Ice Hockey' then right_broadcast_duration else 0 end) as IHSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Motor Sport' then right_broadcast_duration else 0 end) as MSPSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Racing' then right_broadcast_duration else 0 end) as RACSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Rugby' then right_broadcast_duration else 0 end) as RUGSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Snooker/Pool' then right_broadcast_duration else 0 end) as SNPSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Tennis' then right_broadcast_duration else 0 end) as TENSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Unknown' then right_broadcast_duration else 0 end) as UNKSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Watersports' then right_broadcast_duration else 0 end) as WATSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Wintersports' then right_broadcast_duration else 0 end) as WINSS_right_broadcast_duration ,sum(case when analysis_right ='Sky Sports Wrestling' then right_broadcast_duration else 0 end) as WRESS_right_broadcast_duration ,sum(case when analysis_right ='Solheim Cup 2013 Ladies Golf - Sky Sports' then right_broadcast_duration else 0 end) as SOLSS_right_broadcast_duration ,sum(case when analysis_right ='South African Home Cricket 2012-2020 Sky Sports' then right_broadcast_duration else 0 end) as SACSS_right_broadcast_duration ,sum(case when analysis_right ='Spanish Football 2012/13 To 14/15 - Sky Sports' then right_broadcast_duration else 0 end) as SPFSS_right_broadcast_duration ,sum(case when analysis_right ='SPFL - BT Sport' then right_broadcast_duration else 0 end) as SPFLBTS_right_broadcast_duration ,sum(case when analysis_right ='SPL - ESPN' then right_broadcast_duration else 0 end) as SPLESPN_right_broadcast_duration ,sum(case when analysis_right ='SPL - Sky Sports' then right_broadcast_duration else 0 end) as SPLSS_right_broadcast_duration ,sum(case when analysis_right ='Sportfive World Cup 2014 Qualifers - Sky Sports' then right_broadcast_duration else 0 end) as SP5SS_right_broadcast_duration ,sum(case when analysis_right ='The boat race - BBC' then right_broadcast_duration else 0 end) as BTRBBC_right_broadcast_duration ,sum(case when analysis_right ='The football league show - BBC' then right_broadcast_duration else 0 end) as FLSBBC_right_broadcast_duration ,sum(case when analysis_right ='The Masters Golf - BBC' then right_broadcast_duration else 0 end) as MGBBC_right_broadcast_duration ,sum(case when analysis_right ='TNA Wrestling Challenge' then right_broadcast_duration else 0 end) as TNACHA_right_broadcast_duration ,sum(case when analysis_right ='Tour de France - Eurosport' then right_broadcast_duration else 0 end) as TDFEUR_right_broadcast_duration ,sum(case when analysis_right ='Tour de France - ITV' then right_broadcast_duration else 0 end) as TDFITV_right_broadcast_duration ,sum(case when analysis_right ='U S Masters Golf 2011-2014 Sky Sports' then right_broadcast_duration else 0 end) as USMGSS_right_broadcast_duration ,sum(case when analysis_right ='U.S Open Tennis 2013-2015 Sky Sports' then right_broadcast_duration else 0 end) as USOTSS_right_broadcast_duration ,sum(case when analysis_right ='U.S Open/Womens/Seniors/Amateur Golf Sky Sports' then right_broadcast_duration else 0 end) as USOGSS_right_broadcast_duration ,sum(case when analysis_right ='UEFA Champions League - Sky Sports' then right_broadcast_duration else 0 end) as CLASS_right_broadcast_duration ,sum(case when analysis_right ='UEFA Champions League - Sky Sports (non Live)' then right_broadcast_duration else 0 end) as CLNSS_right_broadcast_duration ,sum(case when analysis_right ='UEFA Champions League - Sky Sports (other Live)' then right_broadcast_duration else 0 end) as CLOSS_right_broadcast_duration ,sum(case when analysis_right ='UEFA Champions League - Sky Sports (Tue)' then right_broadcast_duration else 0 end) as CLTSS_right_broadcast_duration ,sum(case when analysis_right ='UEFA Champions League - Sky Sports (Wed)' then right_broadcast_duration else 0 end) as CLWSS_right_broadcast_duration ,sum(case when analysis_right ='US Open Tennis - Eurosport' then right_broadcast_duration else 0 end) as USOTEUR_right_broadcast_duration ,sum(case when analysis_right ='USA Football - BT Sport' then right_broadcast_duration else 0 end) as USFBTS_right_broadcast_duration ,sum(case when analysis_right ='USPGA Championship (2007-2016) Sky Sports' then right_broadcast_duration else 0 end) as USPGASS_right_broadcast_duration ,sum(case when analysis_right ='WCQ - ESPN' then right_broadcast_duration else 0 end) as WCQESPN_right_broadcast_duration ,sum(case when analysis_right ='Welsh Home International Football 2012-2014 Sky Sports' then right_broadcast_duration else 0 end) as WIFSS_right_broadcast_duration ,sum(case when analysis_right ='West Indies Home Cricket 2013-2020 Sky Sports' then right_broadcast_duration else 0 end) as WICSS_right_broadcast_duration ,sum(case when analysis_right ='Wimbledon - BBC' then right_broadcast_duration else 0 end) as WIMBBC_right_broadcast_duration ,sum(case when analysis_right ='Womens Cricket - I C C Cricket Deal 2012-2015 Sky Sports' then right_broadcast_duration else 0 end) as WICCSS_right_broadcast_duration ,sum(case when analysis_right ='World Athletics Championship - More 4' then right_broadcast_duration else 0 end) as WACMR4_right_broadcast_duration ,sum(case when analysis_right ='World Club Championship - BBC' then right_broadcast_duration else 0 end) as WCLBBBC_right_broadcast_duration ,sum(case when analysis_right ='World Cup Qualifiers - BT Sport' then right_broadcast_duration else 0 end) as WCQBTS_right_broadcast_duration ,sum(case when analysis_right ='World Darts Championship 2009-2012 Sky Sports' then right_broadcast_duration else 0 end) as WDCSS_right_broadcast_duration ,sum(case when analysis_right ='World snooker championship - BBC' then right_broadcast_duration else 0 end) as WSCBBC_right_broadcast_duration ,sum(case when analysis_right ='WWE Sky 1 and 2' then right_broadcast_duration else 0 end) as WWES12_right_broadcast_duration ,sum(case when analysis_right ='WWE Sky Sports' then right_broadcast_duration else 0 end) as WWESS_right_broadcast_duration ,sum(case when analysis_right ='Africa Cup of Nations - Eurosport' then right_broadcast_programmes else 0 end) as AFCEUR_right_broadcast_programmes ,sum(case when analysis_right ='Africa Cup of Nations - ITV' then right_broadcast_programmes else 0 end) as AFCITV_right_broadcast_programmes ,sum(case when analysis_right ='Americas Cup - BBC' then right_broadcast_programmes else 0 end) as AMCBBC_right_broadcast_programmes ,sum(case when analysis_right ='Asian Tour Golf 2012-2013 Sky Sports' then right_broadcast_programmes else 0 end) as ATGSS_right_broadcast_programmes ,sum(case when analysis_right ='ATP Tennis Masters Series 2011-2013 Sky Sports' then right_broadcast_programmes else 0 end) as ATPSS_right_broadcast_programmes ,sum(case when analysis_right ='Australia Home Cricket 2012-2016 Sky Sports' then right_broadcast_programmes else 0 end) as AHCSS_right_broadcast_programmes ,sum(case when analysis_right ='Australian Football - BT Sport' then right_broadcast_programmes else 0 end) as AUFBTS_right_broadcast_programmes ,sum(case when analysis_right ='Australian Open Tennis - BBC' then right_broadcast_programmes else 0 end) as AOTBBC_right_broadcast_programmes ,sum(case when analysis_right ='Australian Open Tennis - Eurosport' then right_broadcast_programmes else 0 end) as AOTEUR_right_broadcast_programmes ,sum(case when analysis_right ='Aviva Premiership - ESPN' then right_broadcast_programmes else 0 end) as AVPSS_right_broadcast_programmes ,sum(case when analysis_right ='BBC American Football' then right_broadcast_programmes else 0 end) as AFBBC_right_broadcast_programmes ,sum(case when analysis_right ='BBC Athletics' then right_broadcast_programmes else 0 end) as ATHBBC_right_broadcast_programmes ,sum(case when analysis_right ='BBC Boxing' then right_broadcast_programmes else 0 end) as BOXBBC_right_broadcast_programmes ,sum(case when analysis_right ='BBC Darts' then right_broadcast_programmes else 0 end) as DRTBBC_right_broadcast_programmes ,sum(case when analysis_right ='BBC Equestrian' then right_broadcast_programmes else 0 end) as EQUBBC_right_broadcast_programmes ,sum(case when analysis_right ='BBC Football' then right_broadcast_programmes else 0 end) as FOOTBBC_right_broadcast_programmes ,sum(case when analysis_right ='BBC Golf' then right_broadcast_programmes else 0 end) as GOLFBBC_right_broadcast_programmes ,sum(case when analysis_right ='BBC Motor Sport' then right_broadcast_programmes else 0 end) as MSPBBC_right_broadcast_programmes ,sum(case when analysis_right ='BBC Rugby' then right_broadcast_programmes else 0 end) as RUGBBC_right_broadcast_programmes ,sum(case when analysis_right ='BBC Snooker/Pool' then right_broadcast_programmes else 0 end) as SNPBBC_right_broadcast_programmes ,sum(case when analysis_right ='BBC Tennis' then right_broadcast_programmes else 0 end) as TENBBC_right_broadcast_programmes ,sum(case when analysis_right ='BBC Unknown' then right_broadcast_programmes else 0 end) as UNKBBC_right_broadcast_programmes ,sum(case when analysis_right ='BBC Watersports' then right_broadcast_programmes else 0 end) as WATBBC_right_broadcast_programmes ,sum(case when analysis_right ='BBC Wintersports' then right_broadcast_programmes else 0 end) as WINBBC_right_broadcast_programmes ,sum(case when analysis_right ='Boxing - Channel 5' then right_broadcast_programmes else 0 end) as BOXCH5_right_broadcast_programmes ,sum(case when analysis_right ='Boxing - Matchroom 2012-2014 Sky Sports' then right_broadcast_programmes else 0 end) as BOXMSS_right_broadcast_programmes ,sum(case when analysis_right ='Brazil Football - BT Sport' then right_broadcast_programmes else 0 end) as BFTBTS_right_broadcast_programmes ,sum(case when analysis_right ='British & Irish Lions 2013 - Sky Sports' then right_broadcast_programmes else 0 end) as BILSS_right_broadcast_programmes ,sum(case when analysis_right ='British Open Golf - BBC' then right_broadcast_programmes else 0 end) as BOGSS_right_broadcast_programmes ,sum(case when analysis_right ='BT Sport American Football' then right_broadcast_programmes else 0 end) as AFBTS_right_broadcast_programmes ,sum(case when analysis_right ='BT Sport Athletics' then right_broadcast_programmes else 0 end) as ATHBTS_right_broadcast_programmes ,sum(case when analysis_right ='BT Sport Baseball' then right_broadcast_programmes else 0 end) as BASEBTS_right_broadcast_programmes ,sum(case when analysis_right ='BT Sport Basketball' then right_broadcast_programmes else 0 end) as BASKBTS_right_broadcast_programmes ,sum(case when analysis_right ='BT Sport Boxing' then right_broadcast_programmes else 0 end) as BOXBTS_right_broadcast_programmes ,sum(case when analysis_right ='BT Sport Cricket' then right_broadcast_programmes else 0 end) as CRIBTS_right_broadcast_programmes ,sum(case when analysis_right ='BT Sport Equestrian' then right_broadcast_programmes else 0 end) as EQUBTS_right_broadcast_programmes ,sum(case when analysis_right ='BT Sport Extreme' then right_broadcast_programmes else 0 end) as EXTBTS_right_broadcast_programmes ,sum(case when analysis_right ='BT Sport Football' then right_broadcast_programmes else 0 end) as FOOTBTS_right_broadcast_programmes ,sum(case when analysis_right ='BT Sport Motor Sport' then right_broadcast_programmes else 0 end) as MSPBTS_right_broadcast_programmes ,sum(case when analysis_right ='BT Sport Rugby' then right_broadcast_programmes else 0 end) as RUGBTS_right_broadcast_programmes ,sum(case when analysis_right ='BT Sport Tennis' then right_broadcast_programmes else 0 end) as TENBTS_right_broadcast_programmes ,sum(case when analysis_right ='BT Sport Unknown' then right_broadcast_programmes else 0 end) as UNKBTS_right_broadcast_programmes ,sum(case when analysis_right ='BT Sport Wintersports' then right_broadcast_programmes else 0 end) as WINBTS_right_broadcast_programmes ,sum(case when analysis_right ='Bundesliga - BT Sport' then right_broadcast_programmes else 0 end) as BUNBTS_right_broadcast_programmes ,sum(case when analysis_right ='Bundesliga- ESPN' then right_broadcast_programmes else 0 end) as BUNESPN_right_broadcast_programmes ,sum(case when analysis_right ='Challenge Darts' then right_broadcast_programmes else 0 end) as DRTCHA_right_broadcast_programmes ,sum(case when analysis_right ='Challenge Extreme' then right_broadcast_programmes else 0 end) as EXTCHA_right_broadcast_programmes ,sum(case when analysis_right ='Challenge Unknown' then right_broadcast_programmes else 0 end) as UNKCHA_right_broadcast_programmes ,sum(case when analysis_right ='Challenge Wrestling' then right_broadcast_programmes else 0 end) as WRECHA_right_broadcast_programmes ,sum(case when analysis_right ='Champions League - ITV' then right_broadcast_programmes else 0 end) as CHLITV_right_broadcast_programmes ,sum(case when analysis_right ='Champions Trophy - I C C Cricket Deal 2012-2015 Sky Sports' then right_broadcast_programmes else 0 end) as ICCSS_right_broadcast_programmes ,sum(case when analysis_right ='Channel 4 American Football' then right_broadcast_programmes else 0 end) as AMCH4_right_broadcast_programmes ,sum(case when analysis_right ='Channel 4 Athletics' then right_broadcast_programmes else 0 end) as ATHCH4_right_broadcast_programmes ,sum(case when analysis_right ='Channel 4 Boxing' then right_broadcast_programmes else 0 end) as BOXCH4_right_broadcast_programmes ,sum(case when analysis_right ='Channel 4 Equestrian' then right_broadcast_programmes else 0 end) as EQUCH4_right_broadcast_programmes ,sum(case when analysis_right ='Channel 4 Extreme' then right_broadcast_programmes else 0 end) as EXTCH4_right_broadcast_programmes ,sum(case when analysis_right ='Channel 4 Football' then right_broadcast_programmes else 0 end) as FOOTCH4_right_broadcast_programmes ,sum(case when analysis_right ='Channel 4 Motor Sport' then right_broadcast_programmes else 0 end) as MSPCH4_right_broadcast_programmes ,sum(case when analysis_right ='Channel 4 Racing' then right_broadcast_programmes else 0 end) as RACCH4_right_broadcast_programmes ,sum(case when analysis_right ='Channel 4 Unknown' then right_broadcast_programmes else 0 end) as UNKCH4_right_broadcast_programmes ,sum(case when analysis_right ='Channel 4 Watersports' then right_broadcast_programmes else 0 end) as WATCH4_right_broadcast_programmes ,sum(case when analysis_right ='Channel 4 Wintersports' then right_broadcast_programmes else 0 end) as WINCH4_right_broadcast_programmes ,sum(case when analysis_right ='Channel 5 Athletics' then right_broadcast_programmes else 0 end) as ATHCH5_right_broadcast_programmes ,sum(case when analysis_right ='Channel 5 Boxing' then right_broadcast_programmes else 0 end) as BOXOCH5_right_broadcast_programmes ,sum(case when analysis_right ='Channel 5 Cricket' then right_broadcast_programmes else 0 end) as CRICH5_right_broadcast_programmes ,sum(case when analysis_right ='Channel 5 Motor Sport' then right_broadcast_programmes else 0 end) as MSPCH5_right_broadcast_programmes ,sum(case when analysis_right ='Channel 5 Unknown' then right_broadcast_programmes else 0 end) as UNKCH5_right_broadcast_programmes ,sum(case when analysis_right ='Channel 5 Wrestling' then right_broadcast_programmes else 0 end) as WRECH5_right_broadcast_programmes ,sum(case when analysis_right ='Cheltenham Festival - Channel 4' then right_broadcast_programmes else 0 end) as CHELCH4_right_broadcast_programmes ,sum(case when analysis_right ='Community Shield - ITV' then right_broadcast_programmes else 0 end) as CMSITV_right_broadcast_programmes ,sum(case when analysis_right ='Confederations Cup - BBC' then right_broadcast_programmes else 0 end) as CONCBBC_right_broadcast_programmes ,sum(case when analysis_right ='Conference - BT Sport' then right_broadcast_programmes else 0 end) as CONFBTS_right_broadcast_programmes ,sum(case when analysis_right ='Cycling - La Vuelta ITV' then right_broadcast_programmes else 0 end) as CLVITV_right_broadcast_programmes ,sum(case when analysis_right ='Cycling - U C I World Tour Sky Sports' then right_broadcast_programmes else 0 end) as CUCISS_right_broadcast_programmes ,sum(case when analysis_right ='Cycling Tour of Britain - Eurosport' then right_broadcast_programmes else 0 end) as CTBEUR_right_broadcast_programmes ,sum(case when analysis_right ='Cycling: tour of britain ITV4' then right_broadcast_programmes else 0 end) as CTCITV_right_broadcast_programmes ,sum(case when analysis_right ='Derby - Channel 4' then right_broadcast_programmes else 0 end) as DERCH4_right_broadcast_programmes ,sum(case when analysis_right ='ECB (highlights) - Channel 5' then right_broadcast_programmes else 0 end) as ECBHCH5_right_broadcast_programmes ,sum(case when analysis_right ='ECB Cricket Sky Sports' then right_broadcast_programmes else 0 end) as GECRSS_right_broadcast_programmes ,sum(case when analysis_right ='ECB non-Test Cricket Sky Sports' then right_broadcast_programmes else 0 end) as ECBNSS_right_broadcast_programmes ,sum(case when analysis_right ='ECB Test Cricket Sky Sports' then right_broadcast_programmes else 0 end) as ECBTSS_right_broadcast_programmes ,sum(case when analysis_right ='England Football Internationals - ITV' then right_broadcast_programmes else 0 end) as GENGITV_right_broadcast_programmes ,sum(case when analysis_right ='England Friendlies (Football) - ITV' then right_broadcast_programmes else 0 end) as EFRITV_right_broadcast_programmes ,sum(case when analysis_right ='England Rugby Internationals 2010-2015 - Sky Sports' then right_broadcast_programmes else 0 end) as ENRSS_right_broadcast_programmes ,sum(case when analysis_right ='England World Cup Qualifying (Away) - ITV' then right_broadcast_programmes else 0 end) as EWQAITV_right_broadcast_programmes ,sum(case when analysis_right ='England World Cup Qualifying (Home) - ITV' then right_broadcast_programmes else 0 end) as EWQHITV_right_broadcast_programmes ,sum(case when analysis_right ='ESPN American Football' then right_broadcast_programmes else 0 end) as AMESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Athletics' then right_broadcast_programmes else 0 end) as ATHESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Baseball' then right_broadcast_programmes else 0 end) as BASEESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Basketball' then right_broadcast_programmes else 0 end) as BASKESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Boxing' then right_broadcast_programmes else 0 end) as BOXESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Cricket' then right_broadcast_programmes else 0 end) as CRIESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Darts' then right_broadcast_programmes else 0 end) as DARTESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Equestrian' then right_broadcast_programmes else 0 end) as EQUESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Extreme' then right_broadcast_programmes else 0 end) as EXTESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Football' then right_broadcast_programmes else 0 end) as FOOTESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Golf' then right_broadcast_programmes else 0 end) as GOLFESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Ice Hockey' then right_broadcast_programmes else 0 end) as IHESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Motor Sport' then right_broadcast_programmes else 0 end) as MSPESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Racing' then right_broadcast_programmes else 0 end) as RACESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Rugby' then right_broadcast_programmes else 0 end) as RUGESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Snooker/Pool' then right_broadcast_programmes else 0 end) as SNPESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Tennis' then right_broadcast_programmes else 0 end) as TENESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Unknown' then right_broadcast_programmes else 0 end) as UNKESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Watersports' then right_broadcast_programmes else 0 end) as WATESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Wintersports' then right_broadcast_programmes else 0 end) as WINESPN_right_broadcast_programmes ,sum(case when analysis_right ='ESPN Wrestling' then right_broadcast_programmes else 0 end) as WREESPN_right_broadcast_programmes ,sum(case when analysis_right ='Europa League - BT Sport' then right_broadcast_programmes else 0 end) as ELBTSP_right_broadcast_programmes ,sum(case when analysis_right ='Europa League - ESPN' then right_broadcast_programmes else 0 end) as ELESPN_right_broadcast_programmes ,sum(case when analysis_right ='Europa League - ITV' then right_broadcast_programmes else 0 end) as ELITV_right_broadcast_programmes ,sum(case when analysis_right ='European Tour Golf - Sky Sports' then right_broadcast_programmes else 0 end) as ETGSS_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport American Football' then right_broadcast_programmes else 0 end) as AMEUR_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport Athletics' then right_broadcast_programmes else 0 end) as ATHEUR_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport Baseball' then right_broadcast_programmes else 0 end) as BASEEUR_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport Basketball' then right_broadcast_programmes else 0 end) as BASKEUR_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport Boxing' then right_broadcast_programmes else 0 end) as BOXEUR_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport Cricket' then right_broadcast_programmes else 0 end) as CRIEUR_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport Darts' then right_broadcast_programmes else 0 end) as DARTEUR_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport Equestrian' then right_broadcast_programmes else 0 end) as EQUEUR_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport Extreme' then right_broadcast_programmes else 0 end) as EXTEUR_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport Football' then right_broadcast_programmes else 0 end) as FOOTEUR_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport Golf' then right_broadcast_programmes else 0 end) as GOLFEUR_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport Ice Hockey' then right_broadcast_programmes else 0 end) as IHEUR_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport Motor Sport' then right_broadcast_programmes else 0 end) as MSPEUR_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport Racing' then right_broadcast_programmes else 0 end) as RACEUR_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport Snooker/Pool' then right_broadcast_programmes else 0 end) as SNPEUR_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport Tennis' then right_broadcast_programmes else 0 end) as TENEUR_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport Unknown' then right_broadcast_programmes else 0 end) as UNKEUR_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport Watersports' then right_broadcast_programmes else 0 end) as WATEUR_right_broadcast_programmes ,sum(case when analysis_right ='Eurosport Wintersports' then right_broadcast_programmes else 0 end) as WINEUR_right_broadcast_programmes ,sum(case when analysis_right ='F1 - BBC' then right_broadcast_programmes else 0 end) as GF1BBC_right_broadcast_programmes ,sum(case when analysis_right ='F1 - Sky Sports' then right_broadcast_programmes else 0 end) as GF1SS_right_broadcast_programmes ,sum(case when analysis_right ='F1 (non-Live)- BBC' then right_broadcast_programmes else 0 end) as F1NBBC_right_broadcast_programmes ,sum(case when analysis_right ='F1 (Practice Live)- BBC' then right_broadcast_programmes else 0 end) as F1PBBC_right_broadcast_programmes ,sum(case when analysis_right ='F1 (Qualifying Live)- BBC' then right_broadcast_programmes else 0 end) as F1QBBC_right_broadcast_programmes ,sum(case when analysis_right ='F1 (Race Live)- BBC' then right_broadcast_programmes else 0 end) as F1RBBC_right_broadcast_programmes ,sum(case when analysis_right ='FA Cup - ESPN' then right_broadcast_programmes else 0 end) as FACESPN_right_broadcast_programmes ,sum(case when analysis_right ='FA Cup - ITV' then right_broadcast_programmes else 0 end) as FACITV_right_broadcast_programmes ,sum(case when analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - Capital 1 Cup' then right_broadcast_programmes else 0 end) as FLCCSS_right_broadcast_programmes ,sum(case when analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - others' then right_broadcast_programmes else 0 end) as FLOTSS_right_broadcast_programmes ,sum(case when analysis_right ='Formula One 2012-2018 - (non-Live) Sky Sports' then right_broadcast_programmes else 0 end) as F1NSS_right_broadcast_programmes ,sum(case when analysis_right ='Formula One 2012-2018 - (Practice Live) Sky Sports' then right_broadcast_programmes else 0 end) as F1PSS_right_broadcast_programmes ,sum(case when analysis_right ='Formula One 2012-2018 - (Qualifying Live) Sky Sports' then right_broadcast_programmes else 0 end) as F1QSS_right_broadcast_programmes ,sum(case when analysis_right ='Formula One 2012-2018 - (Race Live) Sky Sports' then right_broadcast_programmes else 0 end) as F1RSS_right_broadcast_programmes ,sum(case when analysis_right ='French Open Tennis - Eurosport' then right_broadcast_programmes else 0 end) as FOTEUR_right_broadcast_programmes ,sum(case when analysis_right ='French Open Tennis - ITV' then right_broadcast_programmes else 0 end) as FOTITV_right_broadcast_programmes ,sum(case when analysis_right ='Grand National - Channel 4' then right_broadcast_programmes else 0 end) as GDNCH4_right_broadcast_programmes ,sum(case when analysis_right ='Heineken Cup 2010/11 To 2013/14- Sky Sports' then right_broadcast_programmes else 0 end) as HECSS_right_broadcast_programmes ,sum(case when analysis_right ='I R B Sevens 2008/09 -2014/15 - Sky Sports' then right_broadcast_programmes else 0 end) as IRBSS_right_broadcast_programmes ,sum(case when analysis_right ='IAAF World Athletics Championship - Eurosport' then right_broadcast_programmes else 0 end) as WACEUR_right_broadcast_programmes ,sum(case when analysis_right ='India Home Cricket 2012-2018 Sky Sports' then right_broadcast_programmes else 0 end) as IHCSS_right_broadcast_programmes ,sum(case when analysis_right ='India Premier League - ITV' then right_broadcast_programmes else 0 end) as IPLITV_right_broadcast_programmes ,sum(case when analysis_right ='International Freindlies - ESPN' then right_broadcast_programmes else 0 end) as IFESPN_right_broadcast_programmes ,sum(case when analysis_right ='International Friendlies - BT Sport' then right_broadcast_programmes else 0 end) as IFBTS_right_broadcast_programmes ,sum(case when analysis_right ='ITV1 Boxing' then right_broadcast_programmes else 0 end) as BOXITV1_right_broadcast_programmes ,sum(case when analysis_right ='ITV1 Football' then right_broadcast_programmes else 0 end) as FOOTITV1_right_broadcast_programmes ,sum(case when analysis_right ='ITV1 Motor Sport' then right_broadcast_programmes else 0 end) as MOTSITV1_right_broadcast_programmes ,sum(case when analysis_right ='ITV1 Rugby' then right_broadcast_programmes else 0 end) as RUGITV1_right_broadcast_programmes ,sum(case when analysis_right ='ITV1 Snooker/Pool' then right_broadcast_programmes else 0 end) as SNPITV1_right_broadcast_programmes ,sum(case when analysis_right ='ITV1 Unknown' then right_broadcast_programmes else 0 end) as UNKITV1_right_broadcast_programmes ,sum(case when analysis_right ='ITV4 Boxing' then right_broadcast_programmes else 0 end) as BOXITV4_right_broadcast_programmes ,sum(case when analysis_right ='ITV4 Cricket' then right_broadcast_programmes else 0 end) as CRIITV4_right_broadcast_programmes ,sum(case when analysis_right ='ITV4 Darts' then right_broadcast_programmes else 0 end) as DARTITV4_right_broadcast_programmes ,sum(case when analysis_right ='ITV4 Extreme' then right_broadcast_programmes else 0 end) as EXTITV4_right_broadcast_programmes ,sum(case when analysis_right ='ITV4 Football' then right_broadcast_programmes else 0 end) as FOOTITV4_right_broadcast_programmes ,sum(case when analysis_right ='ITV4 Motor Sport' then right_broadcast_programmes else 0 end) as MSPITV4_right_broadcast_programmes ,sum(case when analysis_right ='ITV4 Rugby' then right_broadcast_programmes else 0 end) as RUGITV4_right_broadcast_programmes ,sum(case when analysis_right ='ITV4 Snooker/Pool' then right_broadcast_programmes else 0 end) as SNPITV4_right_broadcast_programmes ,sum(case when analysis_right ='ITV4 Tennis' then right_broadcast_programmes else 0 end) as TENITV4_right_broadcast_programmes ,sum(case when analysis_right ='ITV4 Unknown' then right_broadcast_programmes else 0 end) as UNKITV4_right_broadcast_programmes ,sum(case when analysis_right ='Ligue 1 - BT Sport' then right_broadcast_programmes else 0 end) as L1BTS_right_broadcast_programmes ,sum(case when analysis_right ='Ligue 1 - ESPN' then right_broadcast_programmes else 0 end) as L1ESPN_right_broadcast_programmes ,sum(case when analysis_right ='Match of the day - BBC' then right_broadcast_programmes else 0 end) as MOTDBBC_right_broadcast_programmes ,sum(case when analysis_right ='Matchroom Output Deal 2010-2012 (Other)- Sky Sports' then right_broadcast_programmes else 0 end) as MROSS_right_broadcast_programmes ,sum(case when analysis_right ='Matchroom Output Deal 2010-2012 (Pool)- Sky Sports' then right_broadcast_programmes else 0 end) as MRPSS_right_broadcast_programmes ,sum(case when analysis_right ='Matchroom Output Deal 2010-2012 (Snooker)- Sky Sports' then right_broadcast_programmes else 0 end) as MRSSS_right_broadcast_programmes ,sum(case when analysis_right ='Moto GP BBC' then right_broadcast_programmes else 0 end) as MGPBBC_right_broadcast_programmes ,sum(case when analysis_right ='NBA - Sky Sports' then right_broadcast_programmes else 0 end) as NBASS_right_broadcast_programmes ,sum(case when analysis_right ='NFL - BBC' then right_broadcast_programmes else 0 end) as NFLBBC_right_broadcast_programmes ,sum(case when analysis_right ='NFL - Channel 4' then right_broadcast_programmes else 0 end) as NFLCH4_right_broadcast_programmes ,sum(case when analysis_right ='NFL Seasons 2012-2015 - Sky Sports' then right_broadcast_programmes else 0 end) as NFLSS_right_broadcast_programmes ,sum(case when analysis_right ='Northern Ireland Football Association 2012-2014 - Sky Sports' then right_broadcast_programmes else 0 end) as NIFSS_right_broadcast_programmes ,sum(case when analysis_right ='Oaks - Channel 4' then right_broadcast_programmes else 0 end) as OAKCH4_right_broadcast_programmes ,sum(case when analysis_right ='Other American Football' then right_broadcast_programmes else 0 end) as AMOTH_right_broadcast_programmes ,sum(case when analysis_right ='Other Athletics' then right_broadcast_programmes else 0 end) as ATHOTH_right_broadcast_programmes ,sum(case when analysis_right ='Other Baseball' then right_broadcast_programmes else 0 end) as BASEOTH_right_broadcast_programmes ,sum(case when analysis_right ='Other Basketball' then right_broadcast_programmes else 0 end) as BASKOTH_right_broadcast_programmes ,sum(case when analysis_right ='Other Boxing' then right_broadcast_programmes else 0 end) as BOXOTH_right_broadcast_programmes ,sum(case when analysis_right ='Other Cricket' then right_broadcast_programmes else 0 end) as CRIOTH_right_broadcast_programmes ,sum(case when analysis_right ='Other Darts' then right_broadcast_programmes else 0 end) as DARTOTH_right_broadcast_programmes ,sum(case when analysis_right ='Other Equestrian' then right_broadcast_programmes else 0 end) as EQUOTH_right_broadcast_programmes ,sum(case when analysis_right ='Other Extreme' then right_broadcast_programmes else 0 end) as EXTOTH_right_broadcast_programmes ,sum(case when analysis_right ='Other Fishing' then right_broadcast_programmes else 0 end) as FSHOTH_right_broadcast_programmes ,sum(case when analysis_right ='Other Football' then right_broadcast_programmes else 0 end) as FOOTOTH_right_broadcast_programmes ,sum(case when analysis_right ='Other Golf' then right_broadcast_programmes else 0 end) as GOLFOTH_right_broadcast_programmes ,sum(case when analysis_right ='Other Ice Hockey' then right_broadcast_programmes else 0 end) as IHOTH_right_broadcast_programmes ,sum(case when analysis_right ='Other Motor Sport' then right_broadcast_programmes else 0 end) as MSPOTH_right_broadcast_programmes ,sum(case when analysis_right ='Other Racing' then right_broadcast_programmes else 0 end) as RACOTH_right_broadcast_programmes ,sum(case when analysis_right ='Other Rugby' then right_broadcast_programmes else 0 end) as RUGOTH_right_broadcast_programmes ,sum(case when analysis_right ='Other Rugby Internationals - ESPN' then right_broadcast_programmes else 0 end) as ORUGESPN_right_broadcast_programmes ,sum(case when analysis_right ='Other Snooker/Pool' then right_broadcast_programmes else 0 end) as OTHSNP_right_broadcast_programmes ,sum(case when analysis_right ='Other Tennis' then right_broadcast_programmes else 0 end) as OTHTEN_right_broadcast_programmes ,sum(case when analysis_right ='Other Unknown' then right_broadcast_programmes else 0 end) as OTHUNK_right_broadcast_programmes ,sum(case when analysis_right ='Other Watersports' then right_broadcast_programmes else 0 end) as OTHWAT_right_broadcast_programmes ,sum(case when analysis_right ='Other Wintersports' then right_broadcast_programmes else 0 end) as OTHWIN_right_broadcast_programmes ,sum(case when analysis_right ='Other Wrestling' then right_broadcast_programmes else 0 end) as OTHWRE_right_broadcast_programmes ,sum(case when analysis_right ='PGA Tour Golf 2010-2017 - Sky Sports' then right_broadcast_programmes else 0 end) as PGASS_right_broadcast_programmes ,sum(case when analysis_right ='Premier League - BT Sport' then right_broadcast_programmes else 0 end) as PLBTS_right_broadcast_programmes ,sum(case when analysis_right ='Premier League - ESPN' then right_broadcast_programmes else 0 end) as PLESPN_right_broadcast_programmes ,sum(case when analysis_right ='Premier League Darts 2010-2013 - Sky Sports' then right_broadcast_programmes else 0 end) as PLDSS_right_broadcast_programmes ,sum(case when analysis_right ='Premier League Football - Sky Sports' then right_broadcast_programmes else 0 end) as GPLSS_right_broadcast_programmes ,sum(case when analysis_right ='Premier League Football - Sky Sports (Match Choice)' then right_broadcast_programmes else 0 end) as PLMCSS_right_broadcast_programmes ,sum(case when analysis_right ='Premier League Football - Sky Sports (MNF)' then right_broadcast_programmes else 0 end) as PLMNFSS_right_broadcast_programmes ,sum(case when analysis_right ='Premier League Football - Sky Sports (non Live)' then right_broadcast_programmes else 0 end) as PLNLSS_right_broadcast_programmes ,sum(case when analysis_right ='Premier League Football - Sky Sports (other Live)' then right_broadcast_programmes else 0 end) as PLOLSS_right_broadcast_programmes ,sum(case when analysis_right ='Premier League Football - Sky Sports (Sat Lunchtime)' then right_broadcast_programmes else 0 end) as PLSLSS_right_broadcast_programmes ,sum(case when analysis_right ='Premier League Football - Sky Sports (Sat Night Live)' then right_broadcast_programmes else 0 end) as PLSNSS_right_broadcast_programmes ,sum(case when analysis_right ='Premier League Football - Sky Sports (Sun 4pm)' then right_broadcast_programmes else 0 end) as PLS4SS_right_broadcast_programmes ,sum(case when analysis_right ='Premier League Football - Sky Sports (Sun Lunchtime)' then right_broadcast_programmes else 0 end) as PLSULSS_right_broadcast_programmes ,sum(case when analysis_right ='Premiership Rugby - Sky Sports' then right_broadcast_programmes else 0 end) as PRUSS_right_broadcast_programmes ,sum(case when analysis_right ='Republic Of Ireland FA - 2010/11 To 2013/14 - Sky Sports' then right_broadcast_programmes else 0 end) as ROISS_right_broadcast_programmes ,sum(case when analysis_right ='Royal Ascot - Channel 4' then right_broadcast_programmes else 0 end) as RASCH4_right_broadcast_programmes ,sum(case when analysis_right ='Rugby Internationals (England) - BBC' then right_broadcast_programmes else 0 end) as RIEBBC_right_broadcast_programmes ,sum(case when analysis_right ='Rugby Internationals (Ireland) - BBC' then right_broadcast_programmes else 0 end) as RIIBBC_right_broadcast_programmes ,sum(case when analysis_right ='Rugby Internationals (Scotland) - BBC' then right_broadcast_programmes else 0 end) as RISBBC_right_broadcast_programmes ,sum(case when analysis_right ='Rugby Internationals (Wales) - BBC' then right_broadcast_programmes else 0 end) as RIWBBC_right_broadcast_programmes ,sum(case when analysis_right ='Rugby League Challenge Cup- BBC' then right_broadcast_programmes else 0 end) as RLCCBBC_right_broadcast_programmes ,sum(case when analysis_right ='Rugby League - Sky Sports' then right_broadcast_programmes else 0 end) as RLGSS_right_broadcast_programmes ,sum(case when analysis_right ='Rugby League World Cup- BBC' then right_broadcast_programmes else 0 end) as RLWCBBC_right_broadcast_programmes ,sum(case when analysis_right ='Sanzar Rugby Union 2011 - 2015 - Sky Sports' then right_broadcast_programmes else 0 end) as SARUSS_right_broadcast_programmes ,sum(case when analysis_right ='Scottish FA Deal - 2010/11 To 2013/14 - Sky Sports' then right_broadcast_programmes else 0 end) as SFASS_right_broadcast_programmes ,sum(case when analysis_right ='Serie A - BT Sport' then right_broadcast_programmes else 0 end) as SABTS_right_broadcast_programmes ,sum(case when analysis_right ='Serie A - ESPN' then right_broadcast_programmes else 0 end) as SAESPN_right_broadcast_programmes ,sum(case when analysis_right ='SFL - ESPN' then right_broadcast_programmes else 0 end) as SFLESPN_right_broadcast_programmes ,sum(case when analysis_right ='Six Nations - BBC' then right_broadcast_programmes else 0 end) as SNRBBC_right_broadcast_programmes ,sum(case when analysis_right ='Sky 1 and Sky 2 Boxing' then right_broadcast_programmes else 0 end) as BOXS12_right_broadcast_programmes ,sum(case when analysis_right ='Sky 1 and Sky 2 Football' then right_broadcast_programmes else 0 end) as FOOTS12_right_broadcast_programmes ,sum(case when analysis_right ='Sky 1 and Sky 2 Motor Sport' then right_broadcast_programmes else 0 end) as MSPS12_right_broadcast_programmes ,sum(case when analysis_right ='Sky 1 and Sky 2 Unknown' then right_broadcast_programmes else 0 end) as UNKS12_right_broadcast_programmes ,sum(case when analysis_right ='Sky 1 and Sky 2 Wrestling' then right_broadcast_programmes else 0 end) as WRES12_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports American Football' then right_broadcast_programmes else 0 end) as AMSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Athletics' then right_broadcast_programmes else 0 end) as ATHSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Baseball' then right_broadcast_programmes else 0 end) as BASESS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Basketball' then right_broadcast_programmes else 0 end) as BASKSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Boxing' then right_broadcast_programmes else 0 end) as BOXSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Cricket' then right_broadcast_programmes else 0 end) as CRISS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Darts' then right_broadcast_programmes else 0 end) as DARTSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Equestrian' then right_broadcast_programmes else 0 end) as EQUSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Extreme' then right_broadcast_programmes else 0 end) as EXTSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Fishing' then right_broadcast_programmes else 0 end) as FISHSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Football' then right_broadcast_programmes else 0 end) as FOOTSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Golf' then right_broadcast_programmes else 0 end) as GOLFSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Ice Hockey' then right_broadcast_programmes else 0 end) as IHSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Motor Sport' then right_broadcast_programmes else 0 end) as MSPSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Racing' then right_broadcast_programmes else 0 end) as RACSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Rugby' then right_broadcast_programmes else 0 end) as RUGSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Snooker/Pool' then right_broadcast_programmes else 0 end) as SNPSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Tennis' then right_broadcast_programmes else 0 end) as TENSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Unknown' then right_broadcast_programmes else 0 end) as UNKSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Watersports' then right_broadcast_programmes else 0 end) as WATSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Wintersports' then right_broadcast_programmes else 0 end) as WINSS_right_broadcast_programmes ,sum(case when analysis_right ='Sky Sports Wrestling' then right_broadcast_programmes else 0 end) as WRESS_right_broadcast_programmes ,sum(case when analysis_right ='Solheim Cup 2013 Ladies Golf - Sky Sports' then right_broadcast_programmes else 0 end) as SOLSS_right_broadcast_programmes ,sum(case when analysis_right ='South African Home Cricket 2012-2020 Sky Sports' then right_broadcast_programmes else 0 end) as SACSS_right_broadcast_programmes ,sum(case when analysis_right ='Spanish Football 2012/13 To 14/15 - Sky Sports' then right_broadcast_programmes else 0 end) as SPFSS_right_broadcast_programmes ,sum(case when analysis_right ='SPFL - BT Sport' then right_broadcast_programmes else 0 end) as SPFLBTS_right_broadcast_programmes ,sum(case when analysis_right ='SPL - ESPN' then right_broadcast_programmes else 0 end) as SPLESPN_right_broadcast_programmes ,sum(case when analysis_right ='SPL - Sky Sports' then right_broadcast_programmes else 0 end) as SPLSS_right_broadcast_programmes ,sum(case when analysis_right ='Sportfive World Cup 2014 Qualifers - Sky Sports' then right_broadcast_programmes else 0 end) as SP5SS_right_broadcast_programmes ,sum(case when analysis_right ='The boat race - BBC' then right_broadcast_programmes else 0 end) as BTRBBC_right_broadcast_programmes ,sum(case when analysis_right ='The football league show - BBC' then right_broadcast_programmes else 0 end) as FLSBBC_right_broadcast_programmes ,sum(case when analysis_right ='The Masters Golf - BBC' then right_broadcast_programmes else 0 end) as MGBBC_right_broadcast_programmes ,sum(case when analysis_right ='TNA Wrestling Challenge' then right_broadcast_programmes else 0 end) as TNACHA_right_broadcast_programmes ,sum(case when analysis_right ='Tour de France - Eurosport' then right_broadcast_programmes else 0 end) as TDFEUR_right_broadcast_programmes ,sum(case when analysis_right ='Tour de France - ITV' then right_broadcast_programmes else 0 end) as TDFITV_right_broadcast_programmes ,sum(case when analysis_right ='U S Masters Golf 2011-2014 Sky Sports' then right_broadcast_programmes else 0 end) as USMGSS_right_broadcast_programmes ,sum(case when analysis_right ='U.S Open Tennis 2013-2015 Sky Sports' then right_broadcast_programmes else 0 end) as USOTSS_right_broadcast_programmes ,sum(case when analysis_right ='U.S Open/Womens/Seniors/Amateur Golf Sky Sports' then right_broadcast_programmes else 0 end) as USOGSS_right_broadcast_programmes ,sum(case when analysis_right ='UEFA Champions League - Sky Sports' then right_broadcast_programmes else 0 end) as CLASS_right_broadcast_programmes ,sum(case when analysis_right ='UEFA Champions League - Sky Sports (non Live)' then right_broadcast_programmes else 0 end) as CLNSS_right_broadcast_programmes ,sum(case when analysis_right ='UEFA Champions League - Sky Sports (other Live)' then right_broadcast_programmes else 0 end) as CLOSS_right_broadcast_programmes ,sum(case when analysis_right ='UEFA Champions League - Sky Sports (Tue)' then right_broadcast_programmes else 0 end) as CLTSS_right_broadcast_programmes ,sum(case when analysis_right ='UEFA Champions League - Sky Sports (Wed)' then right_broadcast_programmes else 0 end) as CLWSS_right_broadcast_programmes ,sum(case when analysis_right ='US Open Tennis - Eurosport' then right_broadcast_programmes else 0 end) as USOTEUR_right_broadcast_programmes ,sum(case when analysis_right ='USA Football - BT Sport' then right_broadcast_programmes else 0 end) as USFBTS_right_broadcast_programmes ,sum(case when analysis_right ='USPGA Championship (2007-2016) Sky Sports' then right_broadcast_programmes else 0 end) as USPGASS_right_broadcast_programmes ,sum(case when analysis_right ='WCQ - ESPN' then right_broadcast_programmes else 0 end) as WCQESPN_right_broadcast_programmes ,sum(case when analysis_right ='Welsh Home International Football 2012-2014 Sky Sports' then right_broadcast_programmes else 0 end) as WIFSS_right_broadcast_programmes ,sum(case when analysis_right ='West Indies Home Cricket 2013-2020 Sky Sports' then right_broadcast_programmes else 0 end) as WICSS_right_broadcast_programmes ,sum(case when analysis_right ='Wimbledon - BBC' then right_broadcast_programmes else 0 end) as WIMBBC_right_broadcast_programmes ,sum(case when analysis_right ='Womens Cricket - I C C Cricket Deal 2012-2015 Sky Sports' then right_broadcast_programmes else 0 end) as WICCSS_right_broadcast_programmes ,sum(case when analysis_right ='World Athletics Championship - More 4' then right_broadcast_programmes else 0 end) as WACMR4_right_broadcast_programmes ,sum(case when analysis_right ='World Club Championship - BBC' then right_broadcast_programmes else 0 end) as WCLBBBC_right_broadcast_programmes ,sum(case when analysis_right ='World Cup Qualifiers - BT Sport' then right_broadcast_programmes else 0 end) as WCQBTS_right_broadcast_programmes ,sum(case when analysis_right ='World Darts Championship 2009-2012 Sky Sports' then right_broadcast_programmes else 0 end) as WDCSS_right_broadcast_programmes ,sum(case when analysis_right ='World snooker championship - BBC' then right_broadcast_programmes else 0 end) as WSCBBC_right_broadcast_programmes ,sum(case when analysis_right ='WWE Sky 1 and 2' then right_broadcast_programmes else 0 end) as WWES12_right_broadcast_programmes ,sum(case when analysis_right ='WWE Sky Sports' then right_broadcast_programmes else 0 end) as WWESS_right_broadcast_programmes into dbarnett.v250_right_viewable_account_summary from dbarnett.v250_days_right_viewable_by_account_v09 group by account_number ; commit; --select count(*) from dbarnett.v250_right_viewable_account_summary; ---run down to here--- CREATE HG INDEX idx1 ON dbarnett.v250_days_right_viewable_by_account_by_live_status (account_number); commit; --select count(*) from dbarnett.v250_right_viewable_account_summary; ---Aggregate for live non live---dbarnett.v250_right_viewable_account_summary_by_live_status --select count(*) from dbarnett.v250_right_viewable_account_summary_by_live_status drop table dbarnett.v250_right_viewable_account_summary_by_live_status; select account_number ,sum(case when live=1 and analysis_right ='Africa Cup of Nations - Eurosport' then days_right_viewable else 0 end) as AFCEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Africa Cup of Nations - ITV' then days_right_viewable else 0 end) as AFCITV_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Americas Cup - BBC' then days_right_viewable else 0 end) as AMCBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Asian Tour Golf 2012-2013 Sky Sports' then days_right_viewable else 0 end) as ATGSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ATP Tennis Masters Series 2011-2013 Sky Sports' then days_right_viewable else 0 end) as ATPSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Australia Home Cricket 2012-2016 Sky Sports' then days_right_viewable else 0 end) as AHCSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Australian Football - BT Sport' then days_right_viewable else 0 end) as AUFBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Australian Open Tennis - BBC' then days_right_viewable else 0 end) as AOTBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Australian Open Tennis - Eurosport' then days_right_viewable else 0 end) as AOTEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Aviva Premiership - ESPN' then days_right_viewable else 0 end) as AVPSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BBC American Football' then days_right_viewable else 0 end) as AFBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BBC Athletics' then days_right_viewable else 0 end) as ATHBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BBC Boxing' then days_right_viewable else 0 end) as BOXBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BBC Darts' then days_right_viewable else 0 end) as DRTBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BBC Equestrian' then days_right_viewable else 0 end) as EQUBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BBC Football' then days_right_viewable else 0 end) as FOOTBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BBC Golf' then days_right_viewable else 0 end) as GOLFBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BBC Motor Sport' then days_right_viewable else 0 end) as MSPBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BBC Rugby' then days_right_viewable else 0 end) as RUGBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BBC Snooker/Pool' then days_right_viewable else 0 end) as SNPBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BBC Tennis' then days_right_viewable else 0 end) as TENBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BBC Unknown' then days_right_viewable else 0 end) as UNKBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BBC Watersports' then days_right_viewable else 0 end) as WATBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BBC Wintersports' then days_right_viewable else 0 end) as WINBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Boxing - Channel 5' then days_right_viewable else 0 end) as BOXCH5_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Boxing - Matchroom 2012-2014 Sky Sports' then days_right_viewable else 0 end) as BOXMSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Brazil Football - BT Sport' then days_right_viewable else 0 end) as BFTBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='British & Irish Lions 2013 - Sky Sports' then days_right_viewable else 0 end) as BILSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='British Open Golf - BBC' then days_right_viewable else 0 end) as BOGSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BT Sport American Football' then days_right_viewable else 0 end) as AFBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Athletics' then days_right_viewable else 0 end) as ATHBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Baseball' then days_right_viewable else 0 end) as BASEBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Basketball' then days_right_viewable else 0 end) as BASKBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Boxing' then days_right_viewable else 0 end) as BOXBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Cricket' then days_right_viewable else 0 end) as CRIBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Equestrian' then days_right_viewable else 0 end) as EQUBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Extreme' then days_right_viewable else 0 end) as EXTBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Football' then days_right_viewable else 0 end) as FOOTBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Motor Sport' then days_right_viewable else 0 end) as MSPBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Rugby' then days_right_viewable else 0 end) as RUGBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Tennis' then days_right_viewable else 0 end) as TENBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Unknown' then days_right_viewable else 0 end) as UNKBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Wintersports' then days_right_viewable else 0 end) as WINBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Bundesliga - BT Sport' then days_right_viewable else 0 end) as BUNBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Bundesliga- ESPN' then days_right_viewable else 0 end) as BUNESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Challenge Darts' then days_right_viewable else 0 end) as DRTCHA_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Challenge Extreme' then days_right_viewable else 0 end) as EXTCHA_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Challenge Unknown' then days_right_viewable else 0 end) as UNKCHA_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Challenge Wrestling' then days_right_viewable else 0 end) as WRECHA_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Champions League - ITV' then days_right_viewable else 0 end) as CHLITV_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Champions Trophy - I C C Cricket Deal 2012-2015 Sky Sports' then days_right_viewable else 0 end) as ICCSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 American Football' then days_right_viewable else 0 end) as AMCH4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Athletics' then days_right_viewable else 0 end) as ATHCH4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Boxing' then days_right_viewable else 0 end) as BOXCH4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Equestrian' then days_right_viewable else 0 end) as EQUCH4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Extreme' then days_right_viewable else 0 end) as EXTCH4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Football' then days_right_viewable else 0 end) as FOOTCH4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Motor Sport' then days_right_viewable else 0 end) as MSPCH4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Racing' then days_right_viewable else 0 end) as RACCH4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Unknown' then days_right_viewable else 0 end) as UNKCH4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Watersports' then days_right_viewable else 0 end) as WATCH4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Wintersports' then days_right_viewable else 0 end) as WINCH4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Athletics' then days_right_viewable else 0 end) as ATHCH5_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Boxing' then days_right_viewable else 0 end) as BOXOCH5_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Cricket' then days_right_viewable else 0 end) as CRICH5_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Motor Sport' then days_right_viewable else 0 end) as MSPCH5_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Unknown' then days_right_viewable else 0 end) as UNKCH5_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Wrestling' then days_right_viewable else 0 end) as WRECH5_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Cheltenham Festival - Channel 4' then days_right_viewable else 0 end) as CHELCH4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Community Shield - ITV' then days_right_viewable else 0 end) as CMSITV_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Confederations Cup - BBC' then days_right_viewable else 0 end) as CONCBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Conference - BT Sport' then days_right_viewable else 0 end) as CONFBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Cycling - La Vuelta ITV' then days_right_viewable else 0 end) as CLVITV_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Cycling - U C I World Tour Sky Sports' then days_right_viewable else 0 end) as CUCISS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Cycling Tour of Britain - Eurosport' then days_right_viewable else 0 end) as CTBEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Cycling: tour of britain ITV4' then days_right_viewable else 0 end) as CTCITV_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Derby - Channel 4' then days_right_viewable else 0 end) as DERCH4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ECB (highlights) - Channel 5' then days_right_viewable else 0 end) as ECBHCH5_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ECB Cricket Sky Sports' then days_right_viewable else 0 end) as GECRSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ECB non-Test Cricket Sky Sports' then days_right_viewable else 0 end) as ECBNSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ECB Test Cricket Sky Sports' then days_right_viewable else 0 end) as ECBTSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='England Football Internationals - ITV' then days_right_viewable else 0 end) as GENGITV_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='England Friendlies (Football) - ITV' then days_right_viewable else 0 end) as EFRITV_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='England Rugby Internationals 2010-2015 - Sky Sports' then days_right_viewable else 0 end) as ENRSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='England World Cup Qualifying (Away) - ITV' then days_right_viewable else 0 end) as EWQAITV_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='England World Cup Qualifying (Home) - ITV' then days_right_viewable else 0 end) as EWQHITV_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN American Football' then days_right_viewable else 0 end) as AMESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Athletics' then days_right_viewable else 0 end) as ATHESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Baseball' then days_right_viewable else 0 end) as BASEESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Basketball' then days_right_viewable else 0 end) as BASKESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Boxing' then days_right_viewable else 0 end) as BOXESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Cricket' then days_right_viewable else 0 end) as CRIESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Darts' then days_right_viewable else 0 end) as DARTESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Equestrian' then days_right_viewable else 0 end) as EQUESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Extreme' then days_right_viewable else 0 end) as EXTESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Football' then days_right_viewable else 0 end) as FOOTESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Golf' then days_right_viewable else 0 end) as GOLFESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Ice Hockey' then days_right_viewable else 0 end) as IHESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Motor Sport' then days_right_viewable else 0 end) as MSPESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Racing' then days_right_viewable else 0 end) as RACESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Rugby' then days_right_viewable else 0 end) as RUGESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Snooker/Pool' then days_right_viewable else 0 end) as SNPESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Tennis' then days_right_viewable else 0 end) as TENESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Unknown' then days_right_viewable else 0 end) as UNKESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Watersports' then days_right_viewable else 0 end) as WATESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Wintersports' then days_right_viewable else 0 end) as WINESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ESPN Wrestling' then days_right_viewable else 0 end) as WREESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Europa League - BT Sport' then days_right_viewable else 0 end) as ELBTSP_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Europa League - ESPN' then days_right_viewable else 0 end) as ELESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Europa League - ITV' then days_right_viewable else 0 end) as ELITV_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='European Tour Golf - Sky Sports' then days_right_viewable else 0 end) as ETGSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport American Football' then days_right_viewable else 0 end) as AMEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Athletics' then days_right_viewable else 0 end) as ATHEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Baseball' then days_right_viewable else 0 end) as BASEEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Basketball' then days_right_viewable else 0 end) as BASKEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Boxing' then days_right_viewable else 0 end) as BOXEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Cricket' then days_right_viewable else 0 end) as CRIEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Darts' then days_right_viewable else 0 end) as DARTEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Equestrian' then days_right_viewable else 0 end) as EQUEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Extreme' then days_right_viewable else 0 end) as EXTEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Football' then days_right_viewable else 0 end) as FOOTEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Golf' then days_right_viewable else 0 end) as GOLFEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Ice Hockey' then days_right_viewable else 0 end) as IHEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Motor Sport' then days_right_viewable else 0 end) as MSPEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Racing' then days_right_viewable else 0 end) as RACEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Snooker/Pool' then days_right_viewable else 0 end) as SNPEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Tennis' then days_right_viewable else 0 end) as TENEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Unknown' then days_right_viewable else 0 end) as UNKEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Watersports' then days_right_viewable else 0 end) as WATEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Wintersports' then days_right_viewable else 0 end) as WINEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='F1 - BBC' then days_right_viewable else 0 end) as GF1BBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='F1 - Sky Sports' then days_right_viewable else 0 end) as GF1SS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='F1 (non-Live)- BBC' then days_right_viewable else 0 end) as F1NBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='F1 (Practice Live)- BBC' then days_right_viewable else 0 end) as F1PBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='F1 (Qualifying Live)- BBC' then days_right_viewable else 0 end) as F1QBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='F1 (Race Live)- BBC' then days_right_viewable else 0 end) as F1RBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='FA Cup - ESPN' then days_right_viewable else 0 end) as FACESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='FA Cup - ITV' then days_right_viewable else 0 end) as FACITV_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - Capital 1 Cup' then days_right_viewable else 0 end) as FLCCSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - others' then days_right_viewable else 0 end) as FLOTSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Formula One 2012-2018 - (non-Live) Sky Sports' then days_right_viewable else 0 end) as F1NSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Formula One 2012-2018 - (Practice Live) Sky Sports' then days_right_viewable else 0 end) as F1PSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Formula One 2012-2018 - (Qualifying Live) Sky Sports' then days_right_viewable else 0 end) as F1QSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Formula One 2012-2018 - (Race Live) Sky Sports' then days_right_viewable else 0 end) as F1RSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='French Open Tennis - Eurosport' then days_right_viewable else 0 end) as FOTEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='French Open Tennis - ITV' then days_right_viewable else 0 end) as FOTITV_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Grand National - Channel 4' then days_right_viewable else 0 end) as GDNCH4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Heineken Cup 2010/11 To 2013/14- Sky Sports' then days_right_viewable else 0 end) as HECSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='I R B Sevens 2008/09 -2014/15 - Sky Sports' then days_right_viewable else 0 end) as IRBSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='IAAF World Athletics Championship - Eurosport' then days_right_viewable else 0 end) as WACEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='India Home Cricket 2012-2018 Sky Sports' then days_right_viewable else 0 end) as IHCSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='India Premier League - ITV' then days_right_viewable else 0 end) as IPLITV_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='International Freindlies - ESPN' then days_right_viewable else 0 end) as IFESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='International Friendlies - BT Sport' then days_right_viewable else 0 end) as IFBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Boxing' then days_right_viewable else 0 end) as BOXITV1_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Football' then days_right_viewable else 0 end) as FOOTITV1_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Motor Sport' then days_right_viewable else 0 end) as MOTSITV1_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Rugby' then days_right_viewable else 0 end) as RUGITV1_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Snooker/Pool' then days_right_viewable else 0 end) as SNPITV1_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Unknown' then days_right_viewable else 0 end) as UNKITV1_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Boxing' then days_right_viewable else 0 end) as BOXITV4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Cricket' then days_right_viewable else 0 end) as CRIITV4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Darts' then days_right_viewable else 0 end) as DARTITV4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Extreme' then days_right_viewable else 0 end) as EXTITV4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Football' then days_right_viewable else 0 end) as FOOTITV4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Motor Sport' then days_right_viewable else 0 end) as MSPITV4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Rugby' then days_right_viewable else 0 end) as RUGITV4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Snooker/Pool' then days_right_viewable else 0 end) as SNPITV4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Tennis' then days_right_viewable else 0 end) as TENITV4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Unknown' then days_right_viewable else 0 end) as UNKITV4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Ligue 1 - BT Sport' then days_right_viewable else 0 end) as L1BTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Ligue 1 - ESPN' then days_right_viewable else 0 end) as L1ESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Match of the day - BBC' then days_right_viewable else 0 end) as MOTDBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Matchroom Output Deal 2010-2012 (Other)- Sky Sports' then days_right_viewable else 0 end) as MROSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Matchroom Output Deal 2010-2012 (Pool)- Sky Sports' then days_right_viewable else 0 end) as MRPSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Matchroom Output Deal 2010-2012 (Snooker)- Sky Sports' then days_right_viewable else 0 end) as MRSSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Moto GP BBC' then days_right_viewable else 0 end) as MGPBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='NBA - Sky Sports' then days_right_viewable else 0 end) as NBASS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='NFL - BBC' then days_right_viewable else 0 end) as NFLBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='NFL - Channel 4' then days_right_viewable else 0 end) as NFLCH4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='NFL Seasons 2012-2015 - Sky Sports' then days_right_viewable else 0 end) as NFLSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Northern Ireland Football Association 2012-2014 - Sky Sports' then days_right_viewable else 0 end) as NIFSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Oaks - Channel 4' then days_right_viewable else 0 end) as OAKCH4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other American Football' then days_right_viewable else 0 end) as AMOTH_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Athletics' then days_right_viewable else 0 end) as ATHOTH_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Baseball' then days_right_viewable else 0 end) as BASEOTH_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Basketball' then days_right_viewable else 0 end) as BASKOTH_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Boxing' then days_right_viewable else 0 end) as BOXOTH_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Cricket' then days_right_viewable else 0 end) as CRIOTH_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Darts' then days_right_viewable else 0 end) as DARTOTH_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Equestrian' then days_right_viewable else 0 end) as EQUOTH_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Extreme' then days_right_viewable else 0 end) as EXTOTH_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Fishing' then days_right_viewable else 0 end) as FSHOTH_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Football' then days_right_viewable else 0 end) as FOOTOTH_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Golf' then days_right_viewable else 0 end) as GOLFOTH_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Ice Hockey' then days_right_viewable else 0 end) as IHOTH_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Motor Sport' then days_right_viewable else 0 end) as MSPOTH_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Racing' then days_right_viewable else 0 end) as RACOTH_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Rugby' then days_right_viewable else 0 end) as RUGOTH_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Rugby Internationals - ESPN' then days_right_viewable else 0 end) as ORUGESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Snooker/Pool' then days_right_viewable else 0 end) as OTHSNP_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Tennis' then days_right_viewable else 0 end) as OTHTEN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Unknown' then days_right_viewable else 0 end) as OTHUNK_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Watersports' then days_right_viewable else 0 end) as OTHWAT_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Wintersports' then days_right_viewable else 0 end) as OTHWIN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Other Wrestling' then days_right_viewable else 0 end) as OTHWRE_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='PGA Tour Golf 2010-2017 - Sky Sports' then days_right_viewable else 0 end) as PGASS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Premier League - BT Sport' then days_right_viewable else 0 end) as PLBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Premier League - ESPN' then days_right_viewable else 0 end) as PLESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Premier League Darts 2010-2013 - Sky Sports' then days_right_viewable else 0 end) as PLDSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports' then days_right_viewable else 0 end) as GPLSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Match Choice)' then days_right_viewable else 0 end) as PLMCSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (MNF)' then days_right_viewable else 0 end) as PLMNFSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (non Live)' then days_right_viewable else 0 end) as PLNLSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (other Live)' then days_right_viewable else 0 end) as PLOLSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Sat Lunchtime)' then days_right_viewable else 0 end) as PLSLSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Sat Night Live)' then days_right_viewable else 0 end) as PLSNSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Sun 4pm)' then days_right_viewable else 0 end) as PLS4SS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Sun Lunchtime)' then days_right_viewable else 0 end) as PLSULSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Premiership Rugby - Sky Sports' then days_right_viewable else 0 end) as PRUSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Republic Of Ireland FA - 2010/11 To 2013/14 - Sky Sports' then days_right_viewable else 0 end) as ROISS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Royal Ascot - Channel 4' then days_right_viewable else 0 end) as RASCH4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Rugby Internationals (England) - BBC' then days_right_viewable else 0 end) as RIEBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Rugby Internationals (Ireland) - BBC' then days_right_viewable else 0 end) as RIIBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Rugby Internationals (Scotland) - BBC' then days_right_viewable else 0 end) as RISBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Rugby Internationals (Wales) - BBC' then days_right_viewable else 0 end) as RIWBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Rugby League Challenge Cup- BBC' then days_right_viewable else 0 end) as RLCCBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Rugby League - Sky Sports' then days_right_viewable else 0 end) as RLGSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Rugby League World Cup- BBC' then days_right_viewable else 0 end) as RLWCBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sanzar Rugby Union 2011 - 2015 - Sky Sports' then days_right_viewable else 0 end) as SARUSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Scottish FA Deal - 2010/11 To 2013/14 - Sky Sports' then days_right_viewable else 0 end) as SFASS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Serie A - BT Sport' then days_right_viewable else 0 end) as SABTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Serie A - ESPN' then days_right_viewable else 0 end) as SAESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='SFL - ESPN' then days_right_viewable else 0 end) as SFLESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Six Nations - BBC' then days_right_viewable else 0 end) as SNRBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Boxing' then days_right_viewable else 0 end) as BOXS12_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Football' then days_right_viewable else 0 end) as FOOTS12_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Motor Sport' then days_right_viewable else 0 end) as MSPS12_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Unknown' then days_right_viewable else 0 end) as UNKS12_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Wrestling' then days_right_viewable else 0 end) as WRES12_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports American Football' then days_right_viewable else 0 end) as AMSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Athletics' then days_right_viewable else 0 end) as ATHSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Baseball' then days_right_viewable else 0 end) as BASESS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Basketball' then days_right_viewable else 0 end) as BASKSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Boxing' then days_right_viewable else 0 end) as BOXSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Cricket' then days_right_viewable else 0 end) as CRISS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Darts' then days_right_viewable else 0 end) as DARTSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Equestrian' then days_right_viewable else 0 end) as EQUSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Extreme' then days_right_viewable else 0 end) as EXTSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Fishing' then days_right_viewable else 0 end) as FISHSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Football' then days_right_viewable else 0 end) as FOOTSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Golf' then days_right_viewable else 0 end) as GOLFSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Ice Hockey' then days_right_viewable else 0 end) as IHSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Motor Sport' then days_right_viewable else 0 end) as MSPSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Racing' then days_right_viewable else 0 end) as RACSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Rugby' then days_right_viewable else 0 end) as RUGSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Snooker/Pool' then days_right_viewable else 0 end) as SNPSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Tennis' then days_right_viewable else 0 end) as TENSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Unknown' then days_right_viewable else 0 end) as UNKSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Watersports' then days_right_viewable else 0 end) as WATSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Wintersports' then days_right_viewable else 0 end) as WINSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Wrestling' then days_right_viewable else 0 end) as WRESS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Solheim Cup 2013 Ladies Golf - Sky Sports' then days_right_viewable else 0 end) as SOLSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='South African Home Cricket 2012-2020 Sky Sports' then days_right_viewable else 0 end) as SACSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Spanish Football 2012/13 To 14/15 - Sky Sports' then days_right_viewable else 0 end) as SPFSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='SPFL - BT Sport' then days_right_viewable else 0 end) as SPFLBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='SPL - ESPN' then days_right_viewable else 0 end) as SPLESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='SPL - Sky Sports' then days_right_viewable else 0 end) as SPLSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Sportfive World Cup 2014 Qualifers - Sky Sports' then days_right_viewable else 0 end) as SP5SS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='The boat race - BBC' then days_right_viewable else 0 end) as BTRBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='The football league show - BBC' then days_right_viewable else 0 end) as FLSBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='The Masters Golf - BBC' then days_right_viewable else 0 end) as MGBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='TNA Wrestling Challenge' then days_right_viewable else 0 end) as TNACHA_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Tour de France - Eurosport' then days_right_viewable else 0 end) as TDFEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Tour de France - ITV' then days_right_viewable else 0 end) as TDFITV_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='U S Masters Golf 2011-2014 Sky Sports' then days_right_viewable else 0 end) as USMGSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='U.S Open Tennis 2013-2015 Sky Sports' then days_right_viewable else 0 end) as USOTSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='U.S Open/Womens/Seniors/Amateur Golf Sky Sports' then days_right_viewable else 0 end) as USOGSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports' then days_right_viewable else 0 end) as CLASS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports (non Live)' then days_right_viewable else 0 end) as CLNSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports (other Live)' then days_right_viewable else 0 end) as CLOSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports (Tue)' then days_right_viewable else 0 end) as CLTSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports (Wed)' then days_right_viewable else 0 end) as CLWSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='US Open Tennis - Eurosport' then days_right_viewable else 0 end) as USOTEUR_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='USA Football - BT Sport' then days_right_viewable else 0 end) as USFBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='USPGA Championship (2007-2016) Sky Sports' then days_right_viewable else 0 end) as USPGASS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='WCQ - ESPN' then days_right_viewable else 0 end) as WCQESPN_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Welsh Home International Football 2012-2014 Sky Sports' then days_right_viewable else 0 end) as WIFSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='West Indies Home Cricket 2013-2020 Sky Sports' then days_right_viewable else 0 end) as WICSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Wimbledon - BBC' then days_right_viewable else 0 end) as WIMBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='Womens Cricket - I C C Cricket Deal 2012-2015 Sky Sports' then days_right_viewable else 0 end) as WICCSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='World Athletics Championship - More 4' then days_right_viewable else 0 end) as WACMR4_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='World Club Championship - BBC' then days_right_viewable else 0 end) as WCLBBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='World Cup Qualifiers - BT Sport' then days_right_viewable else 0 end) as WCQBTS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='World Darts Championship 2009-2012 Sky Sports' then days_right_viewable else 0 end) as WDCSS_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='World snooker championship - BBC' then days_right_viewable else 0 end) as WSCBBC_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='WWE Sky 1 and 2' then days_right_viewable else 0 end) as WWES12_days_right_viewable_LIVE ,sum(case when live=1 and analysis_right ='WWE Sky Sports' then days_right_viewable else 0 end) as WWESS_days_right_viewable_LIVE ,sum(case when Live=0 and analysis_right ='Africa Cup of Nations - Eurosport' then days_right_viewable else 0 end) as AFCEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Africa Cup of Nations - ITV' then days_right_viewable else 0 end) as AFCITV_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Americas Cup - BBC' then days_right_viewable else 0 end) as AMCBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Asian Tour Golf 2012-2013 Sky Sports' then days_right_viewable else 0 end) as ATGSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ATP Tennis Masters Series 2011-2013 Sky Sports' then days_right_viewable else 0 end) as ATPSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Australia Home Cricket 2012-2016 Sky Sports' then days_right_viewable else 0 end) as AHCSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Australian Football - BT Sport' then days_right_viewable else 0 end) as AUFBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Australian Open Tennis - BBC' then days_right_viewable else 0 end) as AOTBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Australian Open Tennis - Eurosport' then days_right_viewable else 0 end) as AOTEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Aviva Premiership - ESPN' then days_right_viewable else 0 end) as AVPSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BBC American Football' then days_right_viewable else 0 end) as AFBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BBC Athletics' then days_right_viewable else 0 end) as ATHBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BBC Boxing' then days_right_viewable else 0 end) as BOXBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BBC Darts' then days_right_viewable else 0 end) as DRTBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BBC Equestrian' then days_right_viewable else 0 end) as EQUBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BBC Football' then days_right_viewable else 0 end) as FOOTBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BBC Golf' then days_right_viewable else 0 end) as GOLFBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BBC Motor Sport' then days_right_viewable else 0 end) as MSPBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BBC Rugby' then days_right_viewable else 0 end) as RUGBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BBC Snooker/Pool' then days_right_viewable else 0 end) as SNPBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BBC Tennis' then days_right_viewable else 0 end) as TENBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BBC Unknown' then days_right_viewable else 0 end) as UNKBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BBC Watersports' then days_right_viewable else 0 end) as WATBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BBC Wintersports' then days_right_viewable else 0 end) as WINBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Boxing - Channel 5' then days_right_viewable else 0 end) as BOXCH5_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Boxing - Matchroom 2012-2014 Sky Sports' then days_right_viewable else 0 end) as BOXMSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Brazil Football - BT Sport' then days_right_viewable else 0 end) as BFTBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='British & Irish Lions 2013 - Sky Sports' then days_right_viewable else 0 end) as BILSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='British Open Golf - BBC' then days_right_viewable else 0 end) as BOGSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport American Football' then days_right_viewable else 0 end) as AFBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Athletics' then days_right_viewable else 0 end) as ATHBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Baseball' then days_right_viewable else 0 end) as BASEBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Basketball' then days_right_viewable else 0 end) as BASKBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Boxing' then days_right_viewable else 0 end) as BOXBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Cricket' then days_right_viewable else 0 end) as CRIBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Equestrian' then days_right_viewable else 0 end) as EQUBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Extreme' then days_right_viewable else 0 end) as EXTBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Football' then days_right_viewable else 0 end) as FOOTBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Motor Sport' then days_right_viewable else 0 end) as MSPBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Rugby' then days_right_viewable else 0 end) as RUGBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Tennis' then days_right_viewable else 0 end) as TENBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Unknown' then days_right_viewable else 0 end) as UNKBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Wintersports' then days_right_viewable else 0 end) as WINBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Bundesliga - BT Sport' then days_right_viewable else 0 end) as BUNBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Bundesliga- ESPN' then days_right_viewable else 0 end) as BUNESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Challenge Darts' then days_right_viewable else 0 end) as DRTCHA_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Challenge Extreme' then days_right_viewable else 0 end) as EXTCHA_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Challenge Unknown' then days_right_viewable else 0 end) as UNKCHA_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Challenge Wrestling' then days_right_viewable else 0 end) as WRECHA_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Champions League - ITV' then days_right_viewable else 0 end) as CHLITV_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Champions Trophy - I C C Cricket Deal 2012-2015 Sky Sports' then days_right_viewable else 0 end) as ICCSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 American Football' then days_right_viewable else 0 end) as AMCH4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Athletics' then days_right_viewable else 0 end) as ATHCH4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Boxing' then days_right_viewable else 0 end) as BOXCH4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Equestrian' then days_right_viewable else 0 end) as EQUCH4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Extreme' then days_right_viewable else 0 end) as EXTCH4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Football' then days_right_viewable else 0 end) as FOOTCH4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Motor Sport' then days_right_viewable else 0 end) as MSPCH4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Racing' then days_right_viewable else 0 end) as RACCH4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Unknown' then days_right_viewable else 0 end) as UNKCH4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Watersports' then days_right_viewable else 0 end) as WATCH4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Wintersports' then days_right_viewable else 0 end) as WINCH4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Athletics' then days_right_viewable else 0 end) as ATHCH5_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Boxing' then days_right_viewable else 0 end) as BOXOCH5_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Cricket' then days_right_viewable else 0 end) as CRICH5_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Motor Sport' then days_right_viewable else 0 end) as MSPCH5_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Unknown' then days_right_viewable else 0 end) as UNKCH5_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Wrestling' then days_right_viewable else 0 end) as WRECH5_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Cheltenham Festival - Channel 4' then days_right_viewable else 0 end) as CHELCH4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Community Shield - ITV' then days_right_viewable else 0 end) as CMSITV_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Confederations Cup - BBC' then days_right_viewable else 0 end) as CONCBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Conference - BT Sport' then days_right_viewable else 0 end) as CONFBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Cycling - La Vuelta ITV' then days_right_viewable else 0 end) as CLVITV_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Cycling - U C I World Tour Sky Sports' then days_right_viewable else 0 end) as CUCISS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Cycling Tour of Britain - Eurosport' then days_right_viewable else 0 end) as CTBEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Cycling: tour of britain ITV4' then days_right_viewable else 0 end) as CTCITV_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Derby - Channel 4' then days_right_viewable else 0 end) as DERCH4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ECB (highlights) - Channel 5' then days_right_viewable else 0 end) as ECBHCH5_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ECB Cricket Sky Sports' then days_right_viewable else 0 end) as GECRSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ECB non-Test Cricket Sky Sports' then days_right_viewable else 0 end) as ECBNSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ECB Test Cricket Sky Sports' then days_right_viewable else 0 end) as ECBTSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='England Football Internationals - ITV' then days_right_viewable else 0 end) as GENGITV_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='England Friendlies (Football) - ITV' then days_right_viewable else 0 end) as EFRITV_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='England Rugby Internationals 2010-2015 - Sky Sports' then days_right_viewable else 0 end) as ENRSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='England World Cup Qualifying (Away) - ITV' then days_right_viewable else 0 end) as EWQAITV_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='England World Cup Qualifying (Home) - ITV' then days_right_viewable else 0 end) as EWQHITV_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN American Football' then days_right_viewable else 0 end) as AMESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Athletics' then days_right_viewable else 0 end) as ATHESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Baseball' then days_right_viewable else 0 end) as BASEESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Basketball' then days_right_viewable else 0 end) as BASKESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Boxing' then days_right_viewable else 0 end) as BOXESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Cricket' then days_right_viewable else 0 end) as CRIESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Darts' then days_right_viewable else 0 end) as DARTESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Equestrian' then days_right_viewable else 0 end) as EQUESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Extreme' then days_right_viewable else 0 end) as EXTESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Football' then days_right_viewable else 0 end) as FOOTESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Golf' then days_right_viewable else 0 end) as GOLFESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Ice Hockey' then days_right_viewable else 0 end) as IHESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Motor Sport' then days_right_viewable else 0 end) as MSPESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Racing' then days_right_viewable else 0 end) as RACESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Rugby' then days_right_viewable else 0 end) as RUGESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Snooker/Pool' then days_right_viewable else 0 end) as SNPESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Tennis' then days_right_viewable else 0 end) as TENESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Unknown' then days_right_viewable else 0 end) as UNKESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Watersports' then days_right_viewable else 0 end) as WATESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Wintersports' then days_right_viewable else 0 end) as WINESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Wrestling' then days_right_viewable else 0 end) as WREESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Europa League - BT Sport' then days_right_viewable else 0 end) as ELBTSP_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Europa League - ESPN' then days_right_viewable else 0 end) as ELESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Europa League - ITV' then days_right_viewable else 0 end) as ELITV_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='European Tour Golf - Sky Sports' then days_right_viewable else 0 end) as ETGSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport American Football' then days_right_viewable else 0 end) as AMEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Athletics' then days_right_viewable else 0 end) as ATHEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Baseball' then days_right_viewable else 0 end) as BASEEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Basketball' then days_right_viewable else 0 end) as BASKEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Boxing' then days_right_viewable else 0 end) as BOXEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Cricket' then days_right_viewable else 0 end) as CRIEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Darts' then days_right_viewable else 0 end) as DARTEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Equestrian' then days_right_viewable else 0 end) as EQUEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Extreme' then days_right_viewable else 0 end) as EXTEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Football' then days_right_viewable else 0 end) as FOOTEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Golf' then days_right_viewable else 0 end) as GOLFEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Ice Hockey' then days_right_viewable else 0 end) as IHEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Motor Sport' then days_right_viewable else 0 end) as MSPEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Racing' then days_right_viewable else 0 end) as RACEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Snooker/Pool' then days_right_viewable else 0 end) as SNPEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Tennis' then days_right_viewable else 0 end) as TENEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Unknown' then days_right_viewable else 0 end) as UNKEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Watersports' then days_right_viewable else 0 end) as WATEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Wintersports' then days_right_viewable else 0 end) as WINEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='F1 - BBC' then days_right_viewable else 0 end) as GF1BBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='F1 - Sky Sports' then days_right_viewable else 0 end) as GF1SS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='F1 (non-Live)- BBC' then days_right_viewable else 0 end) as F1NBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='F1 (Practice Live)- BBC' then days_right_viewable else 0 end) as F1PBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='F1 (Qualifying Live)- BBC' then days_right_viewable else 0 end) as F1QBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='F1 (Race Live)- BBC' then days_right_viewable else 0 end) as F1RBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='FA Cup - ESPN' then days_right_viewable else 0 end) as FACESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='FA Cup - ITV' then days_right_viewable else 0 end) as FACITV_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - Capital 1 Cup' then days_right_viewable else 0 end) as FLCCSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - others' then days_right_viewable else 0 end) as FLOTSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Formula One 2012-2018 - (non-Live) Sky Sports' then days_right_viewable else 0 end) as F1NSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Formula One 2012-2018 - (Practice Live) Sky Sports' then days_right_viewable else 0 end) as F1PSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Formula One 2012-2018 - (Qualifying Live) Sky Sports' then days_right_viewable else 0 end) as F1QSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Formula One 2012-2018 - (Race Live) Sky Sports' then days_right_viewable else 0 end) as F1RSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='French Open Tennis - Eurosport' then days_right_viewable else 0 end) as FOTEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='French Open Tennis - ITV' then days_right_viewable else 0 end) as FOTITV_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Grand National - Channel 4' then days_right_viewable else 0 end) as GDNCH4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Heineken Cup 2010/11 To 2013/14- Sky Sports' then days_right_viewable else 0 end) as HECSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='I R B Sevens 2008/09 -2014/15 - Sky Sports' then days_right_viewable else 0 end) as IRBSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='IAAF World Athletics Championship - Eurosport' then days_right_viewable else 0 end) as WACEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='India Home Cricket 2012-2018 Sky Sports' then days_right_viewable else 0 end) as IHCSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='India Premier League - ITV' then days_right_viewable else 0 end) as IPLITV_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='International Freindlies - ESPN' then days_right_viewable else 0 end) as IFESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='International Friendlies - BT Sport' then days_right_viewable else 0 end) as IFBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Boxing' then days_right_viewable else 0 end) as BOXITV1_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Football' then days_right_viewable else 0 end) as FOOTITV1_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Motor Sport' then days_right_viewable else 0 end) as MOTSITV1_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Rugby' then days_right_viewable else 0 end) as RUGITV1_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Snooker/Pool' then days_right_viewable else 0 end) as SNPITV1_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Unknown' then days_right_viewable else 0 end) as UNKITV1_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Boxing' then days_right_viewable else 0 end) as BOXITV4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Cricket' then days_right_viewable else 0 end) as CRIITV4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Darts' then days_right_viewable else 0 end) as DARTITV4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Extreme' then days_right_viewable else 0 end) as EXTITV4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Football' then days_right_viewable else 0 end) as FOOTITV4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Motor Sport' then days_right_viewable else 0 end) as MSPITV4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Rugby' then days_right_viewable else 0 end) as RUGITV4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Snooker/Pool' then days_right_viewable else 0 end) as SNPITV4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Tennis' then days_right_viewable else 0 end) as TENITV4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Unknown' then days_right_viewable else 0 end) as UNKITV4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Ligue 1 - BT Sport' then days_right_viewable else 0 end) as L1BTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Ligue 1 - ESPN' then days_right_viewable else 0 end) as L1ESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Match of the day - BBC' then days_right_viewable else 0 end) as MOTDBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Matchroom Output Deal 2010-2012 (Other)- Sky Sports' then days_right_viewable else 0 end) as MROSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Matchroom Output Deal 2010-2012 (Pool)- Sky Sports' then days_right_viewable else 0 end) as MRPSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Matchroom Output Deal 2010-2012 (Snooker)- Sky Sports' then days_right_viewable else 0 end) as MRSSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Moto GP BBC' then days_right_viewable else 0 end) as MGPBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='NBA - Sky Sports' then days_right_viewable else 0 end) as NBASS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='NFL - BBC' then days_right_viewable else 0 end) as NFLBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='NFL - Channel 4' then days_right_viewable else 0 end) as NFLCH4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='NFL Seasons 2012-2015 - Sky Sports' then days_right_viewable else 0 end) as NFLSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Northern Ireland Football Association 2012-2014 - Sky Sports' then days_right_viewable else 0 end) as NIFSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Oaks - Channel 4' then days_right_viewable else 0 end) as OAKCH4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other American Football' then days_right_viewable else 0 end) as AMOTH_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Athletics' then days_right_viewable else 0 end) as ATHOTH_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Baseball' then days_right_viewable else 0 end) as BASEOTH_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Basketball' then days_right_viewable else 0 end) as BASKOTH_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Boxing' then days_right_viewable else 0 end) as BOXOTH_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Cricket' then days_right_viewable else 0 end) as CRIOTH_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Darts' then days_right_viewable else 0 end) as DARTOTH_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Equestrian' then days_right_viewable else 0 end) as EQUOTH_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Extreme' then days_right_viewable else 0 end) as EXTOTH_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Fishing' then days_right_viewable else 0 end) as FSHOTH_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Football' then days_right_viewable else 0 end) as FOOTOTH_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Golf' then days_right_viewable else 0 end) as GOLFOTH_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Ice Hockey' then days_right_viewable else 0 end) as IHOTH_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Motor Sport' then days_right_viewable else 0 end) as MSPOTH_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Racing' then days_right_viewable else 0 end) as RACOTH_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Rugby' then days_right_viewable else 0 end) as RUGOTH_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Rugby Internationals - ESPN' then days_right_viewable else 0 end) as ORUGESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Snooker/Pool' then days_right_viewable else 0 end) as OTHSNP_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Tennis' then days_right_viewable else 0 end) as OTHTEN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Unknown' then days_right_viewable else 0 end) as OTHUNK_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Watersports' then days_right_viewable else 0 end) as OTHWAT_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Wintersports' then days_right_viewable else 0 end) as OTHWIN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Other Wrestling' then days_right_viewable else 0 end) as OTHWRE_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='PGA Tour Golf 2010-2017 - Sky Sports' then days_right_viewable else 0 end) as PGASS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Premier League - BT Sport' then days_right_viewable else 0 end) as PLBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Premier League - ESPN' then days_right_viewable else 0 end) as PLESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Darts 2010-2013 - Sky Sports' then days_right_viewable else 0 end) as PLDSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports' then days_right_viewable else 0 end) as GPLSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Match Choice)' then days_right_viewable else 0 end) as PLMCSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (MNF)' then days_right_viewable else 0 end) as PLMNFSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (non Live)' then days_right_viewable else 0 end) as PLNLSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (other Live)' then days_right_viewable else 0 end) as PLOLSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Sat Lunchtime)' then days_right_viewable else 0 end) as PLSLSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Sat Night Live)' then days_right_viewable else 0 end) as PLSNSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Sun 4pm)' then days_right_viewable else 0 end) as PLS4SS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Sun Lunchtime)' then days_right_viewable else 0 end) as PLSULSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Premiership Rugby - Sky Sports' then days_right_viewable else 0 end) as PRUSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Republic Of Ireland FA - 2010/11 To 2013/14 - Sky Sports' then days_right_viewable else 0 end) as ROISS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Royal Ascot - Channel 4' then days_right_viewable else 0 end) as RASCH4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Rugby Internationals (England) - BBC' then days_right_viewable else 0 end) as RIEBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Rugby Internationals (Ireland) - BBC' then days_right_viewable else 0 end) as RIIBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Rugby Internationals (Scotland) - BBC' then days_right_viewable else 0 end) as RISBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Rugby Internationals (Wales) - BBC' then days_right_viewable else 0 end) as RIWBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Rugby League Challenge Cup- BBC' then days_right_viewable else 0 end) as RLCCBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Rugby League - Sky Sports' then days_right_viewable else 0 end) as RLGSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Rugby League World Cup- BBC' then days_right_viewable else 0 end) as RLWCBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sanzar Rugby Union 2011 - 2015 - Sky Sports' then days_right_viewable else 0 end) as SARUSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Scottish FA Deal - 2010/11 To 2013/14 - Sky Sports' then days_right_viewable else 0 end) as SFASS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Serie A - BT Sport' then days_right_viewable else 0 end) as SABTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Serie A - ESPN' then days_right_viewable else 0 end) as SAESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='SFL - ESPN' then days_right_viewable else 0 end) as SFLESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Six Nations - BBC' then days_right_viewable else 0 end) as SNRBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Boxing' then days_right_viewable else 0 end) as BOXS12_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Football' then days_right_viewable else 0 end) as FOOTS12_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Motor Sport' then days_right_viewable else 0 end) as MSPS12_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Unknown' then days_right_viewable else 0 end) as UNKS12_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Wrestling' then days_right_viewable else 0 end) as WRES12_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports American Football' then days_right_viewable else 0 end) as AMSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Athletics' then days_right_viewable else 0 end) as ATHSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Baseball' then days_right_viewable else 0 end) as BASESS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Basketball' then days_right_viewable else 0 end) as BASKSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Boxing' then days_right_viewable else 0 end) as BOXSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Cricket' then days_right_viewable else 0 end) as CRISS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Darts' then days_right_viewable else 0 end) as DARTSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Equestrian' then days_right_viewable else 0 end) as EQUSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Extreme' then days_right_viewable else 0 end) as EXTSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Fishing' then days_right_viewable else 0 end) as FISHSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Football' then days_right_viewable else 0 end) as FOOTSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Golf' then days_right_viewable else 0 end) as GOLFSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Ice Hockey' then days_right_viewable else 0 end) as IHSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Motor Sport' then days_right_viewable else 0 end) as MSPSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Racing' then days_right_viewable else 0 end) as RACSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Rugby' then days_right_viewable else 0 end) as RUGSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Snooker/Pool' then days_right_viewable else 0 end) as SNPSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Tennis' then days_right_viewable else 0 end) as TENSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Unknown' then days_right_viewable else 0 end) as UNKSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Watersports' then days_right_viewable else 0 end) as WATSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Wintersports' then days_right_viewable else 0 end) as WINSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Wrestling' then days_right_viewable else 0 end) as WRESS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Solheim Cup 2013 Ladies Golf - Sky Sports' then days_right_viewable else 0 end) as SOLSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='South African Home Cricket 2012-2020 Sky Sports' then days_right_viewable else 0 end) as SACSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Spanish Football 2012/13 To 14/15 - Sky Sports' then days_right_viewable else 0 end) as SPFSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='SPFL - BT Sport' then days_right_viewable else 0 end) as SPFLBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='SPL - ESPN' then days_right_viewable else 0 end) as SPLESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='SPL - Sky Sports' then days_right_viewable else 0 end) as SPLSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Sportfive World Cup 2014 Qualifers - Sky Sports' then days_right_viewable else 0 end) as SP5SS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='The boat race - BBC' then days_right_viewable else 0 end) as BTRBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='The football league show - BBC' then days_right_viewable else 0 end) as FLSBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='The Masters Golf - BBC' then days_right_viewable else 0 end) as MGBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='TNA Wrestling Challenge' then days_right_viewable else 0 end) as TNACHA_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Tour de France - Eurosport' then days_right_viewable else 0 end) as TDFEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Tour de France - ITV' then days_right_viewable else 0 end) as TDFITV_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='U S Masters Golf 2011-2014 Sky Sports' then days_right_viewable else 0 end) as USMGSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='U.S Open Tennis 2013-2015 Sky Sports' then days_right_viewable else 0 end) as USOTSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='U.S Open/Womens/Seniors/Amateur Golf Sky Sports' then days_right_viewable else 0 end) as USOGSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports' then days_right_viewable else 0 end) as CLASS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports (non Live)' then days_right_viewable else 0 end) as CLNSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports (other Live)' then days_right_viewable else 0 end) as CLOSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports (Tue)' then days_right_viewable else 0 end) as CLTSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports (Wed)' then days_right_viewable else 0 end) as CLWSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='US Open Tennis - Eurosport' then days_right_viewable else 0 end) as USOTEUR_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='USA Football - BT Sport' then days_right_viewable else 0 end) as USFBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='USPGA Championship (2007-2016) Sky Sports' then days_right_viewable else 0 end) as USPGASS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='WCQ - ESPN' then days_right_viewable else 0 end) as WCQESPN_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Welsh Home International Football 2012-2014 Sky Sports' then days_right_viewable else 0 end) as WIFSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='West Indies Home Cricket 2013-2020 Sky Sports' then days_right_viewable else 0 end) as WICSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Wimbledon - BBC' then days_right_viewable else 0 end) as WIMBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='Womens Cricket - I C C Cricket Deal 2012-2015 Sky Sports' then days_right_viewable else 0 end) as WICCSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='World Athletics Championship - More 4' then days_right_viewable else 0 end) as WACMR4_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='World Club Championship - BBC' then days_right_viewable else 0 end) as WCLBBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='World Cup Qualifiers - BT Sport' then days_right_viewable else 0 end) as WCQBTS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='World Darts Championship 2009-2012 Sky Sports' then days_right_viewable else 0 end) as WDCSS_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='World snooker championship - BBC' then days_right_viewable else 0 end) as WSCBBC_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='WWE Sky 1 and 2' then days_right_viewable else 0 end) as WWES12_days_right_viewableNon_Live ,sum(case when Live=0 and analysis_right ='WWE Sky Sports' then days_right_viewable else 0 end) as WWESS_days_right_viewableNon_Live ,sum(case when live=1 and analysis_right ='Africa Cup of Nations - Eurosport' then days_right_broadcast else 0 end) as AFCEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Africa Cup of Nations - ITV' then days_right_broadcast else 0 end) as AFCITV_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Americas Cup - BBC' then days_right_broadcast else 0 end) as AMCBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Asian Tour Golf 2012-2013 Sky Sports' then days_right_broadcast else 0 end) as ATGSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ATP Tennis Masters Series 2011-2013 Sky Sports' then days_right_broadcast else 0 end) as ATPSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Australia Home Cricket 2012-2016 Sky Sports' then days_right_broadcast else 0 end) as AHCSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Australian Football - BT Sport' then days_right_broadcast else 0 end) as AUFBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Australian Open Tennis - BBC' then days_right_broadcast else 0 end) as AOTBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Australian Open Tennis - Eurosport' then days_right_broadcast else 0 end) as AOTEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Aviva Premiership - ESPN' then days_right_broadcast else 0 end) as AVPSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BBC American Football' then days_right_broadcast else 0 end) as AFBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BBC Athletics' then days_right_broadcast else 0 end) as ATHBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BBC Boxing' then days_right_broadcast else 0 end) as BOXBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BBC Darts' then days_right_broadcast else 0 end) as DRTBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BBC Equestrian' then days_right_broadcast else 0 end) as EQUBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BBC Football' then days_right_broadcast else 0 end) as FOOTBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BBC Golf' then days_right_broadcast else 0 end) as GOLFBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BBC Motor Sport' then days_right_broadcast else 0 end) as MSPBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BBC Rugby' then days_right_broadcast else 0 end) as RUGBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BBC Snooker/Pool' then days_right_broadcast else 0 end) as SNPBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BBC Tennis' then days_right_broadcast else 0 end) as TENBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BBC Unknown' then days_right_broadcast else 0 end) as UNKBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BBC Watersports' then days_right_broadcast else 0 end) as WATBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BBC Wintersports' then days_right_broadcast else 0 end) as WINBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Boxing - Channel 5' then days_right_broadcast else 0 end) as BOXCH5_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Boxing - Matchroom 2012-2014 Sky Sports' then days_right_broadcast else 0 end) as BOXMSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Brazil Football - BT Sport' then days_right_broadcast else 0 end) as BFTBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='British & Irish Lions 2013 - Sky Sports' then days_right_broadcast else 0 end) as BILSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='British Open Golf - BBC' then days_right_broadcast else 0 end) as BOGSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BT Sport American Football' then days_right_broadcast else 0 end) as AFBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Athletics' then days_right_broadcast else 0 end) as ATHBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Baseball' then days_right_broadcast else 0 end) as BASEBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Basketball' then days_right_broadcast else 0 end) as BASKBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Boxing' then days_right_broadcast else 0 end) as BOXBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Cricket' then days_right_broadcast else 0 end) as CRIBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Equestrian' then days_right_broadcast else 0 end) as EQUBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Extreme' then days_right_broadcast else 0 end) as EXTBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Football' then days_right_broadcast else 0 end) as FOOTBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Motor Sport' then days_right_broadcast else 0 end) as MSPBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Rugby' then days_right_broadcast else 0 end) as RUGBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Tennis' then days_right_broadcast else 0 end) as TENBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Unknown' then days_right_broadcast else 0 end) as UNKBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Wintersports' then days_right_broadcast else 0 end) as WINBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Bundesliga - BT Sport' then days_right_broadcast else 0 end) as BUNBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Bundesliga- ESPN' then days_right_broadcast else 0 end) as BUNESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Challenge Darts' then days_right_broadcast else 0 end) as DRTCHA_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Challenge Extreme' then days_right_broadcast else 0 end) as EXTCHA_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Challenge Unknown' then days_right_broadcast else 0 end) as UNKCHA_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Challenge Wrestling' then days_right_broadcast else 0 end) as WRECHA_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Champions League - ITV' then days_right_broadcast else 0 end) as CHLITV_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Champions Trophy - I C C Cricket Deal 2012-2015 Sky Sports' then days_right_broadcast else 0 end) as ICCSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 American Football' then days_right_broadcast else 0 end) as AMCH4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Athletics' then days_right_broadcast else 0 end) as ATHCH4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Boxing' then days_right_broadcast else 0 end) as BOXCH4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Equestrian' then days_right_broadcast else 0 end) as EQUCH4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Extreme' then days_right_broadcast else 0 end) as EXTCH4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Football' then days_right_broadcast else 0 end) as FOOTCH4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Motor Sport' then days_right_broadcast else 0 end) as MSPCH4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Racing' then days_right_broadcast else 0 end) as RACCH4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Unknown' then days_right_broadcast else 0 end) as UNKCH4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Watersports' then days_right_broadcast else 0 end) as WATCH4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Wintersports' then days_right_broadcast else 0 end) as WINCH4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Athletics' then days_right_broadcast else 0 end) as ATHCH5_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Boxing' then days_right_broadcast else 0 end) as BOXOCH5_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Cricket' then days_right_broadcast else 0 end) as CRICH5_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Motor Sport' then days_right_broadcast else 0 end) as MSPCH5_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Unknown' then days_right_broadcast else 0 end) as UNKCH5_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Wrestling' then days_right_broadcast else 0 end) as WRECH5_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Cheltenham Festival - Channel 4' then days_right_broadcast else 0 end) as CHELCH4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Community Shield - ITV' then days_right_broadcast else 0 end) as CMSITV_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Confederations Cup - BBC' then days_right_broadcast else 0 end) as CONCBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Conference - BT Sport' then days_right_broadcast else 0 end) as CONFBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Cycling - La Vuelta ITV' then days_right_broadcast else 0 end) as CLVITV_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Cycling - U C I World Tour Sky Sports' then days_right_broadcast else 0 end) as CUCISS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Cycling Tour of Britain - Eurosport' then days_right_broadcast else 0 end) as CTBEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Cycling: tour of britain ITV4' then days_right_broadcast else 0 end) as CTCITV_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Derby - Channel 4' then days_right_broadcast else 0 end) as DERCH4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ECB (highlights) - Channel 5' then days_right_broadcast else 0 end) as ECBHCH5_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ECB Cricket Sky Sports' then days_right_broadcast else 0 end) as GECRSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ECB non-Test Cricket Sky Sports' then days_right_broadcast else 0 end) as ECBNSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ECB Test Cricket Sky Sports' then days_right_broadcast else 0 end) as ECBTSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='England Football Internationals - ITV' then days_right_broadcast else 0 end) as GENGITV_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='England Friendlies (Football) - ITV' then days_right_broadcast else 0 end) as EFRITV_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='England Rugby Internationals 2010-2015 - Sky Sports' then days_right_broadcast else 0 end) as ENRSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='England World Cup Qualifying (Away) - ITV' then days_right_broadcast else 0 end) as EWQAITV_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='England World Cup Qualifying (Home) - ITV' then days_right_broadcast else 0 end) as EWQHITV_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN American Football' then days_right_broadcast else 0 end) as AMESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Athletics' then days_right_broadcast else 0 end) as ATHESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Baseball' then days_right_broadcast else 0 end) as BASEESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Basketball' then days_right_broadcast else 0 end) as BASKESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Boxing' then days_right_broadcast else 0 end) as BOXESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Cricket' then days_right_broadcast else 0 end) as CRIESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Darts' then days_right_broadcast else 0 end) as DARTESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Equestrian' then days_right_broadcast else 0 end) as EQUESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Extreme' then days_right_broadcast else 0 end) as EXTESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Football' then days_right_broadcast else 0 end) as FOOTESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Golf' then days_right_broadcast else 0 end) as GOLFESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Ice Hockey' then days_right_broadcast else 0 end) as IHESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Motor Sport' then days_right_broadcast else 0 end) as MSPESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Racing' then days_right_broadcast else 0 end) as RACESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Rugby' then days_right_broadcast else 0 end) as RUGESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Snooker/Pool' then days_right_broadcast else 0 end) as SNPESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Tennis' then days_right_broadcast else 0 end) as TENESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Unknown' then days_right_broadcast else 0 end) as UNKESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Watersports' then days_right_broadcast else 0 end) as WATESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Wintersports' then days_right_broadcast else 0 end) as WINESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ESPN Wrestling' then days_right_broadcast else 0 end) as WREESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Europa League - BT Sport' then days_right_broadcast else 0 end) as ELBTSP_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Europa League - ESPN' then days_right_broadcast else 0 end) as ELESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Europa League - ITV' then days_right_broadcast else 0 end) as ELITV_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='European Tour Golf - Sky Sports' then days_right_broadcast else 0 end) as ETGSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport American Football' then days_right_broadcast else 0 end) as AMEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Athletics' then days_right_broadcast else 0 end) as ATHEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Baseball' then days_right_broadcast else 0 end) as BASEEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Basketball' then days_right_broadcast else 0 end) as BASKEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Boxing' then days_right_broadcast else 0 end) as BOXEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Cricket' then days_right_broadcast else 0 end) as CRIEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Darts' then days_right_broadcast else 0 end) as DARTEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Equestrian' then days_right_broadcast else 0 end) as EQUEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Extreme' then days_right_broadcast else 0 end) as EXTEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Football' then days_right_broadcast else 0 end) as FOOTEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Golf' then days_right_broadcast else 0 end) as GOLFEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Ice Hockey' then days_right_broadcast else 0 end) as IHEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Motor Sport' then days_right_broadcast else 0 end) as MSPEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Racing' then days_right_broadcast else 0 end) as RACEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Snooker/Pool' then days_right_broadcast else 0 end) as SNPEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Tennis' then days_right_broadcast else 0 end) as TENEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Unknown' then days_right_broadcast else 0 end) as UNKEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Watersports' then days_right_broadcast else 0 end) as WATEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Wintersports' then days_right_broadcast else 0 end) as WINEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='F1 - BBC' then days_right_broadcast else 0 end) as GF1BBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='F1 - Sky Sports' then days_right_broadcast else 0 end) as GF1SS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='F1 (non-Live)- BBC' then days_right_broadcast else 0 end) as F1NBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='F1 (Practice Live)- BBC' then days_right_broadcast else 0 end) as F1PBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='F1 (Qualifying Live)- BBC' then days_right_broadcast else 0 end) as F1QBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='F1 (Race Live)- BBC' then days_right_broadcast else 0 end) as F1RBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='FA Cup - ESPN' then days_right_broadcast else 0 end) as FACESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='FA Cup - ITV' then days_right_broadcast else 0 end) as FACITV_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - Capital 1 Cup' then days_right_broadcast else 0 end) as FLCCSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - others' then days_right_broadcast else 0 end) as FLOTSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Formula One 2012-2018 - (non-Live) Sky Sports' then days_right_broadcast else 0 end) as F1NSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Formula One 2012-2018 - (Practice Live) Sky Sports' then days_right_broadcast else 0 end) as F1PSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Formula One 2012-2018 - (Qualifying Live) Sky Sports' then days_right_broadcast else 0 end) as F1QSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Formula One 2012-2018 - (Race Live) Sky Sports' then days_right_broadcast else 0 end) as F1RSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='French Open Tennis - Eurosport' then days_right_broadcast else 0 end) as FOTEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='French Open Tennis - ITV' then days_right_broadcast else 0 end) as FOTITV_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Grand National - Channel 4' then days_right_broadcast else 0 end) as GDNCH4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Heineken Cup 2010/11 To 2013/14- Sky Sports' then days_right_broadcast else 0 end) as HECSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='I R B Sevens 2008/09 -2014/15 - Sky Sports' then days_right_broadcast else 0 end) as IRBSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='IAAF World Athletics Championship - Eurosport' then days_right_broadcast else 0 end) as WACEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='India Home Cricket 2012-2018 Sky Sports' then days_right_broadcast else 0 end) as IHCSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='India Premier League - ITV' then days_right_broadcast else 0 end) as IPLITV_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='International Freindlies - ESPN' then days_right_broadcast else 0 end) as IFESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='International Friendlies - BT Sport' then days_right_broadcast else 0 end) as IFBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Boxing' then days_right_broadcast else 0 end) as BOXITV1_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Football' then days_right_broadcast else 0 end) as FOOTITV1_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Motor Sport' then days_right_broadcast else 0 end) as MOTSITV1_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Rugby' then days_right_broadcast else 0 end) as RUGITV1_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Snooker/Pool' then days_right_broadcast else 0 end) as SNPITV1_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Unknown' then days_right_broadcast else 0 end) as UNKITV1_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Boxing' then days_right_broadcast else 0 end) as BOXITV4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Cricket' then days_right_broadcast else 0 end) as CRIITV4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Darts' then days_right_broadcast else 0 end) as DARTITV4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Extreme' then days_right_broadcast else 0 end) as EXTITV4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Football' then days_right_broadcast else 0 end) as FOOTITV4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Motor Sport' then days_right_broadcast else 0 end) as MSPITV4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Rugby' then days_right_broadcast else 0 end) as RUGITV4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Snooker/Pool' then days_right_broadcast else 0 end) as SNPITV4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Tennis' then days_right_broadcast else 0 end) as TENITV4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Unknown' then days_right_broadcast else 0 end) as UNKITV4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Ligue 1 - BT Sport' then days_right_broadcast else 0 end) as L1BTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Ligue 1 - ESPN' then days_right_broadcast else 0 end) as L1ESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Match of the day - BBC' then days_right_broadcast else 0 end) as MOTDBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Matchroom Output Deal 2010-2012 (Other)- Sky Sports' then days_right_broadcast else 0 end) as MROSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Matchroom Output Deal 2010-2012 (Pool)- Sky Sports' then days_right_broadcast else 0 end) as MRPSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Matchroom Output Deal 2010-2012 (Snooker)- Sky Sports' then days_right_broadcast else 0 end) as MRSSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Moto GP BBC' then days_right_broadcast else 0 end) as MGPBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='NBA - Sky Sports' then days_right_broadcast else 0 end) as NBASS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='NFL - BBC' then days_right_broadcast else 0 end) as NFLBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='NFL - Channel 4' then days_right_broadcast else 0 end) as NFLCH4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='NFL Seasons 2012-2015 - Sky Sports' then days_right_broadcast else 0 end) as NFLSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Northern Ireland Football Association 2012-2014 - Sky Sports' then days_right_broadcast else 0 end) as NIFSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Oaks - Channel 4' then days_right_broadcast else 0 end) as OAKCH4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other American Football' then days_right_broadcast else 0 end) as AMOTH_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Athletics' then days_right_broadcast else 0 end) as ATHOTH_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Baseball' then days_right_broadcast else 0 end) as BASEOTH_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Basketball' then days_right_broadcast else 0 end) as BASKOTH_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Boxing' then days_right_broadcast else 0 end) as BOXOTH_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Cricket' then days_right_broadcast else 0 end) as CRIOTH_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Darts' then days_right_broadcast else 0 end) as DARTOTH_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Equestrian' then days_right_broadcast else 0 end) as EQUOTH_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Extreme' then days_right_broadcast else 0 end) as EXTOTH_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Fishing' then days_right_broadcast else 0 end) as FSHOTH_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Football' then days_right_broadcast else 0 end) as FOOTOTH_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Golf' then days_right_broadcast else 0 end) as GOLFOTH_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Ice Hockey' then days_right_broadcast else 0 end) as IHOTH_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Motor Sport' then days_right_broadcast else 0 end) as MSPOTH_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Racing' then days_right_broadcast else 0 end) as RACOTH_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Rugby' then days_right_broadcast else 0 end) as RUGOTH_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Rugby Internationals - ESPN' then days_right_broadcast else 0 end) as ORUGESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Snooker/Pool' then days_right_broadcast else 0 end) as OTHSNP_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Tennis' then days_right_broadcast else 0 end) as OTHTEN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Unknown' then days_right_broadcast else 0 end) as OTHUNK_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Watersports' then days_right_broadcast else 0 end) as OTHWAT_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Wintersports' then days_right_broadcast else 0 end) as OTHWIN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Other Wrestling' then days_right_broadcast else 0 end) as OTHWRE_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='PGA Tour Golf 2010-2017 - Sky Sports' then days_right_broadcast else 0 end) as PGASS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Premier League - BT Sport' then days_right_broadcast else 0 end) as PLBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Premier League - ESPN' then days_right_broadcast else 0 end) as PLESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Premier League Darts 2010-2013 - Sky Sports' then days_right_broadcast else 0 end) as PLDSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports' then days_right_broadcast else 0 end) as GPLSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Match Choice)' then days_right_broadcast else 0 end) as PLMCSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (MNF)' then days_right_broadcast else 0 end) as PLMNFSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (non Live)' then days_right_broadcast else 0 end) as PLNLSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (other Live)' then days_right_broadcast else 0 end) as PLOLSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Sat Lunchtime)' then days_right_broadcast else 0 end) as PLSLSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Sat Night Live)' then days_right_broadcast else 0 end) as PLSNSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Sun 4pm)' then days_right_broadcast else 0 end) as PLS4SS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Sun Lunchtime)' then days_right_broadcast else 0 end) as PLSULSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Premiership Rugby - Sky Sports' then days_right_broadcast else 0 end) as PRUSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Republic Of Ireland FA - 2010/11 To 2013/14 - Sky Sports' then days_right_broadcast else 0 end) as ROISS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Royal Ascot - Channel 4' then days_right_broadcast else 0 end) as RASCH4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Rugby Internationals (England) - BBC' then days_right_broadcast else 0 end) as RIEBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Rugby Internationals (Ireland) - BBC' then days_right_broadcast else 0 end) as RIIBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Rugby Internationals (Scotland) - BBC' then days_right_broadcast else 0 end) as RISBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Rugby Internationals (Wales) - BBC' then days_right_broadcast else 0 end) as RIWBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Rugby League Challenge Cup- BBC' then days_right_broadcast else 0 end) as RLCCBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Rugby League - Sky Sports' then days_right_broadcast else 0 end) as RLGSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Rugby League World Cup- BBC' then days_right_broadcast else 0 end) as RLWCBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sanzar Rugby Union 2011 - 2015 - Sky Sports' then days_right_broadcast else 0 end) as SARUSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Scottish FA Deal - 2010/11 To 2013/14 - Sky Sports' then days_right_broadcast else 0 end) as SFASS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Serie A - BT Sport' then days_right_broadcast else 0 end) as SABTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Serie A - ESPN' then days_right_broadcast else 0 end) as SAESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='SFL - ESPN' then days_right_broadcast else 0 end) as SFLESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Six Nations - BBC' then days_right_broadcast else 0 end) as SNRBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Boxing' then days_right_broadcast else 0 end) as BOXS12_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Football' then days_right_broadcast else 0 end) as FOOTS12_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Motor Sport' then days_right_broadcast else 0 end) as MSPS12_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Unknown' then days_right_broadcast else 0 end) as UNKS12_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Wrestling' then days_right_broadcast else 0 end) as WRES12_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports American Football' then days_right_broadcast else 0 end) as AMSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Athletics' then days_right_broadcast else 0 end) as ATHSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Baseball' then days_right_broadcast else 0 end) as BASESS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Basketball' then days_right_broadcast else 0 end) as BASKSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Boxing' then days_right_broadcast else 0 end) as BOXSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Cricket' then days_right_broadcast else 0 end) as CRISS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Darts' then days_right_broadcast else 0 end) as DARTSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Equestrian' then days_right_broadcast else 0 end) as EQUSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Extreme' then days_right_broadcast else 0 end) as EXTSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Fishing' then days_right_broadcast else 0 end) as FISHSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Football' then days_right_broadcast else 0 end) as FOOTSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Golf' then days_right_broadcast else 0 end) as GOLFSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Ice Hockey' then days_right_broadcast else 0 end) as IHSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Motor Sport' then days_right_broadcast else 0 end) as MSPSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Racing' then days_right_broadcast else 0 end) as RACSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Rugby' then days_right_broadcast else 0 end) as RUGSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Snooker/Pool' then days_right_broadcast else 0 end) as SNPSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Tennis' then days_right_broadcast else 0 end) as TENSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Unknown' then days_right_broadcast else 0 end) as UNKSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Watersports' then days_right_broadcast else 0 end) as WATSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Wintersports' then days_right_broadcast else 0 end) as WINSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Wrestling' then days_right_broadcast else 0 end) as WRESS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Solheim Cup 2013 Ladies Golf - Sky Sports' then days_right_broadcast else 0 end) as SOLSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='South African Home Cricket 2012-2020 Sky Sports' then days_right_broadcast else 0 end) as SACSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Spanish Football 2012/13 To 14/15 - Sky Sports' then days_right_broadcast else 0 end) as SPFSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='SPFL - BT Sport' then days_right_broadcast else 0 end) as SPFLBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='SPL - ESPN' then days_right_broadcast else 0 end) as SPLESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='SPL - Sky Sports' then days_right_broadcast else 0 end) as SPLSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Sportfive World Cup 2014 Qualifers - Sky Sports' then days_right_broadcast else 0 end) as SP5SS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='The boat race - BBC' then days_right_broadcast else 0 end) as BTRBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='The football league show - BBC' then days_right_broadcast else 0 end) as FLSBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='The Masters Golf - BBC' then days_right_broadcast else 0 end) as MGBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='TNA Wrestling Challenge' then days_right_broadcast else 0 end) as TNACHA_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Tour de France - Eurosport' then days_right_broadcast else 0 end) as TDFEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Tour de France - ITV' then days_right_broadcast else 0 end) as TDFITV_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='U S Masters Golf 2011-2014 Sky Sports' then days_right_broadcast else 0 end) as USMGSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='U.S Open Tennis 2013-2015 Sky Sports' then days_right_broadcast else 0 end) as USOTSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='U.S Open/Womens/Seniors/Amateur Golf Sky Sports' then days_right_broadcast else 0 end) as USOGSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports' then days_right_broadcast else 0 end) as CLASS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports (non Live)' then days_right_broadcast else 0 end) as CLNSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports (other Live)' then days_right_broadcast else 0 end) as CLOSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports (Tue)' then days_right_broadcast else 0 end) as CLTSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports (Wed)' then days_right_broadcast else 0 end) as CLWSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='US Open Tennis - Eurosport' then days_right_broadcast else 0 end) as USOTEUR_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='USA Football - BT Sport' then days_right_broadcast else 0 end) as USFBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='USPGA Championship (2007-2016) Sky Sports' then days_right_broadcast else 0 end) as USPGASS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='WCQ - ESPN' then days_right_broadcast else 0 end) as WCQESPN_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Welsh Home International Football 2012-2014 Sky Sports' then days_right_broadcast else 0 end) as WIFSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='West Indies Home Cricket 2013-2020 Sky Sports' then days_right_broadcast else 0 end) as WICSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Wimbledon - BBC' then days_right_broadcast else 0 end) as WIMBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='Womens Cricket - I C C Cricket Deal 2012-2015 Sky Sports' then days_right_broadcast else 0 end) as WICCSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='World Athletics Championship - More 4' then days_right_broadcast else 0 end) as WACMR4_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='World Club Championship - BBC' then days_right_broadcast else 0 end) as WCLBBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='World Cup Qualifiers - BT Sport' then days_right_broadcast else 0 end) as WCQBTS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='World Darts Championship 2009-2012 Sky Sports' then days_right_broadcast else 0 end) as WDCSS_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='World snooker championship - BBC' then days_right_broadcast else 0 end) as WSCBBC_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='WWE Sky 1 and 2' then days_right_broadcast else 0 end) as WWES12_days_right_broadcast_LIVE ,sum(case when live=1 and analysis_right ='WWE Sky Sports' then days_right_broadcast else 0 end) as WWESS_days_right_broadcast_LIVE ,sum(case when Live=0 and analysis_right ='Africa Cup of Nations - Eurosport' then days_right_broadcast else 0 end) as AFCEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Africa Cup of Nations - ITV' then days_right_broadcast else 0 end) as AFCITV_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Americas Cup - BBC' then days_right_broadcast else 0 end) as AMCBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Asian Tour Golf 2012-2013 Sky Sports' then days_right_broadcast else 0 end) as ATGSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ATP Tennis Masters Series 2011-2013 Sky Sports' then days_right_broadcast else 0 end) as ATPSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Australia Home Cricket 2012-2016 Sky Sports' then days_right_broadcast else 0 end) as AHCSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Australian Football - BT Sport' then days_right_broadcast else 0 end) as AUFBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Australian Open Tennis - BBC' then days_right_broadcast else 0 end) as AOTBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Australian Open Tennis - Eurosport' then days_right_broadcast else 0 end) as AOTEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Aviva Premiership - ESPN' then days_right_broadcast else 0 end) as AVPSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BBC American Football' then days_right_broadcast else 0 end) as AFBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BBC Athletics' then days_right_broadcast else 0 end) as ATHBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BBC Boxing' then days_right_broadcast else 0 end) as BOXBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BBC Darts' then days_right_broadcast else 0 end) as DRTBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BBC Equestrian' then days_right_broadcast else 0 end) as EQUBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BBC Football' then days_right_broadcast else 0 end) as FOOTBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BBC Golf' then days_right_broadcast else 0 end) as GOLFBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BBC Motor Sport' then days_right_broadcast else 0 end) as MSPBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BBC Rugby' then days_right_broadcast else 0 end) as RUGBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BBC Snooker/Pool' then days_right_broadcast else 0 end) as SNPBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BBC Tennis' then days_right_broadcast else 0 end) as TENBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BBC Unknown' then days_right_broadcast else 0 end) as UNKBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BBC Watersports' then days_right_broadcast else 0 end) as WATBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BBC Wintersports' then days_right_broadcast else 0 end) as WINBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Boxing - Channel 5' then days_right_broadcast else 0 end) as BOXCH5_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Boxing - Matchroom 2012-2014 Sky Sports' then days_right_broadcast else 0 end) as BOXMSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Brazil Football - BT Sport' then days_right_broadcast else 0 end) as BFTBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='British & Irish Lions 2013 - Sky Sports' then days_right_broadcast else 0 end) as BILSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='British Open Golf - BBC' then days_right_broadcast else 0 end) as BOGSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport American Football' then days_right_broadcast else 0 end) as AFBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Athletics' then days_right_broadcast else 0 end) as ATHBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Baseball' then days_right_broadcast else 0 end) as BASEBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Basketball' then days_right_broadcast else 0 end) as BASKBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Boxing' then days_right_broadcast else 0 end) as BOXBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Cricket' then days_right_broadcast else 0 end) as CRIBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Equestrian' then days_right_broadcast else 0 end) as EQUBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Extreme' then days_right_broadcast else 0 end) as EXTBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Football' then days_right_broadcast else 0 end) as FOOTBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Motor Sport' then days_right_broadcast else 0 end) as MSPBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Rugby' then days_right_broadcast else 0 end) as RUGBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Tennis' then days_right_broadcast else 0 end) as TENBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Unknown' then days_right_broadcast else 0 end) as UNKBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Wintersports' then days_right_broadcast else 0 end) as WINBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Bundesliga - BT Sport' then days_right_broadcast else 0 end) as BUNBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Bundesliga- ESPN' then days_right_broadcast else 0 end) as BUNESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Challenge Darts' then days_right_broadcast else 0 end) as DRTCHA_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Challenge Extreme' then days_right_broadcast else 0 end) as EXTCHA_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Challenge Unknown' then days_right_broadcast else 0 end) as UNKCHA_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Challenge Wrestling' then days_right_broadcast else 0 end) as WRECHA_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Champions League - ITV' then days_right_broadcast else 0 end) as CHLITV_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Champions Trophy - I C C Cricket Deal 2012-2015 Sky Sports' then days_right_broadcast else 0 end) as ICCSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 American Football' then days_right_broadcast else 0 end) as AMCH4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Athletics' then days_right_broadcast else 0 end) as ATHCH4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Boxing' then days_right_broadcast else 0 end) as BOXCH4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Equestrian' then days_right_broadcast else 0 end) as EQUCH4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Extreme' then days_right_broadcast else 0 end) as EXTCH4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Football' then days_right_broadcast else 0 end) as FOOTCH4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Motor Sport' then days_right_broadcast else 0 end) as MSPCH4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Racing' then days_right_broadcast else 0 end) as RACCH4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Unknown' then days_right_broadcast else 0 end) as UNKCH4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Watersports' then days_right_broadcast else 0 end) as WATCH4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Wintersports' then days_right_broadcast else 0 end) as WINCH4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Athletics' then days_right_broadcast else 0 end) as ATHCH5_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Boxing' then days_right_broadcast else 0 end) as BOXOCH5_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Cricket' then days_right_broadcast else 0 end) as CRICH5_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Motor Sport' then days_right_broadcast else 0 end) as MSPCH5_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Unknown' then days_right_broadcast else 0 end) as UNKCH5_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Wrestling' then days_right_broadcast else 0 end) as WRECH5_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Cheltenham Festival - Channel 4' then days_right_broadcast else 0 end) as CHELCH4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Community Shield - ITV' then days_right_broadcast else 0 end) as CMSITV_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Confederations Cup - BBC' then days_right_broadcast else 0 end) as CONCBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Conference - BT Sport' then days_right_broadcast else 0 end) as CONFBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Cycling - La Vuelta ITV' then days_right_broadcast else 0 end) as CLVITV_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Cycling - U C I World Tour Sky Sports' then days_right_broadcast else 0 end) as CUCISS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Cycling Tour of Britain - Eurosport' then days_right_broadcast else 0 end) as CTBEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Cycling: tour of britain ITV4' then days_right_broadcast else 0 end) as CTCITV_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Derby - Channel 4' then days_right_broadcast else 0 end) as DERCH4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ECB (highlights) - Channel 5' then days_right_broadcast else 0 end) as ECBHCH5_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ECB Cricket Sky Sports' then days_right_broadcast else 0 end) as GECRSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ECB non-Test Cricket Sky Sports' then days_right_broadcast else 0 end) as ECBNSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ECB Test Cricket Sky Sports' then days_right_broadcast else 0 end) as ECBTSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='England Football Internationals - ITV' then days_right_broadcast else 0 end) as GENGITV_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='England Friendlies (Football) - ITV' then days_right_broadcast else 0 end) as EFRITV_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='England Rugby Internationals 2010-2015 - Sky Sports' then days_right_broadcast else 0 end) as ENRSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='England World Cup Qualifying (Away) - ITV' then days_right_broadcast else 0 end) as EWQAITV_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='England World Cup Qualifying (Home) - ITV' then days_right_broadcast else 0 end) as EWQHITV_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN American Football' then days_right_broadcast else 0 end) as AMESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Athletics' then days_right_broadcast else 0 end) as ATHESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Baseball' then days_right_broadcast else 0 end) as BASEESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Basketball' then days_right_broadcast else 0 end) as BASKESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Boxing' then days_right_broadcast else 0 end) as BOXESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Cricket' then days_right_broadcast else 0 end) as CRIESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Darts' then days_right_broadcast else 0 end) as DARTESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Equestrian' then days_right_broadcast else 0 end) as EQUESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Extreme' then days_right_broadcast else 0 end) as EXTESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Football' then days_right_broadcast else 0 end) as FOOTESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Golf' then days_right_broadcast else 0 end) as GOLFESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Ice Hockey' then days_right_broadcast else 0 end) as IHESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Motor Sport' then days_right_broadcast else 0 end) as MSPESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Racing' then days_right_broadcast else 0 end) as RACESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Rugby' then days_right_broadcast else 0 end) as RUGESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Snooker/Pool' then days_right_broadcast else 0 end) as SNPESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Tennis' then days_right_broadcast else 0 end) as TENESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Unknown' then days_right_broadcast else 0 end) as UNKESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Watersports' then days_right_broadcast else 0 end) as WATESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Wintersports' then days_right_broadcast else 0 end) as WINESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Wrestling' then days_right_broadcast else 0 end) as WREESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Europa League - BT Sport' then days_right_broadcast else 0 end) as ELBTSP_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Europa League - ESPN' then days_right_broadcast else 0 end) as ELESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Europa League - ITV' then days_right_broadcast else 0 end) as ELITV_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='European Tour Golf - Sky Sports' then days_right_broadcast else 0 end) as ETGSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport American Football' then days_right_broadcast else 0 end) as AMEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Athletics' then days_right_broadcast else 0 end) as ATHEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Baseball' then days_right_broadcast else 0 end) as BASEEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Basketball' then days_right_broadcast else 0 end) as BASKEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Boxing' then days_right_broadcast else 0 end) as BOXEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Cricket' then days_right_broadcast else 0 end) as CRIEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Darts' then days_right_broadcast else 0 end) as DARTEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Equestrian' then days_right_broadcast else 0 end) as EQUEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Extreme' then days_right_broadcast else 0 end) as EXTEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Football' then days_right_broadcast else 0 end) as FOOTEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Golf' then days_right_broadcast else 0 end) as GOLFEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Ice Hockey' then days_right_broadcast else 0 end) as IHEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Motor Sport' then days_right_broadcast else 0 end) as MSPEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Racing' then days_right_broadcast else 0 end) as RACEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Snooker/Pool' then days_right_broadcast else 0 end) as SNPEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Tennis' then days_right_broadcast else 0 end) as TENEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Unknown' then days_right_broadcast else 0 end) as UNKEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Watersports' then days_right_broadcast else 0 end) as WATEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Wintersports' then days_right_broadcast else 0 end) as WINEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='F1 - BBC' then days_right_broadcast else 0 end) as GF1BBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='F1 - Sky Sports' then days_right_broadcast else 0 end) as GF1SS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='F1 (non-Live)- BBC' then days_right_broadcast else 0 end) as F1NBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='F1 (Practice Live)- BBC' then days_right_broadcast else 0 end) as F1PBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='F1 (Qualifying Live)- BBC' then days_right_broadcast else 0 end) as F1QBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='F1 (Race Live)- BBC' then days_right_broadcast else 0 end) as F1RBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='FA Cup - ESPN' then days_right_broadcast else 0 end) as FACESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='FA Cup - ITV' then days_right_broadcast else 0 end) as FACITV_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - Capital 1 Cup' then days_right_broadcast else 0 end) as FLCCSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - others' then days_right_broadcast else 0 end) as FLOTSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Formula One 2012-2018 - (non-Live) Sky Sports' then days_right_broadcast else 0 end) as F1NSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Formula One 2012-2018 - (Practice Live) Sky Sports' then days_right_broadcast else 0 end) as F1PSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Formula One 2012-2018 - (Qualifying Live) Sky Sports' then days_right_broadcast else 0 end) as F1QSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Formula One 2012-2018 - (Race Live) Sky Sports' then days_right_broadcast else 0 end) as F1RSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='French Open Tennis - Eurosport' then days_right_broadcast else 0 end) as FOTEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='French Open Tennis - ITV' then days_right_broadcast else 0 end) as FOTITV_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Grand National - Channel 4' then days_right_broadcast else 0 end) as GDNCH4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Heineken Cup 2010/11 To 2013/14- Sky Sports' then days_right_broadcast else 0 end) as HECSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='I R B Sevens 2008/09 -2014/15 - Sky Sports' then days_right_broadcast else 0 end) as IRBSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='IAAF World Athletics Championship - Eurosport' then days_right_broadcast else 0 end) as WACEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='India Home Cricket 2012-2018 Sky Sports' then days_right_broadcast else 0 end) as IHCSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='India Premier League - ITV' then days_right_broadcast else 0 end) as IPLITV_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='International Freindlies - ESPN' then days_right_broadcast else 0 end) as IFESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='International Friendlies - BT Sport' then days_right_broadcast else 0 end) as IFBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Boxing' then days_right_broadcast else 0 end) as BOXITV1_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Football' then days_right_broadcast else 0 end) as FOOTITV1_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Motor Sport' then days_right_broadcast else 0 end) as MOTSITV1_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Rugby' then days_right_broadcast else 0 end) as RUGITV1_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Snooker/Pool' then days_right_broadcast else 0 end) as SNPITV1_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Unknown' then days_right_broadcast else 0 end) as UNKITV1_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Boxing' then days_right_broadcast else 0 end) as BOXITV4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Cricket' then days_right_broadcast else 0 end) as CRIITV4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Darts' then days_right_broadcast else 0 end) as DARTITV4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Extreme' then days_right_broadcast else 0 end) as EXTITV4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Football' then days_right_broadcast else 0 end) as FOOTITV4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Motor Sport' then days_right_broadcast else 0 end) as MSPITV4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Rugby' then days_right_broadcast else 0 end) as RUGITV4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Snooker/Pool' then days_right_broadcast else 0 end) as SNPITV4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Tennis' then days_right_broadcast else 0 end) as TENITV4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Unknown' then days_right_broadcast else 0 end) as UNKITV4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Ligue 1 - BT Sport' then days_right_broadcast else 0 end) as L1BTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Ligue 1 - ESPN' then days_right_broadcast else 0 end) as L1ESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Match of the day - BBC' then days_right_broadcast else 0 end) as MOTDBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Matchroom Output Deal 2010-2012 (Other)- Sky Sports' then days_right_broadcast else 0 end) as MROSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Matchroom Output Deal 2010-2012 (Pool)- Sky Sports' then days_right_broadcast else 0 end) as MRPSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Matchroom Output Deal 2010-2012 (Snooker)- Sky Sports' then days_right_broadcast else 0 end) as MRSSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Moto GP BBC' then days_right_broadcast else 0 end) as MGPBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='NBA - Sky Sports' then days_right_broadcast else 0 end) as NBASS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='NFL - BBC' then days_right_broadcast else 0 end) as NFLBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='NFL - Channel 4' then days_right_broadcast else 0 end) as NFLCH4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='NFL Seasons 2012-2015 - Sky Sports' then days_right_broadcast else 0 end) as NFLSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Northern Ireland Football Association 2012-2014 - Sky Sports' then days_right_broadcast else 0 end) as NIFSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Oaks - Channel 4' then days_right_broadcast else 0 end) as OAKCH4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other American Football' then days_right_broadcast else 0 end) as AMOTH_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Athletics' then days_right_broadcast else 0 end) as ATHOTH_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Baseball' then days_right_broadcast else 0 end) as BASEOTH_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Basketball' then days_right_broadcast else 0 end) as BASKOTH_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Boxing' then days_right_broadcast else 0 end) as BOXOTH_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Cricket' then days_right_broadcast else 0 end) as CRIOTH_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Darts' then days_right_broadcast else 0 end) as DARTOTH_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Equestrian' then days_right_broadcast else 0 end) as EQUOTH_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Extreme' then days_right_broadcast else 0 end) as EXTOTH_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Fishing' then days_right_broadcast else 0 end) as FSHOTH_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Football' then days_right_broadcast else 0 end) as FOOTOTH_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Golf' then days_right_broadcast else 0 end) as GOLFOTH_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Ice Hockey' then days_right_broadcast else 0 end) as IHOTH_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Motor Sport' then days_right_broadcast else 0 end) as MSPOTH_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Racing' then days_right_broadcast else 0 end) as RACOTH_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Rugby' then days_right_broadcast else 0 end) as RUGOTH_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Rugby Internationals - ESPN' then days_right_broadcast else 0 end) as ORUGESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Snooker/Pool' then days_right_broadcast else 0 end) as OTHSNP_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Tennis' then days_right_broadcast else 0 end) as OTHTEN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Unknown' then days_right_broadcast else 0 end) as OTHUNK_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Watersports' then days_right_broadcast else 0 end) as OTHWAT_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Wintersports' then days_right_broadcast else 0 end) as OTHWIN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Other Wrestling' then days_right_broadcast else 0 end) as OTHWRE_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='PGA Tour Golf 2010-2017 - Sky Sports' then days_right_broadcast else 0 end) as PGASS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Premier League - BT Sport' then days_right_broadcast else 0 end) as PLBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Premier League - ESPN' then days_right_broadcast else 0 end) as PLESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Darts 2010-2013 - Sky Sports' then days_right_broadcast else 0 end) as PLDSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports' then days_right_broadcast else 0 end) as GPLSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Match Choice)' then days_right_broadcast else 0 end) as PLMCSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (MNF)' then days_right_broadcast else 0 end) as PLMNFSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (non Live)' then days_right_broadcast else 0 end) as PLNLSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (other Live)' then days_right_broadcast else 0 end) as PLOLSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Sat Lunchtime)' then days_right_broadcast else 0 end) as PLSLSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Sat Night Live)' then days_right_broadcast else 0 end) as PLSNSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Sun 4pm)' then days_right_broadcast else 0 end) as PLS4SS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Sun Lunchtime)' then days_right_broadcast else 0 end) as PLSULSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Premiership Rugby - Sky Sports' then days_right_broadcast else 0 end) as PRUSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Republic Of Ireland FA - 2010/11 To 2013/14 - Sky Sports' then days_right_broadcast else 0 end) as ROISS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Royal Ascot - Channel 4' then days_right_broadcast else 0 end) as RASCH4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Rugby Internationals (England) - BBC' then days_right_broadcast else 0 end) as RIEBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Rugby Internationals (Ireland) - BBC' then days_right_broadcast else 0 end) as RIIBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Rugby Internationals (Scotland) - BBC' then days_right_broadcast else 0 end) as RISBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Rugby Internationals (Wales) - BBC' then days_right_broadcast else 0 end) as RIWBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Rugby League Challenge Cup- BBC' then days_right_broadcast else 0 end) as RLCCBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Rugby League - Sky Sports' then days_right_broadcast else 0 end) as RLGSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Rugby League World Cup- BBC' then days_right_broadcast else 0 end) as RLWCBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sanzar Rugby Union 2011 - 2015 - Sky Sports' then days_right_broadcast else 0 end) as SARUSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Scottish FA Deal - 2010/11 To 2013/14 - Sky Sports' then days_right_broadcast else 0 end) as SFASS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Serie A - BT Sport' then days_right_broadcast else 0 end) as SABTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Serie A - ESPN' then days_right_broadcast else 0 end) as SAESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='SFL - ESPN' then days_right_broadcast else 0 end) as SFLESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Six Nations - BBC' then days_right_broadcast else 0 end) as SNRBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Boxing' then days_right_broadcast else 0 end) as BOXS12_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Football' then days_right_broadcast else 0 end) as FOOTS12_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Motor Sport' then days_right_broadcast else 0 end) as MSPS12_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Unknown' then days_right_broadcast else 0 end) as UNKS12_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Wrestling' then days_right_broadcast else 0 end) as WRES12_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports American Football' then days_right_broadcast else 0 end) as AMSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Athletics' then days_right_broadcast else 0 end) as ATHSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Baseball' then days_right_broadcast else 0 end) as BASESS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Basketball' then days_right_broadcast else 0 end) as BASKSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Boxing' then days_right_broadcast else 0 end) as BOXSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Cricket' then days_right_broadcast else 0 end) as CRISS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Darts' then days_right_broadcast else 0 end) as DARTSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Equestrian' then days_right_broadcast else 0 end) as EQUSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Extreme' then days_right_broadcast else 0 end) as EXTSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Fishing' then days_right_broadcast else 0 end) as FISHSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Football' then days_right_broadcast else 0 end) as FOOTSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Golf' then days_right_broadcast else 0 end) as GOLFSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Ice Hockey' then days_right_broadcast else 0 end) as IHSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Motor Sport' then days_right_broadcast else 0 end) as MSPSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Racing' then days_right_broadcast else 0 end) as RACSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Rugby' then days_right_broadcast else 0 end) as RUGSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Snooker/Pool' then days_right_broadcast else 0 end) as SNPSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Tennis' then days_right_broadcast else 0 end) as TENSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Unknown' then days_right_broadcast else 0 end) as UNKSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Watersports' then days_right_broadcast else 0 end) as WATSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Wintersports' then days_right_broadcast else 0 end) as WINSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Wrestling' then days_right_broadcast else 0 end) as WRESS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Solheim Cup 2013 Ladies Golf - Sky Sports' then days_right_broadcast else 0 end) as SOLSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='South African Home Cricket 2012-2020 Sky Sports' then days_right_broadcast else 0 end) as SACSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Spanish Football 2012/13 To 14/15 - Sky Sports' then days_right_broadcast else 0 end) as SPFSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='SPFL - BT Sport' then days_right_broadcast else 0 end) as SPFLBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='SPL - ESPN' then days_right_broadcast else 0 end) as SPLESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='SPL - Sky Sports' then days_right_broadcast else 0 end) as SPLSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Sportfive World Cup 2014 Qualifers - Sky Sports' then days_right_broadcast else 0 end) as SP5SS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='The boat race - BBC' then days_right_broadcast else 0 end) as BTRBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='The football league show - BBC' then days_right_broadcast else 0 end) as FLSBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='The Masters Golf - BBC' then days_right_broadcast else 0 end) as MGBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='TNA Wrestling Challenge' then days_right_broadcast else 0 end) as TNACHA_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Tour de France - Eurosport' then days_right_broadcast else 0 end) as TDFEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Tour de France - ITV' then days_right_broadcast else 0 end) as TDFITV_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='U S Masters Golf 2011-2014 Sky Sports' then days_right_broadcast else 0 end) as USMGSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='U.S Open Tennis 2013-2015 Sky Sports' then days_right_broadcast else 0 end) as USOTSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='U.S Open/Womens/Seniors/Amateur Golf Sky Sports' then days_right_broadcast else 0 end) as USOGSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports' then days_right_broadcast else 0 end) as CLASS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports (non Live)' then days_right_broadcast else 0 end) as CLNSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports (other Live)' then days_right_broadcast else 0 end) as CLOSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports (Tue)' then days_right_broadcast else 0 end) as CLTSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports (Wed)' then days_right_broadcast else 0 end) as CLWSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='US Open Tennis - Eurosport' then days_right_broadcast else 0 end) as USOTEUR_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='USA Football - BT Sport' then days_right_broadcast else 0 end) as USFBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='USPGA Championship (2007-2016) Sky Sports' then days_right_broadcast else 0 end) as USPGASS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='WCQ - ESPN' then days_right_broadcast else 0 end) as WCQESPN_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Welsh Home International Football 2012-2014 Sky Sports' then days_right_broadcast else 0 end) as WIFSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='West Indies Home Cricket 2013-2020 Sky Sports' then days_right_broadcast else 0 end) as WICSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Wimbledon - BBC' then days_right_broadcast else 0 end) as WIMBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='Womens Cricket - I C C Cricket Deal 2012-2015 Sky Sports' then days_right_broadcast else 0 end) as WICCSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='World Athletics Championship - More 4' then days_right_broadcast else 0 end) as WACMR4_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='World Club Championship - BBC' then days_right_broadcast else 0 end) as WCLBBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='World Cup Qualifiers - BT Sport' then days_right_broadcast else 0 end) as WCQBTS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='World Darts Championship 2009-2012 Sky Sports' then days_right_broadcast else 0 end) as WDCSS_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='World snooker championship - BBC' then days_right_broadcast else 0 end) as WSCBBC_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='WWE Sky 1 and 2' then days_right_broadcast else 0 end) as WWES12_days_right_broadcastNon_Live ,sum(case when Live=0 and analysis_right ='WWE Sky Sports' then days_right_broadcast else 0 end) as WWESS_days_right_broadcastNon_Live ,sum(case when live=1 and analysis_right ='Africa Cup of Nations - Eurosport' then right_broadcast_duration else 0 end) as AFCEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Africa Cup of Nations - ITV' then right_broadcast_duration else 0 end) as AFCITV_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Americas Cup - BBC' then right_broadcast_duration else 0 end) as AMCBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Asian Tour Golf 2012-2013 Sky Sports' then right_broadcast_duration else 0 end) as ATGSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ATP Tennis Masters Series 2011-2013 Sky Sports' then right_broadcast_duration else 0 end) as ATPSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Australia Home Cricket 2012-2016 Sky Sports' then right_broadcast_duration else 0 end) as AHCSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Australian Football - BT Sport' then right_broadcast_duration else 0 end) as AUFBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Australian Open Tennis - BBC' then right_broadcast_duration else 0 end) as AOTBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Australian Open Tennis - Eurosport' then right_broadcast_duration else 0 end) as AOTEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Aviva Premiership - ESPN' then right_broadcast_duration else 0 end) as AVPSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BBC American Football' then right_broadcast_duration else 0 end) as AFBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BBC Athletics' then right_broadcast_duration else 0 end) as ATHBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BBC Boxing' then right_broadcast_duration else 0 end) as BOXBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BBC Darts' then right_broadcast_duration else 0 end) as DRTBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BBC Equestrian' then right_broadcast_duration else 0 end) as EQUBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BBC Football' then right_broadcast_duration else 0 end) as FOOTBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BBC Golf' then right_broadcast_duration else 0 end) as GOLFBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BBC Motor Sport' then right_broadcast_duration else 0 end) as MSPBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BBC Rugby' then right_broadcast_duration else 0 end) as RUGBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BBC Snooker/Pool' then right_broadcast_duration else 0 end) as SNPBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BBC Tennis' then right_broadcast_duration else 0 end) as TENBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BBC Unknown' then right_broadcast_duration else 0 end) as UNKBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BBC Watersports' then right_broadcast_duration else 0 end) as WATBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BBC Wintersports' then right_broadcast_duration else 0 end) as WINBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Boxing - Channel 5' then right_broadcast_duration else 0 end) as BOXCH5_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Boxing - Matchroom 2012-2014 Sky Sports' then right_broadcast_duration else 0 end) as BOXMSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Brazil Football - BT Sport' then right_broadcast_duration else 0 end) as BFTBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='British & Irish Lions 2013 - Sky Sports' then right_broadcast_duration else 0 end) as BILSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='British Open Golf - BBC' then right_broadcast_duration else 0 end) as BOGSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BT Sport American Football' then right_broadcast_duration else 0 end) as AFBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Athletics' then right_broadcast_duration else 0 end) as ATHBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Baseball' then right_broadcast_duration else 0 end) as BASEBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Basketball' then right_broadcast_duration else 0 end) as BASKBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Boxing' then right_broadcast_duration else 0 end) as BOXBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Cricket' then right_broadcast_duration else 0 end) as CRIBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Equestrian' then right_broadcast_duration else 0 end) as EQUBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Extreme' then right_broadcast_duration else 0 end) as EXTBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Football' then right_broadcast_duration else 0 end) as FOOTBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Motor Sport' then right_broadcast_duration else 0 end) as MSPBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Rugby' then right_broadcast_duration else 0 end) as RUGBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Tennis' then right_broadcast_duration else 0 end) as TENBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Unknown' then right_broadcast_duration else 0 end) as UNKBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Wintersports' then right_broadcast_duration else 0 end) as WINBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Bundesliga - BT Sport' then right_broadcast_duration else 0 end) as BUNBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Bundesliga- ESPN' then right_broadcast_duration else 0 end) as BUNESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Challenge Darts' then right_broadcast_duration else 0 end) as DRTCHA_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Challenge Extreme' then right_broadcast_duration else 0 end) as EXTCHA_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Challenge Unknown' then right_broadcast_duration else 0 end) as UNKCHA_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Challenge Wrestling' then right_broadcast_duration else 0 end) as WRECHA_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Champions League - ITV' then right_broadcast_duration else 0 end) as CHLITV_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Champions Trophy - I C C Cricket Deal 2012-2015 Sky Sports' then right_broadcast_duration else 0 end) as ICCSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 American Football' then right_broadcast_duration else 0 end) as AMCH4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Athletics' then right_broadcast_duration else 0 end) as ATHCH4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Boxing' then right_broadcast_duration else 0 end) as BOXCH4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Equestrian' then right_broadcast_duration else 0 end) as EQUCH4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Extreme' then right_broadcast_duration else 0 end) as EXTCH4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Football' then right_broadcast_duration else 0 end) as FOOTCH4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Motor Sport' then right_broadcast_duration else 0 end) as MSPCH4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Racing' then right_broadcast_duration else 0 end) as RACCH4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Unknown' then right_broadcast_duration else 0 end) as UNKCH4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Watersports' then right_broadcast_duration else 0 end) as WATCH4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Wintersports' then right_broadcast_duration else 0 end) as WINCH4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Athletics' then right_broadcast_duration else 0 end) as ATHCH5_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Boxing' then right_broadcast_duration else 0 end) as BOXOCH5_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Cricket' then right_broadcast_duration else 0 end) as CRICH5_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Motor Sport' then right_broadcast_duration else 0 end) as MSPCH5_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Unknown' then right_broadcast_duration else 0 end) as UNKCH5_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Wrestling' then right_broadcast_duration else 0 end) as WRECH5_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Cheltenham Festival - Channel 4' then right_broadcast_duration else 0 end) as CHELCH4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Community Shield - ITV' then right_broadcast_duration else 0 end) as CMSITV_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Confederations Cup - BBC' then right_broadcast_duration else 0 end) as CONCBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Conference - BT Sport' then right_broadcast_duration else 0 end) as CONFBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Cycling - La Vuelta ITV' then right_broadcast_duration else 0 end) as CLVITV_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Cycling - U C I World Tour Sky Sports' then right_broadcast_duration else 0 end) as CUCISS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Cycling Tour of Britain - Eurosport' then right_broadcast_duration else 0 end) as CTBEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Cycling: tour of britain ITV4' then right_broadcast_duration else 0 end) as CTCITV_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Derby - Channel 4' then right_broadcast_duration else 0 end) as DERCH4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ECB (highlights) - Channel 5' then right_broadcast_duration else 0 end) as ECBHCH5_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ECB Cricket Sky Sports' then right_broadcast_duration else 0 end) as GECRSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ECB non-Test Cricket Sky Sports' then right_broadcast_duration else 0 end) as ECBNSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ECB Test Cricket Sky Sports' then right_broadcast_duration else 0 end) as ECBTSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='England Football Internationals - ITV' then right_broadcast_duration else 0 end) as GENGITV_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='England Friendlies (Football) - ITV' then right_broadcast_duration else 0 end) as EFRITV_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='England Rugby Internationals 2010-2015 - Sky Sports' then right_broadcast_duration else 0 end) as ENRSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='England World Cup Qualifying (Away) - ITV' then right_broadcast_duration else 0 end) as EWQAITV_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='England World Cup Qualifying (Home) - ITV' then right_broadcast_duration else 0 end) as EWQHITV_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN American Football' then right_broadcast_duration else 0 end) as AMESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Athletics' then right_broadcast_duration else 0 end) as ATHESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Baseball' then right_broadcast_duration else 0 end) as BASEESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Basketball' then right_broadcast_duration else 0 end) as BASKESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Boxing' then right_broadcast_duration else 0 end) as BOXESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Cricket' then right_broadcast_duration else 0 end) as CRIESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Darts' then right_broadcast_duration else 0 end) as DARTESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Equestrian' then right_broadcast_duration else 0 end) as EQUESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Extreme' then right_broadcast_duration else 0 end) as EXTESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Football' then right_broadcast_duration else 0 end) as FOOTESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Golf' then right_broadcast_duration else 0 end) as GOLFESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Ice Hockey' then right_broadcast_duration else 0 end) as IHESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Motor Sport' then right_broadcast_duration else 0 end) as MSPESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Racing' then right_broadcast_duration else 0 end) as RACESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Rugby' then right_broadcast_duration else 0 end) as RUGESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Snooker/Pool' then right_broadcast_duration else 0 end) as SNPESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Tennis' then right_broadcast_duration else 0 end) as TENESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Unknown' then right_broadcast_duration else 0 end) as UNKESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Watersports' then right_broadcast_duration else 0 end) as WATESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Wintersports' then right_broadcast_duration else 0 end) as WINESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ESPN Wrestling' then right_broadcast_duration else 0 end) as WREESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Europa League - BT Sport' then right_broadcast_duration else 0 end) as ELBTSP_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Europa League - ESPN' then right_broadcast_duration else 0 end) as ELESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Europa League - ITV' then right_broadcast_duration else 0 end) as ELITV_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='European Tour Golf - Sky Sports' then right_broadcast_duration else 0 end) as ETGSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport American Football' then right_broadcast_duration else 0 end) as AMEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Athletics' then right_broadcast_duration else 0 end) as ATHEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Baseball' then right_broadcast_duration else 0 end) as BASEEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Basketball' then right_broadcast_duration else 0 end) as BASKEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Boxing' then right_broadcast_duration else 0 end) as BOXEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Cricket' then right_broadcast_duration else 0 end) as CRIEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Darts' then right_broadcast_duration else 0 end) as DARTEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Equestrian' then right_broadcast_duration else 0 end) as EQUEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Extreme' then right_broadcast_duration else 0 end) as EXTEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Football' then right_broadcast_duration else 0 end) as FOOTEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Golf' then right_broadcast_duration else 0 end) as GOLFEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Ice Hockey' then right_broadcast_duration else 0 end) as IHEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Motor Sport' then right_broadcast_duration else 0 end) as MSPEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Racing' then right_broadcast_duration else 0 end) as RACEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Snooker/Pool' then right_broadcast_duration else 0 end) as SNPEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Tennis' then right_broadcast_duration else 0 end) as TENEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Unknown' then right_broadcast_duration else 0 end) as UNKEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Watersports' then right_broadcast_duration else 0 end) as WATEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Wintersports' then right_broadcast_duration else 0 end) as WINEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='F1 - BBC' then right_broadcast_duration else 0 end) as GF1BBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='F1 - Sky Sports' then right_broadcast_duration else 0 end) as GF1SS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='F1 (non-Live)- BBC' then right_broadcast_duration else 0 end) as F1NBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='F1 (Practice Live)- BBC' then right_broadcast_duration else 0 end) as F1PBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='F1 (Qualifying Live)- BBC' then right_broadcast_duration else 0 end) as F1QBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='F1 (Race Live)- BBC' then right_broadcast_duration else 0 end) as F1RBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='FA Cup - ESPN' then right_broadcast_duration else 0 end) as FACESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='FA Cup - ITV' then right_broadcast_duration else 0 end) as FACITV_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - Capital 1 Cup' then right_broadcast_duration else 0 end) as FLCCSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - others' then right_broadcast_duration else 0 end) as FLOTSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Formula One 2012-2018 - (non-Live) Sky Sports' then right_broadcast_duration else 0 end) as F1NSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Formula One 2012-2018 - (Practice Live) Sky Sports' then right_broadcast_duration else 0 end) as F1PSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Formula One 2012-2018 - (Qualifying Live) Sky Sports' then right_broadcast_duration else 0 end) as F1QSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Formula One 2012-2018 - (Race Live) Sky Sports' then right_broadcast_duration else 0 end) as F1RSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='French Open Tennis - Eurosport' then right_broadcast_duration else 0 end) as FOTEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='French Open Tennis - ITV' then right_broadcast_duration else 0 end) as FOTITV_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Grand National - Channel 4' then right_broadcast_duration else 0 end) as GDNCH4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Heineken Cup 2010/11 To 2013/14- Sky Sports' then right_broadcast_duration else 0 end) as HECSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='I R B Sevens 2008/09 -2014/15 - Sky Sports' then right_broadcast_duration else 0 end) as IRBSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='IAAF World Athletics Championship - Eurosport' then right_broadcast_duration else 0 end) as WACEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='India Home Cricket 2012-2018 Sky Sports' then right_broadcast_duration else 0 end) as IHCSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='India Premier League - ITV' then right_broadcast_duration else 0 end) as IPLITV_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='International Freindlies - ESPN' then right_broadcast_duration else 0 end) as IFESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='International Friendlies - BT Sport' then right_broadcast_duration else 0 end) as IFBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Boxing' then right_broadcast_duration else 0 end) as BOXITV1_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Football' then right_broadcast_duration else 0 end) as FOOTITV1_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Motor Sport' then right_broadcast_duration else 0 end) as MOTSITV1_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Rugby' then right_broadcast_duration else 0 end) as RUGITV1_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Snooker/Pool' then right_broadcast_duration else 0 end) as SNPITV1_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Unknown' then right_broadcast_duration else 0 end) as UNKITV1_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Boxing' then right_broadcast_duration else 0 end) as BOXITV4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Cricket' then right_broadcast_duration else 0 end) as CRIITV4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Darts' then right_broadcast_duration else 0 end) as DARTITV4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Extreme' then right_broadcast_duration else 0 end) as EXTITV4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Football' then right_broadcast_duration else 0 end) as FOOTITV4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Motor Sport' then right_broadcast_duration else 0 end) as MSPITV4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Rugby' then right_broadcast_duration else 0 end) as RUGITV4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Snooker/Pool' then right_broadcast_duration else 0 end) as SNPITV4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Tennis' then right_broadcast_duration else 0 end) as TENITV4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Unknown' then right_broadcast_duration else 0 end) as UNKITV4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Ligue 1 - BT Sport' then right_broadcast_duration else 0 end) as L1BTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Ligue 1 - ESPN' then right_broadcast_duration else 0 end) as L1ESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Match of the day - BBC' then right_broadcast_duration else 0 end) as MOTDBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Matchroom Output Deal 2010-2012 (Other)- Sky Sports' then right_broadcast_duration else 0 end) as MROSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Matchroom Output Deal 2010-2012 (Pool)- Sky Sports' then right_broadcast_duration else 0 end) as MRPSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Matchroom Output Deal 2010-2012 (Snooker)- Sky Sports' then right_broadcast_duration else 0 end) as MRSSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Moto GP BBC' then right_broadcast_duration else 0 end) as MGPBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='NBA - Sky Sports' then right_broadcast_duration else 0 end) as NBASS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='NFL - BBC' then right_broadcast_duration else 0 end) as NFLBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='NFL - Channel 4' then right_broadcast_duration else 0 end) as NFLCH4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='NFL Seasons 2012-2015 - Sky Sports' then right_broadcast_duration else 0 end) as NFLSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Northern Ireland Football Association 2012-2014 - Sky Sports' then right_broadcast_duration else 0 end) as NIFSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Oaks - Channel 4' then right_broadcast_duration else 0 end) as OAKCH4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other American Football' then right_broadcast_duration else 0 end) as AMOTH_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Athletics' then right_broadcast_duration else 0 end) as ATHOTH_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Baseball' then right_broadcast_duration else 0 end) as BASEOTH_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Basketball' then right_broadcast_duration else 0 end) as BASKOTH_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Boxing' then right_broadcast_duration else 0 end) as BOXOTH_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Cricket' then right_broadcast_duration else 0 end) as CRIOTH_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Darts' then right_broadcast_duration else 0 end) as DARTOTH_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Equestrian' then right_broadcast_duration else 0 end) as EQUOTH_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Extreme' then right_broadcast_duration else 0 end) as EXTOTH_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Fishing' then right_broadcast_duration else 0 end) as FSHOTH_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Football' then right_broadcast_duration else 0 end) as FOOTOTH_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Golf' then right_broadcast_duration else 0 end) as GOLFOTH_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Ice Hockey' then right_broadcast_duration else 0 end) as IHOTH_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Motor Sport' then right_broadcast_duration else 0 end) as MSPOTH_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Racing' then right_broadcast_duration else 0 end) as RACOTH_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Rugby' then right_broadcast_duration else 0 end) as RUGOTH_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Rugby Internationals - ESPN' then right_broadcast_duration else 0 end) as ORUGESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Snooker/Pool' then right_broadcast_duration else 0 end) as OTHSNP_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Tennis' then right_broadcast_duration else 0 end) as OTHTEN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Unknown' then right_broadcast_duration else 0 end) as OTHUNK_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Watersports' then right_broadcast_duration else 0 end) as OTHWAT_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Wintersports' then right_broadcast_duration else 0 end) as OTHWIN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Other Wrestling' then right_broadcast_duration else 0 end) as OTHWRE_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='PGA Tour Golf 2010-2017 - Sky Sports' then right_broadcast_duration else 0 end) as PGASS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Premier League - BT Sport' then right_broadcast_duration else 0 end) as PLBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Premier League - ESPN' then right_broadcast_duration else 0 end) as PLESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Premier League Darts 2010-2013 - Sky Sports' then right_broadcast_duration else 0 end) as PLDSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports' then right_broadcast_duration else 0 end) as GPLSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Match Choice)' then right_broadcast_duration else 0 end) as PLMCSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (MNF)' then right_broadcast_duration else 0 end) as PLMNFSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (non Live)' then right_broadcast_duration else 0 end) as PLNLSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (other Live)' then right_broadcast_duration else 0 end) as PLOLSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Sat Lunchtime)' then right_broadcast_duration else 0 end) as PLSLSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Sat Night Live)' then right_broadcast_duration else 0 end) as PLSNSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Sun 4pm)' then right_broadcast_duration else 0 end) as PLS4SS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Sun Lunchtime)' then right_broadcast_duration else 0 end) as PLSULSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Premiership Rugby - Sky Sports' then right_broadcast_duration else 0 end) as PRUSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Republic Of Ireland FA - 2010/11 To 2013/14 - Sky Sports' then right_broadcast_duration else 0 end) as ROISS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Royal Ascot - Channel 4' then right_broadcast_duration else 0 end) as RASCH4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Rugby Internationals (England) - BBC' then right_broadcast_duration else 0 end) as RIEBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Rugby Internationals (Ireland) - BBC' then right_broadcast_duration else 0 end) as RIIBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Rugby Internationals (Scotland) - BBC' then right_broadcast_duration else 0 end) as RISBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Rugby Internationals (Wales) - BBC' then right_broadcast_duration else 0 end) as RIWBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Rugby League Challenge Cup- BBC' then right_broadcast_duration else 0 end) as RLCCBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Rugby League - Sky Sports' then right_broadcast_duration else 0 end) as RLGSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Rugby League World Cup- BBC' then right_broadcast_duration else 0 end) as RLWCBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sanzar Rugby Union 2011 - 2015 - Sky Sports' then right_broadcast_duration else 0 end) as SARUSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Scottish FA Deal - 2010/11 To 2013/14 - Sky Sports' then right_broadcast_duration else 0 end) as SFASS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Serie A - BT Sport' then right_broadcast_duration else 0 end) as SABTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Serie A - ESPN' then right_broadcast_duration else 0 end) as SAESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='SFL - ESPN' then right_broadcast_duration else 0 end) as SFLESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Six Nations - BBC' then right_broadcast_duration else 0 end) as SNRBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Boxing' then right_broadcast_duration else 0 end) as BOXS12_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Football' then right_broadcast_duration else 0 end) as FOOTS12_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Motor Sport' then right_broadcast_duration else 0 end) as MSPS12_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Unknown' then right_broadcast_duration else 0 end) as UNKS12_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Wrestling' then right_broadcast_duration else 0 end) as WRES12_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports American Football' then right_broadcast_duration else 0 end) as AMSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Athletics' then right_broadcast_duration else 0 end) as ATHSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Baseball' then right_broadcast_duration else 0 end) as BASESS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Basketball' then right_broadcast_duration else 0 end) as BASKSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Boxing' then right_broadcast_duration else 0 end) as BOXSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Cricket' then right_broadcast_duration else 0 end) as CRISS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Darts' then right_broadcast_duration else 0 end) as DARTSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Equestrian' then right_broadcast_duration else 0 end) as EQUSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Extreme' then right_broadcast_duration else 0 end) as EXTSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Fishing' then right_broadcast_duration else 0 end) as FISHSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Football' then right_broadcast_duration else 0 end) as FOOTSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Golf' then right_broadcast_duration else 0 end) as GOLFSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Ice Hockey' then right_broadcast_duration else 0 end) as IHSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Motor Sport' then right_broadcast_duration else 0 end) as MSPSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Racing' then right_broadcast_duration else 0 end) as RACSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Rugby' then right_broadcast_duration else 0 end) as RUGSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Snooker/Pool' then right_broadcast_duration else 0 end) as SNPSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Tennis' then right_broadcast_duration else 0 end) as TENSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Unknown' then right_broadcast_duration else 0 end) as UNKSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Watersports' then right_broadcast_duration else 0 end) as WATSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Wintersports' then right_broadcast_duration else 0 end) as WINSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Wrestling' then right_broadcast_duration else 0 end) as WRESS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Solheim Cup 2013 Ladies Golf - Sky Sports' then right_broadcast_duration else 0 end) as SOLSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='South African Home Cricket 2012-2020 Sky Sports' then right_broadcast_duration else 0 end) as SACSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Spanish Football 2012/13 To 14/15 - Sky Sports' then right_broadcast_duration else 0 end) as SPFSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='SPFL - BT Sport' then right_broadcast_duration else 0 end) as SPFLBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='SPL - ESPN' then right_broadcast_duration else 0 end) as SPLESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='SPL - Sky Sports' then right_broadcast_duration else 0 end) as SPLSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Sportfive World Cup 2014 Qualifers - Sky Sports' then right_broadcast_duration else 0 end) as SP5SS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='The boat race - BBC' then right_broadcast_duration else 0 end) as BTRBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='The football league show - BBC' then right_broadcast_duration else 0 end) as FLSBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='The Masters Golf - BBC' then right_broadcast_duration else 0 end) as MGBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='TNA Wrestling Challenge' then right_broadcast_duration else 0 end) as TNACHA_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Tour de France - Eurosport' then right_broadcast_duration else 0 end) as TDFEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Tour de France - ITV' then right_broadcast_duration else 0 end) as TDFITV_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='U S Masters Golf 2011-2014 Sky Sports' then right_broadcast_duration else 0 end) as USMGSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='U.S Open Tennis 2013-2015 Sky Sports' then right_broadcast_duration else 0 end) as USOTSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='U.S Open/Womens/Seniors/Amateur Golf Sky Sports' then right_broadcast_duration else 0 end) as USOGSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports' then right_broadcast_duration else 0 end) as CLASS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports (non Live)' then right_broadcast_duration else 0 end) as CLNSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports (other Live)' then right_broadcast_duration else 0 end) as CLOSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports (Tue)' then right_broadcast_duration else 0 end) as CLTSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports (Wed)' then right_broadcast_duration else 0 end) as CLWSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='US Open Tennis - Eurosport' then right_broadcast_duration else 0 end) as USOTEUR_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='USA Football - BT Sport' then right_broadcast_duration else 0 end) as USFBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='USPGA Championship (2007-2016) Sky Sports' then right_broadcast_duration else 0 end) as USPGASS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='WCQ - ESPN' then right_broadcast_duration else 0 end) as WCQESPN_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Welsh Home International Football 2012-2014 Sky Sports' then right_broadcast_duration else 0 end) as WIFSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='West Indies Home Cricket 2013-2020 Sky Sports' then right_broadcast_duration else 0 end) as WICSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Wimbledon - BBC' then right_broadcast_duration else 0 end) as WIMBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='Womens Cricket - I C C Cricket Deal 2012-2015 Sky Sports' then right_broadcast_duration else 0 end) as WICCSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='World Athletics Championship - More 4' then right_broadcast_duration else 0 end) as WACMR4_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='World Club Championship - BBC' then right_broadcast_duration else 0 end) as WCLBBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='World Cup Qualifiers - BT Sport' then right_broadcast_duration else 0 end) as WCQBTS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='World Darts Championship 2009-2012 Sky Sports' then right_broadcast_duration else 0 end) as WDCSS_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='World snooker championship - BBC' then right_broadcast_duration else 0 end) as WSCBBC_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='WWE Sky 1 and 2' then right_broadcast_duration else 0 end) as WWES12_right_broadcast_duration_LIVE ,sum(case when live=1 and analysis_right ='WWE Sky Sports' then right_broadcast_duration else 0 end) as WWESS_right_broadcast_duration_LIVE ,sum(case when Live=0 and analysis_right ='Africa Cup of Nations - Eurosport' then right_broadcast_duration else 0 end) as AFCEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Africa Cup of Nations - ITV' then right_broadcast_duration else 0 end) as AFCITV_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Americas Cup - BBC' then right_broadcast_duration else 0 end) as AMCBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Asian Tour Golf 2012-2013 Sky Sports' then right_broadcast_duration else 0 end) as ATGSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ATP Tennis Masters Series 2011-2013 Sky Sports' then right_broadcast_duration else 0 end) as ATPSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Australia Home Cricket 2012-2016 Sky Sports' then right_broadcast_duration else 0 end) as AHCSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Australian Football - BT Sport' then right_broadcast_duration else 0 end) as AUFBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Australian Open Tennis - BBC' then right_broadcast_duration else 0 end) as AOTBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Australian Open Tennis - Eurosport' then right_broadcast_duration else 0 end) as AOTEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Aviva Premiership - ESPN' then right_broadcast_duration else 0 end) as AVPSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BBC American Football' then right_broadcast_duration else 0 end) as AFBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BBC Athletics' then right_broadcast_duration else 0 end) as ATHBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BBC Boxing' then right_broadcast_duration else 0 end) as BOXBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BBC Darts' then right_broadcast_duration else 0 end) as DRTBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BBC Equestrian' then right_broadcast_duration else 0 end) as EQUBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BBC Football' then right_broadcast_duration else 0 end) as FOOTBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BBC Golf' then right_broadcast_duration else 0 end) as GOLFBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BBC Motor Sport' then right_broadcast_duration else 0 end) as MSPBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BBC Rugby' then right_broadcast_duration else 0 end) as RUGBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BBC Snooker/Pool' then right_broadcast_duration else 0 end) as SNPBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BBC Tennis' then right_broadcast_duration else 0 end) as TENBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BBC Unknown' then right_broadcast_duration else 0 end) as UNKBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BBC Watersports' then right_broadcast_duration else 0 end) as WATBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BBC Wintersports' then right_broadcast_duration else 0 end) as WINBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Boxing - Channel 5' then right_broadcast_duration else 0 end) as BOXCH5_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Boxing - Matchroom 2012-2014 Sky Sports' then right_broadcast_duration else 0 end) as BOXMSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Brazil Football - BT Sport' then right_broadcast_duration else 0 end) as BFTBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='British & Irish Lions 2013 - Sky Sports' then right_broadcast_duration else 0 end) as BILSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='British Open Golf - BBC' then right_broadcast_duration else 0 end) as BOGSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport American Football' then right_broadcast_duration else 0 end) as AFBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Athletics' then right_broadcast_duration else 0 end) as ATHBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Baseball' then right_broadcast_duration else 0 end) as BASEBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Basketball' then right_broadcast_duration else 0 end) as BASKBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Boxing' then right_broadcast_duration else 0 end) as BOXBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Cricket' then right_broadcast_duration else 0 end) as CRIBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Equestrian' then right_broadcast_duration else 0 end) as EQUBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Extreme' then right_broadcast_duration else 0 end) as EXTBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Football' then right_broadcast_duration else 0 end) as FOOTBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Motor Sport' then right_broadcast_duration else 0 end) as MSPBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Rugby' then right_broadcast_duration else 0 end) as RUGBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Tennis' then right_broadcast_duration else 0 end) as TENBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Unknown' then right_broadcast_duration else 0 end) as UNKBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Wintersports' then right_broadcast_duration else 0 end) as WINBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Bundesliga - BT Sport' then right_broadcast_duration else 0 end) as BUNBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Bundesliga- ESPN' then right_broadcast_duration else 0 end) as BUNESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Challenge Darts' then right_broadcast_duration else 0 end) as DRTCHA_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Challenge Extreme' then right_broadcast_duration else 0 end) as EXTCHA_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Challenge Unknown' then right_broadcast_duration else 0 end) as UNKCHA_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Challenge Wrestling' then right_broadcast_duration else 0 end) as WRECHA_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Champions League - ITV' then right_broadcast_duration else 0 end) as CHLITV_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Champions Trophy - I C C Cricket Deal 2012-2015 Sky Sports' then right_broadcast_duration else 0 end) as ICCSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 American Football' then right_broadcast_duration else 0 end) as AMCH4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Athletics' then right_broadcast_duration else 0 end) as ATHCH4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Boxing' then right_broadcast_duration else 0 end) as BOXCH4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Equestrian' then right_broadcast_duration else 0 end) as EQUCH4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Extreme' then right_broadcast_duration else 0 end) as EXTCH4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Football' then right_broadcast_duration else 0 end) as FOOTCH4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Motor Sport' then right_broadcast_duration else 0 end) as MSPCH4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Racing' then right_broadcast_duration else 0 end) as RACCH4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Unknown' then right_broadcast_duration else 0 end) as UNKCH4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Watersports' then right_broadcast_duration else 0 end) as WATCH4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Wintersports' then right_broadcast_duration else 0 end) as WINCH4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Athletics' then right_broadcast_duration else 0 end) as ATHCH5_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Boxing' then right_broadcast_duration else 0 end) as BOXOCH5_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Cricket' then right_broadcast_duration else 0 end) as CRICH5_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Motor Sport' then right_broadcast_duration else 0 end) as MSPCH5_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Unknown' then right_broadcast_duration else 0 end) as UNKCH5_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Wrestling' then right_broadcast_duration else 0 end) as WRECH5_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Cheltenham Festival - Channel 4' then right_broadcast_duration else 0 end) as CHELCH4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Community Shield - ITV' then right_broadcast_duration else 0 end) as CMSITV_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Confederations Cup - BBC' then right_broadcast_duration else 0 end) as CONCBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Conference - BT Sport' then right_broadcast_duration else 0 end) as CONFBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Cycling - La Vuelta ITV' then right_broadcast_duration else 0 end) as CLVITV_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Cycling - U C I World Tour Sky Sports' then right_broadcast_duration else 0 end) as CUCISS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Cycling Tour of Britain - Eurosport' then right_broadcast_duration else 0 end) as CTBEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Cycling: tour of britain ITV4' then right_broadcast_duration else 0 end) as CTCITV_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Derby - Channel 4' then right_broadcast_duration else 0 end) as DERCH4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ECB (highlights) - Channel 5' then right_broadcast_duration else 0 end) as ECBHCH5_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ECB Cricket Sky Sports' then right_broadcast_duration else 0 end) as GECRSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ECB non-Test Cricket Sky Sports' then right_broadcast_duration else 0 end) as ECBNSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ECB Test Cricket Sky Sports' then right_broadcast_duration else 0 end) as ECBTSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='England Football Internationals - ITV' then right_broadcast_duration else 0 end) as GENGITV_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='England Friendlies (Football) - ITV' then right_broadcast_duration else 0 end) as EFRITV_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='England Rugby Internationals 2010-2015 - Sky Sports' then right_broadcast_duration else 0 end) as ENRSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='England World Cup Qualifying (Away) - ITV' then right_broadcast_duration else 0 end) as EWQAITV_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='England World Cup Qualifying (Home) - ITV' then right_broadcast_duration else 0 end) as EWQHITV_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN American Football' then right_broadcast_duration else 0 end) as AMESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Athletics' then right_broadcast_duration else 0 end) as ATHESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Baseball' then right_broadcast_duration else 0 end) as BASEESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Basketball' then right_broadcast_duration else 0 end) as BASKESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Boxing' then right_broadcast_duration else 0 end) as BOXESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Cricket' then right_broadcast_duration else 0 end) as CRIESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Darts' then right_broadcast_duration else 0 end) as DARTESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Equestrian' then right_broadcast_duration else 0 end) as EQUESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Extreme' then right_broadcast_duration else 0 end) as EXTESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Football' then right_broadcast_duration else 0 end) as FOOTESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Golf' then right_broadcast_duration else 0 end) as GOLFESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Ice Hockey' then right_broadcast_duration else 0 end) as IHESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Motor Sport' then right_broadcast_duration else 0 end) as MSPESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Racing' then right_broadcast_duration else 0 end) as RACESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Rugby' then right_broadcast_duration else 0 end) as RUGESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Snooker/Pool' then right_broadcast_duration else 0 end) as SNPESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Tennis' then right_broadcast_duration else 0 end) as TENESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Unknown' then right_broadcast_duration else 0 end) as UNKESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Watersports' then right_broadcast_duration else 0 end) as WATESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Wintersports' then right_broadcast_duration else 0 end) as WINESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Wrestling' then right_broadcast_duration else 0 end) as WREESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Europa League - BT Sport' then right_broadcast_duration else 0 end) as ELBTSP_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Europa League - ESPN' then right_broadcast_duration else 0 end) as ELESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Europa League - ITV' then right_broadcast_duration else 0 end) as ELITV_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='European Tour Golf - Sky Sports' then right_broadcast_duration else 0 end) as ETGSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport American Football' then right_broadcast_duration else 0 end) as AMEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Athletics' then right_broadcast_duration else 0 end) as ATHEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Baseball' then right_broadcast_duration else 0 end) as BASEEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Basketball' then right_broadcast_duration else 0 end) as BASKEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Boxing' then right_broadcast_duration else 0 end) as BOXEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Cricket' then right_broadcast_duration else 0 end) as CRIEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Darts' then right_broadcast_duration else 0 end) as DARTEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Equestrian' then right_broadcast_duration else 0 end) as EQUEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Extreme' then right_broadcast_duration else 0 end) as EXTEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Football' then right_broadcast_duration else 0 end) as FOOTEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Golf' then right_broadcast_duration else 0 end) as GOLFEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Ice Hockey' then right_broadcast_duration else 0 end) as IHEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Motor Sport' then right_broadcast_duration else 0 end) as MSPEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Racing' then right_broadcast_duration else 0 end) as RACEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Snooker/Pool' then right_broadcast_duration else 0 end) as SNPEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Tennis' then right_broadcast_duration else 0 end) as TENEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Unknown' then right_broadcast_duration else 0 end) as UNKEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Watersports' then right_broadcast_duration else 0 end) as WATEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Wintersports' then right_broadcast_duration else 0 end) as WINEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='F1 - BBC' then right_broadcast_duration else 0 end) as GF1BBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='F1 - Sky Sports' then right_broadcast_duration else 0 end) as GF1SS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='F1 (non-Live)- BBC' then right_broadcast_duration else 0 end) as F1NBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='F1 (Practice Live)- BBC' then right_broadcast_duration else 0 end) as F1PBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='F1 (Qualifying Live)- BBC' then right_broadcast_duration else 0 end) as F1QBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='F1 (Race Live)- BBC' then right_broadcast_duration else 0 end) as F1RBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='FA Cup - ESPN' then right_broadcast_duration else 0 end) as FACESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='FA Cup - ITV' then right_broadcast_duration else 0 end) as FACITV_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - Capital 1 Cup' then right_broadcast_duration else 0 end) as FLCCSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - others' then right_broadcast_duration else 0 end) as FLOTSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Formula One 2012-2018 - (non-Live) Sky Sports' then right_broadcast_duration else 0 end) as F1NSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Formula One 2012-2018 - (Practice Live) Sky Sports' then right_broadcast_duration else 0 end) as F1PSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Formula One 2012-2018 - (Qualifying Live) Sky Sports' then right_broadcast_duration else 0 end) as F1QSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Formula One 2012-2018 - (Race Live) Sky Sports' then right_broadcast_duration else 0 end) as F1RSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='French Open Tennis - Eurosport' then right_broadcast_duration else 0 end) as FOTEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='French Open Tennis - ITV' then right_broadcast_duration else 0 end) as FOTITV_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Grand National - Channel 4' then right_broadcast_duration else 0 end) as GDNCH4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Heineken Cup 2010/11 To 2013/14- Sky Sports' then right_broadcast_duration else 0 end) as HECSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='I R B Sevens 2008/09 -2014/15 - Sky Sports' then right_broadcast_duration else 0 end) as IRBSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='IAAF World Athletics Championship - Eurosport' then right_broadcast_duration else 0 end) as WACEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='India Home Cricket 2012-2018 Sky Sports' then right_broadcast_duration else 0 end) as IHCSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='India Premier League - ITV' then right_broadcast_duration else 0 end) as IPLITV_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='International Freindlies - ESPN' then right_broadcast_duration else 0 end) as IFESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='International Friendlies - BT Sport' then right_broadcast_duration else 0 end) as IFBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Boxing' then right_broadcast_duration else 0 end) as BOXITV1_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Football' then right_broadcast_duration else 0 end) as FOOTITV1_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Motor Sport' then right_broadcast_duration else 0 end) as MOTSITV1_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Rugby' then right_broadcast_duration else 0 end) as RUGITV1_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Snooker/Pool' then right_broadcast_duration else 0 end) as SNPITV1_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Unknown' then right_broadcast_duration else 0 end) as UNKITV1_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Boxing' then right_broadcast_duration else 0 end) as BOXITV4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Cricket' then right_broadcast_duration else 0 end) as CRIITV4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Darts' then right_broadcast_duration else 0 end) as DARTITV4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Extreme' then right_broadcast_duration else 0 end) as EXTITV4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Football' then right_broadcast_duration else 0 end) as FOOTITV4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Motor Sport' then right_broadcast_duration else 0 end) as MSPITV4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Rugby' then right_broadcast_duration else 0 end) as RUGITV4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Snooker/Pool' then right_broadcast_duration else 0 end) as SNPITV4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Tennis' then right_broadcast_duration else 0 end) as TENITV4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Unknown' then right_broadcast_duration else 0 end) as UNKITV4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Ligue 1 - BT Sport' then right_broadcast_duration else 0 end) as L1BTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Ligue 1 - ESPN' then right_broadcast_duration else 0 end) as L1ESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Match of the day - BBC' then right_broadcast_duration else 0 end) as MOTDBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Matchroom Output Deal 2010-2012 (Other)- Sky Sports' then right_broadcast_duration else 0 end) as MROSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Matchroom Output Deal 2010-2012 (Pool)- Sky Sports' then right_broadcast_duration else 0 end) as MRPSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Matchroom Output Deal 2010-2012 (Snooker)- Sky Sports' then right_broadcast_duration else 0 end) as MRSSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Moto GP BBC' then right_broadcast_duration else 0 end) as MGPBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='NBA - Sky Sports' then right_broadcast_duration else 0 end) as NBASS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='NFL - BBC' then right_broadcast_duration else 0 end) as NFLBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='NFL - Channel 4' then right_broadcast_duration else 0 end) as NFLCH4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='NFL Seasons 2012-2015 - Sky Sports' then right_broadcast_duration else 0 end) as NFLSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Northern Ireland Football Association 2012-2014 - Sky Sports' then right_broadcast_duration else 0 end) as NIFSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Oaks - Channel 4' then right_broadcast_duration else 0 end) as OAKCH4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other American Football' then right_broadcast_duration else 0 end) as AMOTH_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Athletics' then right_broadcast_duration else 0 end) as ATHOTH_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Baseball' then right_broadcast_duration else 0 end) as BASEOTH_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Basketball' then right_broadcast_duration else 0 end) as BASKOTH_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Boxing' then right_broadcast_duration else 0 end) as BOXOTH_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Cricket' then right_broadcast_duration else 0 end) as CRIOTH_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Darts' then right_broadcast_duration else 0 end) as DARTOTH_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Equestrian' then right_broadcast_duration else 0 end) as EQUOTH_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Extreme' then right_broadcast_duration else 0 end) as EXTOTH_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Fishing' then right_broadcast_duration else 0 end) as FSHOTH_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Football' then right_broadcast_duration else 0 end) as FOOTOTH_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Golf' then right_broadcast_duration else 0 end) as GOLFOTH_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Ice Hockey' then right_broadcast_duration else 0 end) as IHOTH_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Motor Sport' then right_broadcast_duration else 0 end) as MSPOTH_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Racing' then right_broadcast_duration else 0 end) as RACOTH_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Rugby' then right_broadcast_duration else 0 end) as RUGOTH_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Rugby Internationals - ESPN' then right_broadcast_duration else 0 end) as ORUGESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Snooker/Pool' then right_broadcast_duration else 0 end) as OTHSNP_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Tennis' then right_broadcast_duration else 0 end) as OTHTEN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Unknown' then right_broadcast_duration else 0 end) as OTHUNK_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Watersports' then right_broadcast_duration else 0 end) as OTHWAT_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Wintersports' then right_broadcast_duration else 0 end) as OTHWIN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Other Wrestling' then right_broadcast_duration else 0 end) as OTHWRE_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='PGA Tour Golf 2010-2017 - Sky Sports' then right_broadcast_duration else 0 end) as PGASS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Premier League - BT Sport' then right_broadcast_duration else 0 end) as PLBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Premier League - ESPN' then right_broadcast_duration else 0 end) as PLESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Darts 2010-2013 - Sky Sports' then right_broadcast_duration else 0 end) as PLDSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports' then right_broadcast_duration else 0 end) as GPLSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Match Choice)' then right_broadcast_duration else 0 end) as PLMCSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (MNF)' then right_broadcast_duration else 0 end) as PLMNFSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (non Live)' then right_broadcast_duration else 0 end) as PLNLSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (other Live)' then right_broadcast_duration else 0 end) as PLOLSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Sat Lunchtime)' then right_broadcast_duration else 0 end) as PLSLSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Sat Night Live)' then right_broadcast_duration else 0 end) as PLSNSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Sun 4pm)' then right_broadcast_duration else 0 end) as PLS4SS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Sun Lunchtime)' then right_broadcast_duration else 0 end) as PLSULSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Premiership Rugby - Sky Sports' then right_broadcast_duration else 0 end) as PRUSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Republic Of Ireland FA - 2010/11 To 2013/14 - Sky Sports' then right_broadcast_duration else 0 end) as ROISS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Royal Ascot - Channel 4' then right_broadcast_duration else 0 end) as RASCH4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Rugby Internationals (England) - BBC' then right_broadcast_duration else 0 end) as RIEBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Rugby Internationals (Ireland) - BBC' then right_broadcast_duration else 0 end) as RIIBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Rugby Internationals (Scotland) - BBC' then right_broadcast_duration else 0 end) as RISBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Rugby Internationals (Wales) - BBC' then right_broadcast_duration else 0 end) as RIWBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Rugby League Challenge Cup- BBC' then right_broadcast_duration else 0 end) as RLCCBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Rugby League - Sky Sports' then right_broadcast_duration else 0 end) as RLGSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Rugby League World Cup- BBC' then right_broadcast_duration else 0 end) as RLWCBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sanzar Rugby Union 2011 - 2015 - Sky Sports' then right_broadcast_duration else 0 end) as SARUSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Scottish FA Deal - 2010/11 To 2013/14 - Sky Sports' then right_broadcast_duration else 0 end) as SFASS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Serie A - BT Sport' then right_broadcast_duration else 0 end) as SABTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Serie A - ESPN' then right_broadcast_duration else 0 end) as SAESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='SFL - ESPN' then right_broadcast_duration else 0 end) as SFLESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Six Nations - BBC' then right_broadcast_duration else 0 end) as SNRBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Boxing' then right_broadcast_duration else 0 end) as BOXS12_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Football' then right_broadcast_duration else 0 end) as FOOTS12_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Motor Sport' then right_broadcast_duration else 0 end) as MSPS12_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Unknown' then right_broadcast_duration else 0 end) as UNKS12_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Wrestling' then right_broadcast_duration else 0 end) as WRES12_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports American Football' then right_broadcast_duration else 0 end) as AMSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Athletics' then right_broadcast_duration else 0 end) as ATHSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Baseball' then right_broadcast_duration else 0 end) as BASESS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Basketball' then right_broadcast_duration else 0 end) as BASKSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Boxing' then right_broadcast_duration else 0 end) as BOXSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Cricket' then right_broadcast_duration else 0 end) as CRISS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Darts' then right_broadcast_duration else 0 end) as DARTSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Equestrian' then right_broadcast_duration else 0 end) as EQUSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Extreme' then right_broadcast_duration else 0 end) as EXTSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Fishing' then right_broadcast_duration else 0 end) as FISHSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Football' then right_broadcast_duration else 0 end) as FOOTSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Golf' then right_broadcast_duration else 0 end) as GOLFSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Ice Hockey' then right_broadcast_duration else 0 end) as IHSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Motor Sport' then right_broadcast_duration else 0 end) as MSPSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Racing' then right_broadcast_duration else 0 end) as RACSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Rugby' then right_broadcast_duration else 0 end) as RUGSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Snooker/Pool' then right_broadcast_duration else 0 end) as SNPSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Tennis' then right_broadcast_duration else 0 end) as TENSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Unknown' then right_broadcast_duration else 0 end) as UNKSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Watersports' then right_broadcast_duration else 0 end) as WATSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Wintersports' then right_broadcast_duration else 0 end) as WINSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Wrestling' then right_broadcast_duration else 0 end) as WRESS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Solheim Cup 2013 Ladies Golf - Sky Sports' then right_broadcast_duration else 0 end) as SOLSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='South African Home Cricket 2012-2020 Sky Sports' then right_broadcast_duration else 0 end) as SACSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Spanish Football 2012/13 To 14/15 - Sky Sports' then right_broadcast_duration else 0 end) as SPFSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='SPFL - BT Sport' then right_broadcast_duration else 0 end) as SPFLBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='SPL - ESPN' then right_broadcast_duration else 0 end) as SPLESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='SPL - Sky Sports' then right_broadcast_duration else 0 end) as SPLSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Sportfive World Cup 2014 Qualifers - Sky Sports' then right_broadcast_duration else 0 end) as SP5SS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='The boat race - BBC' then right_broadcast_duration else 0 end) as BTRBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='The football league show - BBC' then right_broadcast_duration else 0 end) as FLSBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='The Masters Golf - BBC' then right_broadcast_duration else 0 end) as MGBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='TNA Wrestling Challenge' then right_broadcast_duration else 0 end) as TNACHA_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Tour de France - Eurosport' then right_broadcast_duration else 0 end) as TDFEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Tour de France - ITV' then right_broadcast_duration else 0 end) as TDFITV_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='U S Masters Golf 2011-2014 Sky Sports' then right_broadcast_duration else 0 end) as USMGSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='U.S Open Tennis 2013-2015 Sky Sports' then right_broadcast_duration else 0 end) as USOTSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='U.S Open/Womens/Seniors/Amateur Golf Sky Sports' then right_broadcast_duration else 0 end) as USOGSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports' then right_broadcast_duration else 0 end) as CLASS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports (non Live)' then right_broadcast_duration else 0 end) as CLNSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports (other Live)' then right_broadcast_duration else 0 end) as CLOSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports (Tue)' then right_broadcast_duration else 0 end) as CLTSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports (Wed)' then right_broadcast_duration else 0 end) as CLWSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='US Open Tennis - Eurosport' then right_broadcast_duration else 0 end) as USOTEUR_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='USA Football - BT Sport' then right_broadcast_duration else 0 end) as USFBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='USPGA Championship (2007-2016) Sky Sports' then right_broadcast_duration else 0 end) as USPGASS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='WCQ - ESPN' then right_broadcast_duration else 0 end) as WCQESPN_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Welsh Home International Football 2012-2014 Sky Sports' then right_broadcast_duration else 0 end) as WIFSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='West Indies Home Cricket 2013-2020 Sky Sports' then right_broadcast_duration else 0 end) as WICSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Wimbledon - BBC' then right_broadcast_duration else 0 end) as WIMBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='Womens Cricket - I C C Cricket Deal 2012-2015 Sky Sports' then right_broadcast_duration else 0 end) as WICCSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='World Athletics Championship - More 4' then right_broadcast_duration else 0 end) as WACMR4_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='World Club Championship - BBC' then right_broadcast_duration else 0 end) as WCLBBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='World Cup Qualifiers - BT Sport' then right_broadcast_duration else 0 end) as WCQBTS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='World Darts Championship 2009-2012 Sky Sports' then right_broadcast_duration else 0 end) as WDCSS_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='World snooker championship - BBC' then right_broadcast_duration else 0 end) as WSCBBC_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='WWE Sky 1 and 2' then right_broadcast_duration else 0 end) as WWES12_right_broadcast_durationNon_Live ,sum(case when Live=0 and analysis_right ='WWE Sky Sports' then right_broadcast_duration else 0 end) as WWESS_right_broadcast_durationNon_Live ,sum(case when live=1 and analysis_right ='Africa Cup of Nations - Eurosport' then right_broadcast_programmes else 0 end) as AFCEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Africa Cup of Nations - ITV' then right_broadcast_programmes else 0 end) as AFCITV_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Americas Cup - BBC' then right_broadcast_programmes else 0 end) as AMCBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Asian Tour Golf 2012-2013 Sky Sports' then right_broadcast_programmes else 0 end) as ATGSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ATP Tennis Masters Series 2011-2013 Sky Sports' then right_broadcast_programmes else 0 end) as ATPSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Australia Home Cricket 2012-2016 Sky Sports' then right_broadcast_programmes else 0 end) as AHCSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Australian Football - BT Sport' then right_broadcast_programmes else 0 end) as AUFBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Australian Open Tennis - BBC' then right_broadcast_programmes else 0 end) as AOTBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Australian Open Tennis - Eurosport' then right_broadcast_programmes else 0 end) as AOTEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Aviva Premiership - ESPN' then right_broadcast_programmes else 0 end) as AVPSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BBC American Football' then right_broadcast_programmes else 0 end) as AFBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BBC Athletics' then right_broadcast_programmes else 0 end) as ATHBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BBC Boxing' then right_broadcast_programmes else 0 end) as BOXBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BBC Darts' then right_broadcast_programmes else 0 end) as DRTBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BBC Equestrian' then right_broadcast_programmes else 0 end) as EQUBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BBC Football' then right_broadcast_programmes else 0 end) as FOOTBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BBC Golf' then right_broadcast_programmes else 0 end) as GOLFBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BBC Motor Sport' then right_broadcast_programmes else 0 end) as MSPBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BBC Rugby' then right_broadcast_programmes else 0 end) as RUGBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BBC Snooker/Pool' then right_broadcast_programmes else 0 end) as SNPBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BBC Tennis' then right_broadcast_programmes else 0 end) as TENBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BBC Unknown' then right_broadcast_programmes else 0 end) as UNKBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BBC Watersports' then right_broadcast_programmes else 0 end) as WATBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BBC Wintersports' then right_broadcast_programmes else 0 end) as WINBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Boxing - Channel 5' then right_broadcast_programmes else 0 end) as BOXCH5_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Boxing - Matchroom 2012-2014 Sky Sports' then right_broadcast_programmes else 0 end) as BOXMSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Brazil Football - BT Sport' then right_broadcast_programmes else 0 end) as BFTBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='British & Irish Lions 2013 - Sky Sports' then right_broadcast_programmes else 0 end) as BILSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='British Open Golf - BBC' then right_broadcast_programmes else 0 end) as BOGSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BT Sport American Football' then right_broadcast_programmes else 0 end) as AFBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Athletics' then right_broadcast_programmes else 0 end) as ATHBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Baseball' then right_broadcast_programmes else 0 end) as BASEBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Basketball' then right_broadcast_programmes else 0 end) as BASKBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Boxing' then right_broadcast_programmes else 0 end) as BOXBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Cricket' then right_broadcast_programmes else 0 end) as CRIBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Equestrian' then right_broadcast_programmes else 0 end) as EQUBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Extreme' then right_broadcast_programmes else 0 end) as EXTBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Football' then right_broadcast_programmes else 0 end) as FOOTBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Motor Sport' then right_broadcast_programmes else 0 end) as MSPBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Rugby' then right_broadcast_programmes else 0 end) as RUGBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Tennis' then right_broadcast_programmes else 0 end) as TENBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Unknown' then right_broadcast_programmes else 0 end) as UNKBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='BT Sport Wintersports' then right_broadcast_programmes else 0 end) as WINBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Bundesliga - BT Sport' then right_broadcast_programmes else 0 end) as BUNBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Bundesliga- ESPN' then right_broadcast_programmes else 0 end) as BUNESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Challenge Darts' then right_broadcast_programmes else 0 end) as DRTCHA_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Challenge Extreme' then right_broadcast_programmes else 0 end) as EXTCHA_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Challenge Unknown' then right_broadcast_programmes else 0 end) as UNKCHA_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Challenge Wrestling' then right_broadcast_programmes else 0 end) as WRECHA_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Champions League - ITV' then right_broadcast_programmes else 0 end) as CHLITV_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Champions Trophy - I C C Cricket Deal 2012-2015 Sky Sports' then right_broadcast_programmes else 0 end) as ICCSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 American Football' then right_broadcast_programmes else 0 end) as AMCH4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Athletics' then right_broadcast_programmes else 0 end) as ATHCH4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Boxing' then right_broadcast_programmes else 0 end) as BOXCH4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Equestrian' then right_broadcast_programmes else 0 end) as EQUCH4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Extreme' then right_broadcast_programmes else 0 end) as EXTCH4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Football' then right_broadcast_programmes else 0 end) as FOOTCH4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Motor Sport' then right_broadcast_programmes else 0 end) as MSPCH4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Racing' then right_broadcast_programmes else 0 end) as RACCH4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Unknown' then right_broadcast_programmes else 0 end) as UNKCH4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Watersports' then right_broadcast_programmes else 0 end) as WATCH4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Channel 4 Wintersports' then right_broadcast_programmes else 0 end) as WINCH4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Athletics' then right_broadcast_programmes else 0 end) as ATHCH5_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Boxing' then right_broadcast_programmes else 0 end) as BOXOCH5_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Cricket' then right_broadcast_programmes else 0 end) as CRICH5_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Motor Sport' then right_broadcast_programmes else 0 end) as MSPCH5_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Unknown' then right_broadcast_programmes else 0 end) as UNKCH5_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Channel 5 Wrestling' then right_broadcast_programmes else 0 end) as WRECH5_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Cheltenham Festival - Channel 4' then right_broadcast_programmes else 0 end) as CHELCH4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Community Shield - ITV' then right_broadcast_programmes else 0 end) as CMSITV_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Confederations Cup - BBC' then right_broadcast_programmes else 0 end) as CONCBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Conference - BT Sport' then right_broadcast_programmes else 0 end) as CONFBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Cycling - La Vuelta ITV' then right_broadcast_programmes else 0 end) as CLVITV_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Cycling - U C I World Tour Sky Sports' then right_broadcast_programmes else 0 end) as CUCISS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Cycling Tour of Britain - Eurosport' then right_broadcast_programmes else 0 end) as CTBEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Cycling: tour of britain ITV4' then right_broadcast_programmes else 0 end) as CTCITV_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Derby - Channel 4' then right_broadcast_programmes else 0 end) as DERCH4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ECB (highlights) - Channel 5' then right_broadcast_programmes else 0 end) as ECBHCH5_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ECB Cricket Sky Sports' then right_broadcast_programmes else 0 end) as GECRSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ECB non-Test Cricket Sky Sports' then right_broadcast_programmes else 0 end) as ECBNSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ECB Test Cricket Sky Sports' then right_broadcast_programmes else 0 end) as ECBTSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='England Football Internationals - ITV' then right_broadcast_programmes else 0 end) as GENGITV_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='England Friendlies (Football) - ITV' then right_broadcast_programmes else 0 end) as EFRITV_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='England Rugby Internationals 2010-2015 - Sky Sports' then right_broadcast_programmes else 0 end) as ENRSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='England World Cup Qualifying (Away) - ITV' then right_broadcast_programmes else 0 end) as EWQAITV_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='England World Cup Qualifying (Home) - ITV' then right_broadcast_programmes else 0 end) as EWQHITV_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN American Football' then right_broadcast_programmes else 0 end) as AMESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Athletics' then right_broadcast_programmes else 0 end) as ATHESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Baseball' then right_broadcast_programmes else 0 end) as BASEESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Basketball' then right_broadcast_programmes else 0 end) as BASKESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Boxing' then right_broadcast_programmes else 0 end) as BOXESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Cricket' then right_broadcast_programmes else 0 end) as CRIESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Darts' then right_broadcast_programmes else 0 end) as DARTESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Equestrian' then right_broadcast_programmes else 0 end) as EQUESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Extreme' then right_broadcast_programmes else 0 end) as EXTESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Football' then right_broadcast_programmes else 0 end) as FOOTESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Golf' then right_broadcast_programmes else 0 end) as GOLFESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Ice Hockey' then right_broadcast_programmes else 0 end) as IHESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Motor Sport' then right_broadcast_programmes else 0 end) as MSPESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Racing' then right_broadcast_programmes else 0 end) as RACESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Rugby' then right_broadcast_programmes else 0 end) as RUGESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Snooker/Pool' then right_broadcast_programmes else 0 end) as SNPESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Tennis' then right_broadcast_programmes else 0 end) as TENESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Unknown' then right_broadcast_programmes else 0 end) as UNKESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Watersports' then right_broadcast_programmes else 0 end) as WATESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Wintersports' then right_broadcast_programmes else 0 end) as WINESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ESPN Wrestling' then right_broadcast_programmes else 0 end) as WREESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Europa League - BT Sport' then right_broadcast_programmes else 0 end) as ELBTSP_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Europa League - ESPN' then right_broadcast_programmes else 0 end) as ELESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Europa League - ITV' then right_broadcast_programmes else 0 end) as ELITV_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='European Tour Golf - Sky Sports' then right_broadcast_programmes else 0 end) as ETGSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport American Football' then right_broadcast_programmes else 0 end) as AMEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Athletics' then right_broadcast_programmes else 0 end) as ATHEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Baseball' then right_broadcast_programmes else 0 end) as BASEEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Basketball' then right_broadcast_programmes else 0 end) as BASKEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Boxing' then right_broadcast_programmes else 0 end) as BOXEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Cricket' then right_broadcast_programmes else 0 end) as CRIEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Darts' then right_broadcast_programmes else 0 end) as DARTEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Equestrian' then right_broadcast_programmes else 0 end) as EQUEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Extreme' then right_broadcast_programmes else 0 end) as EXTEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Football' then right_broadcast_programmes else 0 end) as FOOTEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Golf' then right_broadcast_programmes else 0 end) as GOLFEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Ice Hockey' then right_broadcast_programmes else 0 end) as IHEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Motor Sport' then right_broadcast_programmes else 0 end) as MSPEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Racing' then right_broadcast_programmes else 0 end) as RACEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Snooker/Pool' then right_broadcast_programmes else 0 end) as SNPEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Tennis' then right_broadcast_programmes else 0 end) as TENEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Unknown' then right_broadcast_programmes else 0 end) as UNKEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Watersports' then right_broadcast_programmes else 0 end) as WATEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Eurosport Wintersports' then right_broadcast_programmes else 0 end) as WINEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='F1 - BBC' then right_broadcast_programmes else 0 end) as GF1BBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='F1 - Sky Sports' then right_broadcast_programmes else 0 end) as GF1SS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='F1 (non-Live)- BBC' then right_broadcast_programmes else 0 end) as F1NBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='F1 (Practice Live)- BBC' then right_broadcast_programmes else 0 end) as F1PBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='F1 (Qualifying Live)- BBC' then right_broadcast_programmes else 0 end) as F1QBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='F1 (Race Live)- BBC' then right_broadcast_programmes else 0 end) as F1RBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='FA Cup - ESPN' then right_broadcast_programmes else 0 end) as FACESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='FA Cup - ITV' then right_broadcast_programmes else 0 end) as FACITV_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - Capital 1 Cup' then right_broadcast_programmes else 0 end) as FLCCSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - others' then right_broadcast_programmes else 0 end) as FLOTSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Formula One 2012-2018 - (non-Live) Sky Sports' then right_broadcast_programmes else 0 end) as F1NSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Formula One 2012-2018 - (Practice Live) Sky Sports' then right_broadcast_programmes else 0 end) as F1PSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Formula One 2012-2018 - (Qualifying Live) Sky Sports' then right_broadcast_programmes else 0 end) as F1QSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Formula One 2012-2018 - (Race Live) Sky Sports' then right_broadcast_programmes else 0 end) as F1RSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='French Open Tennis - Eurosport' then right_broadcast_programmes else 0 end) as FOTEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='French Open Tennis - ITV' then right_broadcast_programmes else 0 end) as FOTITV_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Grand National - Channel 4' then right_broadcast_programmes else 0 end) as GDNCH4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Heineken Cup 2010/11 To 2013/14- Sky Sports' then right_broadcast_programmes else 0 end) as HECSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='I R B Sevens 2008/09 -2014/15 - Sky Sports' then right_broadcast_programmes else 0 end) as IRBSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='IAAF World Athletics Championship - Eurosport' then right_broadcast_programmes else 0 end) as WACEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='India Home Cricket 2012-2018 Sky Sports' then right_broadcast_programmes else 0 end) as IHCSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='India Premier League - ITV' then right_broadcast_programmes else 0 end) as IPLITV_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='International Freindlies - ESPN' then right_broadcast_programmes else 0 end) as IFESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='International Friendlies - BT Sport' then right_broadcast_programmes else 0 end) as IFBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Boxing' then right_broadcast_programmes else 0 end) as BOXITV1_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Football' then right_broadcast_programmes else 0 end) as FOOTITV1_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Motor Sport' then right_broadcast_programmes else 0 end) as MOTSITV1_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Rugby' then right_broadcast_programmes else 0 end) as RUGITV1_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Snooker/Pool' then right_broadcast_programmes else 0 end) as SNPITV1_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ITV1 Unknown' then right_broadcast_programmes else 0 end) as UNKITV1_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Boxing' then right_broadcast_programmes else 0 end) as BOXITV4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Cricket' then right_broadcast_programmes else 0 end) as CRIITV4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Darts' then right_broadcast_programmes else 0 end) as DARTITV4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Extreme' then right_broadcast_programmes else 0 end) as EXTITV4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Football' then right_broadcast_programmes else 0 end) as FOOTITV4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Motor Sport' then right_broadcast_programmes else 0 end) as MSPITV4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Rugby' then right_broadcast_programmes else 0 end) as RUGITV4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Snooker/Pool' then right_broadcast_programmes else 0 end) as SNPITV4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Tennis' then right_broadcast_programmes else 0 end) as TENITV4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='ITV4 Unknown' then right_broadcast_programmes else 0 end) as UNKITV4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Ligue 1 - BT Sport' then right_broadcast_programmes else 0 end) as L1BTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Ligue 1 - ESPN' then right_broadcast_programmes else 0 end) as L1ESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Match of the day - BBC' then right_broadcast_programmes else 0 end) as MOTDBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Matchroom Output Deal 2010-2012 (Other)- Sky Sports' then right_broadcast_programmes else 0 end) as MROSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Matchroom Output Deal 2010-2012 (Pool)- Sky Sports' then right_broadcast_programmes else 0 end) as MRPSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Matchroom Output Deal 2010-2012 (Snooker)- Sky Sports' then right_broadcast_programmes else 0 end) as MRSSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Moto GP BBC' then right_broadcast_programmes else 0 end) as MGPBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='NBA - Sky Sports' then right_broadcast_programmes else 0 end) as NBASS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='NFL - BBC' then right_broadcast_programmes else 0 end) as NFLBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='NFL - Channel 4' then right_broadcast_programmes else 0 end) as NFLCH4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='NFL Seasons 2012-2015 - Sky Sports' then right_broadcast_programmes else 0 end) as NFLSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Northern Ireland Football Association 2012-2014 - Sky Sports' then right_broadcast_programmes else 0 end) as NIFSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Oaks - Channel 4' then right_broadcast_programmes else 0 end) as OAKCH4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other American Football' then right_broadcast_programmes else 0 end) as AMOTH_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Athletics' then right_broadcast_programmes else 0 end) as ATHOTH_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Baseball' then right_broadcast_programmes else 0 end) as BASEOTH_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Basketball' then right_broadcast_programmes else 0 end) as BASKOTH_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Boxing' then right_broadcast_programmes else 0 end) as BOXOTH_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Cricket' then right_broadcast_programmes else 0 end) as CRIOTH_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Darts' then right_broadcast_programmes else 0 end) as DARTOTH_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Equestrian' then right_broadcast_programmes else 0 end) as EQUOTH_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Extreme' then right_broadcast_programmes else 0 end) as EXTOTH_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Fishing' then right_broadcast_programmes else 0 end) as FSHOTH_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Football' then right_broadcast_programmes else 0 end) as FOOTOTH_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Golf' then right_broadcast_programmes else 0 end) as GOLFOTH_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Ice Hockey' then right_broadcast_programmes else 0 end) as IHOTH_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Motor Sport' then right_broadcast_programmes else 0 end) as MSPOTH_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Racing' then right_broadcast_programmes else 0 end) as RACOTH_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Rugby' then right_broadcast_programmes else 0 end) as RUGOTH_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Rugby Internationals - ESPN' then right_broadcast_programmes else 0 end) as ORUGESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Snooker/Pool' then right_broadcast_programmes else 0 end) as OTHSNP_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Tennis' then right_broadcast_programmes else 0 end) as OTHTEN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Unknown' then right_broadcast_programmes else 0 end) as OTHUNK_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Watersports' then right_broadcast_programmes else 0 end) as OTHWAT_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Wintersports' then right_broadcast_programmes else 0 end) as OTHWIN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Other Wrestling' then right_broadcast_programmes else 0 end) as OTHWRE_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='PGA Tour Golf 2010-2017 - Sky Sports' then right_broadcast_programmes else 0 end) as PGASS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Premier League - BT Sport' then right_broadcast_programmes else 0 end) as PLBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Premier League - ESPN' then right_broadcast_programmes else 0 end) as PLESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Premier League Darts 2010-2013 - Sky Sports' then right_broadcast_programmes else 0 end) as PLDSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports' then right_broadcast_programmes else 0 end) as GPLSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Match Choice)' then right_broadcast_programmes else 0 end) as PLMCSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (MNF)' then right_broadcast_programmes else 0 end) as PLMNFSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (non Live)' then right_broadcast_programmes else 0 end) as PLNLSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (other Live)' then right_broadcast_programmes else 0 end) as PLOLSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Sat Lunchtime)' then right_broadcast_programmes else 0 end) as PLSLSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Sat Night Live)' then right_broadcast_programmes else 0 end) as PLSNSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Sun 4pm)' then right_broadcast_programmes else 0 end) as PLS4SS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Premier League Football - Sky Sports (Sun Lunchtime)' then right_broadcast_programmes else 0 end) as PLSULSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Premiership Rugby - Sky Sports' then right_broadcast_programmes else 0 end) as PRUSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Republic Of Ireland FA - 2010/11 To 2013/14 - Sky Sports' then right_broadcast_programmes else 0 end) as ROISS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Royal Ascot - Channel 4' then right_broadcast_programmes else 0 end) as RASCH4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Rugby Internationals (England) - BBC' then right_broadcast_programmes else 0 end) as RIEBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Rugby Internationals (Ireland) - BBC' then right_broadcast_programmes else 0 end) as RIIBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Rugby Internationals (Scotland) - BBC' then right_broadcast_programmes else 0 end) as RISBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Rugby Internationals (Wales) - BBC' then right_broadcast_programmes else 0 end) as RIWBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Rugby League Challenge Cup- BBC' then right_broadcast_programmes else 0 end) as RLCCBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Rugby League - Sky Sports' then right_broadcast_programmes else 0 end) as RLGSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Rugby League World Cup- BBC' then right_broadcast_programmes else 0 end) as RLWCBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sanzar Rugby Union 2011 - 2015 - Sky Sports' then right_broadcast_programmes else 0 end) as SARUSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Scottish FA Deal - 2010/11 To 2013/14 - Sky Sports' then right_broadcast_programmes else 0 end) as SFASS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Serie A - BT Sport' then right_broadcast_programmes else 0 end) as SABTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Serie A - ESPN' then right_broadcast_programmes else 0 end) as SAESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='SFL - ESPN' then right_broadcast_programmes else 0 end) as SFLESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Six Nations - BBC' then right_broadcast_programmes else 0 end) as SNRBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Boxing' then right_broadcast_programmes else 0 end) as BOXS12_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Football' then right_broadcast_programmes else 0 end) as FOOTS12_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Motor Sport' then right_broadcast_programmes else 0 end) as MSPS12_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Unknown' then right_broadcast_programmes else 0 end) as UNKS12_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky 1 and Sky 2 Wrestling' then right_broadcast_programmes else 0 end) as WRES12_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports American Football' then right_broadcast_programmes else 0 end) as AMSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Athletics' then right_broadcast_programmes else 0 end) as ATHSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Baseball' then right_broadcast_programmes else 0 end) as BASESS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Basketball' then right_broadcast_programmes else 0 end) as BASKSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Boxing' then right_broadcast_programmes else 0 end) as BOXSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Cricket' then right_broadcast_programmes else 0 end) as CRISS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Darts' then right_broadcast_programmes else 0 end) as DARTSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Equestrian' then right_broadcast_programmes else 0 end) as EQUSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Extreme' then right_broadcast_programmes else 0 end) as EXTSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Fishing' then right_broadcast_programmes else 0 end) as FISHSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Football' then right_broadcast_programmes else 0 end) as FOOTSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Golf' then right_broadcast_programmes else 0 end) as GOLFSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Ice Hockey' then right_broadcast_programmes else 0 end) as IHSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Motor Sport' then right_broadcast_programmes else 0 end) as MSPSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Racing' then right_broadcast_programmes else 0 end) as RACSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Rugby' then right_broadcast_programmes else 0 end) as RUGSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Snooker/Pool' then right_broadcast_programmes else 0 end) as SNPSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Tennis' then right_broadcast_programmes else 0 end) as TENSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Unknown' then right_broadcast_programmes else 0 end) as UNKSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Watersports' then right_broadcast_programmes else 0 end) as WATSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Wintersports' then right_broadcast_programmes else 0 end) as WINSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sky Sports Wrestling' then right_broadcast_programmes else 0 end) as WRESS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Solheim Cup 2013 Ladies Golf - Sky Sports' then right_broadcast_programmes else 0 end) as SOLSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='South African Home Cricket 2012-2020 Sky Sports' then right_broadcast_programmes else 0 end) as SACSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Spanish Football 2012/13 To 14/15 - Sky Sports' then right_broadcast_programmes else 0 end) as SPFSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='SPFL - BT Sport' then right_broadcast_programmes else 0 end) as SPFLBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='SPL - ESPN' then right_broadcast_programmes else 0 end) as SPLESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='SPL - Sky Sports' then right_broadcast_programmes else 0 end) as SPLSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Sportfive World Cup 2014 Qualifers - Sky Sports' then right_broadcast_programmes else 0 end) as SP5SS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='The boat race - BBC' then right_broadcast_programmes else 0 end) as BTRBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='The football league show - BBC' then right_broadcast_programmes else 0 end) as FLSBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='The Masters Golf - BBC' then right_broadcast_programmes else 0 end) as MGBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='TNA Wrestling Challenge' then right_broadcast_programmes else 0 end) as TNACHA_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Tour de France - Eurosport' then right_broadcast_programmes else 0 end) as TDFEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Tour de France - ITV' then right_broadcast_programmes else 0 end) as TDFITV_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='U S Masters Golf 2011-2014 Sky Sports' then right_broadcast_programmes else 0 end) as USMGSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='U.S Open Tennis 2013-2015 Sky Sports' then right_broadcast_programmes else 0 end) as USOTSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='U.S Open/Womens/Seniors/Amateur Golf Sky Sports' then right_broadcast_programmes else 0 end) as USOGSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports' then right_broadcast_programmes else 0 end) as CLASS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports (non Live)' then right_broadcast_programmes else 0 end) as CLNSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports (other Live)' then right_broadcast_programmes else 0 end) as CLOSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports (Tue)' then right_broadcast_programmes else 0 end) as CLTSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='UEFA Champions League - Sky Sports (Wed)' then right_broadcast_programmes else 0 end) as CLWSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='US Open Tennis - Eurosport' then right_broadcast_programmes else 0 end) as USOTEUR_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='USA Football - BT Sport' then right_broadcast_programmes else 0 end) as USFBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='USPGA Championship (2007-2016) Sky Sports' then right_broadcast_programmes else 0 end) as USPGASS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='WCQ - ESPN' then right_broadcast_programmes else 0 end) as WCQESPN_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Welsh Home International Football 2012-2014 Sky Sports' then right_broadcast_programmes else 0 end) as WIFSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='West Indies Home Cricket 2013-2020 Sky Sports' then right_broadcast_programmes else 0 end) as WICSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Wimbledon - BBC' then right_broadcast_programmes else 0 end) as WIMBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='Womens Cricket - I C C Cricket Deal 2012-2015 Sky Sports' then right_broadcast_programmes else 0 end) as WICCSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='World Athletics Championship - More 4' then right_broadcast_programmes else 0 end) as WACMR4_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='World Club Championship - BBC' then right_broadcast_programmes else 0 end) as WCLBBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='World Cup Qualifiers - BT Sport' then right_broadcast_programmes else 0 end) as WCQBTS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='World Darts Championship 2009-2012 Sky Sports' then right_broadcast_programmes else 0 end) as WDCSS_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='World snooker championship - BBC' then right_broadcast_programmes else 0 end) as WSCBBC_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='WWE Sky 1 and 2' then right_broadcast_programmes else 0 end) as WWES12_right_broadcast_programmes_LIVE ,sum(case when live=1 and analysis_right ='WWE Sky Sports' then right_broadcast_programmes else 0 end) as WWESS_right_broadcast_programmes_LIVE ,sum(case when Live=0 and analysis_right ='Africa Cup of Nations - Eurosport' then right_broadcast_programmes else 0 end) as AFCEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Africa Cup of Nations - ITV' then right_broadcast_programmes else 0 end) as AFCITV_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Americas Cup - BBC' then right_broadcast_programmes else 0 end) as AMCBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Asian Tour Golf 2012-2013 Sky Sports' then right_broadcast_programmes else 0 end) as ATGSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ATP Tennis Masters Series 2011-2013 Sky Sports' then right_broadcast_programmes else 0 end) as ATPSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Australia Home Cricket 2012-2016 Sky Sports' then right_broadcast_programmes else 0 end) as AHCSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Australian Football - BT Sport' then right_broadcast_programmes else 0 end) as AUFBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Australian Open Tennis - BBC' then right_broadcast_programmes else 0 end) as AOTBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Australian Open Tennis - Eurosport' then right_broadcast_programmes else 0 end) as AOTEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Aviva Premiership - ESPN' then right_broadcast_programmes else 0 end) as AVPSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BBC American Football' then right_broadcast_programmes else 0 end) as AFBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BBC Athletics' then right_broadcast_programmes else 0 end) as ATHBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BBC Boxing' then right_broadcast_programmes else 0 end) as BOXBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BBC Darts' then right_broadcast_programmes else 0 end) as DRTBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BBC Equestrian' then right_broadcast_programmes else 0 end) as EQUBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BBC Football' then right_broadcast_programmes else 0 end) as FOOTBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BBC Golf' then right_broadcast_programmes else 0 end) as GOLFBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BBC Motor Sport' then right_broadcast_programmes else 0 end) as MSPBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BBC Rugby' then right_broadcast_programmes else 0 end) as RUGBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BBC Snooker/Pool' then right_broadcast_programmes else 0 end) as SNPBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BBC Tennis' then right_broadcast_programmes else 0 end) as TENBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BBC Unknown' then right_broadcast_programmes else 0 end) as UNKBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BBC Watersports' then right_broadcast_programmes else 0 end) as WATBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BBC Wintersports' then right_broadcast_programmes else 0 end) as WINBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Boxing - Channel 5' then right_broadcast_programmes else 0 end) as BOXCH5_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Boxing - Matchroom 2012-2014 Sky Sports' then right_broadcast_programmes else 0 end) as BOXMSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Brazil Football - BT Sport' then right_broadcast_programmes else 0 end) as BFTBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='British & Irish Lions 2013 - Sky Sports' then right_broadcast_programmes else 0 end) as BILSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='British Open Golf - BBC' then right_broadcast_programmes else 0 end) as BOGSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport American Football' then right_broadcast_programmes else 0 end) as AFBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Athletics' then right_broadcast_programmes else 0 end) as ATHBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Baseball' then right_broadcast_programmes else 0 end) as BASEBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Basketball' then right_broadcast_programmes else 0 end) as BASKBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Boxing' then right_broadcast_programmes else 0 end) as BOXBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Cricket' then right_broadcast_programmes else 0 end) as CRIBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Equestrian' then right_broadcast_programmes else 0 end) as EQUBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Extreme' then right_broadcast_programmes else 0 end) as EXTBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Football' then right_broadcast_programmes else 0 end) as FOOTBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Motor Sport' then right_broadcast_programmes else 0 end) as MSPBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Rugby' then right_broadcast_programmes else 0 end) as RUGBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Tennis' then right_broadcast_programmes else 0 end) as TENBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Unknown' then right_broadcast_programmes else 0 end) as UNKBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='BT Sport Wintersports' then right_broadcast_programmes else 0 end) as WINBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Bundesliga - BT Sport' then right_broadcast_programmes else 0 end) as BUNBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Bundesliga- ESPN' then right_broadcast_programmes else 0 end) as BUNESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Challenge Darts' then right_broadcast_programmes else 0 end) as DRTCHA_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Challenge Extreme' then right_broadcast_programmes else 0 end) as EXTCHA_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Challenge Unknown' then right_broadcast_programmes else 0 end) as UNKCHA_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Challenge Wrestling' then right_broadcast_programmes else 0 end) as WRECHA_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Champions League - ITV' then right_broadcast_programmes else 0 end) as CHLITV_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Champions Trophy - I C C Cricket Deal 2012-2015 Sky Sports' then right_broadcast_programmes else 0 end) as ICCSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 American Football' then right_broadcast_programmes else 0 end) as AMCH4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Athletics' then right_broadcast_programmes else 0 end) as ATHCH4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Boxing' then right_broadcast_programmes else 0 end) as BOXCH4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Equestrian' then right_broadcast_programmes else 0 end) as EQUCH4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Extreme' then right_broadcast_programmes else 0 end) as EXTCH4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Football' then right_broadcast_programmes else 0 end) as FOOTCH4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Motor Sport' then right_broadcast_programmes else 0 end) as MSPCH4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Racing' then right_broadcast_programmes else 0 end) as RACCH4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Unknown' then right_broadcast_programmes else 0 end) as UNKCH4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Watersports' then right_broadcast_programmes else 0 end) as WATCH4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Channel 4 Wintersports' then right_broadcast_programmes else 0 end) as WINCH4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Athletics' then right_broadcast_programmes else 0 end) as ATHCH5_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Boxing' then right_broadcast_programmes else 0 end) as BOXOCH5_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Cricket' then right_broadcast_programmes else 0 end) as CRICH5_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Motor Sport' then right_broadcast_programmes else 0 end) as MSPCH5_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Unknown' then right_broadcast_programmes else 0 end) as UNKCH5_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Channel 5 Wrestling' then right_broadcast_programmes else 0 end) as WRECH5_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Cheltenham Festival - Channel 4' then right_broadcast_programmes else 0 end) as CHELCH4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Community Shield - ITV' then right_broadcast_programmes else 0 end) as CMSITV_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Confederations Cup - BBC' then right_broadcast_programmes else 0 end) as CONCBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Conference - BT Sport' then right_broadcast_programmes else 0 end) as CONFBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Cycling - La Vuelta ITV' then right_broadcast_programmes else 0 end) as CLVITV_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Cycling - U C I World Tour Sky Sports' then right_broadcast_programmes else 0 end) as CUCISS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Cycling Tour of Britain - Eurosport' then right_broadcast_programmes else 0 end) as CTBEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Cycling: tour of britain ITV4' then right_broadcast_programmes else 0 end) as CTCITV_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Derby - Channel 4' then right_broadcast_programmes else 0 end) as DERCH4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ECB (highlights) - Channel 5' then right_broadcast_programmes else 0 end) as ECBHCH5_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ECB Cricket Sky Sports' then right_broadcast_programmes else 0 end) as GECRSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ECB non-Test Cricket Sky Sports' then right_broadcast_programmes else 0 end) as ECBNSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ECB Test Cricket Sky Sports' then right_broadcast_programmes else 0 end) as ECBTSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='England Football Internationals - ITV' then right_broadcast_programmes else 0 end) as GENGITV_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='England Friendlies (Football) - ITV' then right_broadcast_programmes else 0 end) as EFRITV_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='England Rugby Internationals 2010-2015 - Sky Sports' then right_broadcast_programmes else 0 end) as ENRSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='England World Cup Qualifying (Away) - ITV' then right_broadcast_programmes else 0 end) as EWQAITV_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='England World Cup Qualifying (Home) - ITV' then right_broadcast_programmes else 0 end) as EWQHITV_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN American Football' then right_broadcast_programmes else 0 end) as AMESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Athletics' then right_broadcast_programmes else 0 end) as ATHESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Baseball' then right_broadcast_programmes else 0 end) as BASEESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Basketball' then right_broadcast_programmes else 0 end) as BASKESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Boxing' then right_broadcast_programmes else 0 end) as BOXESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Cricket' then right_broadcast_programmes else 0 end) as CRIESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Darts' then right_broadcast_programmes else 0 end) as DARTESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Equestrian' then right_broadcast_programmes else 0 end) as EQUESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Extreme' then right_broadcast_programmes else 0 end) as EXTESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Football' then right_broadcast_programmes else 0 end) as FOOTESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Golf' then right_broadcast_programmes else 0 end) as GOLFESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Ice Hockey' then right_broadcast_programmes else 0 end) as IHESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Motor Sport' then right_broadcast_programmes else 0 end) as MSPESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Racing' then right_broadcast_programmes else 0 end) as RACESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Rugby' then right_broadcast_programmes else 0 end) as RUGESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Snooker/Pool' then right_broadcast_programmes else 0 end) as SNPESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Tennis' then right_broadcast_programmes else 0 end) as TENESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Unknown' then right_broadcast_programmes else 0 end) as UNKESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Watersports' then right_broadcast_programmes else 0 end) as WATESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Wintersports' then right_broadcast_programmes else 0 end) as WINESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ESPN Wrestling' then right_broadcast_programmes else 0 end) as WREESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Europa League - BT Sport' then right_broadcast_programmes else 0 end) as ELBTSP_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Europa League - ESPN' then right_broadcast_programmes else 0 end) as ELESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Europa League - ITV' then right_broadcast_programmes else 0 end) as ELITV_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='European Tour Golf - Sky Sports' then right_broadcast_programmes else 0 end) as ETGSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport American Football' then right_broadcast_programmes else 0 end) as AMEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Athletics' then right_broadcast_programmes else 0 end) as ATHEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Baseball' then right_broadcast_programmes else 0 end) as BASEEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Basketball' then right_broadcast_programmes else 0 end) as BASKEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Boxing' then right_broadcast_programmes else 0 end) as BOXEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Cricket' then right_broadcast_programmes else 0 end) as CRIEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Darts' then right_broadcast_programmes else 0 end) as DARTEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Equestrian' then right_broadcast_programmes else 0 end) as EQUEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Extreme' then right_broadcast_programmes else 0 end) as EXTEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Football' then right_broadcast_programmes else 0 end) as FOOTEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Golf' then right_broadcast_programmes else 0 end) as GOLFEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Ice Hockey' then right_broadcast_programmes else 0 end) as IHEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Motor Sport' then right_broadcast_programmes else 0 end) as MSPEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Racing' then right_broadcast_programmes else 0 end) as RACEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Snooker/Pool' then right_broadcast_programmes else 0 end) as SNPEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Tennis' then right_broadcast_programmes else 0 end) as TENEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Unknown' then right_broadcast_programmes else 0 end) as UNKEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Watersports' then right_broadcast_programmes else 0 end) as WATEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Eurosport Wintersports' then right_broadcast_programmes else 0 end) as WINEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='F1 - BBC' then right_broadcast_programmes else 0 end) as GF1BBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='F1 - Sky Sports' then right_broadcast_programmes else 0 end) as GF1SS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='F1 (non-Live)- BBC' then right_broadcast_programmes else 0 end) as F1NBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='F1 (Practice Live)- BBC' then right_broadcast_programmes else 0 end) as F1PBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='F1 (Qualifying Live)- BBC' then right_broadcast_programmes else 0 end) as F1QBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='F1 (Race Live)- BBC' then right_broadcast_programmes else 0 end) as F1RBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='FA Cup - ESPN' then right_broadcast_programmes else 0 end) as FACESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='FA Cup - ITV' then right_broadcast_programmes else 0 end) as FACITV_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - Capital 1 Cup' then right_broadcast_programmes else 0 end) as FLCCSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Football League - Seasons 2012/13 To 14/15 Sky Sports - others' then right_broadcast_programmes else 0 end) as FLOTSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Formula One 2012-2018 - (non-Live) Sky Sports' then right_broadcast_programmes else 0 end) as F1NSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Formula One 2012-2018 - (Practice Live) Sky Sports' then right_broadcast_programmes else 0 end) as F1PSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Formula One 2012-2018 - (Qualifying Live) Sky Sports' then right_broadcast_programmes else 0 end) as F1QSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Formula One 2012-2018 - (Race Live) Sky Sports' then right_broadcast_programmes else 0 end) as F1RSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='French Open Tennis - Eurosport' then right_broadcast_programmes else 0 end) as FOTEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='French Open Tennis - ITV' then right_broadcast_programmes else 0 end) as FOTITV_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Grand National - Channel 4' then right_broadcast_programmes else 0 end) as GDNCH4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Heineken Cup 2010/11 To 2013/14- Sky Sports' then right_broadcast_programmes else 0 end) as HECSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='I R B Sevens 2008/09 -2014/15 - Sky Sports' then right_broadcast_programmes else 0 end) as IRBSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='IAAF World Athletics Championship - Eurosport' then right_broadcast_programmes else 0 end) as WACEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='India Home Cricket 2012-2018 Sky Sports' then right_broadcast_programmes else 0 end) as IHCSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='India Premier League - ITV' then right_broadcast_programmes else 0 end) as IPLITV_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='International Freindlies - ESPN' then right_broadcast_programmes else 0 end) as IFESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='International Friendlies - BT Sport' then right_broadcast_programmes else 0 end) as IFBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Boxing' then right_broadcast_programmes else 0 end) as BOXITV1_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Football' then right_broadcast_programmes else 0 end) as FOOTITV1_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Motor Sport' then right_broadcast_programmes else 0 end) as MOTSITV1_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Rugby' then right_broadcast_programmes else 0 end) as RUGITV1_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Snooker/Pool' then right_broadcast_programmes else 0 end) as SNPITV1_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ITV1 Unknown' then right_broadcast_programmes else 0 end) as UNKITV1_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Boxing' then right_broadcast_programmes else 0 end) as BOXITV4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Cricket' then right_broadcast_programmes else 0 end) as CRIITV4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Darts' then right_broadcast_programmes else 0 end) as DARTITV4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Extreme' then right_broadcast_programmes else 0 end) as EXTITV4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Football' then right_broadcast_programmes else 0 end) as FOOTITV4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Motor Sport' then right_broadcast_programmes else 0 end) as MSPITV4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Rugby' then right_broadcast_programmes else 0 end) as RUGITV4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Snooker/Pool' then right_broadcast_programmes else 0 end) as SNPITV4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Tennis' then right_broadcast_programmes else 0 end) as TENITV4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='ITV4 Unknown' then right_broadcast_programmes else 0 end) as UNKITV4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Ligue 1 - BT Sport' then right_broadcast_programmes else 0 end) as L1BTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Ligue 1 - ESPN' then right_broadcast_programmes else 0 end) as L1ESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Match of the day - BBC' then right_broadcast_programmes else 0 end) as MOTDBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Matchroom Output Deal 2010-2012 (Other)- Sky Sports' then right_broadcast_programmes else 0 end) as MROSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Matchroom Output Deal 2010-2012 (Pool)- Sky Sports' then right_broadcast_programmes else 0 end) as MRPSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Matchroom Output Deal 2010-2012 (Snooker)- Sky Sports' then right_broadcast_programmes else 0 end) as MRSSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Moto GP BBC' then right_broadcast_programmes else 0 end) as MGPBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='NBA - Sky Sports' then right_broadcast_programmes else 0 end) as NBASS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='NFL - BBC' then right_broadcast_programmes else 0 end) as NFLBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='NFL - Channel 4' then right_broadcast_programmes else 0 end) as NFLCH4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='NFL Seasons 2012-2015 - Sky Sports' then right_broadcast_programmes else 0 end) as NFLSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Northern Ireland Football Association 2012-2014 - Sky Sports' then right_broadcast_programmes else 0 end) as NIFSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Oaks - Channel 4' then right_broadcast_programmes else 0 end) as OAKCH4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other American Football' then right_broadcast_programmes else 0 end) as AMOTH_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Athletics' then right_broadcast_programmes else 0 end) as ATHOTH_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Baseball' then right_broadcast_programmes else 0 end) as BASEOTH_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Basketball' then right_broadcast_programmes else 0 end) as BASKOTH_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Boxing' then right_broadcast_programmes else 0 end) as BOXOTH_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Cricket' then right_broadcast_programmes else 0 end) as CRIOTH_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Darts' then right_broadcast_programmes else 0 end) as DARTOTH_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Equestrian' then right_broadcast_programmes else 0 end) as EQUOTH_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Extreme' then right_broadcast_programmes else 0 end) as EXTOTH_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Fishing' then right_broadcast_programmes else 0 end) as FSHOTH_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Football' then right_broadcast_programmes else 0 end) as FOOTOTH_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Golf' then right_broadcast_programmes else 0 end) as GOLFOTH_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Ice Hockey' then right_broadcast_programmes else 0 end) as IHOTH_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Motor Sport' then right_broadcast_programmes else 0 end) as MSPOTH_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Racing' then right_broadcast_programmes else 0 end) as RACOTH_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Rugby' then right_broadcast_programmes else 0 end) as RUGOTH_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Rugby Internationals - ESPN' then right_broadcast_programmes else 0 end) as ORUGESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Snooker/Pool' then right_broadcast_programmes else 0 end) as OTHSNP_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Tennis' then right_broadcast_programmes else 0 end) as OTHTEN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Unknown' then right_broadcast_programmes else 0 end) as OTHUNK_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Watersports' then right_broadcast_programmes else 0 end) as OTHWAT_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Wintersports' then right_broadcast_programmes else 0 end) as OTHWIN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Other Wrestling' then right_broadcast_programmes else 0 end) as OTHWRE_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='PGA Tour Golf 2010-2017 - Sky Sports' then right_broadcast_programmes else 0 end) as PGASS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Premier League - BT Sport' then right_broadcast_programmes else 0 end) as PLBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Premier League - ESPN' then right_broadcast_programmes else 0 end) as PLESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Darts 2010-2013 - Sky Sports' then right_broadcast_programmes else 0 end) as PLDSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports' then right_broadcast_programmes else 0 end) as GPLSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Match Choice)' then right_broadcast_programmes else 0 end) as PLMCSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (MNF)' then right_broadcast_programmes else 0 end) as PLMNFSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (non Live)' then right_broadcast_programmes else 0 end) as PLNLSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (other Live)' then right_broadcast_programmes else 0 end) as PLOLSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Sat Lunchtime)' then right_broadcast_programmes else 0 end) as PLSLSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Sat Night Live)' then right_broadcast_programmes else 0 end) as PLSNSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Sun 4pm)' then right_broadcast_programmes else 0 end) as PLS4SS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Premier League Football - Sky Sports (Sun Lunchtime)' then right_broadcast_programmes else 0 end) as PLSULSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Premiership Rugby - Sky Sports' then right_broadcast_programmes else 0 end) as PRUSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Republic Of Ireland FA - 2010/11 To 2013/14 - Sky Sports' then right_broadcast_programmes else 0 end) as ROISS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Royal Ascot - Channel 4' then right_broadcast_programmes else 0 end) as RASCH4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Rugby Internationals (England) - BBC' then right_broadcast_programmes else 0 end) as RIEBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Rugby Internationals (Ireland) - BBC' then right_broadcast_programmes else 0 end) as RIIBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Rugby Internationals (Scotland) - BBC' then right_broadcast_programmes else 0 end) as RISBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Rugby Internationals (Wales) - BBC' then right_broadcast_programmes else 0 end) as RIWBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Rugby League Challenge Cup- BBC' then right_broadcast_programmes else 0 end) as RLCCBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Rugby League - Sky Sports' then right_broadcast_programmes else 0 end) as RLGSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Rugby League World Cup- BBC' then right_broadcast_programmes else 0 end) as RLWCBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sanzar Rugby Union 2011 - 2015 - Sky Sports' then right_broadcast_programmes else 0 end) as SARUSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Scottish FA Deal - 2010/11 To 2013/14 - Sky Sports' then right_broadcast_programmes else 0 end) as SFASS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Serie A - BT Sport' then right_broadcast_programmes else 0 end) as SABTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Serie A - ESPN' then right_broadcast_programmes else 0 end) as SAESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='SFL - ESPN' then right_broadcast_programmes else 0 end) as SFLESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Six Nations - BBC' then right_broadcast_programmes else 0 end) as SNRBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Boxing' then right_broadcast_programmes else 0 end) as BOXS12_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Football' then right_broadcast_programmes else 0 end) as FOOTS12_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Motor Sport' then right_broadcast_programmes else 0 end) as MSPS12_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Unknown' then right_broadcast_programmes else 0 end) as UNKS12_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky 1 and Sky 2 Wrestling' then right_broadcast_programmes else 0 end) as WRES12_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports American Football' then right_broadcast_programmes else 0 end) as AMSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Athletics' then right_broadcast_programmes else 0 end) as ATHSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Baseball' then right_broadcast_programmes else 0 end) as BASESS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Basketball' then right_broadcast_programmes else 0 end) as BASKSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Boxing' then right_broadcast_programmes else 0 end) as BOXSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Cricket' then right_broadcast_programmes else 0 end) as CRISS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Darts' then right_broadcast_programmes else 0 end) as DARTSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Equestrian' then right_broadcast_programmes else 0 end) as EQUSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Extreme' then right_broadcast_programmes else 0 end) as EXTSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Fishing' then right_broadcast_programmes else 0 end) as FISHSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Football' then right_broadcast_programmes else 0 end) as FOOTSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Golf' then right_broadcast_programmes else 0 end) as GOLFSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Ice Hockey' then right_broadcast_programmes else 0 end) as IHSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Motor Sport' then right_broadcast_programmes else 0 end) as MSPSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Racing' then right_broadcast_programmes else 0 end) as RACSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Rugby' then right_broadcast_programmes else 0 end) as RUGSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Snooker/Pool' then right_broadcast_programmes else 0 end) as SNPSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Tennis' then right_broadcast_programmes else 0 end) as TENSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Unknown' then right_broadcast_programmes else 0 end) as UNKSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Watersports' then right_broadcast_programmes else 0 end) as WATSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Wintersports' then right_broadcast_programmes else 0 end) as WINSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sky Sports Wrestling' then right_broadcast_programmes else 0 end) as WRESS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Solheim Cup 2013 Ladies Golf - Sky Sports' then right_broadcast_programmes else 0 end) as SOLSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='South African Home Cricket 2012-2020 Sky Sports' then right_broadcast_programmes else 0 end) as SACSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Spanish Football 2012/13 To 14/15 - Sky Sports' then right_broadcast_programmes else 0 end) as SPFSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='SPFL - BT Sport' then right_broadcast_programmes else 0 end) as SPFLBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='SPL - ESPN' then right_broadcast_programmes else 0 end) as SPLESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='SPL - Sky Sports' then right_broadcast_programmes else 0 end) as SPLSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Sportfive World Cup 2014 Qualifers - Sky Sports' then right_broadcast_programmes else 0 end) as SP5SS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='The boat race - BBC' then right_broadcast_programmes else 0 end) as BTRBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='The football league show - BBC' then right_broadcast_programmes else 0 end) as FLSBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='The Masters Golf - BBC' then right_broadcast_programmes else 0 end) as MGBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='TNA Wrestling Challenge' then right_broadcast_programmes else 0 end) as TNACHA_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Tour de France - Eurosport' then right_broadcast_programmes else 0 end) as TDFEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Tour de France - ITV' then right_broadcast_programmes else 0 end) as TDFITV_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='U S Masters Golf 2011-2014 Sky Sports' then right_broadcast_programmes else 0 end) as USMGSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='U.S Open Tennis 2013-2015 Sky Sports' then right_broadcast_programmes else 0 end) as USOTSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='U.S Open/Womens/Seniors/Amateur Golf Sky Sports' then right_broadcast_programmes else 0 end) as USOGSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports' then right_broadcast_programmes else 0 end) as CLASS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports (non Live)' then right_broadcast_programmes else 0 end) as CLNSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports (other Live)' then right_broadcast_programmes else 0 end) as CLOSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports (Tue)' then right_broadcast_programmes else 0 end) as CLTSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='UEFA Champions League - Sky Sports (Wed)' then right_broadcast_programmes else 0 end) as CLWSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='US Open Tennis - Eurosport' then right_broadcast_programmes else 0 end) as USOTEUR_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='USA Football - BT Sport' then right_broadcast_programmes else 0 end) as USFBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='USPGA Championship (2007-2016) Sky Sports' then right_broadcast_programmes else 0 end) as USPGASS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='WCQ - ESPN' then right_broadcast_programmes else 0 end) as WCQESPN_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Welsh Home International Football 2012-2014 Sky Sports' then right_broadcast_programmes else 0 end) as WIFSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='West Indies Home Cricket 2013-2020 Sky Sports' then right_broadcast_programmes else 0 end) as WICSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Wimbledon - BBC' then right_broadcast_programmes else 0 end) as WIMBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='Womens Cricket - I C C Cricket Deal 2012-2015 Sky Sports' then right_broadcast_programmes else 0 end) as WICCSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='World Athletics Championship - More 4' then right_broadcast_programmes else 0 end) as WACMR4_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='World Club Championship - BBC' then right_broadcast_programmes else 0 end) as WCLBBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='World Cup Qualifiers - BT Sport' then right_broadcast_programmes else 0 end) as WCQBTS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='World Darts Championship 2009-2012 Sky Sports' then right_broadcast_programmes else 0 end) as WDCSS_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='World snooker championship - BBC' then right_broadcast_programmes else 0 end) as WSCBBC_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='WWE Sky 1 and 2' then right_broadcast_programmes else 0 end) as WWES12_right_broadcast_programmesNon_Live ,sum(case when Live=0 and analysis_right ='WWE Sky Sports' then right_broadcast_programmes else 0 end) as WWESS_right_broadcast_programmesNon_Live --select top 100 * from dbarnett.v250_right_viewable_account_summary_by_live_status into dbarnett.v250_right_viewable_account_summary_by_live_status from dbarnett.v250_days_right_viewable_by_account_by_live_status group by account_number ; commit; --select top 100 * from dbarnett.v250_days_right_viewable_by_account_by_live_status; commit; CREATE HG INDEX idx1 ON dbarnett.v250_right_viewable_account_summary (account_number); CREATE HG INDEX idx1 ON dbarnett.v250_right_viewable_account_summary_by_live_status (account_number); commit; --select top 500 * from dbarnett.v250_master_account_list as a; --select top 500 * from dbarnett.v250_right_viewable_account_summary_by_live_status; --select top 500 * from dbarnett.v250_unannualised_right_activity as b ---20140203 alter table dbarnett.v250_master_account_list add account_weight real; update dbarnett.v250_master_account_list set account_weight=case when b.account_weight is null then 0 else b.account_weight end from dbarnett.v250_master_account_list as a left outer join dbarnett.v250_annualised_activity_table_for_workshop as b on a.account_number = b.account_number ; commit;
true
4fada3b8bbed5089a47a55bf3026d0c667bccc99
SQL
giancarloCavalli/bds05
/src/main/resources/data.sql
UTF-8
2,201
3.25
3
[]
no_license
INSERT INTO users (id, name, email, password) VALUES (1, 'Bob DePay', 'bob@gmail.com', '$2a$10$eACCYoNOHEqXve8aIWT8Nu3PkMXWBaOxJ9aORUYzfMQCbVBIhZ8tG'); INSERT INTO users (id, name, email, password) VALUES (2, 'Ana Leroy', 'ana@gmail.com', '$2a$10$eACCYoNOHEqXve8aIWT8Nu3PkMXWBaOxJ9aORUYzfMQCbVBIhZ8tG'); INSERT INTO roles (id, authority) VALUES (1, 'ROLE_VISITOR'); INSERT INTO roles (id, authority) VALUES (2, 'ROLE_MEMBER'); INSERT INTO user_roles (user_id, role_id) VALUES (1, 1); INSERT INTO user_roles (user_id, role_id) VALUES (2, 2); INSERT INTO genres (id, name) VALUES (1, 'Animation'); INSERT INTO genres (id, name) VALUES (2, 'Comedy'); INSERT INTO genres (id, name) VALUES (3, 'Action'); INSERT INTO genres (id, name) VALUES (4, 'Thriller'); INSERT INTO genres (id, name) VALUES (5, 'Romance'); INSERT INTO genres (id, name) VALUES (6, 'Adventure'); INSERT INTO movies (id, title, sub_Title, year, img_Url, synopsis, genre_id) VALUES (1, 'Kung Fu Panda', 'The Rise of the Dragon Warrior', 2008, 'https://m.media-amazon.com/images/I/51xlf28jbiL.jpg', 'An awesome rocking story of ancient dope kung fu!', 1); INSERT INTO movies (id, title, sub_Title, year, img_Url, synopsis, genre_id) VALUES (2, 'Lord of the rings: Society of the ring', 'Lord Sauron is back???', 2001, 'https://upload.wikimedia.org/wikipedia/pt/thumb/0/0d/EsdlaIII.jpg/250px-EsdlaIII.jpg', 'Get out of the shire, you hobbit fools, and save the middle land!', 6); INSERT INTO movies (id, title, sub_Title, year, img_Url, synopsis, genre_id) VALUES (3, 'Night at the museum', 'Magic??? What the heck!', 2006, 'https://m.media-amazon.com/images/I/51AUcaNVnyL.jpg', 'He thought it would be a monotonous job... Poor thing.', 2); INSERT INTO reviews (id, text, user_id, movie_id) VALUES (1, 'OMG!! Love this movie. Its freaking awesome!', 1, 1); INSERT INTO reviews (id, text, user_id, movie_id) VALUES (2, 'A Classic! Cant wait till Amazon release its LOR series!', 1, 2); INSERT INTO reviews (id, text, user_id, movie_id) VALUES (3, 'This movie brings me warm childhood memories :)', 1, 3); INSERT INTO reviews (id, text, user_id, movie_id) VALUES (4, 'Love how funny and innocent Po is.', 2, 1); INSERT INTO reviews (id, text, user_id, movie_id) VALUES (5, 'I love to watch this movie! Cant say how many times I did already hahaha.', 2, 3);
true
52533b254f14c4fd7b5d85ddd17e3bb2f808a7c2
SQL
cazicbor/Library-Manager
/insertion.sql
UTF-8
4,698
2.828125
3
[]
no_license
INSERT INTO Ressource(code, titre, date_apparition, editeur, genre, code_classification) VALUES (1, 'Guytoune', 2020, 'D or et de platine', 'rap', 890); INSERT INTO Ressource(code, titre, date_apparition, editeur, genre, code_classification) VALUES (449, 'Cremoso', 2019, 'D or et de platine', 'rap', 279); INSERT INTO Ressource(code, titre, date_apparition, editeur, genre, code_classification) VALUES (511, '50 nuances de Grecs', 2020, 'Bordas', 'Bande dessinée', 779); INSERT INTO Ressource(code, titre, date_apparition, editeur, genre, code_classification) VALUES (209, 'Stupeur et tremblements', 2008, 'Edition spinelle', 'Roman', 650); INSERT INTO Ressource VALUES (10203, 'Comment avoir A sans réviser', 2021, 'Bor', 'Philosophie', 08); INSERT INTO Ressource VALUES (460903, 'KillBill', 2003, 'Miramax', 'Action', 1234); INSERT INTO Contributeur VALUES (666, 'Acab', 'Quentin', 'AQ du tieks', '1946-09-03', 'Liechtensteinois'); INSERT INTO Contributeur VALUES (404, 'Lussier', 'Benjamin', 'Benji du 07', '1990-07-10', 'Américain'); INSERT INTO Contributeur VALUES (111, 'Thurman', 'Uma', 'Uma Thurman', '1970-05-29', 'Américaine'); INSERT INTO Contributeur VALUES (438, 'Pepin', 'Charles', 'PC', '1989-03-11', 'Français'); INSERT INTO Contributeur VALUES (5903, 'Amelie', 'Nothomb', 'Amelie Nothomb', '101-07-01', 'Belge'); INSERT INTO Contributeur VALUES (59, 'Julien', 'Mari', 'JUL', '1990-06-02', 'Marseillais'); INSERT INTO Oeuvre_musicale VALUES (1, 4.3); INSERT INTO Oeuvre_musicale VALUES (449, 3.28); INSERT INTO Livre VALUES (511, 3, 'La mythologie grecque en satire contemporaine tout ceci raconté en bande dessinée'); INSERT INTO Livre VALUES (209, 5, 'L’histoire se déroule dans un aéroport… ou est-ce dans sa tête ?'); INSERT INTO Livre VALUES (10203, 10, 'Le titre explicite de cette oeuvre ne nécessite pas plus de développement'); INSERT INTO Film VALUES (460903, 125, 'Beatrix Kiddo a soif de vengeance après avoir été laissée pour morte dans le désert le jour de son mariage'); INSERT INTO Auteur VALUES (10203, 404); INSERT INTO Utilisateur (adresse_mail, nom, prenom, date_naissance, adresse) VALUES ('adresse_mail@gmail.com', 'Victorino', 'Alessandro', '01/01/1985', 'Quelque part'); INSERT INTO Utilisateur (adresse_mail, nom, prenom, date_naissance, adresse) VALUES ('adresse2@gmail.com', 'Zhang', 'Aline', '01/01/2000', 'Autre part'); INSERT INTO Utilisateur (adresse_mail, nom, prenom, date_naissance, adresse) VALUES ('adresse3@gmail.com', 'Cazic', 'Boris', '02/02/2000', ''); INSERT INTO Utilisateur (adresse_mail, nom, prenom, date_naissance, adresse) VALUES ('adresse4@gmail.com', 'Debette', 'Eugénie', '03/03/2000', ''); INSERT INTO Compte_utilisateur VALUES ('ed', 'coucou', 'adresse_mail@gmail.com'); INSERT INTO Compte_utilisateur VALUES ('zhangali', '1234', 'adresse2@gmail.com'); INSERT INTO Compte_utilisateur VALUES ('cazicbor', 'abcd', 'adresse3@gmail.com'); INSERT INTO Compte_utilisateur VALUES ('debettee', 'motdepasse', 'adresse4@gmail.com'); INSERT INTO Compte_utilisateur VALUES ('jolegran', 'test', 'adresse5@gmail.com'); INSERT INTO Adherent (adresse_mail, nombre_emprunts, blackliste) VALUES ('adresse_mail@gmail.com', 0, TRUE); INSERT INTO Adherent (adresse_mail, nombre_emprunts, blackliste) VALUES ('adresse2@gmail.com', 0, FALSE); INSERT INTO Adherent (adresse_mail, nombre_emprunts, blackliste) VALUES ('adresse5@gmail.com', 0, FALSE); INSERT INTO Membre (adresse_mail) VALUES ('adresse3@gmail.com'); INSERT INTO Membre (adresse_mail) VALUES ('adresse4@gmail.com'); INSERT INTO Pret VALUES ('03/05/2021', '09/05/2021', 'adresse3@gmail.com'); INSERT INTO Pret VALUES ('02/05/2021', '10/05/2021', 'adresse4@gmail.com'); INSERT INTO Pret VALUES ('01/05/2021', '09/05/2021', 'adresse3@gmail.com'); INSERT INTO Exemplaire (code, disponible, etat, ressource) VALUES (1, FALSE, 'abime', 1); INSERT INTO Exemplaire (code, disponible, etat, ressource) VALUES (2, TRUE, 'bon', 449); INSERT INTO Exemplaire (code, disponible, etat, ressource) VALUES (3, TRUE, 'bon', 449); INSERT INTO Exemplaire (code, id_pret, disponible, etat, ressource) VALUES (4, 1, FALSE, 'neuf', 460903); INSERT INTO Exemplaire (code, id_pret, disponible, etat, ressource) VALUES (5, 2, FALSE, 'bon', 511); INSERT INTO Exemplaire (code, id_pret, disponible, etat, ressource) VALUES (6, 3, FALSE, 'neuf', 209); INSERT INTO Sanction VALUES (1); INSERT INTO Sanction VALUES (2); INSERT INTO Sanction VALUES (3); INSERT INTO Retard VALUES (1, 3); INSERT INTO Degradation VALUES (2, FALSE); INSERT INTO Degradation VALUES (3, TRUE); INSERT INTO Realisateur VALUES (460903, 666); INSERT INTO Acteur VALUES (460903, 111); INSERT INTO Auteur VALUES (511, 438); INSERT INTO Auteur VALUES (209, 5903); INSERT INTO Interprete VALUES (1, 59); INSERT INTO Compositeur VALUES (1, 59); INSERT INTO Interprete VALUES (449, 59); INSERT INTO Compositeur VALUES (449, 59);
true
b16114944ee836ce52087c2d39dc00d8a462f4ed
SQL
yuanyanzhu123456/rsc
/doc/db/geo-release/v2.0.0/rcs_quartz_config_v1.0_2018.6.19.sql
UTF-8
14,673
3.046875
3
[]
no_license
# ************************************************************ # Sequel Pro SQL dump # Version 4541 # # http://www.sequelpro.com/ # https://github.com/sequelpro/sequelpro # # Host: 127.0.0.1 (MySQL 5.6.38) # Database: rcs # Generation Time: 2018-06-19 03:54:21 +0000 # ************************************************************ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; # Dump of table qrtz_blob_triggers # ------------------------------------------------------------ DROP TABLE IF EXISTS `qrtz_blob_triggers`; CREATE TABLE `qrtz_blob_triggers` ( `SCHED_NAME` varchar(120) NOT NULL, `TRIGGER_NAME` varchar(200) NOT NULL, `TRIGGER_GROUP` varchar(200) NOT NULL, `BLOB_DATA` blob, PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), CONSTRAINT `qrtz_blob_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; # Dump of table qrtz_calendars # ------------------------------------------------------------ DROP TABLE IF EXISTS `qrtz_calendars`; CREATE TABLE `qrtz_calendars` ( `SCHED_NAME` varchar(120) NOT NULL, `CALENDAR_NAME` varchar(200) NOT NULL, `CALENDAR` blob NOT NULL, PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; # Dump of table qrtz_cron_triggers # ------------------------------------------------------------ DROP TABLE IF EXISTS `qrtz_cron_triggers`; CREATE TABLE `qrtz_cron_triggers` ( `SCHED_NAME` varchar(120) NOT NULL, `TRIGGER_NAME` varchar(200) NOT NULL, `TRIGGER_GROUP` varchar(200) NOT NULL, `CRON_EXPRESSION` varchar(120) NOT NULL, `TIME_ZONE_ID` varchar(80) DEFAULT NULL, PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), CONSTRAINT `qrtz_cron_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; LOCK TABLES `qrtz_cron_triggers` WRITE; /*!40000 ALTER TABLE `qrtz_cron_triggers` DISABLE KEYS */; INSERT INTO `qrtz_cron_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`, `CRON_EXPRESSION`, `TIME_ZONE_ID`) VALUES ('quartzScheduler','triggertest01','test','0/20 * * * * ?','Asia/Shanghai'); /*!40000 ALTER TABLE `qrtz_cron_triggers` ENABLE KEYS */; UNLOCK TABLES; # Dump of table qrtz_fired_triggers # ------------------------------------------------------------ DROP TABLE IF EXISTS `qrtz_fired_triggers`; CREATE TABLE `qrtz_fired_triggers` ( `SCHED_NAME` varchar(120) NOT NULL, `ENTRY_ID` varchar(95) NOT NULL, `TRIGGER_NAME` varchar(200) NOT NULL, `TRIGGER_GROUP` varchar(200) NOT NULL, `INSTANCE_NAME` varchar(200) NOT NULL, `FIRED_TIME` bigint(13) NOT NULL, `SCHED_TIME` bigint(13) NOT NULL, `PRIORITY` int(11) NOT NULL, `STATE` varchar(16) NOT NULL, `JOB_NAME` varchar(200) DEFAULT NULL, `JOB_GROUP` varchar(200) DEFAULT NULL, `IS_NONCONCURRENT` varchar(1) DEFAULT NULL, `REQUESTS_RECOVERY` varchar(1) DEFAULT NULL, PRIMARY KEY (`SCHED_NAME`,`ENTRY_ID`), KEY `IDX_QRTZ_FT_TRIG_INST_NAME` (`SCHED_NAME`,`INSTANCE_NAME`), KEY `IDX_QRTZ_FT_INST_JOB_REQ_RCVRY` (`SCHED_NAME`,`INSTANCE_NAME`,`REQUESTS_RECOVERY`), KEY `IDX_QRTZ_FT_J_G` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), KEY `IDX_QRTZ_FT_JG` (`SCHED_NAME`,`JOB_GROUP`), KEY `IDX_QRTZ_FT_T_G` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), KEY `IDX_QRTZ_FT_TG` (`SCHED_NAME`,`TRIGGER_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; # Dump of table qrtz_job_details # ------------------------------------------------------------ DROP TABLE IF EXISTS `qrtz_job_details`; CREATE TABLE `qrtz_job_details` ( `SCHED_NAME` varchar(120) NOT NULL, `JOB_NAME` varchar(200) NOT NULL, `JOB_GROUP` varchar(200) NOT NULL, `DESCRIPTION` varchar(250) DEFAULT NULL, `JOB_CLASS_NAME` varchar(250) NOT NULL, `IS_DURABLE` varchar(1) NOT NULL, `IS_NONCONCURRENT` varchar(1) NOT NULL, `IS_UPDATE_DATA` varchar(1) NOT NULL, `REQUESTS_RECOVERY` varchar(1) NOT NULL, `JOB_DATA` blob, PRIMARY KEY (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), KEY `IDX_QRTZ_J_REQ_RECOVERY` (`SCHED_NAME`,`REQUESTS_RECOVERY`), KEY `IDX_QRTZ_J_GRP` (`SCHED_NAME`,`JOB_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; LOCK TABLES `qrtz_job_details` WRITE; /*!40000 ALTER TABLE `qrtz_job_details` DISABLE KEYS */; INSERT INTO `qrtz_job_details` (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`, `DESCRIPTION`, `JOB_CLASS_NAME`, `IS_DURABLE`, `IS_NONCONCURRENT`, `IS_UPDATE_DATA`, `REQUESTS_RECOVERY`, `JOB_DATA`) VALUES ('quartzScheduler','test01','test','测试任务','com.itstyle.quartz.job.ChickenJob','0','0','0','0',X'ACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787001737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F4000000000000C7708000000100000000374000464617461757200135B4C6A6176612E6C616E672E537472696E673BADD256E7E91D7B47020000787000000002740006E5BCA0E4B889740006E69D8EE59B9B740004626C6F6774001A68747470733A2F2F626C6F672E353269747374796C652E636F6D74000769747374796C65740012E7A791E5B8AEE7BD91E6ACA2E8BF8EE4BDA07800'); /*!40000 ALTER TABLE `qrtz_job_details` ENABLE KEYS */; UNLOCK TABLES; # Dump of table qrtz_locks # ------------------------------------------------------------ DROP TABLE IF EXISTS `qrtz_locks`; CREATE TABLE `qrtz_locks` ( `SCHED_NAME` varchar(120) NOT NULL, `LOCK_NAME` varchar(40) NOT NULL, PRIMARY KEY (`SCHED_NAME`,`LOCK_NAME`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; LOCK TABLES `qrtz_locks` WRITE; /*!40000 ALTER TABLE `qrtz_locks` DISABLE KEYS */; INSERT INTO `qrtz_locks` (`SCHED_NAME`, `LOCK_NAME`) VALUES ('GeoScheduler','STATE_ACCESS'), ('GeoScheduler','TRIGGER_ACCESS'), ('quartzScheduler','STATE_ACCESS'), ('quartzScheduler','TRIGGER_ACCESS'); /*!40000 ALTER TABLE `qrtz_locks` ENABLE KEYS */; UNLOCK TABLES; # Dump of table qrtz_paused_trigger_grps # ------------------------------------------------------------ DROP TABLE IF EXISTS `qrtz_paused_trigger_grps`; CREATE TABLE `qrtz_paused_trigger_grps` ( `SCHED_NAME` varchar(120) NOT NULL, `TRIGGER_GROUP` varchar(200) NOT NULL, PRIMARY KEY (`SCHED_NAME`,`TRIGGER_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; # Dump of table qrtz_scheduler_state # ------------------------------------------------------------ DROP TABLE IF EXISTS `qrtz_scheduler_state`; CREATE TABLE `qrtz_scheduler_state` ( `SCHED_NAME` varchar(120) NOT NULL, `INSTANCE_NAME` varchar(200) NOT NULL, `LAST_CHECKIN_TIME` bigint(13) NOT NULL, `CHECKIN_INTERVAL` bigint(13) NOT NULL, PRIMARY KEY (`SCHED_NAME`,`INSTANCE_NAME`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; LOCK TABLES `qrtz_scheduler_state` WRITE; /*!40000 ALTER TABLE `qrtz_scheduler_state` DISABLE KEYS */; INSERT INTO `qrtz_scheduler_state` (`SCHED_NAME`, `INSTANCE_NAME`, `LAST_CHECKIN_TIME`, `CHECKIN_INTERVAL`) VALUES ('GeoScheduler','bogon1529379051265',1529380448560,15000), ('quartzScheduler','guoyujie.local1528944536391',1528944956475,2000); /*!40000 ALTER TABLE `qrtz_scheduler_state` ENABLE KEYS */; UNLOCK TABLES; # Dump of table qrtz_simple_triggers # ------------------------------------------------------------ DROP TABLE IF EXISTS `qrtz_simple_triggers`; CREATE TABLE `qrtz_simple_triggers` ( `SCHED_NAME` varchar(120) NOT NULL, `TRIGGER_NAME` varchar(200) NOT NULL, `TRIGGER_GROUP` varchar(200) NOT NULL, `REPEAT_COUNT` bigint(7) NOT NULL, `REPEAT_INTERVAL` bigint(12) NOT NULL, `TIMES_TRIGGERED` bigint(10) NOT NULL, PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), CONSTRAINT `qrtz_simple_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; # Dump of table qrtz_simprop_triggers # ------------------------------------------------------------ DROP TABLE IF EXISTS `qrtz_simprop_triggers`; CREATE TABLE `qrtz_simprop_triggers` ( `SCHED_NAME` varchar(120) NOT NULL, `TRIGGER_NAME` varchar(200) NOT NULL, `TRIGGER_GROUP` varchar(200) NOT NULL, `STR_PROP_1` varchar(512) DEFAULT NULL, `STR_PROP_2` varchar(512) DEFAULT NULL, `STR_PROP_3` varchar(512) DEFAULT NULL, `INT_PROP_1` int(11) DEFAULT NULL, `INT_PROP_2` int(11) DEFAULT NULL, `LONG_PROP_1` bigint(20) DEFAULT NULL, `LONG_PROP_2` bigint(20) DEFAULT NULL, `DEC_PROP_1` decimal(13,4) DEFAULT NULL, `DEC_PROP_2` decimal(13,4) DEFAULT NULL, `BOOL_PROP_1` varchar(1) DEFAULT NULL, `BOOL_PROP_2` varchar(1) DEFAULT NULL, PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), CONSTRAINT `qrtz_simprop_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; # Dump of table qrtz_triggers # ------------------------------------------------------------ DROP TABLE IF EXISTS `qrtz_triggers`; CREATE TABLE `qrtz_triggers` ( `SCHED_NAME` varchar(120) NOT NULL, `TRIGGER_NAME` varchar(200) NOT NULL, `TRIGGER_GROUP` varchar(200) NOT NULL, `JOB_NAME` varchar(200) NOT NULL, `JOB_GROUP` varchar(200) NOT NULL, `DESCRIPTION` varchar(250) DEFAULT NULL, `NEXT_FIRE_TIME` bigint(13) DEFAULT NULL, `PREV_FIRE_TIME` bigint(13) DEFAULT NULL, `PRIORITY` int(11) DEFAULT NULL, `TRIGGER_STATE` varchar(16) NOT NULL, `TRIGGER_TYPE` varchar(8) NOT NULL, `START_TIME` bigint(13) NOT NULL, `END_TIME` bigint(13) DEFAULT NULL, `CALENDAR_NAME` varchar(200) DEFAULT NULL, `MISFIRE_INSTR` smallint(2) DEFAULT NULL, `JOB_DATA` blob, PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), KEY `IDX_QRTZ_T_J` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), KEY `IDX_QRTZ_T_JG` (`SCHED_NAME`,`JOB_GROUP`), KEY `IDX_QRTZ_T_C` (`SCHED_NAME`,`CALENDAR_NAME`), KEY `IDX_QRTZ_T_G` (`SCHED_NAME`,`TRIGGER_GROUP`), KEY `IDX_QRTZ_T_STATE` (`SCHED_NAME`,`TRIGGER_STATE`), KEY `IDX_QRTZ_T_N_STATE` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`), KEY `IDX_QRTZ_T_N_G_STATE` (`SCHED_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`), KEY `IDX_QRTZ_T_NEXT_FIRE_TIME` (`SCHED_NAME`,`NEXT_FIRE_TIME`), KEY `IDX_QRTZ_T_NFT_ST` (`SCHED_NAME`,`TRIGGER_STATE`,`NEXT_FIRE_TIME`), KEY `IDX_QRTZ_T_NFT_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`), KEY `IDX_QRTZ_T_NFT_ST_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_STATE`), KEY `IDX_QRTZ_T_NFT_ST_MISFIRE_GRP` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_GROUP`,`TRIGGER_STATE`), CONSTRAINT `qrtz_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) REFERENCES `qrtz_job_details` (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; LOCK TABLES `qrtz_triggers` WRITE; /*!40000 ALTER TABLE `qrtz_triggers` DISABLE KEYS */; INSERT INTO `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`, `JOB_NAME`, `JOB_GROUP`, `DESCRIPTION`, `NEXT_FIRE_TIME`, `PREV_FIRE_TIME`, `PRIORITY`, `TRIGGER_STATE`, `TRIGGER_TYPE`, `START_TIME`, `END_TIME`, `CALENDAR_NAME`, `MISFIRE_INSTR`, `JOB_DATA`) VALUES ('quartzScheduler','triggertest01','test','test01','test',NULL,1528944960000,1528944940000,5,'WAITING','CRON',1528944537000,0,NULL,0,''); /*!40000 ALTER TABLE `qrtz_triggers` ENABLE KEYS */; UNLOCK TABLES; # Dump of table jobs_monitor # ------------------------------------------------------------ DROP TABLE IF EXISTS `jobs_monitor`; CREATE TABLE `jobs_monitor` ( `job_id` int(20) NOT NULL AUTO_INCREMENT COMMENT '编号', `job_name` varchar(255) DEFAULT NULL COMMENT '任务名称', `bean_name` varchar(255) DEFAULT NULL COMMENT '类名', `method_name` varchar(255) DEFAULT NULL COMMENT '方法名', `params` varchar(255) DEFAULT NULL COMMENT '参数', `cron_expression` varchar(255) DEFAULT NULL COMMENT '表达式(频率)', `status` varchar(255) DEFAULT NULL COMMENT '任务状态(0:运行中,1:暂停,2:--,3:结束,4:异常)', `priority` int(255) DEFAULT NULL COMMENT '优先级(0:最低,1:中,2:高,3:最高)', `group` varchar(255) DEFAULT NULL COMMENT '分组', `upper_limit` int(20) DEFAULT NULL COMMENT '上限', `create_time` datetime DEFAULT NULL COMMENT '创建时间', `update_time` datetime DEFAULT NULL COMMENT '更新时间', `remark` varchar(255) DEFAULT NULL COMMENT '备注', `user_id` bigint(20) DEFAULT NULL COMMENT '客户标识', `rules_id` bigint(20) DEFAULT NULL COMMENT '规则集编号', `cycle_num` int(11) DEFAULT NULL COMMENT '周期数', PRIMARY KEY (`job_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; # Dump of table job_log_monitor # ------------------------------------------------------------ DROP TABLE IF EXISTS `job_log_monitor`; CREATE TABLE `job_log_monitor` ( `log_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务日志id', `job_id` bigint(20) NOT NULL COMMENT '任务id', `bean_name` varchar(200) DEFAULT NULL COMMENT 'spring bean名称', `method_name` varchar(100) DEFAULT NULL COMMENT '方法名', `params` varchar(2000) DEFAULT NULL COMMENT '参数', `status` tinyint(4) NOT NULL COMMENT '任务状态 0:成功 1:失败', `error` varchar(2000) DEFAULT NULL COMMENT '失败信息', `times` int(11) NOT NULL COMMENT '耗时(单位:毫秒)', `create_time` datetime DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`log_id`), KEY `job_id` (`job_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='定时任务日志'; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
70a3d855db82183dc6e4961df33256367e9127c3
SQL
Raparker88/daily-journal-server
/dailyjournal.sql
UTF-8
368
3.046875
3
[]
no_license
SELECT * FROM Entries; SELECT * FROM MOODS; SELECT e.id, e.date, e.entry, e.mood_id, m.label FROM entries e JOIN Moods m ON e.mood_id = m.id SELECT e.id, e.date, e.entry, e.mood_id, m.label FROM entries e JOIN Moods m ON e.mood_id = m.id WHERE e.entry LIKE '%a%' ALTER TABLE Entries ADD concepts DataType DEFAULT coding;
true
1dfd4ca4b0724168d6691e80f28210c9b415eca6
SQL
jinson7/QueriesSQL
/USFlights/SolutionQueriesSQL.sql
UTF-8
1,040
4.1875
4
[]
no_license
#1 SELECT count(*) as "Numbers of flights" FROM Flights; #2 SELECT Origin as "Origin airport", avg(ArrDelay) as "Average delay of arrival", avg(DepDelay) as "Average delay of exit" FROM Flights GROUP BY Origin; #3 SELECT Origin as "Origin airport", colYear as "Year", colMonth as "Month", "retard" FROM Flights GROUP BY Origin, colYear, colMonth ORDER BY Origin, colYear, colMonth; #4 SELECT a.Airport as "City", f.colYear as "Year", f.colMonth as "Month", "retard" FROM Flights f, USAirports a Where IATA = Origin GROUP BY a.Airport, f.colYear, f.colMonth ORDER BY a.Airport, f.colYear, f.colMonth #5 select UniqueCarrier as "Company", count(*) as "Nº flights canceled" from Flights where Cancelled = 1 group by UniqueCarrier order by 2 desc # SELECT UniqueCarrier as "Company", sum(Distance) as "Distance" FROM Flights Group by UniqueCarrier Order by 2 desc Limit 10 #7 SELECT UniqueCarrier as "Company", avg(DepDelay) as "Average delay of destination" FROM Flights Group by UniqueCarrier Having avg(DepDelay) > 10 Order by 2 asc
true
3bf4d2dee1105c2de12dcd1f91fa6b8a67282614
SQL
christinegaraudy/mvp
/server/db/schema.sql
UTF-8
263
2.796875
3
[]
no_license
DROP DATABASE IF EXISTS recipe_finder; CREATE DATABASE recipe_finder; USE recipe_finder; CREATE TABLE saved_recipes ( id int NOT NULL AUTO_INCREMENT, image varchar(8000), title varchar(250), PRIMARY KEY (id) ); -- mysql -u root < server/db/schema.sql
true
b4446a100f7554a13806a5725b9cc6192599cb91
SQL
natebecker11/bamazon
/bamazonSeed.sql
UTF-8
319
3.28125
3
[]
no_license
DROP DATABASE IF EXISTS bamazon; CREATE DATABASE bamazon; USE bamazon; CREATE TABLE products ( item_id INT NOT NULL AUTO_INCREMENT, product_name VARCHAR(40) NOT NULL, department_name VARCHAR(40), price DECIMAL(10,2) NOT NULL, stock_quantity INT NOT NULL, PRIMARY KEY (item_id) ); SELECT * FROM products;
true
31b83dfae8e5416f336c130a46b652747f42659d
SQL
Kasenovea/Webapplication_petshood
/Dbsql/service.sql
UTF-8
3,483
3.359375
3
[]
no_license
CREATE TABLE service ( id_s VARCHAR(5) ,UNIQUE (id_s), service_photo VARCHAR(100), service_name VARCHAR(50), service_description TEXT, image_1 VARCHAR(100), info_1 VARCHAR(100), image_2 VARCHAR(100), info_2 VARCHAR(100), image_3 VARCHAR(100), info_3 VARCHAR(100), other_info VARCHAR(200) ); INSERT INTO service(id_s, service_photo, service_name, service_description, image_1, info_1 , image_2, info_2, image_3, info_3, other_info) VALUES ('S_R', '../img/service RESCUE.jpg', 'Rescue' , 'Petshood fights against abandonment and mistreatment of animals. So if you happened to come across one of these situations your help can be crucial to save these pets. If you find a dog: after having ascertained the abandonment status of the animal, contact us immediately in the appropriate section If you find a cat: free cats can be part of a local feline colony, so we only welcome mistreated or injured domestic cats.', '../img/S_R1.jpg', 'Emergency calls. With just a simple call you can save a pet', '../img/S_R2.jpg', 'Immediate rescue. In maximum 20 minutes our volunteers will come', '../img/S_R3.jpg', 'Immediate adoption procedure. If you save a pet you can immediately adopt him', 'We help fight the abandonment of dogs and cats, sensibilizing people about the topic and rescuing pets from the street.'); INSERT INTO service(id_s, service_photo, service_name, service_description, image_1, info_1 , image_2, info_2, image_3, info_3, other_info) VALUES ('S_A', '../img/service ADOPTION.jpg', 'Adoption' , 'Petshood is the first site to offer the possibility to adopt your pet online, choosing it from different centers in the region, to have a wide choice that is always updated real-time. The adoption procedure starts online through our contact form and ends after a visit on site where the legal procedures will be completed and the pet will be prepared to leave the shelter. We can bring the pet to you in case you are unable to come and take it.', '../img/S_A1.jpg', 'Find your pet in advance. Choose between three different provinces', '../img/S_R1.jpg', 'Book a visit online. Book a visit to the pet before adoption', '../img/S_A3.jpg', 'Recive your pet at home. We can bring you the pet directly at home', 'We help dogs and cats to find a new house in which they can receive love and respect from their new family.'); /*PROBLEMA COOOOOONNN ' */ INSERT INTO service(id_s, service_photo, service_name, service_description, image_1, info_1 , image_2, info_2, image_3, info_3, other_info) VALUES ('S_P', '../img/service POSTADOPTION.jpg', 'Post Adoption' , 'If you adopt a pet from our kennels you will be able to talk to our expert veterinarians about your pet'' s problems and book free specialized visits with your favourite vet. We know your pet from the beginning and we will be able to find your ideal therapy. If the problem is of a more serious nature, however, you can take advantage of discounts in some partner veterinary clinics, namely the clinics ''Pethospital'' in Baggiovara and ''Ciuffodi pelo'' in Vignola.', '../img/S_P1.jpg', 'Free medical checkup. Speak with our experts about your pet'' s health', '../img/S_P2.jpg', 'Specialised visits. We can find the perfect therapy for you pet', '../img/S_P3.jpg', 'Partner clinics. In our partner clinics you can have discounts', 'We help fight the abandonment of dogs and cats, sensibilizing people about the topic and rescuing pets from the street.');
true
45d70ce66f63152864624b33ba45f5a959064ae6
SQL
m-stearns/workout-admin-application
/application/database/dmq.sql
UTF-8
6,258
3.71875
4
[]
no_license
---------------------USERS----------------------------- -- View USERS SELECT * FROM USERS; -- Search USERS SELECT * FROM USERS WHERE user_name = :user_name_input; -- Add USERS INSERT INTO USERS (user_name) VALUES (:user_name_input); -- Edit USERS UPDATE USERS SET user_name = :user_name_input WHERE user_id = :user_id_input; -- Delete USERS DELETE FROM USERS WHERE user_id = :user_id_input; --------------------END OF USERS---------------------------- ---------------------EQUIPMENTS----------------------------- -- View EQUIPMENTS SELECT * FROM EQUIPMENTS; -- Search EQUIPMENTS SELECT * FROM EQUIPMENTS WHERE equipment_name = :equipment_name_input; -- Add EQUIPMENTS INSERT INTO EQUIPMENTS (equipment_name) VALUES (:equipment_name_input); -- Edit EQUIPMENTS UPDATE EQUIPMENTS SET equipment_name = :equipment_name_input WHERE equipment_id = :equipment_id_input; -- Delete EQUIPMENTS DELETE FROM EQUIPMENTS WHERE equipment_id = :equipment_id_input; -----------------END OF EQUIPMENTS----------------------- ---------------------MUSCLES----------------------------- -- View MUSCLES SELECT * FROM MUSCLES; -- Search MUSCLES SELECT * FROM MUSCLES WHERE muscle_name = :muscle_name_input; -- Add MUSCLES INSERT INTO USERS ( muscle_name, muscle_group ) VALUES ( :muscle_name_input, (SELECT muscle_group_id FROM MUSCLE_GROUPS WHERE muscle_group_name=:muscle_group_name_input) ); -- Edit MUSCLES UPDATE MUSCLES SET muscle_name = :muscle_name_input, muscle_group = (SELECT muscle_group_id FROM MUSCLE_GROUPS WHERE muscle_group_name=:muscle_group_name_input) WHERE muscle_id = :muscle_id_input; -- Delete MUSCLES DELETE FROM MUSCLES WHERE muscle_id = :muscle_id_input; -----------------END OF MUSCLES----------------------- ---------------------EXERCISES----------------------------- -- View EXERCISES SELECT * FROM EXERCISES; -- Search EXERCISES SELECT * FROM EXERCISES WHERE exercise_name=:exercise_name_input; -- Add EXERCISES INSERT INTO EXERCISES ( exercise_name, weight, set_count, rep_count, equipment_required ) VALUES ( :exercise_name_input, :weight_input, :set_count_input, :rep_count_input, (SELECT equipment_id FROM EQUIPMENTS WHERE equipment_name=:equipment_name_input) ); -- Edit EXERCISES UPDATE EXERCISES SET exercise_name = :exercise_name_input, weight = :weight_input, set_count = :set_count_input, rep_count = :rep_count_input, equipment_required = (SELECT equipment_id FROM EQUIPMENTS WHERE equipment_name=:equipment_name_input) WHERE exercise_id = :exercise_id_input; -- Delete EXERCISES DELETE FROM EXERCISES WHERE exercise_id = :exercise_id_input; -----------------END OF EXERCISES----------------------- ---------------------MUSCLE_GROUPS----------------------------- -- View MUSCLE_GROUPS SELECT * FROM MUSCLE_GROUPS; -- Search MUSCLE_GROUPS SELECT * FROM MUSCLE_GROUPS WHERE muscle_group_name=:muscle_group_name_input; -- Add MUSCLE_GROUPS INSERT INTO MUSCLE_GROUPS (muscle_group_name) VALUES (:muscle_group_name_input); -- Edit MUSCLE_GROUPS UPDATE MUSCLE_GROUPS SET muscle_group_name = :muscle_group_name_input WHERE muscle_group_id = muscle_group_id_input; -----------------END OF EXERCISES----------------------- ---------------------USERS_MUSCLEGROUPS----------------------------- -- View USERS_MUSCLEGROUPS SELECT user_name, muscle_group_name FROM MUSCLE_GROUPS mg INNER JOIN USERS_MUSCLEGROUPS um ON mg.muscle_group_id = um.muscle_group_id INNER JOIN USERS ON um.user_id = USERS.user_id; -- Search USERS_MUSCLEGROUPS SELECT user_name, muscle_group_name FROM MUSCLE_GROUPS mg INNER JOIN USERS_MUSCLEGROUPS um ON mg.muscle_group_id = um.muscle_group_id INNER JOIN USERS ON um.user_id = USERS.user_id WHERE USERS.user_name = :user_name_input; -- add USERS_MUSCLEGROUPS INSERT INTO USERS_MUSCLEGROUPS (user_id, muscle_group_id) VALUES ( (SELECT user_id FROM USERS WHERE user_name=:user_name_input), (SELECT muscle_group_id FROM MUSCLE_GROUPS WHERE muscle_group_name=:muscle_group_name_input) ); -- Edit USERS_MUSCLEGROUPS UPDATE USERS_MUSCLEGROUPS SET user_id = (SELECT user_id FROM USERS WHERE user_name=:new_user_name_input), muscle_group_id = (SELECT muscle_group_id FROM MUSCLE_GROUPS WHERE muscle_group_id=:new_muscle_group_name_input) WHERE user_id = (SELECT user_id FROM USERS WHERE user_name=:old_user_name_input), muscle_group_id = (SELECT muscle_group_id FROM MUSCLE_GROUPS WHERE muscle_group_name=:old_muscle_group_name_input); ---------------------END OF USERS_MUSCLEGROUPS----------------------------- ---------------------MUSCLEGROUPS_EXERCISES----------------------------- -- View MUSCLEGROUPS_EXERCISES SELECT e.exercise_id, mg.muscle_group_id, muscle_group_name, exercise_name, weight, set_count, rep_count, eq.equipment_name FROM EQUIPMENTS eq RIGHT JOIN EXERCISES e ON eq.equipment_id = e.equipment_required INNER JOIN MUSCLEGROUPS_EXERCISES me ON e.exercise_id = me.exercise_id INNER JOIN MUSCLE_GROUPS mg ON me.muscle_group_id = mg.muscle_group_id; -- add MUSCLEGROUPS_EXERCISES INSERT INTO MUSCLEGROUPS_EXERCISES (muscle_group_id, exercise_id) VALUES ( (SELECT muscle_group_id FROM MUSCLE_GROUPS WHERE muscle_group_name=%s), ( SELECT exercise_id FROM EXERCISES WHERE exercise_name = %s AND weight = %s AND set_count = %s AND rep_count = %s ) ); ---------------------END OF MUSCLEGROUPS_EXERCISES----------------------------- ---------------------USERS_EXERCISES----------------------------- -- View USERS_EXERCISES SELECT u.user_id, e.exercise_id, user_name, exercise_name, weight, set_count, rep_count, eq.equipment_name FROM EQUIPMENTS eq RIGHT JOIN EXERCISES e ON eq.equipment_id = e.equipment_required INNER JOIN USERS_EXERCISES ue ON e.exercise_id = ue.exercise_id RIGHT JOIN USERS u ON ue.user_id = u.user_id; -- add USERS_EXERCISES INSERT INTO USERS_EXERCISES (user_id, exercise_id) VALUES ( (SELECT user_id FROM USERS WHERE user_name=%s), ( SELECT exercise_id FROM EXERCISES WHERE exercise_name = %s AND weight = %s AND set_count = %s AND rep_count = %s ) ); ---------------------END OF USERS_EXERCISES-----------------------------
true
58267b9b1bcd135f0df0febf6ec7242606efd007
SQL
dain1403/MYSQL
/SQL DML연습 2020-8-19.sql
UHC
2,315
3.578125
4
[]
no_license
SELECT TABLE_NAME FROM USER_TABLES; -- DML .. INSERT/UPDATE/DELETE DROP TABLE A_ENROL; CREATE TABLE A_ENROL AS SELECT * FROM ENROL WHERE STU_NO < 20150000; --INSERT INSERT INTO A_ENROL(SUB_NO, STU_NO, ENR_GRADE) -- VALUES (108, 20151062, 92); DESC A_ENROL; SELECT * FROM A_ENROL; INSERT INTO A_ENROL VALUES (111, 20153075, NULL); -- INSERT INTO A_ENROL(SUB_NO, STU_NO) VALUES (110, 20152088); --԰ SELECT * FROM A_ENROL; SELECT * FROM A_ENROL WHERE STU_NO LIKE '2015%'; INSERT INTO A_ENROL SELECT * FROM ENROL WHERE STU_NO LIKE '2015%'; SELECT * FROM A_ENROL; -- UPDATE UPDATE A_ENROL SET ENR_GRADE = ENR_GRADE + 5; SELECT * FROM A_ENROL; --ȣ 101 ؼ 5 ߰϶ UPDATE A_ENROL SET ENR_GRADE = ENR_GRADE + 5 WHERE SUB_NO = 101; -- ̸ ýۺм л ؼ 10 ÷ SELECT * FROM SUBJECT; SELECT * FROM A_ENROL; UPDATE A_ENROL SET ENR_GRADE = ENR_GRADE+10 WHERE SUB_NO = (SELECT SUB_NO FROM SUBJECT WHERE SUB_NAME = 'ýۺм'); -- DELETE DELETE FROM A_ENROL WHERE STU_NO = 20131001; SELECT * FROM A_ENROL; -- ̸ Ҽ ϴ л ̺(ENROL) DELETE FROM A_ENROL WHERE SUB_NO = (SELECT SUB_NO FROM SUBJECT WHERE SUB_NAME = 'Ҽ'); SELECT * FROM A_ENROL; DELETE FROM A_ENROL; SELECT * FROM A_ENROL; ROLLBACK; SELECT * FROM A_ENROL; -- TCL(TRANSACTION COUNTROL LANG,)__COMIT/ROLLBACK SELECT * FROM B_STUDENT; DELETE FROM B_STUDENT; SELECT * FROM B_STUDENT; ROLLBACK; SELECT * FROM B_STUDENT; CREATE TABLE C_STUDENT -- DDL ϰԵǸ ڵ COMMITϰ (STU_NO NUMBER, STT_ANE CHAR(10)); ROLLBACK; SELECT * FROM B_STUDENT; SELECT * FROM A_STUDENT; SELECT * FROM A_STUDENT; SELECT * FROM A_STUDENT; ROLLBACK; SELECT * FROM A_STUDENT; INSERT INTO A_STUDENT(STU_NO, STU_NAME) VALUES(10,'ȫ'); SELECT * FROM A_STUDENT; -- CMD SQLPLUS SCOTT/ Է --> ȫ ߰Ȱ COMMIT; -- CMD SQLPLUS SCOTT/ Է --> ȫ ߰Ȱ (COMMIT Ƿ)
true
ac9e99050f83b02009404973e2b6fa7bd1ad44c7
SQL
physikerwelt/mediawiki-extensions-MathSearch
/db/snippets/CosProd.sql
UTF-8
625
3.6875
4
[]
no_license
delimiter $$ CREATE DEFINER=`root`@`localhost` FUNCTION `CosProd`(IDA INT,IDB INT ) RETURNS decimal(20,10) READS SQL DATA DETERMINISTIC BEGIN -- Calculates the CosineSimilarity of two pages return ( SELECT SUM(CAST(LOG( a.`pagestat_featurecount`)* LOG(b.`pagestat_featurecount`) as DECIMAL(20,10)) /(LOG(varstat_featurecount)*LOG(varstat_featurecount)) )/(getNorm(IDA)* getNorm(IDB)) from mathpagestat as a, mathpagestat as b, mathvarstat as s WHERE (b.`pagestat_pageid`= IDA and a.`pagestat_pageid`=IDB and a.`pagestat_featureid`=b.`pagestat_featureid` and a.`pagestat_featureid`=s.varstat_id) ); END$$
true