├── .gitattributes ├── README.md ├── core ├── __init__.py ├── config.py ├── dataloader.py ├── oracle.py ├── plan.py └── sql.py ├── dataset ├── job_rs_test │ ├── 10a.sql │ ├── 10b.sql │ ├── 12b.sql │ ├── 15a.sql │ ├── 15b.sql │ ├── 15d.sql │ ├── 16a.sql │ ├── 17c.sql │ ├── 17e.sql │ ├── 20a.sql │ ├── 22b.sql │ ├── 22c.sql │ ├── 24b.sql │ ├── 26b.sql │ ├── 2a.sql │ ├── 30c.sql │ ├── 4b.sql │ ├── 4c.sql │ └── 8a.sql ├── job_rs_train │ ├── 10c.sql │ ├── 11a.sql │ ├── 11b.sql │ ├── 11c.sql │ ├── 11d.sql │ ├── 12a.sql │ ├── 12c.sql │ ├── 13a.sql │ ├── 13b.sql │ ├── 13c.sql │ ├── 13d.sql │ ├── 14a.sql │ ├── 14b.sql │ ├── 14c.sql │ ├── 15c.sql │ ├── 16b.sql │ ├── 16c.sql │ ├── 16d.sql │ ├── 17a.sql │ ├── 17b.sql │ ├── 17d.sql │ ├── 17f.sql │ ├── 18a.sql │ ├── 18b.sql │ ├── 18c.sql │ ├── 19a.sql │ ├── 19b.sql │ ├── 19c.sql │ ├── 19d.sql │ ├── 1a.sql │ ├── 1b.sql │ ├── 1c.sql │ ├── 1d.sql │ ├── 20b.sql │ ├── 20c.sql │ ├── 21a.sql │ ├── 21b.sql │ ├── 21c.sql │ ├── 22a.sql │ ├── 22d.sql │ ├── 23a.sql │ ├── 23b.sql │ ├── 23c.sql │ ├── 24a.sql │ ├── 25a.sql │ ├── 25b.sql │ ├── 25c.sql │ ├── 26a.sql │ ├── 26c.sql │ ├── 27a.sql │ ├── 27b.sql │ ├── 27c.sql │ ├── 28a.sql │ ├── 28b.sql │ ├── 28c.sql │ ├── 29a.sql │ ├── 29b.sql │ ├── 29c.sql │ ├── 2b.sql │ ├── 2c.sql │ ├── 2d.sql │ ├── 30a.sql │ ├── 30b.sql │ ├── 31a.sql │ ├── 31b.sql │ ├── 31c.sql │ ├── 32a.sql │ ├── 32b.sql │ ├── 33a.sql │ ├── 33b.sql │ ├── 33c.sql │ ├── 3a.sql │ ├── 3b.sql │ ├── 3c.sql │ ├── 4a.sql │ ├── 5a.sql │ ├── 5b.sql │ ├── 5c.sql │ ├── 6a.sql │ ├── 6b.sql │ ├── 6c.sql │ ├── 6d.sql │ ├── 6e.sql │ ├── 6f.sql │ ├── 7a.sql │ ├── 7b.sql │ ├── 7c.sql │ ├── 8b.sql │ ├── 8c.sql │ ├── 8d.sql │ ├── 9a.sql │ ├── 9b.sql │ ├── 9c.sql │ └── 9d.sql ├── stack_test │ ├── q12_0_ae8c54ce8fa00e0497293c791b8ce5c85932eb36.sql │ ├── q12_1_1349d223cd64d6506968a91e84881bb7069ef83a.sql │ ├── q12_2_062bfd2b89537ed5fe4a1a6b488860f4587e54ec.sql │ ├── q12_3_f919c1ec2117227e9821f0ad96a153017c381b56.sql │ ├── q12_4_75dd50f0d2debbbbc571ab068a7b97e2efeeb3fa.sql │ ├── q14_0_63c0776f1727638316b966fe748df7cc585a335b.sql │ ├── q14_1_242c393daaec760e4c1597c1bfa8c8f21dc8eb78.sql │ ├── q14_2_60e10e94f8356f019e90caff1adae7b3c7e7df82.sql │ ├── q14_3_6fa85fc0fe36ff6f4f7ce7ce340177ffd4f8ace0.sql │ ├── q14_4_03aae0b5a60091b040d0cb97d8bbd78d203b6a44.sql │ ├── q16_0_c5dbc1eb440ba3eef8f8c6ad6659d1c20071dfc7.sql │ ├── q16_1_469b915d6ca7078b4c66ea6256b8eb3d77305f9f.sql │ ├── q16_2_ab899cf3a1d5aad39faec3a8a48389e86cd0ba9d.sql │ ├── q16_3_e25cd79d91cb036a4b162831ca91ef70de7e3740.sql │ ├── q16_4_60adfa44cd3f671e1f74b162796cd659cb9630ac.sql │ ├── q1_0_q1-041.sql │ ├── q1_1_q1-033.sql │ ├── q1_2_q1-072.sql │ ├── q1_3_q1-047.sql │ ├── q1_4_q1-009.sql │ ├── q3_0_q3-033.sql │ ├── q3_1_q3-092.sql │ ├── q3_2_q3-066.sql │ ├── q3_3_q3-045.sql │ ├── q3_4_q3-001.sql │ ├── q5_0_q5-018.sql │ ├── q5_1_q5-068.sql │ ├── q5_2_q5-027.sql │ ├── q5_3_q5-040.sql │ └── q5_4_q5-091.sql ├── stack_train │ ├── q11_0_a84cb91ccd7a6c2bd4f38ced2a0df49948849e21.sql │ ├── q11_1_d3fdf44da765d88d29a55aef5bc5cf5d97ab5aef.sql │ ├── q11_2_559a64b2c4e6fcd9c711433d2185288d2d4303ee.sql │ ├── q11_3_d5c9aebf347912dfd826244e343b6b9511f33d4e.sql │ ├── q11_4_204dc01287c705f5fdd588018f093e6b073659f2.sql │ ├── q11_5_2575ddaf816205ab4435872765920b6ff59ad597.sql │ ├── q11_6_f71f0215d6829ec2e39e6515a33c419c20a9f642.sql │ ├── q11_7_8bb43790b2bf81db798b04a7d6b7cefcdd96e240.sql │ ├── q11_8_a88daa0afcca02d7ebdbecc54cd67e2168d2fa5b.sql │ ├── q11_9_3e63fbef0a479578fb1b4fe6a66d9005f596109c.sql │ ├── q13_0_a7198eec904f3d03894fde8fcad97130e642d911.sql │ ├── q13_1_c46b2b5b6c67a6232a95106bd7e978880bc77475.sql │ ├── q13_2_123d357c3f772b5789d3bed3a55d77aec3880688.sql │ ├── q13_3_9d20f1588787594f2c6c3421b5a333a9bc43e9e8.sql │ ├── q13_4_ff5e410ec196ad41bd5b411798e39b2161633758.sql │ ├── q13_5_b572fae184d6f465efbe8a596715c6c74719c506.sql │ ├── q13_6_669a925c1ab5686f4b3be5e1ff70b607f72be752.sql │ ├── q13_7_cde15099be3b677eed8fe1aa4cb628b668556243.sql │ ├── q13_8_35b038955e07f12ea1117f9f7b8472335c3aa811.sql │ ├── q13_9_855e3cb4d8ca6f07c274fe2977ece8c1951cb2ec.sql │ ├── q15_0_79130ecdd7c92d2c0f29b33f209d6fa9451509bf.sql │ ├── q15_1_98fe7330507572dcd0663718dca903bcf59c87d1.sql │ ├── q15_2_b583d08903c77c8b548313c8017e3ba03f3dd523.sql │ ├── q15_3_4caa94e7f0f1e7f417e775ba4fb75cd46c2877ca.sql │ ├── q15_4_48aad6b7203bb5b270fec3aaf0a5aefeae808299.sql │ ├── q15_5_ea190334aca0230232441265fa260567c29b4ad1.sql │ ├── q15_6_360faf75900ee44a03fb970084b3547366d1f8a8.sql │ ├── q15_7_1b8d35e74d6daeaa0cca3eea0342ea4deaf0bd06.sql │ ├── q15_8_306d928c23b64da23c2494ad41173e1b3ae3a4a5.sql │ ├── q15_9_bf779b1eb1869afd1a71cab77525b35f54163932.sql │ ├── q2_0_q2-006.sql │ ├── q2_1_q2-027.sql │ ├── q2_2_q2-095.sql │ ├── q2_3_q2-091.sql │ ├── q2_4_q2-004.sql │ ├── q2_5_q2-019.sql │ ├── q2_6_q2-080.sql │ ├── q2_7_q2-035.sql │ ├── q2_8_q2-002.sql │ ├── q2_9_q2-089.sql │ ├── q4_0_q4-057.sql │ ├── q4_1_q4-091.sql │ ├── q4_2_q4-022.sql │ ├── q4_3_q4-092.sql │ ├── q4_4_q4-003.sql │ ├── q4_5_q4-036.sql │ ├── q4_6_q4-059.sql │ ├── q4_7_q4-030.sql │ ├── q4_8_q4-025.sql │ ├── q4_9_q4-083.sql │ ├── q6_0_q6-016.sql │ ├── q6_1_q6-039.sql │ ├── q6_2_q6-091.sql │ ├── q6_3_q6-090.sql │ ├── q6_4_q6-050.sql │ ├── q6_5_q6-045.sql │ ├── q6_6_q6-084.sql │ ├── q6_7_q6-013.sql │ ├── q6_8_q6-060.sql │ ├── q6_9_q6-056.sql │ ├── q7_0_q7-030.sql │ ├── q7_1_q7-088.sql │ ├── q7_2_q7-063.sql │ ├── q7_3_q7-038.sql │ ├── q7_4_q7-083.sql │ ├── q7_5_q7-092.sql │ ├── q7_6_q7-016.sql │ ├── q7_7_q7-095.sql │ ├── q7_8_q7-018.sql │ ├── q7_9_q7-017.sql │ ├── q8_0_q8-062.sql │ ├── q8_1_q8-063.sql │ ├── q8_2_q8-021.sql │ ├── q8_3_q8-025.sql │ ├── q8_4_q8-050.sql │ ├── q8_5_q8-015.sql │ ├── q8_6_q8-073.sql │ ├── q8_7_q8-029.sql │ ├── q8_8_q8-071.sql │ └── q8_9_q8-087.sql ├── test │ ├── 10a.sql │ ├── 11a.sql │ ├── 12a.sql │ ├── 13a.sql │ ├── 14a.sql │ ├── 15a.sql │ ├── 16a.sql │ ├── 17a.sql │ ├── 18a.sql │ ├── 19a.sql │ ├── 1a.sql │ ├── 20a.sql │ ├── 21a.sql │ ├── 22a.sql │ ├── 23a.sql │ ├── 24a.sql │ ├── 25a.sql │ ├── 26a.sql │ ├── 27a.sql │ ├── 28a.sql │ ├── 29a.sql │ ├── 2a.sql │ ├── 30a.sql │ ├── 31a.sql │ ├── 32a.sql │ ├── 33a.sql │ ├── 3a.sql │ ├── 4a.sql │ ├── 5a.sql │ ├── 6a.sql │ ├── 7a.sql │ ├── 8a.sql │ └── 9a.sql ├── tpcds_test │ ├── query18_1.sql │ ├── query18_2.sql │ ├── query18_3.sql │ ├── query27_1.sql │ ├── query27_2.sql │ ├── query27_3.sql │ ├── query52_1.sql │ ├── query52_2.sql │ ├── query52_3.sql │ ├── query82_1.sql │ ├── query82_2.sql │ ├── query82_3.sql │ ├── query98_1.sql │ ├── query98_2.sql │ └── query98_3.sql ├── tpcds_train │ ├── query12_1.sql │ ├── query12_2.sql │ ├── query12_3.sql │ ├── query20_1.sql │ ├── query20_2.sql │ ├── query20_3.sql │ ├── query26_1.sql │ ├── query26_2.sql │ ├── query26_3.sql │ ├── query37_1.sql │ ├── query37_2.sql │ ├── query37_3.sql │ ├── query3_1.sql │ ├── query3_2.sql │ ├── query3_3.sql │ ├── query42_1.sql │ ├── query42_2.sql │ ├── query42_3.sql │ ├── query43_1.sql │ ├── query43_2.sql │ ├── query43_3.sql │ ├── query50_1.sql │ ├── query50_2.sql │ ├── query50_3.sql │ ├── query55_1.sql │ ├── query55_2.sql │ ├── query55_3.sql │ ├── query62_1.sql │ ├── query62_2.sql │ ├── query62_3.sql │ ├── query7_1.sql │ ├── query7_2.sql │ ├── query7_3.sql │ ├── query84_1.sql │ ├── query84_2.sql │ ├── query84_3.sql │ ├── query91_1.sql │ ├── query91_2.sql │ ├── query91_3.sql │ ├── query96_1.sql │ ├── query96_2.sql │ ├── query96_3.sql │ ├── query99_1.sql │ ├── query99_2.sql │ └── query99_3.sql └── train │ ├── 10b.sql │ ├── 10c.sql │ ├── 11b.sql │ ├── 11c.sql │ ├── 11d.sql │ ├── 12b.sql │ ├── 12c.sql │ ├── 13b.sql │ ├── 13c.sql │ ├── 13d.sql │ ├── 14b.sql │ ├── 14c.sql │ ├── 15b.sql │ ├── 15c.sql │ ├── 15d.sql │ ├── 16b.sql │ ├── 16c.sql │ ├── 16d.sql │ ├── 17b.sql │ ├── 17c.sql │ ├── 17d.sql │ ├── 17e.sql │ ├── 17f.sql │ ├── 18b.sql │ ├── 18c.sql │ ├── 19b.sql │ ├── 19c.sql │ ├── 19d.sql │ ├── 1b.sql │ ├── 1c.sql │ ├── 1d.sql │ ├── 20b.sql │ ├── 20c.sql │ ├── 21b.sql │ ├── 21c.sql │ ├── 22b.sql │ ├── 22c.sql │ ├── 22d.sql │ ├── 23b.sql │ ├── 23c.sql │ ├── 24b.sql │ ├── 25b.sql │ ├── 25c.sql │ ├── 26b.sql │ ├── 26c.sql │ ├── 27b.sql │ ├── 27c.sql │ ├── 28b.sql │ ├── 28c.sql │ ├── 29b.sql │ ├── 29c.sql │ ├── 2b.sql │ ├── 2c.sql │ ├── 2d.sql │ ├── 30b.sql │ ├── 30c.sql │ ├── 31b.sql │ ├── 31c.sql │ ├── 32b.sql │ ├── 33b.sql │ ├── 33c.sql │ ├── 3b.sql │ ├── 3c.sql │ ├── 4b.sql │ ├── 4c.sql │ ├── 5b.sql │ ├── 5c.sql │ ├── 6b.sql │ ├── 6c.sql │ ├── 6d.sql │ ├── 6e.sql │ ├── 6f.sql │ ├── 7b.sql │ ├── 7c.sql │ ├── 8b.sql │ ├── 8c.sql │ ├── 8d.sql │ ├── 9b.sql │ ├── 9c.sql │ └── 9d.sql ├── lib ├── __init__.py ├── _postgres.py ├── cache.py ├── filepath.py ├── iterator_utils.py ├── log.py ├── postgres.py ├── randomize.py └── timer.py ├── log └── this-is-an-empty-folder.txt ├── model ├── __init__.py ├── dqn.py ├── explorer.py ├── graph_transformer_layer.py ├── lstm.py ├── memory.py ├── step1.py └── step2.py ├── pretrained └── this-is-an-empty-folder.txt ├── psqlparse ├── __init__.py ├── exceptions.py ├── nodes │ ├── __init__.py │ ├── nodes.py │ ├── parsenodes.py │ ├── primnodes.py │ ├── utils.py │ └── value.py ├── parser.cpython-38-x86_64-linux-gnu.so └── parser.py ├── requirements.txt ├── sql └── this-is-an-empty-folder.txt ├── temps └── this-is-an-empty-folder.txt └── train.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /core/__init__.py: -------------------------------------------------------------------------------- 1 | from .config import Config 2 | from .sql import database, Sql, Baseline 3 | from .plan import Plan 4 | from .dataloader import * 5 | 6 | import torch as _torch 7 | 8 | class condition_grad(_torch.no_grad): 9 | def __init__(self, grad=False): 10 | super().__init__() 11 | self.grad = grad 12 | 13 | def __enter__(self): 14 | self.prev = torch.is_grad_enabled() 15 | torch.set_grad_enabled(self.grad) 16 | -------------------------------------------------------------------------------- /core/config.py: -------------------------------------------------------------------------------- 1 | class Config: 2 | feature_size = 64 3 | feature_length = 2 4 | feature_extra_length = 1 5 | 6 | validate_start = 0 7 | validate_interval = 4 8 | 9 | bushy = True 10 | 11 | batch_size = 128 12 | epochs = 200 13 | eval_mode = 100 14 | 15 | beam_width = 4 16 | memory_size = 4000 17 | 18 | sql_timeout_limit = 4 19 | resample_weight_cap = (0.5, 2) 20 | #resample_mode = 'replace' 21 | resample_mode = 'augment' 22 | resample_amount = 0 23 | 24 | use_hint = True 25 | 26 | def __init__(self, **kwargs): 27 | for k, v in kwargs.items(): 28 | setattr(self, k, v) 29 | -------------------------------------------------------------------------------- /dataset/job_rs_test/10a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(chn.name) AS uncredited_voiced_character, 2 | MIN(t.title) AS russian_movie 3 | FROM char_name AS chn, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | company_type AS ct, 7 | movie_companies AS mc, 8 | role_type AS rt, 9 | title AS t 10 | WHERE ci.note LIKE '%(voice)%' 11 | AND ci.note LIKE '%(uncredited)%' 12 | AND cn.country_code = '[ru]' 13 | AND rt.role = 'actor' 14 | AND t.production_year > 2005 15 | AND t.id = mc.movie_id 16 | AND t.id = ci.movie_id 17 | AND ci.movie_id = mc.movie_id 18 | AND chn.id = ci.person_role_id 19 | AND rt.id = ci.role_id 20 | AND cn.id = mc.company_id 21 | AND ct.id = mc.company_type_id; 22 | 23 | -------------------------------------------------------------------------------- /dataset/job_rs_test/10b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(chn.name) AS character, 2 | MIN(t.title) AS russian_mov_with_actor_producer 3 | FROM char_name AS chn, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | company_type AS ct, 7 | movie_companies AS mc, 8 | role_type AS rt, 9 | title AS t 10 | WHERE ci.note LIKE '%(producer)%' 11 | AND cn.country_code = '[ru]' 12 | AND rt.role = 'actor' 13 | AND t.production_year > 2010 14 | AND t.id = mc.movie_id 15 | AND t.id = ci.movie_id 16 | AND ci.movie_id = mc.movie_id 17 | AND chn.id = ci.person_role_id 18 | AND rt.id = ci.role_id 19 | AND cn.id = mc.company_id 20 | AND ct.id = mc.company_type_id; 21 | 22 | -------------------------------------------------------------------------------- /dataset/job_rs_test/12b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mi.info) AS budget, 2 | MIN(t.title) AS unsuccsessful_movie 3 | FROM company_name AS cn, 4 | company_type AS ct, 5 | info_type AS it1, 6 | info_type AS it2, 7 | movie_companies AS mc, 8 | movie_info AS mi, 9 | movie_info_idx AS mi_idx, 10 | title AS t 11 | WHERE cn.country_code ='[us]' 12 | AND ct.kind IS NOT NULL 13 | AND (ct.kind ='production companies' 14 | OR ct.kind = 'distributors') 15 | AND it1.info ='budget' 16 | AND it2.info ='bottom 10 rank' 17 | AND t.production_year >2000 18 | AND (t.title LIKE 'Birdemic%' 19 | OR t.title LIKE '%Movie%') 20 | AND t.id = mi.movie_id 21 | AND t.id = mi_idx.movie_id 22 | AND mi.info_type_id = it1.id 23 | AND mi_idx.info_type_id = it2.id 24 | AND t.id = mc.movie_id 25 | AND ct.id = mc.company_type_id 26 | AND cn.id = mc.company_id 27 | AND mc.movie_id = mi.movie_id 28 | AND mc.movie_id = mi_idx.movie_id 29 | AND mi.movie_id = mi_idx.movie_id; 30 | 31 | -------------------------------------------------------------------------------- /dataset/job_rs_test/15d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(at.title) AS aka_title, 2 | MIN(t.title) AS internet_movie_title 3 | FROM aka_title AS at, 4 | company_name AS cn, 5 | company_type AS ct, 6 | info_type AS it1, 7 | keyword AS k, 8 | movie_companies AS mc, 9 | movie_info AS mi, 10 | movie_keyword AS mk, 11 | title AS t 12 | WHERE cn.country_code = '[us]' 13 | AND it1.info = 'release dates' 14 | AND mi.note LIKE '%internet%' 15 | AND t.production_year > 1990 16 | AND t.id = at.movie_id 17 | AND t.id = mi.movie_id 18 | AND t.id = mk.movie_id 19 | AND t.id = mc.movie_id 20 | AND mk.movie_id = mi.movie_id 21 | AND mk.movie_id = mc.movie_id 22 | AND mk.movie_id = at.movie_id 23 | AND mi.movie_id = mc.movie_id 24 | AND mi.movie_id = at.movie_id 25 | AND mc.movie_id = at.movie_id 26 | AND k.id = mk.keyword_id 27 | AND it1.id = mi.info_type_id 28 | AND cn.id = mc.company_id 29 | AND ct.id = mc.company_type_id; 30 | 31 | -------------------------------------------------------------------------------- /dataset/job_rs_test/16a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an.name) AS cool_actor_pseudonym, 2 | MIN(t.title) AS series_named_after_char 3 | FROM aka_name AS an, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | keyword AS k, 7 | movie_companies AS mc, 8 | movie_keyword AS mk, 9 | name AS n, 10 | title AS t 11 | WHERE cn.country_code ='[us]' 12 | AND k.keyword ='character-name-in-title' 13 | AND t.episode_nr >= 50 14 | AND t.episode_nr < 100 15 | AND an.person_id = n.id 16 | AND n.id = ci.person_id 17 | AND ci.movie_id = t.id 18 | AND t.id = mk.movie_id 19 | AND mk.keyword_id = k.id 20 | AND t.id = mc.movie_id 21 | AND mc.company_id = cn.id 22 | AND an.person_id = ci.person_id 23 | AND ci.movie_id = mc.movie_id 24 | AND ci.movie_id = mk.movie_id 25 | AND mc.movie_id = mk.movie_id; 26 | 27 | -------------------------------------------------------------------------------- /dataset/job_rs_test/17c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(n.name) AS member_in_charnamed_movie, 2 | MIN(n.name) AS a1 3 | FROM cast_info AS ci, 4 | company_name AS cn, 5 | keyword AS k, 6 | movie_companies AS mc, 7 | movie_keyword AS mk, 8 | name AS n, 9 | title AS t 10 | WHERE k.keyword ='character-name-in-title' 11 | AND n.name LIKE 'X%' 12 | AND n.id = ci.person_id 13 | AND ci.movie_id = t.id 14 | AND t.id = mk.movie_id 15 | AND mk.keyword_id = k.id 16 | AND t.id = mc.movie_id 17 | AND mc.company_id = cn.id 18 | AND ci.movie_id = mc.movie_id 19 | AND ci.movie_id = mk.movie_id 20 | AND mc.movie_id = mk.movie_id; 21 | 22 | -------------------------------------------------------------------------------- /dataset/job_rs_test/17e.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(n.name) AS member_in_charnamed_movie 2 | FROM cast_info AS ci, 3 | company_name AS cn, 4 | keyword AS k, 5 | movie_companies AS mc, 6 | movie_keyword AS mk, 7 | name AS n, 8 | title AS t 9 | WHERE cn.country_code ='[us]' 10 | AND k.keyword ='character-name-in-title' 11 | AND n.id = ci.person_id 12 | AND ci.movie_id = t.id 13 | AND t.id = mk.movie_id 14 | AND mk.keyword_id = k.id 15 | AND t.id = mc.movie_id 16 | AND mc.company_id = cn.id 17 | AND ci.movie_id = mc.movie_id 18 | AND ci.movie_id = mk.movie_id 19 | AND mc.movie_id = mk.movie_id; 20 | 21 | -------------------------------------------------------------------------------- /dataset/job_rs_test/2a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS movie_title 2 | FROM company_name AS cn, 3 | keyword AS k, 4 | movie_companies AS mc, 5 | movie_keyword AS mk, 6 | title AS t 7 | WHERE cn.country_code ='[de]' 8 | AND k.keyword ='character-name-in-title' 9 | AND cn.id = mc.company_id 10 | AND mc.movie_id = t.id 11 | AND t.id = mk.movie_id 12 | AND mk.keyword_id = k.id 13 | AND mc.movie_id = mk.movie_id; 14 | 15 | -------------------------------------------------------------------------------- /dataset/job_rs_test/4b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mi_idx.info) AS rating, 2 | MIN(t.title) AS movie_title 3 | FROM info_type AS it, 4 | keyword AS k, 5 | movie_info_idx AS mi_idx, 6 | movie_keyword AS mk, 7 | title AS t 8 | WHERE it.info ='rating' 9 | AND k.keyword LIKE '%sequel%' 10 | AND mi_idx.info > '9.0' 11 | AND t.production_year > 2010 12 | AND t.id = mi_idx.movie_id 13 | AND t.id = mk.movie_id 14 | AND mk.movie_id = mi_idx.movie_id 15 | AND k.id = mk.keyword_id 16 | AND it.id = mi_idx.info_type_id; 17 | 18 | -------------------------------------------------------------------------------- /dataset/job_rs_test/4c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mi_idx.info) AS rating, 2 | MIN(t.title) AS movie_title 3 | FROM info_type AS it, 4 | keyword AS k, 5 | movie_info_idx AS mi_idx, 6 | movie_keyword AS mk, 7 | title AS t 8 | WHERE it.info ='rating' 9 | AND k.keyword LIKE '%sequel%' 10 | AND mi_idx.info > '2.0' 11 | AND t.production_year > 1990 12 | AND t.id = mi_idx.movie_id 13 | AND t.id = mk.movie_id 14 | AND mk.movie_id = mi_idx.movie_id 15 | AND k.id = mk.keyword_id 16 | AND it.id = mi_idx.info_type_id; 17 | 18 | -------------------------------------------------------------------------------- /dataset/job_rs_test/8a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an1.name) AS actress_pseudonym, 2 | MIN(t.title) AS japanese_movie_dubbed 3 | FROM aka_name AS an1, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | movie_companies AS mc, 7 | name AS n1, 8 | role_type AS rt, 9 | title AS t 10 | WHERE ci.note ='(voice: English version)' 11 | AND cn.country_code ='[jp]' 12 | AND mc.note LIKE '%(Japan)%' 13 | AND mc.note NOT LIKE '%(USA)%' 14 | AND n1.name LIKE '%Yo%' 15 | AND n1.name NOT LIKE '%Yu%' 16 | AND rt.role ='actress' 17 | AND an1.person_id = n1.id 18 | AND n1.id = ci.person_id 19 | AND ci.movie_id = t.id 20 | AND t.id = mc.movie_id 21 | AND mc.company_id = cn.id 22 | AND ci.role_id = rt.id 23 | AND an1.person_id = ci.person_id 24 | AND ci.movie_id = mc.movie_id; 25 | 26 | -------------------------------------------------------------------------------- /dataset/job_rs_train/10c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(chn.name) AS character, 2 | MIN(t.title) AS movie_with_american_producer 3 | FROM char_name AS chn, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | company_type AS ct, 7 | movie_companies AS mc, 8 | role_type AS rt, 9 | title AS t 10 | WHERE ci.note LIKE '%(producer)%' 11 | AND cn.country_code = '[us]' 12 | AND t.production_year > 1990 13 | AND t.id = mc.movie_id 14 | AND t.id = ci.movie_id 15 | AND ci.movie_id = mc.movie_id 16 | AND chn.id = ci.person_role_id 17 | AND rt.id = ci.role_id 18 | AND cn.id = mc.company_id 19 | AND ct.id = mc.company_type_id; 20 | -------------------------------------------------------------------------------- /dataset/job_rs_train/11a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(cn.name) AS from_company, 2 | MIN(lt.link) AS movie_link_type, 3 | MIN(t.title) AS non_polish_sequel_movie 4 | FROM company_name AS cn, 5 | company_type AS ct, 6 | keyword AS k, 7 | link_type AS lt, 8 | movie_companies AS mc, 9 | movie_keyword AS mk, 10 | movie_link AS ml, 11 | title AS t 12 | WHERE cn.country_code !='[pl]' 13 | AND (cn.name LIKE '%Film%' 14 | OR cn.name LIKE '%Warner%') 15 | AND ct.kind ='production companies' 16 | AND k.keyword ='sequel' 17 | AND lt.link LIKE '%follow%' 18 | AND mc.note IS NULL 19 | AND t.production_year BETWEEN 1950 AND 2000 20 | AND lt.id = ml.link_type_id 21 | AND ml.movie_id = t.id 22 | AND t.id = mk.movie_id 23 | AND mk.keyword_id = k.id 24 | AND t.id = mc.movie_id 25 | AND mc.company_type_id = ct.id 26 | AND mc.company_id = cn.id 27 | AND ml.movie_id = mk.movie_id 28 | AND ml.movie_id = mc.movie_id 29 | AND mk.movie_id = mc.movie_id; 30 | 31 | -------------------------------------------------------------------------------- /dataset/job_rs_train/11b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(cn.name) AS from_company, 2 | MIN(lt.link) AS movie_link_type, 3 | MIN(t.title) AS sequel_movie 4 | FROM company_name AS cn, 5 | company_type AS ct, 6 | keyword AS k, 7 | link_type AS lt, 8 | movie_companies AS mc, 9 | movie_keyword AS mk, 10 | movie_link AS ml, 11 | title AS t 12 | WHERE cn.country_code !='[pl]' 13 | AND (cn.name LIKE '%Film%' 14 | OR cn.name LIKE '%Warner%') 15 | AND ct.kind ='production companies' 16 | AND k.keyword ='sequel' 17 | AND lt.link LIKE '%follows%' 18 | AND mc.note IS NULL 19 | AND t.production_year = 1998 20 | AND t.title LIKE '%Money%' 21 | AND lt.id = ml.link_type_id 22 | AND ml.movie_id = t.id 23 | AND t.id = mk.movie_id 24 | AND mk.keyword_id = k.id 25 | AND t.id = mc.movie_id 26 | AND mc.company_type_id = ct.id 27 | AND mc.company_id = cn.id 28 | AND ml.movie_id = mk.movie_id 29 | AND ml.movie_id = mc.movie_id 30 | AND mk.movie_id = mc.movie_id; 31 | 32 | -------------------------------------------------------------------------------- /dataset/job_rs_train/11d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(cn.name) AS from_company, 2 | MIN(mc.note) AS production_note, 3 | MIN(t.title) AS movie_based_on_book 4 | FROM company_name AS cn, 5 | company_type AS ct, 6 | keyword AS k, 7 | link_type AS lt, 8 | movie_companies AS mc, 9 | movie_keyword AS mk, 10 | movie_link AS ml, 11 | title AS t 12 | WHERE cn.country_code !='[pl]' 13 | AND ct.kind != 'production companies' 14 | AND ct.kind IS NOT NULL 15 | AND k.keyword IN ('sequel', 16 | 'revenge', 17 | 'based-on-novel') 18 | AND mc.note IS NOT NULL 19 | AND t.production_year > 1950 20 | AND lt.id = ml.link_type_id 21 | AND ml.movie_id = t.id 22 | AND t.id = mk.movie_id 23 | AND mk.keyword_id = k.id 24 | AND t.id = mc.movie_id 25 | AND mc.company_type_id = ct.id 26 | AND mc.company_id = cn.id 27 | AND ml.movie_id = mk.movie_id 28 | AND ml.movie_id = mc.movie_id 29 | AND mk.movie_id = mc.movie_id; 30 | 31 | -------------------------------------------------------------------------------- /dataset/job_rs_train/12a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(cn.name) AS movie_company, 2 | MIN(mi_idx.info) AS rating, 3 | MIN(t.title) AS drama_horror_movie 4 | FROM company_name AS cn, 5 | company_type AS ct, 6 | info_type AS it1, 7 | info_type AS it2, 8 | movie_companies AS mc, 9 | movie_info AS mi, 10 | movie_info_idx AS mi_idx, 11 | title AS t 12 | WHERE cn.country_code = '[us]' 13 | AND ct.kind = 'production companies' 14 | AND it1.info = 'genres' 15 | AND it2.info = 'rating' 16 | AND mi.info IN ('Drama', 17 | 'Horror') 18 | AND mi_idx.info > '8.0' 19 | AND t.production_year BETWEEN 2005 AND 2008 20 | AND t.id = mi.movie_id 21 | AND t.id = mi_idx.movie_id 22 | AND mi.info_type_id = it1.id 23 | AND mi_idx.info_type_id = it2.id 24 | AND t.id = mc.movie_id 25 | AND ct.id = mc.company_type_id 26 | AND cn.id = mc.company_id 27 | AND mc.movie_id = mi.movie_id 28 | AND mc.movie_id = mi_idx.movie_id 29 | AND mi.movie_id = mi_idx.movie_id; 30 | 31 | -------------------------------------------------------------------------------- /dataset/job_rs_train/13a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mi.info) AS release_date, 2 | MIN(miidx.info) AS rating, 3 | MIN(t.title) AS german_movie 4 | FROM company_name AS cn, 5 | company_type AS ct, 6 | info_type AS it, 7 | info_type AS it2, 8 | kind_type AS kt, 9 | movie_companies AS mc, 10 | movie_info AS mi, 11 | movie_info_idx AS miidx, 12 | title AS t 13 | WHERE cn.country_code ='[de]' 14 | AND ct.kind ='production companies' 15 | AND it.info ='rating' 16 | AND it2.info ='release dates' 17 | AND kt.kind ='movie' 18 | AND mi.movie_id = t.id 19 | AND it2.id = mi.info_type_id 20 | AND kt.id = t.kind_id 21 | AND mc.movie_id = t.id 22 | AND cn.id = mc.company_id 23 | AND ct.id = mc.company_type_id 24 | AND miidx.movie_id = t.id 25 | AND it.id = miidx.info_type_id 26 | AND mi.movie_id = miidx.movie_id 27 | AND mi.movie_id = mc.movie_id 28 | AND miidx.movie_id = mc.movie_id; 29 | 30 | -------------------------------------------------------------------------------- /dataset/job_rs_train/13d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(cn.name) AS producing_company, 2 | MIN(miidx.info) AS rating, 3 | MIN(t.title) AS movie 4 | FROM company_name AS cn, 5 | company_type AS ct, 6 | info_type AS it, 7 | info_type AS it2, 8 | kind_type AS kt, 9 | movie_companies AS mc, 10 | movie_info AS mi, 11 | movie_info_idx AS miidx, 12 | title AS t 13 | WHERE cn.country_code ='[us]' 14 | AND ct.kind ='production companies' 15 | AND it.info ='rating' 16 | AND it2.info ='release dates' 17 | AND kt.kind ='movie' 18 | AND mi.movie_id = t.id 19 | AND it2.id = mi.info_type_id 20 | AND kt.id = t.kind_id 21 | AND mc.movie_id = t.id 22 | AND cn.id = mc.company_id 23 | AND ct.id = mc.company_type_id 24 | AND miidx.movie_id = t.id 25 | AND it.id = miidx.info_type_id 26 | AND mi.movie_id = miidx.movie_id 27 | AND mi.movie_id = mc.movie_id 28 | AND miidx.movie_id = mc.movie_id; 29 | 30 | -------------------------------------------------------------------------------- /dataset/job_rs_train/16b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an.name) AS cool_actor_pseudonym, 2 | MIN(t.title) AS series_named_after_char 3 | FROM aka_name AS an, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | keyword AS k, 7 | movie_companies AS mc, 8 | movie_keyword AS mk, 9 | name AS n, 10 | title AS t 11 | WHERE cn.country_code ='[us]' 12 | AND k.keyword ='character-name-in-title' 13 | AND an.person_id = n.id 14 | AND n.id = ci.person_id 15 | AND ci.movie_id = t.id 16 | AND t.id = mk.movie_id 17 | AND mk.keyword_id = k.id 18 | AND t.id = mc.movie_id 19 | AND mc.company_id = cn.id 20 | AND an.person_id = ci.person_id 21 | AND ci.movie_id = mc.movie_id 22 | AND ci.movie_id = mk.movie_id 23 | AND mc.movie_id = mk.movie_id; 24 | 25 | -------------------------------------------------------------------------------- /dataset/job_rs_train/16c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an.name) AS cool_actor_pseudonym, 2 | MIN(t.title) AS series_named_after_char 3 | FROM aka_name AS an, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | keyword AS k, 7 | movie_companies AS mc, 8 | movie_keyword AS mk, 9 | name AS n, 10 | title AS t 11 | WHERE cn.country_code ='[us]' 12 | AND k.keyword ='character-name-in-title' 13 | AND t.episode_nr < 100 14 | AND an.person_id = n.id 15 | AND n.id = ci.person_id 16 | AND ci.movie_id = t.id 17 | AND t.id = mk.movie_id 18 | AND mk.keyword_id = k.id 19 | AND t.id = mc.movie_id 20 | AND mc.company_id = cn.id 21 | AND an.person_id = ci.person_id 22 | AND ci.movie_id = mc.movie_id 23 | AND ci.movie_id = mk.movie_id 24 | AND mc.movie_id = mk.movie_id; 25 | 26 | -------------------------------------------------------------------------------- /dataset/job_rs_train/16d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an.name) AS cool_actor_pseudonym, 2 | MIN(t.title) AS series_named_after_char 3 | FROM aka_name AS an, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | keyword AS k, 7 | movie_companies AS mc, 8 | movie_keyword AS mk, 9 | name AS n, 10 | title AS t 11 | WHERE cn.country_code ='[us]' 12 | AND k.keyword ='character-name-in-title' 13 | AND t.episode_nr >= 5 14 | AND t.episode_nr < 100 15 | AND an.person_id = n.id 16 | AND n.id = ci.person_id 17 | AND ci.movie_id = t.id 18 | AND t.id = mk.movie_id 19 | AND mk.keyword_id = k.id 20 | AND t.id = mc.movie_id 21 | AND mc.company_id = cn.id 22 | AND an.person_id = ci.person_id 23 | AND ci.movie_id = mc.movie_id 24 | AND ci.movie_id = mk.movie_id 25 | AND mc.movie_id = mk.movie_id; 26 | 27 | -------------------------------------------------------------------------------- /dataset/job_rs_train/17a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(n.name) AS member_in_charnamed_american_movie, 2 | MIN(n.name) AS a1 3 | FROM cast_info AS ci, 4 | company_name AS cn, 5 | keyword AS k, 6 | movie_companies AS mc, 7 | movie_keyword AS mk, 8 | name AS n, 9 | title AS t 10 | WHERE cn.country_code ='[us]' 11 | AND k.keyword ='character-name-in-title' 12 | AND n.name LIKE 'B%' 13 | AND n.id = ci.person_id 14 | AND ci.movie_id = t.id 15 | AND t.id = mk.movie_id 16 | AND mk.keyword_id = k.id 17 | AND t.id = mc.movie_id 18 | AND mc.company_id = cn.id 19 | AND ci.movie_id = mc.movie_id 20 | AND ci.movie_id = mk.movie_id 21 | AND mc.movie_id = mk.movie_id; 22 | 23 | -------------------------------------------------------------------------------- /dataset/job_rs_train/17b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(n.name) AS member_in_charnamed_movie, 2 | MIN(n.name) AS a1 3 | FROM cast_info AS ci, 4 | company_name AS cn, 5 | keyword AS k, 6 | movie_companies AS mc, 7 | movie_keyword AS mk, 8 | name AS n, 9 | title AS t 10 | WHERE k.keyword ='character-name-in-title' 11 | AND n.name LIKE 'Z%' 12 | AND n.id = ci.person_id 13 | AND ci.movie_id = t.id 14 | AND t.id = mk.movie_id 15 | AND mk.keyword_id = k.id 16 | AND t.id = mc.movie_id 17 | AND mc.company_id = cn.id 18 | AND ci.movie_id = mc.movie_id 19 | AND ci.movie_id = mk.movie_id 20 | AND mc.movie_id = mk.movie_id; 21 | 22 | -------------------------------------------------------------------------------- /dataset/job_rs_train/17d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(n.name) AS member_in_charnamed_movie 2 | FROM cast_info AS ci, 3 | company_name AS cn, 4 | keyword AS k, 5 | movie_companies AS mc, 6 | movie_keyword AS mk, 7 | name AS n, 8 | title AS t 9 | WHERE k.keyword ='character-name-in-title' 10 | AND n.name LIKE '%Bert%' 11 | AND n.id = ci.person_id 12 | AND ci.movie_id = t.id 13 | AND t.id = mk.movie_id 14 | AND mk.keyword_id = k.id 15 | AND t.id = mc.movie_id 16 | AND mc.company_id = cn.id 17 | AND ci.movie_id = mc.movie_id 18 | AND ci.movie_id = mk.movie_id 19 | AND mc.movie_id = mk.movie_id; 20 | 21 | -------------------------------------------------------------------------------- /dataset/job_rs_train/17f.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(n.name) AS member_in_charnamed_movie 2 | FROM cast_info AS ci, 3 | company_name AS cn, 4 | keyword AS k, 5 | movie_companies AS mc, 6 | movie_keyword AS mk, 7 | name AS n, 8 | title AS t 9 | WHERE k.keyword ='character-name-in-title' 10 | AND n.name LIKE '%B%' 11 | AND n.id = ci.person_id 12 | AND ci.movie_id = t.id 13 | AND t.id = mk.movie_id 14 | AND mk.keyword_id = k.id 15 | AND t.id = mc.movie_id 16 | AND mc.company_id = cn.id 17 | AND ci.movie_id = mc.movie_id 18 | AND ci.movie_id = mk.movie_id 19 | AND mc.movie_id = mk.movie_id; 20 | 21 | -------------------------------------------------------------------------------- /dataset/job_rs_train/18a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mi.info) AS movie_budget, 2 | MIN(mi_idx.info) AS movie_votes, 3 | MIN(t.title) AS movie_title 4 | FROM cast_info AS ci, 5 | info_type AS it1, 6 | info_type AS it2, 7 | movie_info AS mi, 8 | movie_info_idx AS mi_idx, 9 | name AS n, 10 | title AS t 11 | WHERE ci.note IN ('(producer)', 12 | '(executive producer)') 13 | AND it1.info = 'budget' 14 | AND it2.info = 'votes' 15 | AND n.gender = 'm' 16 | AND n.name LIKE '%Tim%' 17 | AND t.id = mi.movie_id 18 | AND t.id = mi_idx.movie_id 19 | AND t.id = ci.movie_id 20 | AND ci.movie_id = mi.movie_id 21 | AND ci.movie_id = mi_idx.movie_id 22 | AND mi.movie_id = mi_idx.movie_id 23 | AND n.id = ci.person_id 24 | AND it1.id = mi.info_type_id 25 | AND it2.id = mi_idx.info_type_id; 26 | 27 | -------------------------------------------------------------------------------- /dataset/job_rs_train/1a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mc.note) AS production_note, 2 | MIN(t.title) AS movie_title, 3 | MIN(t.production_year) AS movie_year 4 | FROM company_type AS ct, 5 | info_type AS it, 6 | movie_companies AS mc, 7 | movie_info_idx AS mi_idx, 8 | title AS t 9 | WHERE ct.kind = 'production companies' 10 | AND it.info = 'top 250 rank' 11 | AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' 12 | AND (mc.note LIKE '%(co-production)%' 13 | OR mc.note LIKE '%(presents)%') 14 | AND ct.id = mc.company_type_id 15 | AND t.id = mc.movie_id 16 | AND t.id = mi_idx.movie_id 17 | AND mc.movie_id = mi_idx.movie_id 18 | AND it.id = mi_idx.info_type_id; 19 | 20 | -------------------------------------------------------------------------------- /dataset/job_rs_train/1b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mc.note) AS production_note, 2 | MIN(t.title) AS movie_title, 3 | MIN(t.production_year) AS movie_year 4 | FROM company_type AS ct, 5 | info_type AS it, 6 | movie_companies AS mc, 7 | movie_info_idx AS mi_idx, 8 | title AS t 9 | WHERE ct.kind = 'production companies' 10 | AND it.info = 'bottom 10 rank' 11 | AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' 12 | AND t.production_year BETWEEN 2005 AND 2010 13 | AND ct.id = mc.company_type_id 14 | AND t.id = mc.movie_id 15 | AND t.id = mi_idx.movie_id 16 | AND mc.movie_id = mi_idx.movie_id 17 | AND it.id = mi_idx.info_type_id; 18 | 19 | -------------------------------------------------------------------------------- /dataset/job_rs_train/1c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mc.note) AS production_note, 2 | MIN(t.title) AS movie_title, 3 | MIN(t.production_year) AS movie_year 4 | FROM company_type AS ct, 5 | info_type AS it, 6 | movie_companies AS mc, 7 | movie_info_idx AS mi_idx, 8 | title AS t 9 | WHERE ct.kind = 'production companies' 10 | AND it.info = 'top 250 rank' 11 | AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' 12 | AND (mc.note LIKE '%(co-production)%') 13 | AND t.production_year >2010 14 | AND ct.id = mc.company_type_id 15 | AND t.id = mc.movie_id 16 | AND t.id = mi_idx.movie_id 17 | AND mc.movie_id = mi_idx.movie_id 18 | AND it.id = mi_idx.info_type_id; 19 | 20 | -------------------------------------------------------------------------------- /dataset/job_rs_train/1d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mc.note) AS production_note, 2 | MIN(t.title) AS movie_title, 3 | MIN(t.production_year) AS movie_year 4 | FROM company_type AS ct, 5 | info_type AS it, 6 | movie_companies AS mc, 7 | movie_info_idx AS mi_idx, 8 | title AS t 9 | WHERE ct.kind = 'production companies' 10 | AND it.info = 'bottom 10 rank' 11 | AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' 12 | AND t.production_year >2000 13 | AND ct.id = mc.company_type_id 14 | AND t.id = mc.movie_id 15 | AND t.id = mi_idx.movie_id 16 | AND mc.movie_id = mi_idx.movie_id 17 | AND it.id = mi_idx.info_type_id; 18 | 19 | -------------------------------------------------------------------------------- /dataset/job_rs_train/2b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS movie_title 2 | FROM company_name AS cn, 3 | keyword AS k, 4 | movie_companies AS mc, 5 | movie_keyword AS mk, 6 | title AS t 7 | WHERE cn.country_code ='[nl]' 8 | AND k.keyword ='character-name-in-title' 9 | AND cn.id = mc.company_id 10 | AND mc.movie_id = t.id 11 | AND t.id = mk.movie_id 12 | AND mk.keyword_id = k.id 13 | AND mc.movie_id = mk.movie_id; 14 | 15 | -------------------------------------------------------------------------------- /dataset/job_rs_train/2c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS movie_title 2 | FROM company_name AS cn, 3 | keyword AS k, 4 | movie_companies AS mc, 5 | movie_keyword AS mk, 6 | title AS t 7 | WHERE cn.country_code ='[sm]' 8 | AND k.keyword ='character-name-in-title' 9 | AND cn.id = mc.company_id 10 | AND mc.movie_id = t.id 11 | AND t.id = mk.movie_id 12 | AND mk.keyword_id = k.id 13 | AND mc.movie_id = mk.movie_id; 14 | 15 | -------------------------------------------------------------------------------- /dataset/job_rs_train/2d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS movie_title 2 | FROM company_name AS cn, 3 | keyword AS k, 4 | movie_companies AS mc, 5 | movie_keyword AS mk, 6 | title AS t 7 | WHERE cn.country_code ='[us]' 8 | AND k.keyword ='character-name-in-title' 9 | AND cn.id = mc.company_id 10 | AND mc.movie_id = t.id 11 | AND t.id = mk.movie_id 12 | AND mk.keyword_id = k.id 13 | AND mc.movie_id = mk.movie_id; 14 | 15 | -------------------------------------------------------------------------------- /dataset/job_rs_train/32a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(lt.link) AS link_type, 2 | MIN(t1.title) AS first_movie, 3 | MIN(t2.title) AS second_movie 4 | FROM keyword AS k, 5 | link_type AS lt, 6 | movie_keyword AS mk, 7 | movie_link AS ml, 8 | title AS t1, 9 | title AS t2 10 | WHERE k.keyword ='10,000-mile-club' 11 | AND mk.keyword_id = k.id 12 | AND t1.id = mk.movie_id 13 | AND ml.movie_id = t1.id 14 | AND ml.linked_movie_id = t2.id 15 | AND lt.id = ml.link_type_id 16 | AND mk.movie_id = t1.id; 17 | 18 | -------------------------------------------------------------------------------- /dataset/job_rs_train/32b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(lt.link) AS link_type, 2 | MIN(t1.title) AS first_movie, 3 | MIN(t2.title) AS second_movie 4 | FROM keyword AS k, 5 | link_type AS lt, 6 | movie_keyword AS mk, 7 | movie_link AS ml, 8 | title AS t1, 9 | title AS t2 10 | WHERE k.keyword ='character-name-in-title' 11 | AND mk.keyword_id = k.id 12 | AND t1.id = mk.movie_id 13 | AND ml.movie_id = t1.id 14 | AND ml.linked_movie_id = t2.id 15 | AND lt.id = ml.link_type_id 16 | AND mk.movie_id = t1.id; 17 | 18 | -------------------------------------------------------------------------------- /dataset/job_rs_train/3a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS movie_title 2 | FROM keyword AS k, 3 | movie_info AS mi, 4 | movie_keyword AS mk, 5 | title AS t 6 | WHERE k.keyword LIKE '%sequel%' 7 | AND mi.info IN ('Sweden', 8 | 'Norway', 9 | 'Germany', 10 | 'Denmark', 11 | 'Swedish', 12 | 'Denish', 13 | 'Norwegian', 14 | 'German') 15 | AND t.production_year > 2005 16 | AND t.id = mi.movie_id 17 | AND t.id = mk.movie_id 18 | AND mk.movie_id = mi.movie_id 19 | AND k.id = mk.keyword_id; 20 | 21 | -------------------------------------------------------------------------------- /dataset/job_rs_train/3b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS movie_title 2 | FROM keyword AS k, 3 | movie_info AS mi, 4 | movie_keyword AS mk, 5 | title AS t 6 | WHERE k.keyword LIKE '%sequel%' 7 | AND mi.info IN ('Bulgaria') 8 | AND t.production_year > 2010 9 | AND t.id = mi.movie_id 10 | AND t.id = mk.movie_id 11 | AND mk.movie_id = mi.movie_id 12 | AND k.id = mk.keyword_id; 13 | 14 | -------------------------------------------------------------------------------- /dataset/job_rs_train/3c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS movie_title 2 | FROM keyword AS k, 3 | movie_info AS mi, 4 | movie_keyword AS mk, 5 | title AS t 6 | WHERE k.keyword LIKE '%sequel%' 7 | AND mi.info IN ('Sweden', 8 | 'Norway', 9 | 'Germany', 10 | 'Denmark', 11 | 'Swedish', 12 | 'Denish', 13 | 'Norwegian', 14 | 'German', 15 | 'USA', 16 | 'American') 17 | AND t.production_year > 1990 18 | AND t.id = mi.movie_id 19 | AND t.id = mk.movie_id 20 | AND mk.movie_id = mi.movie_id 21 | AND k.id = mk.keyword_id; 22 | 23 | -------------------------------------------------------------------------------- /dataset/job_rs_train/4a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mi_idx.info) AS rating, 2 | MIN(t.title) AS movie_title 3 | FROM info_type AS it, 4 | keyword AS k, 5 | movie_info_idx AS mi_idx, 6 | movie_keyword AS mk, 7 | title AS t 8 | WHERE it.info ='rating' 9 | AND k.keyword LIKE '%sequel%' 10 | AND mi_idx.info > '5.0' 11 | AND t.production_year > 2005 12 | AND t.id = mi_idx.movie_id 13 | AND t.id = mk.movie_id 14 | AND mk.movie_id = mi_idx.movie_id 15 | AND k.id = mk.keyword_id 16 | AND it.id = mi_idx.info_type_id; 17 | 18 | -------------------------------------------------------------------------------- /dataset/job_rs_train/5a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS typical_european_movie 2 | FROM company_type AS ct, 3 | info_type AS it, 4 | movie_companies AS mc, 5 | movie_info AS mi, 6 | title AS t 7 | WHERE ct.kind = 'production companies' 8 | AND mc.note LIKE '%(theatrical)%' 9 | AND mc.note LIKE '%(France)%' 10 | AND mi.info IN ('Sweden', 11 | 'Norway', 12 | 'Germany', 13 | 'Denmark', 14 | 'Swedish', 15 | 'Denish', 16 | 'Norwegian', 17 | 'German') 18 | AND t.production_year > 2005 19 | AND t.id = mi.movie_id 20 | AND t.id = mc.movie_id 21 | AND mc.movie_id = mi.movie_id 22 | AND ct.id = mc.company_type_id 23 | AND it.id = mi.info_type_id; 24 | 25 | -------------------------------------------------------------------------------- /dataset/job_rs_train/5b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS american_vhs_movie 2 | FROM company_type AS ct, 3 | info_type AS it, 4 | movie_companies AS mc, 5 | movie_info AS mi, 6 | title AS t 7 | WHERE ct.kind = 'production companies' 8 | AND mc.note LIKE '%(VHS)%' 9 | AND mc.note LIKE '%(USA)%' 10 | AND mc.note LIKE '%(1994)%' 11 | AND mi.info IN ('USA', 12 | 'America') 13 | AND t.production_year > 2010 14 | AND t.id = mi.movie_id 15 | AND t.id = mc.movie_id 16 | AND mc.movie_id = mi.movie_id 17 | AND ct.id = mc.company_type_id 18 | AND it.id = mi.info_type_id; 19 | 20 | -------------------------------------------------------------------------------- /dataset/job_rs_train/5c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS american_movie 2 | FROM company_type AS ct, 3 | info_type AS it, 4 | movie_companies AS mc, 5 | movie_info AS mi, 6 | title AS t 7 | WHERE ct.kind = 'production companies' 8 | AND mc.note NOT LIKE '%(TV)%' 9 | AND mc.note LIKE '%(USA)%' 10 | AND mi.info IN ('Sweden', 11 | 'Norway', 12 | 'Germany', 13 | 'Denmark', 14 | 'Swedish', 15 | 'Denish', 16 | 'Norwegian', 17 | 'German', 18 | 'USA', 19 | 'American') 20 | AND t.production_year > 1990 21 | AND t.id = mi.movie_id 22 | AND t.id = mc.movie_id 23 | AND mc.movie_id = mi.movie_id 24 | AND ct.id = mc.company_type_id 25 | AND it.id = mi.info_type_id; 26 | 27 | -------------------------------------------------------------------------------- /dataset/job_rs_train/6a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(k.keyword) AS movie_keyword, 2 | MIN(n.name) AS actor_name, 3 | MIN(t.title) AS marvel_movie 4 | FROM cast_info AS ci, 5 | keyword AS k, 6 | movie_keyword AS mk, 7 | name AS n, 8 | title AS t 9 | WHERE k.keyword = 'marvel-cinematic-universe' 10 | AND n.name LIKE '%Downey%Robert%' 11 | AND t.production_year > 2010 12 | AND k.id = mk.keyword_id 13 | AND t.id = mk.movie_id 14 | AND t.id = ci.movie_id 15 | AND ci.movie_id = mk.movie_id 16 | AND n.id = ci.person_id; 17 | 18 | -------------------------------------------------------------------------------- /dataset/job_rs_train/6b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(k.keyword) AS movie_keyword, 2 | MIN(n.name) AS actor_name, 3 | MIN(t.title) AS hero_movie 4 | FROM cast_info AS ci, 5 | keyword AS k, 6 | movie_keyword AS mk, 7 | name AS n, 8 | title AS t 9 | WHERE k.keyword IN ('superhero', 10 | 'sequel', 11 | 'second-part', 12 | 'marvel-comics', 13 | 'based-on-comic', 14 | 'tv-special', 15 | 'fight', 16 | 'violence') 17 | AND n.name LIKE '%Downey%Robert%' 18 | AND t.production_year > 2014 19 | AND k.id = mk.keyword_id 20 | AND t.id = mk.movie_id 21 | AND t.id = ci.movie_id 22 | AND ci.movie_id = mk.movie_id 23 | AND n.id = ci.person_id; 24 | 25 | -------------------------------------------------------------------------------- /dataset/job_rs_train/6c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(k.keyword) AS movie_keyword, 2 | MIN(n.name) AS actor_name, 3 | MIN(t.title) AS marvel_movie 4 | FROM cast_info AS ci, 5 | keyword AS k, 6 | movie_keyword AS mk, 7 | name AS n, 8 | title AS t 9 | WHERE k.keyword = 'marvel-cinematic-universe' 10 | AND n.name LIKE '%Downey%Robert%' 11 | AND t.production_year > 2014 12 | AND k.id = mk.keyword_id 13 | AND t.id = mk.movie_id 14 | AND t.id = ci.movie_id 15 | AND ci.movie_id = mk.movie_id 16 | AND n.id = ci.person_id; 17 | 18 | -------------------------------------------------------------------------------- /dataset/job_rs_train/6d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(k.keyword) AS movie_keyword, 2 | MIN(n.name) AS actor_name, 3 | MIN(t.title) AS hero_movie 4 | FROM cast_info AS ci, 5 | keyword AS k, 6 | movie_keyword AS mk, 7 | name AS n, 8 | title AS t 9 | WHERE k.keyword IN ('superhero', 10 | 'sequel', 11 | 'second-part', 12 | 'marvel-comics', 13 | 'based-on-comic', 14 | 'tv-special', 15 | 'fight', 16 | 'violence') 17 | AND n.name LIKE '%Downey%Robert%' 18 | AND t.production_year > 2000 19 | AND k.id = mk.keyword_id 20 | AND t.id = mk.movie_id 21 | AND t.id = ci.movie_id 22 | AND ci.movie_id = mk.movie_id 23 | AND n.id = ci.person_id; 24 | 25 | -------------------------------------------------------------------------------- /dataset/job_rs_train/6e.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(k.keyword) AS movie_keyword, 2 | MIN(n.name) AS actor_name, 3 | MIN(t.title) AS marvel_movie 4 | FROM cast_info AS ci, 5 | keyword AS k, 6 | movie_keyword AS mk, 7 | name AS n, 8 | title AS t 9 | WHERE k.keyword = 'marvel-cinematic-universe' 10 | AND n.name LIKE '%Downey%Robert%' 11 | AND t.production_year > 2000 12 | AND k.id = mk.keyword_id 13 | AND t.id = mk.movie_id 14 | AND t.id = ci.movie_id 15 | AND ci.movie_id = mk.movie_id 16 | AND n.id = ci.person_id; 17 | 18 | -------------------------------------------------------------------------------- /dataset/job_rs_train/6f.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(k.keyword) AS movie_keyword, 2 | MIN(n.name) AS actor_name, 3 | MIN(t.title) AS hero_movie 4 | FROM cast_info AS ci, 5 | keyword AS k, 6 | movie_keyword AS mk, 7 | name AS n, 8 | title AS t 9 | WHERE k.keyword IN ('superhero', 10 | 'sequel', 11 | 'second-part', 12 | 'marvel-comics', 13 | 'based-on-comic', 14 | 'tv-special', 15 | 'fight', 16 | 'violence') 17 | AND t.production_year > 2000 18 | AND k.id = mk.keyword_id 19 | AND t.id = mk.movie_id 20 | AND t.id = ci.movie_id 21 | AND ci.movie_id = mk.movie_id 22 | AND n.id = ci.person_id; 23 | 24 | -------------------------------------------------------------------------------- /dataset/job_rs_train/7a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(n.name) AS of_person, 2 | MIN(t.title) AS biography_movie 3 | FROM aka_name AS an, 4 | cast_info AS ci, 5 | info_type AS it, 6 | link_type AS lt, 7 | movie_link AS ml, 8 | name AS n, 9 | person_info AS pi, 10 | title AS t 11 | WHERE an.name LIKE '%a%' 12 | AND it.info ='mini biography' 13 | AND lt.link ='features' 14 | AND n.name_pcode_cf BETWEEN 'A' AND 'F' 15 | AND (n.gender='m' 16 | OR (n.gender = 'f' 17 | AND n.name LIKE 'B%')) 18 | AND pi.note ='Volker Boehm' 19 | AND t.production_year BETWEEN 1980 AND 1995 20 | AND n.id = an.person_id 21 | AND n.id = pi.person_id 22 | AND ci.person_id = n.id 23 | AND t.id = ci.movie_id 24 | AND ml.linked_movie_id = t.id 25 | AND lt.id = ml.link_type_id 26 | AND it.id = pi.info_type_id 27 | AND pi.person_id = an.person_id 28 | AND pi.person_id = ci.person_id 29 | AND an.person_id = ci.person_id 30 | AND ci.movie_id = ml.linked_movie_id; 31 | 32 | -------------------------------------------------------------------------------- /dataset/job_rs_train/7b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(n.name) AS of_person, 2 | MIN(t.title) AS biography_movie 3 | FROM aka_name AS an, 4 | cast_info AS ci, 5 | info_type AS it, 6 | link_type AS lt, 7 | movie_link AS ml, 8 | name AS n, 9 | person_info AS pi, 10 | title AS t 11 | WHERE an.name LIKE '%a%' 12 | AND it.info ='mini biography' 13 | AND lt.link ='features' 14 | AND n.name_pcode_cf LIKE 'D%' 15 | AND n.gender='m' 16 | AND pi.note ='Volker Boehm' 17 | AND t.production_year BETWEEN 1980 AND 1984 18 | AND n.id = an.person_id 19 | AND n.id = pi.person_id 20 | AND ci.person_id = n.id 21 | AND t.id = ci.movie_id 22 | AND ml.linked_movie_id = t.id 23 | AND lt.id = ml.link_type_id 24 | AND it.id = pi.info_type_id 25 | AND pi.person_id = an.person_id 26 | AND pi.person_id = ci.person_id 27 | AND an.person_id = ci.person_id 28 | AND ci.movie_id = ml.linked_movie_id; 29 | 30 | -------------------------------------------------------------------------------- /dataset/job_rs_train/8b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an.name) AS acress_pseudonym, 2 | MIN(t.title) AS japanese_anime_movie 3 | FROM aka_name AS an, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | movie_companies AS mc, 7 | name AS n, 8 | role_type AS rt, 9 | title AS t 10 | WHERE ci.note ='(voice: English version)' 11 | AND cn.country_code ='[jp]' 12 | AND mc.note LIKE '%(Japan)%' 13 | AND mc.note NOT LIKE '%(USA)%' 14 | AND (mc.note LIKE '%(2006)%' 15 | OR mc.note LIKE '%(2007)%') 16 | AND n.name LIKE '%Yo%' 17 | AND n.name NOT LIKE '%Yu%' 18 | AND rt.role ='actress' 19 | AND t.production_year BETWEEN 2006 AND 2007 20 | AND (t.title LIKE 'One Piece%' 21 | OR t.title LIKE 'Dragon Ball Z%') 22 | AND an.person_id = n.id 23 | AND n.id = ci.person_id 24 | AND ci.movie_id = t.id 25 | AND t.id = mc.movie_id 26 | AND mc.company_id = cn.id 27 | AND ci.role_id = rt.id 28 | AND an.person_id = ci.person_id 29 | AND ci.movie_id = mc.movie_id; 30 | 31 | -------------------------------------------------------------------------------- /dataset/job_rs_train/8c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(a1.name) AS writer_pseudo_name, 2 | MIN(t.title) AS movie_title 3 | FROM aka_name AS a1, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | movie_companies AS mc, 7 | name AS n1, 8 | role_type AS rt, 9 | title AS t 10 | WHERE cn.country_code ='[us]' 11 | AND rt.role ='writer' 12 | AND a1.person_id = n1.id 13 | AND n1.id = ci.person_id 14 | AND ci.movie_id = t.id 15 | AND t.id = mc.movie_id 16 | AND mc.company_id = cn.id 17 | AND ci.role_id = rt.id 18 | AND a1.person_id = ci.person_id 19 | AND ci.movie_id = mc.movie_id; 20 | 21 | -------------------------------------------------------------------------------- /dataset/job_rs_train/8d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an1.name) AS costume_designer_pseudo, 2 | MIN(t.title) AS movie_with_costumes 3 | FROM aka_name AS an1, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | movie_companies AS mc, 7 | name AS n1, 8 | role_type AS rt, 9 | title AS t 10 | WHERE cn.country_code ='[us]' 11 | AND rt.role ='costume designer' 12 | AND an1.person_id = n1.id 13 | AND n1.id = ci.person_id 14 | AND ci.movie_id = t.id 15 | AND t.id = mc.movie_id 16 | AND mc.company_id = cn.id 17 | AND ci.role_id = rt.id 18 | AND an1.person_id = ci.person_id 19 | AND ci.movie_id = mc.movie_id; 20 | 21 | -------------------------------------------------------------------------------- /dataset/job_rs_train/9b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an.name) AS alternative_name, 2 | MIN(chn.name) AS voiced_character, 3 | MIN(n.name) AS voicing_actress, 4 | MIN(t.title) AS american_movie 5 | FROM aka_name AS an, 6 | char_name AS chn, 7 | cast_info AS ci, 8 | company_name AS cn, 9 | movie_companies AS mc, 10 | name AS n, 11 | role_type AS rt, 12 | title AS t 13 | WHERE ci.note = '(voice)' 14 | AND cn.country_code ='[us]' 15 | AND mc.note LIKE '%(200%)%' 16 | AND (mc.note LIKE '%(USA)%' 17 | OR mc.note LIKE '%(worldwide)%') 18 | AND n.gender ='f' 19 | AND n.name LIKE '%Angel%' 20 | AND rt.role ='actress' 21 | AND t.production_year BETWEEN 2007 AND 2010 22 | AND ci.movie_id = t.id 23 | AND t.id = mc.movie_id 24 | AND ci.movie_id = mc.movie_id 25 | AND mc.company_id = cn.id 26 | AND ci.role_id = rt.id 27 | AND n.id = ci.person_id 28 | AND chn.id = ci.person_role_id 29 | AND an.person_id = n.id 30 | AND an.person_id = ci.person_id; 31 | 32 | -------------------------------------------------------------------------------- /dataset/job_rs_train/9c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an.name) AS alternative_name, 2 | MIN(chn.name) AS voiced_character_name, 3 | MIN(n.name) AS voicing_actress, 4 | MIN(t.title) AS american_movie 5 | FROM aka_name AS an, 6 | char_name AS chn, 7 | cast_info AS ci, 8 | company_name AS cn, 9 | movie_companies AS mc, 10 | name AS n, 11 | role_type AS rt, 12 | title AS t 13 | WHERE ci.note IN ('(voice)', 14 | '(voice: Japanese version)', 15 | '(voice) (uncredited)', 16 | '(voice: English version)') 17 | AND cn.country_code ='[us]' 18 | AND n.gender ='f' 19 | AND n.name LIKE '%An%' 20 | AND rt.role ='actress' 21 | AND ci.movie_id = t.id 22 | AND t.id = mc.movie_id 23 | AND ci.movie_id = mc.movie_id 24 | AND mc.company_id = cn.id 25 | AND ci.role_id = rt.id 26 | AND n.id = ci.person_id 27 | AND chn.id = ci.person_role_id 28 | AND an.person_id = n.id 29 | AND an.person_id = ci.person_id; 30 | 31 | -------------------------------------------------------------------------------- /dataset/job_rs_train/9d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an.name) AS alternative_name, 2 | MIN(chn.name) AS voiced_char_name, 3 | MIN(n.name) AS voicing_actress, 4 | MIN(t.title) AS american_movie 5 | FROM aka_name AS an, 6 | char_name AS chn, 7 | cast_info AS ci, 8 | company_name AS cn, 9 | movie_companies AS mc, 10 | name AS n, 11 | role_type AS rt, 12 | title AS t 13 | WHERE ci.note IN ('(voice)', 14 | '(voice: Japanese version)', 15 | '(voice) (uncredited)', 16 | '(voice: English version)') 17 | AND cn.country_code ='[us]' 18 | AND n.gender ='f' 19 | AND rt.role ='actress' 20 | AND ci.movie_id = t.id 21 | AND t.id = mc.movie_id 22 | AND ci.movie_id = mc.movie_id 23 | AND mc.company_id = cn.id 24 | AND ci.role_id = rt.id 25 | AND n.id = ci.person_id 26 | AND chn.id = ci.person_role_id 27 | AND an.person_id = n.id 28 | AND an.person_id = ci.person_id; 29 | 30 | -------------------------------------------------------------------------------- /dataset/stack_test/q12_0_ae8c54ce8fa00e0497293c791b8ce5c85932eb36.sql: -------------------------------------------------------------------------------- 1 | SELECT t1.name, count(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | question as q1, 6 | answer as a1, 7 | tag as t1, 8 | tag_question as tq1 9 | WHERE 10 | q1.owner_user_id = u1.id 11 | AND a1.question_id = q1.id 12 | AND a1.owner_user_id = u1.id 13 | AND s.site_id = q1.site_id 14 | AND s.site_id = a1.site_id 15 | AND s.site_id = u1.site_id 16 | AND s.site_id = tq1.site_id 17 | AND s.site_id = t1.site_id 18 | AND q1.id = tq1.question_id 19 | AND t1.id = tq1.tag_id 20 | AND (s.site_name in ('stackoverflow','superuser')) 21 | AND (t1.name in ('android','design-patterns','google-maps','hibernate','iphone','jquery','json','linux','mongodb','oracle','ruby','ruby-on-rails','spring','sql-server','xcode')) 22 | AND (q1.favorite_count >= 5) 23 | AND (q1.favorite_count <= 5000) 24 | AND (u1.reputation >= 0) 25 | AND (u1.reputation <= 10) 26 | GROUP BY t1.name -------------------------------------------------------------------------------- /dataset/stack_test/q12_1_1349d223cd64d6506968a91e84881bb7069ef83a.sql: -------------------------------------------------------------------------------- 1 | SELECT t1.name, count(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | question as q1, 6 | answer as a1, 7 | tag as t1, 8 | tag_question as tq1 9 | WHERE 10 | q1.owner_user_id = u1.id 11 | AND a1.question_id = q1.id 12 | AND a1.owner_user_id = u1.id 13 | AND s.site_id = q1.site_id 14 | AND s.site_id = a1.site_id 15 | AND s.site_id = u1.site_id 16 | AND s.site_id = tq1.site_id 17 | AND s.site_id = t1.site_id 18 | AND q1.id = tq1.question_id 19 | AND t1.id = tq1.tag_id 20 | AND (s.site_name in ('android','diy','money','security')) 21 | AND (t1.name in ('investing','privacy')) 22 | AND (q1.favorite_count >= 0) 23 | AND (q1.favorite_count <= 10000) 24 | AND (u1.reputation >= 10) 25 | AND (u1.reputation <= 100000) 26 | GROUP BY t1.name -------------------------------------------------------------------------------- /dataset/stack_test/q12_2_062bfd2b89537ed5fe4a1a6b488860f4587e54ec.sql: -------------------------------------------------------------------------------- 1 | SELECT t1.name, count(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | question as q1, 6 | answer as a1, 7 | tag as t1, 8 | tag_question as tq1 9 | WHERE 10 | q1.owner_user_id = u1.id 11 | AND a1.question_id = q1.id 12 | AND a1.owner_user_id = u1.id 13 | AND s.site_id = q1.site_id 14 | AND s.site_id = a1.site_id 15 | AND s.site_id = u1.site_id 16 | AND s.site_id = tq1.site_id 17 | AND s.site_id = t1.site_id 18 | AND q1.id = tq1.question_id 19 | AND t1.id = tq1.tag_id 20 | AND (s.site_name in ('es','gis','physics','stackoverflow')) 21 | AND (t1.name in ('android-layout','c++','file','image','numpy','visual-studio')) 22 | AND (q1.favorite_count >= 5) 23 | AND (q1.favorite_count <= 5000) 24 | AND (u1.downvotes >= 0) 25 | AND (u1.downvotes <= 10) 26 | GROUP BY t1.name -------------------------------------------------------------------------------- /dataset/stack_test/q12_3_f919c1ec2117227e9821f0ad96a153017c381b56.sql: -------------------------------------------------------------------------------- 1 | SELECT t1.name, count(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | question as q1, 6 | answer as a1, 7 | tag as t1, 8 | tag_question as tq1 9 | WHERE 10 | q1.owner_user_id = u1.id 11 | AND a1.question_id = q1.id 12 | AND a1.owner_user_id = u1.id 13 | AND s.site_id = q1.site_id 14 | AND s.site_id = a1.site_id 15 | AND s.site_id = u1.site_id 16 | AND s.site_id = tq1.site_id 17 | AND s.site_id = t1.site_id 18 | AND q1.id = tq1.question_id 19 | AND t1.id = tq1.tag_id 20 | AND (s.site_name in ('academia','android','gamedev','gaming')) 21 | AND (t1.name in ('3d','adb','career-path','conference','javascript','job-search','minecraft-pocket-edition','professors','ps3','shaders','terminology','united-states','writing')) 22 | AND (q1.view_count >= 100) 23 | AND (q1.view_count <= 100000) 24 | AND (u1.reputation >= 0) 25 | AND (u1.reputation <= 10) 26 | GROUP BY t1.name -------------------------------------------------------------------------------- /dataset/stack_test/q12_4_75dd50f0d2debbbbc571ab068a7b97e2efeeb3fa.sql: -------------------------------------------------------------------------------- 1 | SELECT t1.name, count(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | question as q1, 6 | answer as a1, 7 | tag as t1, 8 | tag_question as tq1 9 | WHERE 10 | q1.owner_user_id = u1.id 11 | AND a1.question_id = q1.id 12 | AND a1.owner_user_id = u1.id 13 | AND s.site_id = q1.site_id 14 | AND s.site_id = a1.site_id 15 | AND s.site_id = u1.site_id 16 | AND s.site_id = tq1.site_id 17 | AND s.site_id = t1.site_id 18 | AND q1.id = tq1.question_id 19 | AND t1.id = tq1.tag_id 20 | AND (s.site_name in ('stackoverflow')) 21 | AND (t1.name in ('actionlistener','automated-tests','ffmpeg','java.util.scanner','log4net','random','spring-cloud','umbraco','wcf','xcode6')) 22 | AND (q1.view_count >= 100) 23 | AND (q1.view_count <= 100000) 24 | AND (u1.reputation >= 0) 25 | AND (u1.reputation <= 10) 26 | GROUP BY t1.name -------------------------------------------------------------------------------- /dataset/stack_test/q14_0_63c0776f1727638316b966fe748df7cc585a335b.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | question as q1, 6 | answer as a1, 7 | tag as t1, 8 | tag_question as tq1, 9 | badge as b, 10 | account as acc 11 | WHERE 12 | s.site_id = q1.site_id 13 | AND s.site_id = u1.site_id 14 | AND s.site_id = a1.site_id 15 | AND s.site_id = t1.site_id 16 | AND s.site_id = tq1.site_id 17 | AND s.site_id = b.site_id 18 | AND q1.id = tq1.question_id 19 | AND q1.id = a1.question_id 20 | AND a1.owner_user_id = u1.id 21 | AND t1.id = tq1.tag_id 22 | AND b.user_id = u1.id 23 | AND acc.id = u1.account_id 24 | AND (s.site_name in ('rpg','softwareengineering')) 25 | AND (t1.name in ('architecture','c++','gm-techniques','object-oriented')) 26 | AND (q1.favorite_count >= 1) 27 | AND (q1.favorite_count <= 10) 28 | AND (u1.upvotes >= 0) 29 | AND (u1.upvotes <= 1) 30 | AND (b.name in ('Citizen Patrol','Famous Question','Necromancer','Nice Question','Peer Pressure','Tumbleweed','Yearling')) 31 | -------------------------------------------------------------------------------- /dataset/stack_test/q14_1_242c393daaec760e4c1597c1bfa8c8f21dc8eb78.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | question as q1, 6 | answer as a1, 7 | tag as t1, 8 | tag_question as tq1, 9 | badge as b, 10 | account as acc 11 | WHERE 12 | s.site_id = q1.site_id 13 | AND s.site_id = u1.site_id 14 | AND s.site_id = a1.site_id 15 | AND s.site_id = t1.site_id 16 | AND s.site_id = tq1.site_id 17 | AND s.site_id = b.site_id 18 | AND q1.id = tq1.question_id 19 | AND q1.id = a1.question_id 20 | AND a1.owner_user_id = u1.id 21 | AND t1.id = tq1.tag_id 22 | AND b.user_id = u1.id 23 | AND acc.id = u1.account_id 24 | AND (s.site_name in ('es')) 25 | AND (t1.name in ('android-studio','angularjs','array','asp.net','c++','json','laravel','laravel-5','python-3.x','sql-server')) 26 | AND (q1.view_count >= 100) 27 | AND (q1.view_count <= 100000) 28 | AND (u1.downvotes >= 0) 29 | AND (u1.downvotes <= 1) 30 | AND (b.name ILIKE '%tu%') 31 | -------------------------------------------------------------------------------- /dataset/stack_test/q14_2_60e10e94f8356f019e90caff1adae7b3c7e7df82.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | question as q1, 6 | answer as a1, 7 | tag as t1, 8 | tag_question as tq1, 9 | badge as b, 10 | account as acc 11 | WHERE 12 | s.site_id = q1.site_id 13 | AND s.site_id = u1.site_id 14 | AND s.site_id = a1.site_id 15 | AND s.site_id = t1.site_id 16 | AND s.site_id = tq1.site_id 17 | AND s.site_id = b.site_id 18 | AND q1.id = tq1.question_id 19 | AND q1.id = a1.question_id 20 | AND a1.owner_user_id = u1.id 21 | AND t1.id = tq1.tag_id 22 | AND b.user_id = u1.id 23 | AND acc.id = u1.account_id 24 | AND (s.site_name in ('stackoverflow','superuser')) 25 | AND (t1.name in ('amazon-ec2','babeljs','hyperledger-fabric','internationalization','laravel-5.2','lxml','memory','npm','oledb','selenium','touch')) 26 | AND (q1.view_count >= 10) 27 | AND (q1.view_count <= 1000) 28 | AND (u1.reputation >= 0) 29 | AND (u1.reputation <= 10) 30 | AND (b.name ILIKE '%scho%') 31 | -------------------------------------------------------------------------------- /dataset/stack_test/q14_3_6fa85fc0fe36ff6f4f7ce7ce340177ffd4f8ace0.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | question as q1, 6 | answer as a1, 7 | tag as t1, 8 | tag_question as tq1, 9 | badge as b, 10 | account as acc 11 | WHERE 12 | s.site_id = q1.site_id 13 | AND s.site_id = u1.site_id 14 | AND s.site_id = a1.site_id 15 | AND s.site_id = t1.site_id 16 | AND s.site_id = tq1.site_id 17 | AND s.site_id = b.site_id 18 | AND q1.id = tq1.question_id 19 | AND q1.id = a1.question_id 20 | AND a1.owner_user_id = u1.id 21 | AND t1.id = tq1.tag_id 22 | AND b.user_id = u1.id 23 | AND acc.id = u1.account_id 24 | AND (s.site_name in ('stackoverflow')) 25 | AND (t1.name in ('accessibility','apply','discord.js','gdb','httprequest','in-app-purchase','installation','ios7','key','mockito','size','unique')) 26 | AND (q1.view_count >= 0) 27 | AND (q1.view_count <= 100) 28 | AND (u1.reputation >= 0) 29 | AND (u1.reputation <= 100) 30 | AND (b.name ILIKE '%tu%') 31 | -------------------------------------------------------------------------------- /dataset/stack_test/q14_4_03aae0b5a60091b040d0cb97d8bbd78d203b6a44.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | question as q1, 6 | answer as a1, 7 | tag as t1, 8 | tag_question as tq1, 9 | badge as b, 10 | account as acc 11 | WHERE 12 | s.site_id = q1.site_id 13 | AND s.site_id = u1.site_id 14 | AND s.site_id = a1.site_id 15 | AND s.site_id = t1.site_id 16 | AND s.site_id = tq1.site_id 17 | AND s.site_id = b.site_id 18 | AND q1.id = tq1.question_id 19 | AND q1.id = a1.question_id 20 | AND a1.owner_user_id = u1.id 21 | AND t1.id = tq1.tag_id 22 | AND b.user_id = u1.id 23 | AND acc.id = u1.account_id 24 | AND (s.site_name in ('askubuntu','math')) 25 | AND (t1.name in ('discrete-mathematics','elementary-number-theory','ordinary-differential-equations','statistics','systems-of-equations','vectors')) 26 | AND (q1.view_count >= 0) 27 | AND (q1.view_count <= 100) 28 | AND (u1.downvotes >= 0) 29 | AND (u1.downvotes <= 1) 30 | AND (b.name ILIKE '%ste%') 31 | -------------------------------------------------------------------------------- /dataset/stack_test/q16_0_c5dbc1eb440ba3eef8f8c6ad6659d1c20071dfc7.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | tag as t1, 6 | tag_question as tq1, 7 | question as q1, 8 | badge as b1, 9 | account as acc 10 | WHERE 11 | s.site_id = u1.site_id 12 | AND s.site_id = b1.site_id 13 | AND s.site_id = t1.site_id 14 | AND s.site_id = tq1.site_id 15 | AND s.site_id = q1.site_id 16 | AND t1.id = tq1.tag_id 17 | AND q1.id = tq1.question_id 18 | AND q1.owner_user_id = u1.id 19 | AND acc.id = u1.account_id 20 | AND b1.user_id = u1.id 21 | AND (q1.score >= 0) 22 | AND (q1.score <= 1000) 23 | AND s.site_name = 'stackoverflow' 24 | AND (t1.name in ('android-external-storage','cups','django-validation','gemfire','jsessionid','minimax','multimedia','object-literal','pine-script','ticker','toplink')) 25 | AND (acc.website_url ILIKE ('%io')) 26 | -------------------------------------------------------------------------------- /dataset/stack_test/q16_1_469b915d6ca7078b4c66ea6256b8eb3d77305f9f.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | tag as t1, 6 | tag_question as tq1, 7 | question as q1, 8 | badge as b1, 9 | account as acc 10 | WHERE 11 | s.site_id = u1.site_id 12 | AND s.site_id = b1.site_id 13 | AND s.site_id = t1.site_id 14 | AND s.site_id = tq1.site_id 15 | AND s.site_id = q1.site_id 16 | AND t1.id = tq1.tag_id 17 | AND q1.id = tq1.question_id 18 | AND q1.owner_user_id = u1.id 19 | AND acc.id = u1.account_id 20 | AND b1.user_id = u1.id 21 | AND (q1.view_count >= 0) 22 | AND (q1.view_count <= 100) 23 | AND s.site_name = 'stackoverflow' 24 | AND (t1.name in ('ctypes','databricks','enumeration','http-get','nest','nsurlsession','onload','tic-tac-toe')) 25 | AND (acc.website_url ILIKE ('%com')) 26 | -------------------------------------------------------------------------------- /dataset/stack_test/q16_2_ab899cf3a1d5aad39faec3a8a48389e86cd0ba9d.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | tag as t1, 6 | tag_question as tq1, 7 | question as q1, 8 | badge as b1, 9 | account as acc 10 | WHERE 11 | s.site_id = u1.site_id 12 | AND s.site_id = b1.site_id 13 | AND s.site_id = t1.site_id 14 | AND s.site_id = tq1.site_id 15 | AND s.site_id = q1.site_id 16 | AND t1.id = tq1.tag_id 17 | AND q1.id = tq1.question_id 18 | AND q1.owner_user_id = u1.id 19 | AND acc.id = u1.account_id 20 | AND b1.user_id = u1.id 21 | AND (q1.score >= 0) 22 | AND (q1.score <= 1000) 23 | AND s.site_name = 'stackoverflow' 24 | AND (t1.name in ('contextmenu','fstream','implicit','ksh','link-to','master-pages','monitor','type-erasure')) 25 | AND (acc.website_url ILIKE ('%com')) 26 | -------------------------------------------------------------------------------- /dataset/stack_test/q16_3_e25cd79d91cb036a4b162831ca91ef70de7e3740.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | tag as t1, 6 | tag_question as tq1, 7 | question as q1, 8 | badge as b1, 9 | account as acc 10 | WHERE 11 | s.site_id = u1.site_id 12 | AND s.site_id = b1.site_id 13 | AND s.site_id = t1.site_id 14 | AND s.site_id = tq1.site_id 15 | AND s.site_id = q1.site_id 16 | AND t1.id = tq1.tag_id 17 | AND q1.id = tq1.question_id 18 | AND q1.owner_user_id = u1.id 19 | AND acc.id = u1.account_id 20 | AND b1.user_id = u1.id 21 | AND (q1.score >= 10) 22 | AND (q1.score <= 1000) 23 | AND s.site_name = 'stackoverflow' 24 | AND (t1.name in ('3d','clojure','cocoa-touch','docker-compose','g++','grails','html-table','keras','orm','service','spring','visual-studio-code')) 25 | AND (acc.website_url ILIKE ('%en')) 26 | -------------------------------------------------------------------------------- /dataset/stack_test/q16_4_60adfa44cd3f671e1f74b162796cd659cb9630ac.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | tag as t1, 6 | tag_question as tq1, 7 | question as q1, 8 | badge as b1, 9 | account as acc 10 | WHERE 11 | s.site_id = u1.site_id 12 | AND s.site_id = b1.site_id 13 | AND s.site_id = t1.site_id 14 | AND s.site_id = tq1.site_id 15 | AND s.site_id = q1.site_id 16 | AND t1.id = tq1.tag_id 17 | AND q1.id = tq1.question_id 18 | AND q1.owner_user_id = u1.id 19 | AND acc.id = u1.account_id 20 | AND b1.user_id = u1.id 21 | AND (q1.score >= 1) 22 | AND (q1.score <= 10) 23 | AND s.site_name = 'stackoverflow' 24 | AND (t1.name in ('kubernetes','laravel-routing','nslayoutconstraint','phpstorm','rtsp','xml')) 25 | AND (acc.website_url ILIKE ('%io')) 26 | -------------------------------------------------------------------------------- /dataset/stack_test/q1_0_q1-041.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(*) from tag, site, question, tag_question 3 | where 4 | site.site_name='islam' and 5 | tag.name='clothing' and 6 | tag.site_id = site.site_id and 7 | question.site_id = site.site_id and 8 | tag_question.site_id = site.site_id and 9 | tag_question.question_id = question.id and 10 | tag_question.tag_id = tag.id 11 | -------------------------------------------------------------------------------- /dataset/stack_test/q1_1_q1-033.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(*) from tag, site, question, tag_question 3 | where 4 | site.site_name='stackoverflow' and 5 | tag.name='colorize' and 6 | tag.site_id = site.site_id and 7 | question.site_id = site.site_id and 8 | tag_question.site_id = site.site_id and 9 | tag_question.question_id = question.id and 10 | tag_question.tag_id = tag.id 11 | -------------------------------------------------------------------------------- /dataset/stack_test/q1_2_q1-072.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(*) from tag, site, question, tag_question 3 | where 4 | site.site_name='askubuntu' and 5 | tag.name='drivers' and 6 | tag.site_id = site.site_id and 7 | question.site_id = site.site_id and 8 | tag_question.site_id = site.site_id and 9 | tag_question.question_id = question.id and 10 | tag_question.tag_id = tag.id 11 | -------------------------------------------------------------------------------- /dataset/stack_test/q1_3_q1-047.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(*) from tag, site, question, tag_question 3 | where 4 | site.site_name='tex' and 5 | tag.name='strings' and 6 | tag.site_id = site.site_id and 7 | question.site_id = site.site_id and 8 | tag_question.site_id = site.site_id and 9 | tag_question.question_id = question.id and 10 | tag_question.tag_id = tag.id 11 | -------------------------------------------------------------------------------- /dataset/stack_test/q1_4_q1-009.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(*) from tag, site, question, tag_question 3 | where 4 | site.site_name='raspberrypi' and 5 | tag.name='timekeeping' and 6 | tag.site_id = site.site_id and 7 | question.site_id = site.site_id and 8 | tag_question.site_id = site.site_id and 9 | tag_question.question_id = question.id and 10 | tag_question.tag_id = tag.id 11 | -------------------------------------------------------------------------------- /dataset/stack_test/q5_0_q5-018.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, comment c1, 5 | account 6 | where 7 | -- underappreciated (high votes, low views) questions with at least one comment 8 | s1.site_name='pets' and 9 | t1.name in ('diet', 'aquarium', 'training', 'fish', 'feeding', 'health', 'reptiles', 'toilet-training') and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | q1.owner_user_id = u1.id and 16 | q1.site_id = u1.site_id and 17 | q1.score > 6 and 18 | q1.view_count < 2896 and 19 | c1.site_id = q1.site_id and 20 | c1.post_id = q1.id and 21 | 22 | -- to get the display name 23 | account.id = u1.account_id; 24 | 25 | -------------------------------------------------------------------------------- /dataset/stack_test/q5_1_q5-068.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, comment c1, 5 | account 6 | where 7 | -- underappreciated (high votes, low views) questions with at least one comment 8 | s1.site_name='outdoors' and 9 | t1.name in ('united-states', 'survival', 'tents', 'mountaineering', 'camping', 'hiking', 'backpacking', 'climbing') and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | q1.owner_user_id = u1.id and 16 | q1.site_id = u1.site_id and 17 | q1.score > 13 and 18 | q1.view_count < 2451 and 19 | c1.site_id = q1.site_id and 20 | c1.post_id = q1.id and 21 | 22 | -- to get the display name 23 | account.id = u1.account_id; 24 | 25 | -------------------------------------------------------------------------------- /dataset/stack_test/q5_2_q5-027.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, comment c1, 5 | account 6 | where 7 | -- underappreciated (high votes, low views) questions with at least one comment 8 | s1.site_name='diy' and 9 | t1.name in ('dimmer-switch', 'framing', 'brick', 'junction-box', 'adhesive', 'kitchens', 'ceiling', '240v', 'central-heating', 'powertools') and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | q1.owner_user_id = u1.id and 16 | q1.site_id = u1.site_id and 17 | q1.score > 10 and 18 | q1.view_count < 1645 and 19 | c1.site_id = q1.site_id and 20 | c1.post_id = q1.id and 21 | 22 | -- to get the display name 23 | account.id = u1.account_id; 24 | 25 | -------------------------------------------------------------------------------- /dataset/stack_test/q5_3_q5-040.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, comment c1, 5 | account 6 | where 7 | -- underappreciated (high votes, low views) questions with at least one comment 8 | s1.site_name='opendata' and 9 | t1.name in ('data-request', 'government', 'api', 'medical', 'data.gov', 'usa', 'geospatial') and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | q1.owner_user_id = u1.id and 16 | q1.site_id = u1.site_id and 17 | q1.score > 14 and 18 | q1.view_count < 1667 and 19 | c1.site_id = q1.site_id and 20 | c1.post_id = q1.id and 21 | 22 | -- to get the display name 23 | account.id = u1.account_id; 24 | 25 | -------------------------------------------------------------------------------- /dataset/stack_test/q5_4_q5-091.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, comment c1, 5 | account 6 | where 7 | -- underappreciated (high votes, low views) questions with at least one comment 8 | s1.site_name='spanish' and 9 | t1.name in ('uso-de-palabras', 'expresiones', 'sintaxis') and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | q1.owner_user_id = u1.id and 16 | q1.site_id = u1.site_id and 17 | q1.score > 10 and 18 | q1.view_count < 2591 and 19 | c1.site_id = q1.site_id and 20 | c1.post_id = q1.id and 21 | 22 | -- to get the display name 23 | account.id = u1.account_id; 24 | 25 | -------------------------------------------------------------------------------- /dataset/stack_train/q11_0_a84cb91ccd7a6c2bd4f38ced2a0df49948849e21.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | tag as t, 4 | site as s, 5 | question as q, 6 | tag_question as tq 7 | WHERE 8 | t.site_id = s.site_id 9 | AND q.site_id = s.site_id 10 | AND tq.site_id = s.site_id 11 | AND tq.question_id = q.id 12 | AND tq.tag_id = t.id 13 | AND (s.site_name in ('stackoverflow')) 14 | AND (t.name in ('depth-first-search','google-search','imagick','min','shuffle')) 15 | AND (q.view_count >= 10) 16 | AND (q.view_count <= 1000) 17 | -------------------------------------------------------------------------------- /dataset/stack_train/q11_1_d3fdf44da765d88d29a55aef5bc5cf5d97ab5aef.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | tag as t, 4 | site as s, 5 | question as q, 6 | tag_question as tq 7 | WHERE 8 | t.site_id = s.site_id 9 | AND q.site_id = s.site_id 10 | AND tq.site_id = s.site_id 11 | AND tq.question_id = q.id 12 | AND tq.tag_id = t.id 13 | AND (s.site_name in ('math')) 14 | AND (t.name in ('algebraic-geometry','derivatives','integration')) 15 | AND (q.favorite_count >= 0) 16 | AND (q.favorite_count <= 1) 17 | -------------------------------------------------------------------------------- /dataset/stack_train/q11_2_559a64b2c4e6fcd9c711433d2185288d2d4303ee.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | tag as t, 4 | site as s, 5 | question as q, 6 | tag_question as tq 7 | WHERE 8 | t.site_id = s.site_id 9 | AND q.site_id = s.site_id 10 | AND tq.site_id = s.site_id 11 | AND tq.question_id = q.id 12 | AND tq.tag_id = t.id 13 | AND (s.site_name in ('stackoverflow')) 14 | AND (t.name in ('amazon-ec2','controls','jenkins','sql-server-ce','typeerror')) 15 | AND (q.view_count >= 10) 16 | AND (q.view_count <= 1000) 17 | -------------------------------------------------------------------------------- /dataset/stack_train/q11_3_d5c9aebf347912dfd826244e343b6b9511f33d4e.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | tag as t, 4 | site as s, 5 | question as q, 6 | tag_question as tq 7 | WHERE 8 | t.site_id = s.site_id 9 | AND q.site_id = s.site_id 10 | AND tq.site_id = s.site_id 11 | AND tq.question_id = q.id 12 | AND tq.tag_id = t.id 13 | AND (s.site_name in ('stackoverflow')) 14 | AND (t.name in ('angular-material','apache-spark-mllib','data-science','dax','go','quartz-scheduler','uiviewcontroller','viewmodel','websphere')) 15 | AND (q.score >= 0) 16 | AND (q.score <= 1000) 17 | -------------------------------------------------------------------------------- /dataset/stack_train/q11_4_204dc01287c705f5fdd588018f093e6b073659f2.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | tag as t, 4 | site as s, 5 | question as q, 6 | tag_question as tq 7 | WHERE 8 | t.site_id = s.site_id 9 | AND q.site_id = s.site_id 10 | AND tq.site_id = s.site_id 11 | AND tq.question_id = q.id 12 | AND tq.tag_id = t.id 13 | AND (s.site_name in ('blender')) 14 | AND (t.name in ('animation','cycles','materials','mesh','modeling','python','rendering','scripting')) 15 | AND (q.view_count >= 10) 16 | AND (q.view_count <= 1000) 17 | -------------------------------------------------------------------------------- /dataset/stack_train/q11_5_2575ddaf816205ab4435872765920b6ff59ad597.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | tag as t, 4 | site as s, 5 | question as q, 6 | tag_question as tq 7 | WHERE 8 | t.site_id = s.site_id 9 | AND q.site_id = s.site_id 10 | AND tq.site_id = s.site_id 11 | AND tq.question_id = q.id 12 | AND tq.tag_id = t.id 13 | AND (s.site_name in ('stackoverflow')) 14 | AND (t.name in ('alpha','amazon-route53','django-class-based-views','fixed','glm','kineticjs','member','scikit-image','smack','state-machine','tar','tfs2015','word','xul')) 15 | AND (q.score >= 0) 16 | AND (q.score <= 1000) 17 | -------------------------------------------------------------------------------- /dataset/stack_train/q11_6_f71f0215d6829ec2e39e6515a33c419c20a9f642.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | tag as t, 4 | site as s, 5 | question as q, 6 | tag_question as tq 7 | WHERE 8 | t.site_id = s.site_id 9 | AND q.site_id = s.site_id 10 | AND tq.site_id = s.site_id 11 | AND tq.question_id = q.id 12 | AND tq.tag_id = t.id 13 | AND (s.site_name in ('stackoverflow')) 14 | AND (t.name in ('cabal','deep-copy','filesystemwatcher','getter-setter','gunicorn','htmlunit','selenium-grid','shared','shortcode','streamwriter','text-processing','x509certificate')) 15 | AND (q.score >= 0) 16 | AND (q.score <= 1000) 17 | -------------------------------------------------------------------------------- /dataset/stack_train/q11_7_8bb43790b2bf81db798b04a7d6b7cefcdd96e240.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | tag as t, 4 | site as s, 5 | question as q, 6 | tag_question as tq 7 | WHERE 8 | t.site_id = s.site_id 9 | AND q.site_id = s.site_id 10 | AND tq.site_id = s.site_id 11 | AND tq.question_id = q.id 12 | AND tq.tag_id = t.id 13 | AND (s.site_name in ('security')) 14 | AND (t.name in ('certificates','encryption','hash','linux','malware','network','tls','web-application','windows')) 15 | AND (q.view_count >= 100) 16 | AND (q.view_count <= 100000) 17 | -------------------------------------------------------------------------------- /dataset/stack_train/q11_8_a88daa0afcca02d7ebdbecc54cd67e2168d2fa5b.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | tag as t, 4 | site as s, 5 | question as q, 6 | tag_question as tq 7 | WHERE 8 | t.site_id = s.site_id 9 | AND q.site_id = s.site_id 10 | AND tq.site_id = s.site_id 11 | AND tq.question_id = q.id 12 | AND tq.tag_id = t.id 13 | AND (s.site_name in ('stackoverflow')) 14 | AND (t.name in ('android-bluetooth','breakpoints','chatbot','core-animation','directive','publish-subscribe','pyinstaller','python-3.7','quotes','recaptcha','scenebuilder','string-comparison','userform')) 15 | AND (q.view_count >= 10) 16 | AND (q.view_count <= 1000) 17 | -------------------------------------------------------------------------------- /dataset/stack_train/q11_9_3e63fbef0a479578fb1b4fe6a66d9005f596109c.sql: -------------------------------------------------------------------------------- 1 | SELECT COUNT(*) 2 | FROM 3 | tag as t, 4 | site as s, 5 | question as q, 6 | tag_question as tq 7 | WHERE 8 | t.site_id = s.site_id 9 | AND q.site_id = s.site_id 10 | AND tq.site_id = s.site_id 11 | AND tq.question_id = q.id 12 | AND tq.tag_id = t.id 13 | AND (s.site_name in ('unix')) 14 | AND (t.name in ('compiling','configuration','email','environment-variables','hard-disk','io-redirection','kde','keyboard-shortcuts','network-interface','rename','system-installation','wildcards')) 15 | AND (q.score >= 0) 16 | AND (q.score <= 1000) 17 | -------------------------------------------------------------------------------- /dataset/stack_train/q13_9_855e3cb4d8ca6f07c274fe2977ece8c1951cb2ec.sql: -------------------------------------------------------------------------------- 1 | SELECT acc.location, count(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | question as q1, 6 | answer as a1, 7 | tag as t1, 8 | tag_question as tq1, 9 | badge as b, 10 | account as acc 11 | WHERE 12 | s.site_id = q1.site_id 13 | AND s.site_id = u1.site_id 14 | AND s.site_id = a1.site_id 15 | AND s.site_id = t1.site_id 16 | AND s.site_id = tq1.site_id 17 | AND s.site_id = b.site_id 18 | AND q1.id = tq1.question_id 19 | AND q1.id = a1.question_id 20 | AND a1.owner_user_id = u1.id 21 | AND t1.id = tq1.tag_id 22 | AND b.user_id = u1.id 23 | AND acc.id = u1.account_id 24 | AND (s.site_name in ('chemistry','cs','scifi')) 25 | AND (t1.name in ('books','story-identification')) 26 | AND (q1.view_count >= 10) 27 | AND (q1.view_count <= 1000) 28 | AND (u1.reputation >= 0) 29 | AND (u1.reputation <= 10) 30 | AND (b.name in ('Popular Question','Scholar','Teacher','Tumbleweed')) 31 | GROUP BY acc.location 32 | ORDER BY COUNT(*) 33 | DESC 34 | LIMIT 100 35 | -------------------------------------------------------------------------------- /dataset/stack_train/q15_0_79130ecdd7c92d2c0f29b33f209d6fa9451509bf.sql: -------------------------------------------------------------------------------- 1 | SELECT b1.name, count(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | tag as t1, 6 | tag_question as tq1, 7 | question as q1, 8 | badge as b1, 9 | account as acc 10 | WHERE 11 | s.site_id = u1.site_id 12 | AND s.site_id = b1.site_id 13 | AND s.site_id = t1.site_id 14 | AND s.site_id = tq1.site_id 15 | AND s.site_id = q1.site_id 16 | AND t1.id = tq1.tag_id 17 | AND q1.id = tq1.question_id 18 | AND q1.owner_user_id = u1.id 19 | AND acc.id = u1.account_id 20 | AND b1.user_id = u1.id 21 | AND (q1.score >= 1) 22 | AND (q1.score <= 10) 23 | AND (s.site_name in ('stackoverflow','superuser')) 24 | AND (t1.name in ('access-token','azure-cosmosdb','core-audio','ng-repeat','pic','qt4','sql-server-2014','switch-statement','winscp')) 25 | AND (acc.website_url ILIKE ('%de')) 26 | GROUP BY b1.name 27 | ORDER BY COUNT(*) 28 | DESC 29 | LIMIT 100 30 | -------------------------------------------------------------------------------- /dataset/stack_train/q15_1_98fe7330507572dcd0663718dca903bcf59c87d1.sql: -------------------------------------------------------------------------------- 1 | SELECT b1.name, count(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | tag as t1, 6 | tag_question as tq1, 7 | question as q1, 8 | badge as b1, 9 | account as acc 10 | WHERE 11 | s.site_id = u1.site_id 12 | AND s.site_id = b1.site_id 13 | AND s.site_id = t1.site_id 14 | AND s.site_id = tq1.site_id 15 | AND s.site_id = q1.site_id 16 | AND t1.id = tq1.tag_id 17 | AND q1.id = tq1.question_id 18 | AND q1.owner_user_id = u1.id 19 | AND acc.id = u1.account_id 20 | AND b1.user_id = u1.id 21 | AND (q1.view_count >= 100) 22 | AND (q1.view_count <= 100000) 23 | AND (s.site_name in ('serverfault','unix')) 24 | AND (t1.name in ('arm','certificate-authority','chown','disk-space-utilization','exchange-2013','ext3','failovercluster','fsck','gtk','netstat','nic','readline','ssh-tunnel','tail')) 25 | AND (acc.website_url ILIKE ('%io')) 26 | GROUP BY b1.name 27 | ORDER BY COUNT(*) 28 | DESC 29 | LIMIT 100 30 | -------------------------------------------------------------------------------- /dataset/stack_train/q15_2_b583d08903c77c8b548313c8017e3ba03f3dd523.sql: -------------------------------------------------------------------------------- 1 | SELECT b1.name, count(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | tag as t1, 6 | tag_question as tq1, 7 | question as q1, 8 | badge as b1, 9 | account as acc 10 | WHERE 11 | s.site_id = u1.site_id 12 | AND s.site_id = b1.site_id 13 | AND s.site_id = t1.site_id 14 | AND s.site_id = tq1.site_id 15 | AND s.site_id = q1.site_id 16 | AND t1.id = tq1.tag_id 17 | AND q1.id = tq1.question_id 18 | AND q1.owner_user_id = u1.id 19 | AND acc.id = u1.account_id 20 | AND b1.user_id = u1.id 21 | AND (q1.score >= 0) 22 | AND (q1.score <= 1000) 23 | AND (s.site_name in ('cs')) 24 | AND (t1.name in ('combinatorics','compilers','computational-geometry','formal-grammars','graph-theory','np','proof-techniques','pumping-lemma','regular-expressions','regular-languages','search-algorithms','sorting','time-complexity','trees','undecidability')) 25 | AND (acc.website_url ILIKE ('%org')) 26 | GROUP BY b1.name 27 | ORDER BY COUNT(*) 28 | DESC 29 | LIMIT 100 30 | -------------------------------------------------------------------------------- /dataset/stack_train/q15_3_4caa94e7f0f1e7f417e775ba4fb75cd46c2877ca.sql: -------------------------------------------------------------------------------- 1 | SELECT b1.name, count(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | tag as t1, 6 | tag_question as tq1, 7 | question as q1, 8 | badge as b1, 9 | account as acc 10 | WHERE 11 | s.site_id = u1.site_id 12 | AND s.site_id = b1.site_id 13 | AND s.site_id = t1.site_id 14 | AND s.site_id = tq1.site_id 15 | AND s.site_id = q1.site_id 16 | AND t1.id = tq1.tag_id 17 | AND q1.id = tq1.question_id 18 | AND q1.owner_user_id = u1.id 19 | AND acc.id = u1.account_id 20 | AND b1.user_id = u1.id 21 | AND (q1.favorite_count >= 0) 22 | AND (q1.favorite_count <= 1) 23 | AND (s.site_name in ('stats','superuser')) 24 | AND (t1.name in ('backup','binomial','cmd.exe','firefox','inference','microsoft-excel-2010','microsoft-office','multi-boot','optimization','panel-data','performance','random-forest','regression','repeated-measures','windows-xp')) 25 | AND (acc.website_url ILIKE ('%code%')) 26 | GROUP BY b1.name 27 | ORDER BY COUNT(*) 28 | DESC 29 | LIMIT 100 30 | -------------------------------------------------------------------------------- /dataset/stack_train/q15_4_48aad6b7203bb5b270fec3aaf0a5aefeae808299.sql: -------------------------------------------------------------------------------- 1 | SELECT b1.name, count(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | tag as t1, 6 | tag_question as tq1, 7 | question as q1, 8 | badge as b1, 9 | account as acc 10 | WHERE 11 | s.site_id = u1.site_id 12 | AND s.site_id = b1.site_id 13 | AND s.site_id = t1.site_id 14 | AND s.site_id = tq1.site_id 15 | AND s.site_id = q1.site_id 16 | AND t1.id = tq1.tag_id 17 | AND q1.id = tq1.question_id 18 | AND q1.owner_user_id = u1.id 19 | AND acc.id = u1.account_id 20 | AND b1.user_id = u1.id 21 | AND (q1.favorite_count >= 0) 22 | AND (q1.favorite_count <= 10000) 23 | AND (s.site_name in ('electronics')) 24 | AND (t1.name in ('analog','arduino','c','operational-amplifier','pcb','transformer','voltage')) 25 | AND (acc.website_url ILIKE ('%com')) 26 | GROUP BY b1.name 27 | ORDER BY COUNT(*) 28 | DESC 29 | LIMIT 100 30 | -------------------------------------------------------------------------------- /dataset/stack_train/q15_5_ea190334aca0230232441265fa260567c29b4ad1.sql: -------------------------------------------------------------------------------- 1 | SELECT b1.name, count(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | tag as t1, 6 | tag_question as tq1, 7 | question as q1, 8 | badge as b1, 9 | account as acc 10 | WHERE 11 | s.site_id = u1.site_id 12 | AND s.site_id = b1.site_id 13 | AND s.site_id = t1.site_id 14 | AND s.site_id = tq1.site_id 15 | AND s.site_id = q1.site_id 16 | AND t1.id = tq1.tag_id 17 | AND q1.id = tq1.question_id 18 | AND q1.owner_user_id = u1.id 19 | AND acc.id = u1.account_id 20 | AND b1.user_id = u1.id 21 | AND (q1.favorite_count >= 5) 22 | AND (q1.favorite_count <= 5000) 23 | AND (s.site_name in ('softwareengineering')) 24 | AND (t1.name in ('c#','design','design-patterns','java','programming-languages')) 25 | AND (acc.website_url ILIKE ('%com')) 26 | GROUP BY b1.name 27 | ORDER BY COUNT(*) 28 | DESC 29 | LIMIT 100 30 | -------------------------------------------------------------------------------- /dataset/stack_train/q15_6_360faf75900ee44a03fb970084b3547366d1f8a8.sql: -------------------------------------------------------------------------------- 1 | SELECT b1.name, count(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | tag as t1, 6 | tag_question as tq1, 7 | question as q1, 8 | badge as b1, 9 | account as acc 10 | WHERE 11 | s.site_id = u1.site_id 12 | AND s.site_id = b1.site_id 13 | AND s.site_id = t1.site_id 14 | AND s.site_id = tq1.site_id 15 | AND s.site_id = q1.site_id 16 | AND t1.id = tq1.tag_id 17 | AND q1.id = tq1.question_id 18 | AND q1.owner_user_id = u1.id 19 | AND acc.id = u1.account_id 20 | AND b1.user_id = u1.id 21 | AND (q1.view_count >= 100) 22 | AND (q1.view_count <= 100000) 23 | AND (s.site_name in ('blender','graphicdesign')) 24 | AND (t1.name in ('artboard','font-design','grids','logic-bricks','page-layout','selections','typefaces','uv-image-editor')) 25 | AND (acc.website_url ILIKE ('%en')) 26 | GROUP BY b1.name 27 | ORDER BY COUNT(*) 28 | DESC 29 | LIMIT 100 30 | -------------------------------------------------------------------------------- /dataset/stack_train/q15_7_1b8d35e74d6daeaa0cca3eea0342ea4deaf0bd06.sql: -------------------------------------------------------------------------------- 1 | SELECT b1.name, count(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | tag as t1, 6 | tag_question as tq1, 7 | question as q1, 8 | badge as b1, 9 | account as acc 10 | WHERE 11 | s.site_id = u1.site_id 12 | AND s.site_id = b1.site_id 13 | AND s.site_id = t1.site_id 14 | AND s.site_id = tq1.site_id 15 | AND s.site_id = q1.site_id 16 | AND t1.id = tq1.tag_id 17 | AND q1.id = tq1.question_id 18 | AND q1.owner_user_id = u1.id 19 | AND acc.id = u1.account_id 20 | AND b1.user_id = u1.id 21 | AND (q1.view_count >= 100) 22 | AND (q1.view_count <= 100000) 23 | AND (s.site_name in ('math')) 24 | AND (t1.name in ('combinations','education','elliptic-curves','factoring','game-theory','least-squares','lebesgue-integral','lebesgue-measure','manifolds','notation','random-variables','random-walk','residue-calculus','signal-processing','stochastic-integrals')) 25 | AND (acc.website_url ILIKE ('%org')) 26 | GROUP BY b1.name 27 | ORDER BY COUNT(*) 28 | DESC 29 | LIMIT 100 30 | -------------------------------------------------------------------------------- /dataset/stack_train/q15_8_306d928c23b64da23c2494ad41173e1b3ae3a4a5.sql: -------------------------------------------------------------------------------- 1 | SELECT b1.name, count(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | tag as t1, 6 | tag_question as tq1, 7 | question as q1, 8 | badge as b1, 9 | account as acc 10 | WHERE 11 | s.site_id = u1.site_id 12 | AND s.site_id = b1.site_id 13 | AND s.site_id = t1.site_id 14 | AND s.site_id = tq1.site_id 15 | AND s.site_id = q1.site_id 16 | AND t1.id = tq1.tag_id 17 | AND q1.id = tq1.question_id 18 | AND q1.owner_user_id = u1.id 19 | AND acc.id = u1.account_id 20 | AND b1.user_id = u1.id 21 | AND (q1.favorite_count >= 5) 22 | AND (q1.favorite_count <= 5000) 23 | AND (s.site_name in ('askubuntu','math')) 24 | AND (t1.name in ('abstract-algebra','category-theory','command-line','complex-analysis','differential-geometry','elementary-set-theory','functions','networking','probability','server')) 25 | AND (acc.website_url ILIKE ('%io')) 26 | GROUP BY b1.name 27 | ORDER BY COUNT(*) 28 | DESC 29 | LIMIT 100 30 | -------------------------------------------------------------------------------- /dataset/stack_train/q15_9_bf779b1eb1869afd1a71cab77525b35f54163932.sql: -------------------------------------------------------------------------------- 1 | SELECT b1.name, count(*) 2 | FROM 3 | site as s, 4 | so_user as u1, 5 | tag as t1, 6 | tag_question as tq1, 7 | question as q1, 8 | badge as b1, 9 | account as acc 10 | WHERE 11 | s.site_id = u1.site_id 12 | AND s.site_id = b1.site_id 13 | AND s.site_id = t1.site_id 14 | AND s.site_id = tq1.site_id 15 | AND s.site_id = q1.site_id 16 | AND t1.id = tq1.tag_id 17 | AND q1.id = tq1.question_id 18 | AND q1.owner_user_id = u1.id 19 | AND acc.id = u1.account_id 20 | AND b1.user_id = u1.id 21 | AND (q1.view_count >= 10) 22 | AND (q1.view_count <= 1000) 23 | AND (s.site_name in ('askubuntu')) 24 | AND (t1.name in ('android','gnome-shell','hard-drive','hdmi','home-directory','lightdm','live-usb','mac','mouse','proxy','shutdown','sound','uefi','usb','video')) 25 | AND (acc.website_url ILIKE ('%in')) 26 | GROUP BY b1.name 27 | ORDER BY COUNT(*) 28 | DESC 29 | LIMIT 100 30 | -------------------------------------------------------------------------------- /dataset/stack_train/q2_0_q2-006.sql: -------------------------------------------------------------------------------- 1 | 2 | select distinct account.display_name 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, 5 | tag t2, site s2, question q2, tag_question tq2, so_user u2, 6 | account 7 | where 8 | -- group theory askers 9 | s1.site_name='ru' and 10 | t1.name = 'php' and 11 | t1.site_id = s1.site_id and 12 | q1.site_id = s1.site_id and 13 | tq1.site_id = s1.site_id and 14 | tq1.question_id = q1.id and 15 | tq1.tag_id = t1.id and 16 | q1.owner_user_id = u1.id and 17 | q1.site_id = u1.site_id and 18 | 19 | -- D&D askers 20 | s2.site_name='stackoverflow' and 21 | t2.name = 'vb6' and 22 | t2.site_id = s2.site_id and 23 | q2.site_id = s2.site_id and 24 | tq2.site_id = s2.site_id and 25 | tq2.question_id = q2.id and 26 | tq2.tag_id = t2.id and 27 | q2.owner_user_id = u2.id and 28 | q2.site_id = u2.site_id and 29 | 30 | -- intersect 31 | u1.account_id = u2.account_id and 32 | account.id = u1.account_id; 33 | 34 | -------------------------------------------------------------------------------- /dataset/stack_train/q2_1_q2-027.sql: -------------------------------------------------------------------------------- 1 | 2 | select distinct account.display_name 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, 5 | tag t2, site s2, question q2, tag_question tq2, so_user u2, 6 | account 7 | where 8 | -- group theory askers 9 | s1.site_name='gis' and 10 | t1.name = 'python' and 11 | t1.site_id = s1.site_id and 12 | q1.site_id = s1.site_id and 13 | tq1.site_id = s1.site_id and 14 | tq1.question_id = q1.id and 15 | tq1.tag_id = t1.id and 16 | q1.owner_user_id = u1.id and 17 | q1.site_id = u1.site_id and 18 | 19 | -- D&D askers 20 | s2.site_name='stackoverflow' and 21 | t2.name = 'plugins' and 22 | t2.site_id = s2.site_id and 23 | q2.site_id = s2.site_id and 24 | tq2.site_id = s2.site_id and 25 | tq2.question_id = q2.id and 26 | tq2.tag_id = t2.id and 27 | q2.owner_user_id = u2.id and 28 | q2.site_id = u2.site_id and 29 | 30 | -- intersect 31 | u1.account_id = u2.account_id and 32 | account.id = u1.account_id; 33 | 34 | -------------------------------------------------------------------------------- /dataset/stack_train/q2_2_q2-095.sql: -------------------------------------------------------------------------------- 1 | 2 | select distinct account.display_name 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, 5 | tag t2, site s2, question q2, tag_question tq2, so_user u2, 6 | account 7 | where 8 | -- group theory askers 9 | s1.site_name='stackoverflow' and 10 | t1.name = 'fonts' and 11 | t1.site_id = s1.site_id and 12 | q1.site_id = s1.site_id and 13 | tq1.site_id = s1.site_id and 14 | tq1.question_id = q1.id and 15 | tq1.tag_id = t1.id and 16 | q1.owner_user_id = u1.id and 17 | q1.site_id = u1.site_id and 18 | 19 | -- D&D askers 20 | s2.site_name='stats' and 21 | t2.name = 'machine-learning' and 22 | t2.site_id = s2.site_id and 23 | q2.site_id = s2.site_id and 24 | tq2.site_id = s2.site_id and 25 | tq2.question_id = q2.id and 26 | tq2.tag_id = t2.id and 27 | q2.owner_user_id = u2.id and 28 | q2.site_id = u2.site_id and 29 | 30 | -- intersect 31 | u1.account_id = u2.account_id and 32 | account.id = u1.account_id; 33 | 34 | -------------------------------------------------------------------------------- /dataset/stack_train/q2_3_q2-091.sql: -------------------------------------------------------------------------------- 1 | 2 | select distinct account.display_name 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, 5 | tag t2, site s2, question q2, tag_question tq2, so_user u2, 6 | account 7 | where 8 | -- group theory askers 9 | s1.site_name='pt' and 10 | t1.name = 'java' and 11 | t1.site_id = s1.site_id and 12 | q1.site_id = s1.site_id and 13 | tq1.site_id = s1.site_id and 14 | tq1.question_id = q1.id and 15 | tq1.tag_id = t1.id and 16 | q1.owner_user_id = u1.id and 17 | q1.site_id = u1.site_id and 18 | 19 | -- D&D askers 20 | s2.site_name='stackoverflow' and 21 | t2.name = 'entity-framework' and 22 | t2.site_id = s2.site_id and 23 | q2.site_id = s2.site_id and 24 | tq2.site_id = s2.site_id and 25 | tq2.question_id = q2.id and 26 | tq2.tag_id = t2.id and 27 | q2.owner_user_id = u2.id and 28 | q2.site_id = u2.site_id and 29 | 30 | -- intersect 31 | u1.account_id = u2.account_id and 32 | account.id = u1.account_id; 33 | 34 | -------------------------------------------------------------------------------- /dataset/stack_train/q2_4_q2-004.sql: -------------------------------------------------------------------------------- 1 | 2 | select distinct account.display_name 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, 5 | tag t2, site s2, question q2, tag_question tq2, so_user u2, 6 | account 7 | where 8 | -- group theory askers 9 | s1.site_name='stats' and 10 | t1.name = 'machine-learning' and 11 | t1.site_id = s1.site_id and 12 | q1.site_id = s1.site_id and 13 | tq1.site_id = s1.site_id and 14 | tq1.question_id = q1.id and 15 | tq1.tag_id = t1.id and 16 | q1.owner_user_id = u1.id and 17 | q1.site_id = u1.site_id and 18 | 19 | -- D&D askers 20 | s2.site_name='stackoverflow' and 21 | t2.name = 'heroku' and 22 | t2.site_id = s2.site_id and 23 | q2.site_id = s2.site_id and 24 | tq2.site_id = s2.site_id and 25 | tq2.question_id = q2.id and 26 | tq2.tag_id = t2.id and 27 | q2.owner_user_id = u2.id and 28 | q2.site_id = u2.site_id and 29 | 30 | -- intersect 31 | u1.account_id = u2.account_id and 32 | account.id = u1.account_id; 33 | 34 | -------------------------------------------------------------------------------- /dataset/stack_train/q2_5_q2-019.sql: -------------------------------------------------------------------------------- 1 | 2 | select distinct account.display_name 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, 5 | tag t2, site s2, question q2, tag_question tq2, so_user u2, 6 | account 7 | where 8 | -- group theory askers 9 | s1.site_name='stackoverflow' and 10 | t1.name = 'wordpress' and 11 | t1.site_id = s1.site_id and 12 | q1.site_id = s1.site_id and 13 | tq1.site_id = s1.site_id and 14 | tq1.question_id = q1.id and 15 | tq1.tag_id = t1.id and 16 | q1.owner_user_id = u1.id and 17 | q1.site_id = u1.site_id and 18 | 19 | -- D&D askers 20 | s2.site_name='superuser' and 21 | t2.name = 'windows' and 22 | t2.site_id = s2.site_id and 23 | q2.site_id = s2.site_id and 24 | tq2.site_id = s2.site_id and 25 | tq2.question_id = q2.id and 26 | tq2.tag_id = t2.id and 27 | q2.owner_user_id = u2.id and 28 | q2.site_id = u2.site_id and 29 | 30 | -- intersect 31 | u1.account_id = u2.account_id and 32 | account.id = u1.account_id; 33 | 34 | -------------------------------------------------------------------------------- /dataset/stack_train/q2_6_q2-080.sql: -------------------------------------------------------------------------------- 1 | 2 | select distinct account.display_name 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, 5 | tag t2, site s2, question q2, tag_question tq2, so_user u2, 6 | account 7 | where 8 | -- group theory askers 9 | s1.site_name='stackoverflow' and 10 | t1.name = 'ssl' and 11 | t1.site_id = s1.site_id and 12 | q1.site_id = s1.site_id and 13 | tq1.site_id = s1.site_id and 14 | tq1.question_id = q1.id and 15 | tq1.tag_id = t1.id and 16 | q1.owner_user_id = u1.id and 17 | q1.site_id = u1.site_id and 18 | 19 | -- D&D askers 20 | s2.site_name='math' and 21 | t2.name = 'prime-numbers' and 22 | t2.site_id = s2.site_id and 23 | q2.site_id = s2.site_id and 24 | tq2.site_id = s2.site_id and 25 | tq2.question_id = q2.id and 26 | tq2.tag_id = t2.id and 27 | q2.owner_user_id = u2.id and 28 | q2.site_id = u2.site_id and 29 | 30 | -- intersect 31 | u1.account_id = u2.account_id and 32 | account.id = u1.account_id; 33 | 34 | -------------------------------------------------------------------------------- /dataset/stack_train/q2_7_q2-035.sql: -------------------------------------------------------------------------------- 1 | 2 | select distinct account.display_name 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, 5 | tag t2, site s2, question q2, tag_question tq2, so_user u2, 6 | account 7 | where 8 | -- group theory askers 9 | s1.site_name='stackoverflow' and 10 | t1.name = 'optimization' and 11 | t1.site_id = s1.site_id and 12 | q1.site_id = s1.site_id and 13 | tq1.site_id = s1.site_id and 14 | tq1.question_id = q1.id and 15 | tq1.tag_id = t1.id and 16 | q1.owner_user_id = u1.id and 17 | q1.site_id = u1.site_id and 18 | 19 | -- D&D askers 20 | s2.site_name='stats' and 21 | t2.name = 'machine-learning' and 22 | t2.site_id = s2.site_id and 23 | q2.site_id = s2.site_id and 24 | tq2.site_id = s2.site_id and 25 | tq2.question_id = q2.id and 26 | tq2.tag_id = t2.id and 27 | q2.owner_user_id = u2.id and 28 | q2.site_id = u2.site_id and 29 | 30 | -- intersect 31 | u1.account_id = u2.account_id and 32 | account.id = u1.account_id; 33 | 34 | -------------------------------------------------------------------------------- /dataset/stack_train/q2_8_q2-002.sql: -------------------------------------------------------------------------------- 1 | 2 | select distinct account.display_name 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, 5 | tag t2, site s2, question q2, tag_question tq2, so_user u2, 6 | account 7 | where 8 | -- group theory askers 9 | s1.site_name='stackoverflow' and 10 | t1.name = 'web-scraping' and 11 | t1.site_id = s1.site_id and 12 | q1.site_id = s1.site_id and 13 | tq1.site_id = s1.site_id and 14 | tq1.question_id = q1.id and 15 | tq1.tag_id = t1.id and 16 | q1.owner_user_id = u1.id and 17 | q1.site_id = u1.site_id and 18 | 19 | -- D&D askers 20 | s2.site_name='superuser' and 21 | t2.name = 'microsoft-excel' and 22 | t2.site_id = s2.site_id and 23 | q2.site_id = s2.site_id and 24 | tq2.site_id = s2.site_id and 25 | tq2.question_id = q2.id and 26 | tq2.tag_id = t2.id and 27 | q2.owner_user_id = u2.id and 28 | q2.site_id = u2.site_id and 29 | 30 | -- intersect 31 | u1.account_id = u2.account_id and 32 | account.id = u1.account_id; 33 | 34 | -------------------------------------------------------------------------------- /dataset/stack_train/q2_9_q2-089.sql: -------------------------------------------------------------------------------- 1 | 2 | select distinct account.display_name 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, 5 | tag t2, site s2, question q2, tag_question tq2, so_user u2, 6 | account 7 | where 8 | -- group theory askers 9 | s1.site_name='math' and 10 | t1.name = 'vector-spaces' and 11 | t1.site_id = s1.site_id and 12 | q1.site_id = s1.site_id and 13 | tq1.site_id = s1.site_id and 14 | tq1.question_id = q1.id and 15 | tq1.tag_id = t1.id and 16 | q1.owner_user_id = u1.id and 17 | q1.site_id = u1.site_id and 18 | 19 | -- D&D askers 20 | s2.site_name='stackoverflow' and 21 | t2.name = 'lambda' and 22 | t2.site_id = s2.site_id and 23 | q2.site_id = s2.site_id and 24 | tq2.site_id = s2.site_id and 25 | tq2.question_id = q2.id and 26 | tq2.tag_id = t2.id and 27 | q2.owner_user_id = u2.id and 28 | q2.site_id = u2.site_id and 29 | 30 | -- intersect 31 | u1.account_id = u2.account_id and 32 | account.id = u1.account_id; 33 | 34 | -------------------------------------------------------------------------------- /dataset/stack_train/q4_0_q4-057.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, answer a1, tag_question tq1, so_user u1, 5 | account 6 | where 7 | -- answerers posted at least 1 yr after the question was asked 8 | s1.site_name='gis' and 9 | t1.name = 'python' and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | a1.site_id = q1.site_id and 16 | a1.question_id = q1.id and 17 | a1.owner_user_id = u1.id and 18 | a1.site_id = u1.site_id and 19 | a1.creation_date >= q1.creation_date + '1 year'::interval and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | -------------------------------------------------------------------------------- /dataset/stack_train/q4_1_q4-091.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, answer a1, tag_question tq1, so_user u1, 5 | account 6 | where 7 | -- answerers posted at least 1 yr after the question was asked 8 | s1.site_name='stackoverflow' and 9 | t1.name = 'web-applications' and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | a1.site_id = q1.site_id and 16 | a1.question_id = q1.id and 17 | a1.owner_user_id = u1.id and 18 | a1.site_id = u1.site_id and 19 | a1.creation_date >= q1.creation_date + '1 year'::interval and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | -------------------------------------------------------------------------------- /dataset/stack_train/q4_2_q4-022.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, answer a1, tag_question tq1, so_user u1, 5 | account 6 | where 7 | -- answerers posted at least 1 yr after the question was asked 8 | s1.site_name='math' and 9 | t1.name = 'continuity' and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | a1.site_id = q1.site_id and 16 | a1.question_id = q1.id and 17 | a1.owner_user_id = u1.id and 18 | a1.site_id = u1.site_id and 19 | a1.creation_date >= q1.creation_date + '1 year'::interval and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | -------------------------------------------------------------------------------- /dataset/stack_train/q4_3_q4-092.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, answer a1, tag_question tq1, so_user u1, 5 | account 6 | where 7 | -- answerers posted at least 1 yr after the question was asked 8 | s1.site_name='stackoverflow' and 9 | t1.name = 'initialization' and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | a1.site_id = q1.site_id and 16 | a1.question_id = q1.id and 17 | a1.owner_user_id = u1.id and 18 | a1.site_id = u1.site_id and 19 | a1.creation_date >= q1.creation_date + '1 year'::interval and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | -------------------------------------------------------------------------------- /dataset/stack_train/q4_4_q4-003.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, answer a1, tag_question tq1, so_user u1, 5 | account 6 | where 7 | -- answerers posted at least 1 yr after the question was asked 8 | s1.site_name='superuser' and 9 | t1.name = 'command-line' and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | a1.site_id = q1.site_id and 16 | a1.question_id = q1.id and 17 | a1.owner_user_id = u1.id and 18 | a1.site_id = u1.site_id and 19 | a1.creation_date >= q1.creation_date + '1 year'::interval and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | -------------------------------------------------------------------------------- /dataset/stack_train/q4_5_q4-036.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, answer a1, tag_question tq1, so_user u1, 5 | account 6 | where 7 | -- answerers posted at least 1 yr after the question was asked 8 | s1.site_name='askubuntu' and 9 | t1.name = 'networking' and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | a1.site_id = q1.site_id and 16 | a1.question_id = q1.id and 17 | a1.owner_user_id = u1.id and 18 | a1.site_id = u1.site_id and 19 | a1.creation_date >= q1.creation_date + '1 year'::interval and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | -------------------------------------------------------------------------------- /dataset/stack_train/q4_6_q4-059.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, answer a1, tag_question tq1, so_user u1, 5 | account 6 | where 7 | -- answerers posted at least 1 yr after the question was asked 8 | s1.site_name='magento' and 9 | t1.name = 'magento2' and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | a1.site_id = q1.site_id and 16 | a1.question_id = q1.id and 17 | a1.owner_user_id = u1.id and 18 | a1.site_id = u1.site_id and 19 | a1.creation_date >= q1.creation_date + '1 year'::interval and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | -------------------------------------------------------------------------------- /dataset/stack_train/q4_7_q4-030.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, answer a1, tag_question tq1, so_user u1, 5 | account 6 | where 7 | -- answerers posted at least 1 yr after the question was asked 8 | s1.site_name='askubuntu' and 9 | t1.name = 'apt' and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | a1.site_id = q1.site_id and 16 | a1.question_id = q1.id and 17 | a1.owner_user_id = u1.id and 18 | a1.site_id = u1.site_id and 19 | a1.creation_date >= q1.creation_date + '1 year'::interval and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | -------------------------------------------------------------------------------- /dataset/stack_train/q4_8_q4-025.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, answer a1, tag_question tq1, so_user u1, 5 | account 6 | where 7 | -- answerers posted at least 1 yr after the question was asked 8 | s1.site_name='math' and 9 | t1.name = 'proof-verification' and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | a1.site_id = q1.site_id and 16 | a1.question_id = q1.id and 17 | a1.owner_user_id = u1.id and 18 | a1.site_id = u1.site_id and 19 | a1.creation_date >= q1.creation_date + '1 year'::interval and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | -------------------------------------------------------------------------------- /dataset/stack_train/q4_9_q4-083.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, answer a1, tag_question tq1, so_user u1, 5 | account 6 | where 7 | -- answerers posted at least 1 yr after the question was asked 8 | s1.site_name='apple' and 9 | t1.name = 'macos' and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | a1.site_id = q1.site_id and 16 | a1.question_id = q1.id and 17 | a1.owner_user_id = u1.id and 18 | a1.site_id = u1.site_id and 19 | a1.creation_date >= q1.creation_date + '1 year'::interval and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | -------------------------------------------------------------------------------- /dataset/stack_train/q6_0_q6-016.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, comment c1, 5 | account 6 | where 7 | -- underappreciated (high votes, low views) questions with at least one comment 8 | s1.site_name='money' and 9 | t1.name in ('international-finance', 'earnings-per-share') and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | q1.owner_user_id = u1.id and 16 | q1.site_id = u1.site_id and 17 | c1.site_id = q1.site_id and 18 | c1.post_id = q1.id and 19 | c1.score > q1.score and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | 24 | -------------------------------------------------------------------------------- /dataset/stack_train/q6_1_q6-039.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, comment c1, 5 | account 6 | where 7 | -- underappreciated (high votes, low views) questions with at least one comment 8 | s1.site_name='health' and 9 | t1.name in ('hiv', 'raw-food', 'disease') and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | q1.owner_user_id = u1.id and 16 | q1.site_id = u1.site_id and 17 | c1.site_id = q1.site_id and 18 | c1.post_id = q1.id and 19 | c1.score > q1.score and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | 24 | -------------------------------------------------------------------------------- /dataset/stack_train/q6_2_q6-091.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, comment c1, 5 | account 6 | where 7 | -- underappreciated (high votes, low views) questions with at least one comment 8 | s1.site_name='rpg' and 9 | t1.name in ('parting-ways-with-players', 'semi-diceless', 'narration', 'dnd-adventurers-league') and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | q1.owner_user_id = u1.id and 16 | q1.site_id = u1.site_id and 17 | c1.site_id = q1.site_id and 18 | c1.post_id = q1.id and 19 | c1.score > q1.score and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | 24 | -------------------------------------------------------------------------------- /dataset/stack_train/q6_3_q6-090.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, comment c1, 5 | account 6 | where 7 | -- underappreciated (high votes, low views) questions with at least one comment 8 | s1.site_name='rpg' and 9 | t1.name in ('minds-eye-theatre', 'fudging', 'unknown-armies', 'pokemon-tabletop-united') and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | q1.owner_user_id = u1.id and 16 | q1.site_id = u1.site_id and 17 | c1.site_id = q1.site_id and 18 | c1.post_id = q1.id and 19 | c1.score > q1.score and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | 24 | -------------------------------------------------------------------------------- /dataset/stack_train/q6_4_q6-050.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, comment c1, 5 | account 6 | where 7 | -- underappreciated (high votes, low views) questions with at least one comment 8 | s1.site_name='3dprinting' and 9 | t1.name in ('intamsys-funmat-ht', 'petg', 'serial-connection', 'waste') and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | q1.owner_user_id = u1.id and 16 | q1.site_id = u1.site_id and 17 | c1.site_id = q1.site_id and 18 | c1.post_id = q1.id and 19 | c1.score > q1.score and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | 24 | -------------------------------------------------------------------------------- /dataset/stack_train/q6_5_q6-045.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, comment c1, 5 | account 6 | where 7 | -- underappreciated (high votes, low views) questions with at least one comment 8 | s1.site_name='vegetarianism' and 9 | t1.name in ('cultured-meat', 'ethics', 'global-warming') and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | q1.owner_user_id = u1.id and 16 | q1.site_id = u1.site_id and 17 | c1.site_id = q1.site_id and 18 | c1.post_id = q1.id and 19 | c1.score > q1.score and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | 24 | -------------------------------------------------------------------------------- /dataset/stack_train/q6_6_q6-084.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, comment c1, 5 | account 6 | where 7 | -- underappreciated (high votes, low views) questions with at least one comment 8 | s1.site_name='academia' and 9 | t1.name in ('invitations', 'lab-course', 'research-assistantship', 'copyright', 'hbcu') and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | q1.owner_user_id = u1.id and 16 | q1.site_id = u1.site_id and 17 | c1.site_id = q1.site_id and 18 | c1.post_id = q1.id and 19 | c1.score > q1.score and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | 24 | -------------------------------------------------------------------------------- /dataset/stack_train/q6_7_q6-013.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, comment c1, 5 | account 6 | where 7 | -- underappreciated (high votes, low views) questions with at least one comment 8 | s1.site_name='money' and 9 | t1.name in ('receivership', 'silver', 'whole-life', 'pmi', 'online-banking') and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | q1.owner_user_id = u1.id and 16 | q1.site_id = u1.site_id and 17 | c1.site_id = q1.site_id and 18 | c1.post_id = q1.id and 19 | c1.score > q1.score and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | 24 | -------------------------------------------------------------------------------- /dataset/stack_train/q6_8_q6-060.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, comment c1, 5 | account 6 | where 7 | -- underappreciated (high votes, low views) questions with at least one comment 8 | s1.site_name='superuser' and 9 | t1.name in ('html', 'templeos', 'ejabberd') and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | q1.owner_user_id = u1.id and 16 | q1.site_id = u1.site_id and 17 | c1.site_id = q1.site_id and 18 | c1.post_id = q1.id and 19 | c1.score > q1.score and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | 24 | -------------------------------------------------------------------------------- /dataset/stack_train/q6_9_q6-056.sql: -------------------------------------------------------------------------------- 1 | 2 | select COUNT(distinct account.display_name) 3 | from 4 | tag t1, site s1, question q1, tag_question tq1, so_user u1, comment c1, 5 | account 6 | where 7 | -- underappreciated (high votes, low views) questions with at least one comment 8 | s1.site_name='cstheory' and 9 | t1.name in ('greedy-algorithms', 'homomorphic-encryption', 'perfect-graph', 'streaming', 'correctness') and 10 | t1.site_id = s1.site_id and 11 | q1.site_id = s1.site_id and 12 | tq1.site_id = s1.site_id and 13 | tq1.question_id = q1.id and 14 | tq1.tag_id = t1.id and 15 | q1.owner_user_id = u1.id and 16 | q1.site_id = u1.site_id and 17 | c1.site_id = q1.site_id and 18 | c1.post_id = q1.id and 19 | c1.score > q1.score and 20 | 21 | -- to get the display name 22 | account.id = u1.account_id; 23 | 24 | -------------------------------------------------------------------------------- /dataset/stack_train/q7_0_q7-030.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct account.display_name) from account, so_user, badge b1, badge b2 where 3 | account.website_url != '' and 4 | account.id = so_user.account_id and 5 | 6 | b1.site_id = so_user.site_id and 7 | b1.user_id = so_user.id and 8 | b1.name = 'Commentator' and 9 | 10 | b2.site_id = so_user.site_id and 11 | b2.user_id = so_user.id and 12 | b2.name = 'Constable' and 13 | b2.date > b1.date + '11 months'::interval 14 | -------------------------------------------------------------------------------- /dataset/stack_train/q7_1_q7-088.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct account.display_name) from account, so_user, badge b1, badge b2 where 3 | account.website_url != '' and 4 | account.id = so_user.account_id and 5 | 6 | b1.site_id = so_user.site_id and 7 | b1.user_id = so_user.id and 8 | b1.name = 'Epic' and 9 | 10 | b2.site_id = so_user.site_id and 11 | b2.user_id = so_user.id and 12 | b2.name = 'Famous Question' and 13 | b2.date > b1.date + '12 months'::interval 14 | -------------------------------------------------------------------------------- /dataset/stack_train/q7_2_q7-063.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct account.display_name) from account, so_user, badge b1, badge b2 where 3 | account.website_url != '' and 4 | account.id = so_user.account_id and 5 | 6 | b1.site_id = so_user.site_id and 7 | b1.user_id = so_user.id and 8 | b1.name = 'Lifeboat' and 9 | 10 | b2.site_id = so_user.site_id and 11 | b2.user_id = so_user.id and 12 | b2.name = 'Sheriff' and 13 | b2.date > b1.date + '9 months'::interval 14 | -------------------------------------------------------------------------------- /dataset/stack_train/q7_3_q7-038.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct account.display_name) from account, so_user, badge b1, badge b2 where 3 | account.website_url != '' and 4 | account.id = so_user.account_id and 5 | 6 | b1.site_id = so_user.site_id and 7 | b1.user_id = so_user.id and 8 | b1.name = 'Nice Question' and 9 | 10 | b2.site_id = so_user.site_id and 11 | b2.user_id = so_user.id and 12 | b2.name = 'Nice Question' and 13 | b2.date > b1.date + '9 months'::interval 14 | -------------------------------------------------------------------------------- /dataset/stack_train/q7_4_q7-083.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct account.display_name) from account, so_user, badge b1, badge b2 where 3 | account.website_url != '' and 4 | account.id = so_user.account_id and 5 | 6 | b1.site_id = so_user.site_id and 7 | b1.user_id = so_user.id and 8 | b1.name = 'Caucus' and 9 | 10 | b2.site_id = so_user.site_id and 11 | b2.user_id = so_user.id and 12 | b2.name = 'Epic' and 13 | b2.date > b1.date + '7 months'::interval 14 | -------------------------------------------------------------------------------- /dataset/stack_train/q7_5_q7-092.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct account.display_name) from account, so_user, badge b1, badge b2 where 3 | account.website_url != '' and 4 | account.id = so_user.account_id and 5 | 6 | b1.site_id = so_user.site_id and 7 | b1.user_id = so_user.id and 8 | b1.name = 'Custodian' and 9 | 10 | b2.site_id = so_user.site_id and 11 | b2.user_id = so_user.id and 12 | b2.name = 'Research Assistant' and 13 | b2.date > b1.date + '7 months'::interval 14 | -------------------------------------------------------------------------------- /dataset/stack_train/q7_6_q7-016.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct account.display_name) from account, so_user, badge b1, badge b2 where 3 | account.website_url != '' and 4 | account.id = so_user.account_id and 5 | 6 | b1.site_id = so_user.site_id and 7 | b1.user_id = so_user.id and 8 | b1.name = 'Not a Robot' and 9 | 10 | b2.site_id = so_user.site_id and 11 | b2.user_id = so_user.id and 12 | b2.name = 'Famous Question' and 13 | b2.date > b1.date + '9 months'::interval 14 | -------------------------------------------------------------------------------- /dataset/stack_train/q7_7_q7-095.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct account.display_name) from account, so_user, badge b1, badge b2 where 3 | account.website_url != '' and 4 | account.id = so_user.account_id and 5 | 6 | b1.site_id = so_user.site_id and 7 | b1.user_id = so_user.id and 8 | b1.name = 'Sheriff' and 9 | 10 | b2.site_id = so_user.site_id and 11 | b2.user_id = so_user.id and 12 | b2.name = 'Nice Question' and 13 | b2.date > b1.date + '4 months'::interval 14 | -------------------------------------------------------------------------------- /dataset/stack_train/q7_8_q7-018.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct account.display_name) from account, so_user, badge b1, badge b2 where 3 | account.website_url != '' and 4 | account.id = so_user.account_id and 5 | 6 | b1.site_id = so_user.site_id and 7 | b1.user_id = so_user.id and 8 | b1.name = 'API Evangelist' and 9 | 10 | b2.site_id = so_user.site_id and 11 | b2.user_id = so_user.id and 12 | b2.name = 'Caucus' and 13 | b2.date > b1.date + '6 months'::interval 14 | -------------------------------------------------------------------------------- /dataset/stack_train/q7_9_q7-017.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct account.display_name) from account, so_user, badge b1, badge b2 where 3 | account.website_url != '' and 4 | account.id = so_user.account_id and 5 | 6 | b1.site_id = so_user.site_id and 7 | b1.user_id = so_user.id and 8 | b1.name = 'API Evangelist' and 9 | 10 | b2.site_id = so_user.site_id and 11 | b2.user_id = so_user.id and 12 | b2.name = 'Famous Question' and 13 | b2.date > b1.date + '7 months'::interval 14 | -------------------------------------------------------------------------------- /dataset/stack_train/q8_0_q8-062.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct q1.id) from 3 | site, post_link pl, question q1, question q2, comment c1, comment c2, 4 | tag, tag_question tq1, tag_question tq2 5 | where 6 | site.site_name = 'german' and 7 | pl.site_id = site.site_id and 8 | 9 | pl.site_id = q1.site_id and 10 | pl.post_id_from = q1.id and 11 | pl.site_id = q2.site_id and 12 | pl.post_id_to = q2.id and 13 | 14 | c1.site_id = q1.site_id and 15 | c1.post_id = q1.id and 16 | 17 | c2.site_id = q2.site_id and 18 | c2.post_id = q2.id and 19 | 20 | c1.date < c2.date and 21 | 22 | tag.name in ('ios', '.net', 'c', 'database') and 23 | tag.id = tq1.tag_id and 24 | tag.site_id = tq1.site_id and 25 | tag.id = tq2.tag_id and 26 | tag.site_id = tq1.site_id and 27 | 28 | tag.site_id = pl.site_id and 29 | 30 | tq1.site_id = q1.site_id and 31 | tq1.question_id = q1.id and 32 | tq2.site_id = q2.site_id and 33 | tq2.question_id = q2.id; 34 | 35 | -------------------------------------------------------------------------------- /dataset/stack_train/q8_1_q8-063.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct q1.id) from 3 | site, post_link pl, question q1, question q2, comment c1, comment c2, 4 | tag, tag_question tq1, tag_question tq2 5 | where 6 | site.site_name = 'german' and 7 | pl.site_id = site.site_id and 8 | 9 | pl.site_id = q1.site_id and 10 | pl.post_id_from = q1.id and 11 | pl.site_id = q2.site_id and 12 | pl.post_id_to = q2.id and 13 | 14 | c1.site_id = q1.site_id and 15 | c1.post_id = q1.id and 16 | 17 | c2.site_id = q2.site_id and 18 | c2.post_id = q2.id and 19 | 20 | c1.date < c2.date and 21 | 22 | tag.name in ('python', 'android', 'node.js', 'c#', 'arrays') and 23 | tag.id = tq1.tag_id and 24 | tag.site_id = tq1.site_id and 25 | tag.id = tq2.tag_id and 26 | tag.site_id = tq1.site_id and 27 | 28 | tag.site_id = pl.site_id and 29 | 30 | tq1.site_id = q1.site_id and 31 | tq1.question_id = q1.id and 32 | tq2.site_id = q2.site_id and 33 | tq2.question_id = q2.id; 34 | 35 | -------------------------------------------------------------------------------- /dataset/stack_train/q8_2_q8-021.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct q1.id) from 3 | site, post_link pl, question q1, question q2, comment c1, comment c2, 4 | tag, tag_question tq1, tag_question tq2 5 | where 6 | site.site_name = 'german' and 7 | pl.site_id = site.site_id and 8 | 9 | pl.site_id = q1.site_id and 10 | pl.post_id_from = q1.id and 11 | pl.site_id = q2.site_id and 12 | pl.post_id_to = q2.id and 13 | 14 | c1.site_id = q1.site_id and 15 | c1.post_id = q1.id and 16 | 17 | c2.site_id = q2.site_id and 18 | c2.post_id = q2.id and 19 | 20 | c1.date < c2.date and 21 | 22 | tag.name in ('linux', 'ruby-on-rails', 'c++', 'json', 'asp.net') and 23 | tag.id = tq1.tag_id and 24 | tag.site_id = tq1.site_id and 25 | tag.id = tq2.tag_id and 26 | tag.site_id = tq1.site_id and 27 | 28 | tag.site_id = pl.site_id and 29 | 30 | tq1.site_id = q1.site_id and 31 | tq1.question_id = q1.id and 32 | tq2.site_id = q2.site_id and 33 | tq2.question_id = q2.id; 34 | 35 | -------------------------------------------------------------------------------- /dataset/stack_train/q8_3_q8-025.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct q1.id) from 3 | site, post_link pl, question q1, question q2, comment c1, comment c2, 4 | tag, tag_question tq1, tag_question tq2 5 | where 6 | site.site_name = 'german' and 7 | pl.site_id = site.site_id and 8 | 9 | pl.site_id = q1.site_id and 10 | pl.post_id_from = q1.id and 11 | pl.site_id = q2.site_id and 12 | pl.post_id_to = q2.id and 13 | 14 | c1.site_id = q1.site_id and 15 | c1.post_id = q1.id and 16 | 17 | c2.site_id = q2.site_id and 18 | c2.post_id = q2.id and 19 | 20 | c1.date > c2.date and 21 | 22 | tag.name in ('python', 'c++', 'linux') and 23 | tag.id = tq1.tag_id and 24 | tag.site_id = tq1.site_id and 25 | tag.id = tq2.tag_id and 26 | tag.site_id = tq1.site_id and 27 | 28 | tag.site_id = pl.site_id and 29 | 30 | tq1.site_id = q1.site_id and 31 | tq1.question_id = q1.id and 32 | tq2.site_id = q2.site_id and 33 | tq2.question_id = q2.id; 34 | 35 | -------------------------------------------------------------------------------- /dataset/stack_train/q8_4_q8-050.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct q1.id) from 3 | site, post_link pl, question q1, question q2, comment c1, comment c2, 4 | tag, tag_question tq1, tag_question tq2 5 | where 6 | site.site_name = 'german' and 7 | pl.site_id = site.site_id and 8 | 9 | pl.site_id = q1.site_id and 10 | pl.post_id_from = q1.id and 11 | pl.site_id = q2.site_id and 12 | pl.post_id_to = q2.id and 13 | 14 | c1.site_id = q1.site_id and 15 | c1.post_id = q1.id and 16 | 17 | c2.site_id = q2.site_id and 18 | c2.post_id = q2.id and 19 | 20 | c1.date < c2.date and 21 | 22 | tag.name in ('string', 'linux', 'json', 'sql-server', 'excel') and 23 | tag.id = tq1.tag_id and 24 | tag.site_id = tq1.site_id and 25 | tag.id = tq2.tag_id and 26 | tag.site_id = tq1.site_id and 27 | 28 | tag.site_id = pl.site_id and 29 | 30 | tq1.site_id = q1.site_id and 31 | tq1.question_id = q1.id and 32 | tq2.site_id = q2.site_id and 33 | tq2.question_id = q2.id; 34 | 35 | -------------------------------------------------------------------------------- /dataset/stack_train/q8_5_q8-015.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct q1.id) from 3 | site, post_link pl, question q1, question q2, comment c1, comment c2, 4 | tag, tag_question tq1, tag_question tq2 5 | where 6 | site.site_name = 'german' and 7 | pl.site_id = site.site_id and 8 | 9 | pl.site_id = q1.site_id and 10 | pl.post_id_from = q1.id and 11 | pl.site_id = q2.site_id and 12 | pl.post_id_to = q2.id and 13 | 14 | c1.site_id = q1.site_id and 15 | c1.post_id = q1.id and 16 | 17 | c2.site_id = q2.site_id and 18 | c2.post_id = q2.id and 19 | 20 | c1.date > c2.date and 21 | 22 | tag.name in ('excel', 'angularjs', 'java', 'string') and 23 | tag.id = tq1.tag_id and 24 | tag.site_id = tq1.site_id and 25 | tag.id = tq2.tag_id and 26 | tag.site_id = tq1.site_id and 27 | 28 | tag.site_id = pl.site_id and 29 | 30 | tq1.site_id = q1.site_id and 31 | tq1.question_id = q1.id and 32 | tq2.site_id = q2.site_id and 33 | tq2.question_id = q2.id; 34 | 35 | -------------------------------------------------------------------------------- /dataset/stack_train/q8_6_q8-073.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct q1.id) from 3 | site, post_link pl, question q1, question q2, comment c1, comment c2, 4 | tag, tag_question tq1, tag_question tq2 5 | where 6 | site.site_name = 'german' and 7 | pl.site_id = site.site_id and 8 | 9 | pl.site_id = q1.site_id and 10 | pl.post_id_from = q1.id and 11 | pl.site_id = q2.site_id and 12 | pl.post_id_to = q2.id and 13 | 14 | c1.site_id = q1.site_id and 15 | c1.post_id = q1.id and 16 | 17 | c2.site_id = q2.site_id and 18 | c2.post_id = q2.id and 19 | 20 | c1.date > c2.date and 21 | 22 | tag.name in ('python', 'r') and 23 | tag.id = tq1.tag_id and 24 | tag.site_id = tq1.site_id and 25 | tag.id = tq2.tag_id and 26 | tag.site_id = tq1.site_id and 27 | 28 | tag.site_id = pl.site_id and 29 | 30 | tq1.site_id = q1.site_id and 31 | tq1.question_id = q1.id and 32 | tq2.site_id = q2.site_id and 33 | tq2.question_id = q2.id; 34 | 35 | -------------------------------------------------------------------------------- /dataset/stack_train/q8_7_q8-029.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct q1.id) from 3 | site, post_link pl, question q1, question q2, comment c1, comment c2, 4 | tag, tag_question tq1, tag_question tq2 5 | where 6 | site.site_name = 'german' and 7 | pl.site_id = site.site_id and 8 | 9 | pl.site_id = q1.site_id and 10 | pl.post_id_from = q1.id and 11 | pl.site_id = q2.site_id and 12 | pl.post_id_to = q2.id and 13 | 14 | c1.site_id = q1.site_id and 15 | c1.post_id = q1.id and 16 | 17 | c2.site_id = q2.site_id and 18 | c2.post_id = q2.id and 19 | 20 | c1.date < c2.date and 21 | 22 | tag.name in ('sql-server', 'php', 'html', 'css', 'angularjs') and 23 | tag.id = tq1.tag_id and 24 | tag.site_id = tq1.site_id and 25 | tag.id = tq2.tag_id and 26 | tag.site_id = tq1.site_id and 27 | 28 | tag.site_id = pl.site_id and 29 | 30 | tq1.site_id = q1.site_id and 31 | tq1.question_id = q1.id and 32 | tq2.site_id = q2.site_id and 33 | tq2.question_id = q2.id; 34 | 35 | -------------------------------------------------------------------------------- /dataset/stack_train/q8_8_q8-071.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct q1.id) from 3 | site, post_link pl, question q1, question q2, comment c1, comment c2, 4 | tag, tag_question tq1, tag_question tq2 5 | where 6 | site.site_name = 'german' and 7 | pl.site_id = site.site_id and 8 | 9 | pl.site_id = q1.site_id and 10 | pl.post_id_from = q1.id and 11 | pl.site_id = q2.site_id and 12 | pl.post_id_to = q2.id and 13 | 14 | c1.site_id = q1.site_id and 15 | c1.post_id = q1.id and 16 | 17 | c2.site_id = q2.site_id and 18 | c2.post_id = q2.id and 19 | 20 | c1.date < c2.date and 21 | 22 | tag.name in ('json', 'php', 'objective-c', 'asp.net-mvc', 'asp.net') and 23 | tag.id = tq1.tag_id and 24 | tag.site_id = tq1.site_id and 25 | tag.id = tq2.tag_id and 26 | tag.site_id = tq1.site_id and 27 | 28 | tag.site_id = pl.site_id and 29 | 30 | tq1.site_id = q1.site_id and 31 | tq1.question_id = q1.id and 32 | tq2.site_id = q2.site_id and 33 | tq2.question_id = q2.id; 34 | 35 | -------------------------------------------------------------------------------- /dataset/stack_train/q8_9_q8-087.sql: -------------------------------------------------------------------------------- 1 | 2 | select count(distinct q1.id) from 3 | site, post_link pl, question q1, question q2, comment c1, comment c2, 4 | tag, tag_question tq1, tag_question tq2 5 | where 6 | site.site_name = 'german' and 7 | pl.site_id = site.site_id and 8 | 9 | pl.site_id = q1.site_id and 10 | pl.post_id_from = q1.id and 11 | pl.site_id = q2.site_id and 12 | pl.post_id_to = q2.id and 13 | 14 | c1.site_id = q1.site_id and 15 | c1.post_id = q1.id and 16 | 17 | c2.site_id = q2.site_id and 18 | c2.post_id = q2.id and 19 | 20 | c1.date < c2.date and 21 | 22 | tag.name in ('django', 'database') and 23 | tag.id = tq1.tag_id and 24 | tag.site_id = tq1.site_id and 25 | tag.id = tq2.tag_id and 26 | tag.site_id = tq1.site_id and 27 | 28 | tag.site_id = pl.site_id and 29 | 30 | tq1.site_id = q1.site_id and 31 | tq1.question_id = q1.id and 32 | tq2.site_id = q2.site_id and 33 | tq2.question_id = q2.id; 34 | 35 | -------------------------------------------------------------------------------- /dataset/test/10a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(chn.name) AS uncredited_voiced_character, 2 | MIN(t.title) AS russian_movie 3 | FROM char_name AS chn, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | company_type AS ct, 7 | movie_companies AS mc, 8 | role_type AS rt, 9 | title AS t 10 | WHERE ci.note LIKE '%(voice)%' 11 | AND ci.note LIKE '%(uncredited)%' 12 | AND cn.country_code = '[ru]' 13 | AND rt.role = 'actor' 14 | AND t.production_year > 2005 15 | AND t.id = mc.movie_id 16 | AND t.id = ci.movie_id 17 | AND ci.movie_id = mc.movie_id 18 | AND chn.id = ci.person_role_id 19 | AND rt.id = ci.role_id 20 | AND cn.id = mc.company_id 21 | AND ct.id = mc.company_type_id; 22 | 23 | -------------------------------------------------------------------------------- /dataset/test/11a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(cn.name) AS from_company, 2 | MIN(lt.link) AS movie_link_type, 3 | MIN(t.title) AS non_polish_sequel_movie 4 | FROM company_name AS cn, 5 | company_type AS ct, 6 | keyword AS k, 7 | link_type AS lt, 8 | movie_companies AS mc, 9 | movie_keyword AS mk, 10 | movie_link AS ml, 11 | title AS t 12 | WHERE cn.country_code !='[pl]' 13 | AND (cn.name LIKE '%Film%' 14 | OR cn.name LIKE '%Warner%') 15 | AND ct.kind ='production companies' 16 | AND k.keyword ='sequel' 17 | AND lt.link LIKE '%follow%' 18 | AND mc.note IS NULL 19 | AND t.production_year BETWEEN 1950 AND 2000 20 | AND lt.id = ml.link_type_id 21 | AND ml.movie_id = t.id 22 | AND t.id = mk.movie_id 23 | AND mk.keyword_id = k.id 24 | AND t.id = mc.movie_id 25 | AND mc.company_type_id = ct.id 26 | AND mc.company_id = cn.id 27 | AND ml.movie_id = mk.movie_id 28 | AND ml.movie_id = mc.movie_id 29 | AND mk.movie_id = mc.movie_id; 30 | 31 | -------------------------------------------------------------------------------- /dataset/test/12a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(cn.name) AS movie_company, 2 | MIN(mi_idx.info) AS rating, 3 | MIN(t.title) AS drama_horror_movie 4 | FROM company_name AS cn, 5 | company_type AS ct, 6 | info_type AS it1, 7 | info_type AS it2, 8 | movie_companies AS mc, 9 | movie_info AS mi, 10 | movie_info_idx AS mi_idx, 11 | title AS t 12 | WHERE cn.country_code = '[us]' 13 | AND ct.kind = 'production companies' 14 | AND it1.info = 'genres' 15 | AND it2.info = 'rating' 16 | AND mi.info IN ('Drama', 17 | 'Horror') 18 | AND mi_idx.info > '8.0' 19 | AND t.production_year BETWEEN 2005 AND 2008 20 | AND t.id = mi.movie_id 21 | AND t.id = mi_idx.movie_id 22 | AND mi.info_type_id = it1.id 23 | AND mi_idx.info_type_id = it2.id 24 | AND t.id = mc.movie_id 25 | AND ct.id = mc.company_type_id 26 | AND cn.id = mc.company_id 27 | AND mc.movie_id = mi.movie_id 28 | AND mc.movie_id = mi_idx.movie_id 29 | AND mi.movie_id = mi_idx.movie_id; 30 | 31 | -------------------------------------------------------------------------------- /dataset/test/13a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mi.info) AS release_date, 2 | MIN(miidx.info) AS rating, 3 | MIN(t.title) AS german_movie 4 | FROM company_name AS cn, 5 | company_type AS ct, 6 | info_type AS it, 7 | info_type AS it2, 8 | kind_type AS kt, 9 | movie_companies AS mc, 10 | movie_info AS mi, 11 | movie_info_idx AS miidx, 12 | title AS t 13 | WHERE cn.country_code ='[de]' 14 | AND ct.kind ='production companies' 15 | AND it.info ='rating' 16 | AND it2.info ='release dates' 17 | AND kt.kind ='movie' 18 | AND mi.movie_id = t.id 19 | AND it2.id = mi.info_type_id 20 | AND kt.id = t.kind_id 21 | AND mc.movie_id = t.id 22 | AND cn.id = mc.company_id 23 | AND ct.id = mc.company_type_id 24 | AND miidx.movie_id = t.id 25 | AND it.id = miidx.info_type_id 26 | AND mi.movie_id = miidx.movie_id 27 | AND mi.movie_id = mc.movie_id 28 | AND miidx.movie_id = mc.movie_id; 29 | 30 | -------------------------------------------------------------------------------- /dataset/test/16a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an.name) AS cool_actor_pseudonym, 2 | MIN(t.title) AS series_named_after_char 3 | FROM aka_name AS an, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | keyword AS k, 7 | movie_companies AS mc, 8 | movie_keyword AS mk, 9 | name AS n, 10 | title AS t 11 | WHERE cn.country_code ='[us]' 12 | AND k.keyword ='character-name-in-title' 13 | AND t.episode_nr >= 50 14 | AND t.episode_nr < 100 15 | AND an.person_id = n.id 16 | AND n.id = ci.person_id 17 | AND ci.movie_id = t.id 18 | AND t.id = mk.movie_id 19 | AND mk.keyword_id = k.id 20 | AND t.id = mc.movie_id 21 | AND mc.company_id = cn.id 22 | AND an.person_id = ci.person_id 23 | AND ci.movie_id = mc.movie_id 24 | AND ci.movie_id = mk.movie_id 25 | AND mc.movie_id = mk.movie_id; 26 | 27 | -------------------------------------------------------------------------------- /dataset/test/17a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(n.name) AS member_in_charnamed_american_movie, 2 | MIN(n.name) AS a1 3 | FROM cast_info AS ci, 4 | company_name AS cn, 5 | keyword AS k, 6 | movie_companies AS mc, 7 | movie_keyword AS mk, 8 | name AS n, 9 | title AS t 10 | WHERE cn.country_code ='[us]' 11 | AND k.keyword ='character-name-in-title' 12 | AND n.name LIKE 'B%' 13 | AND n.id = ci.person_id 14 | AND ci.movie_id = t.id 15 | AND t.id = mk.movie_id 16 | AND mk.keyword_id = k.id 17 | AND t.id = mc.movie_id 18 | AND mc.company_id = cn.id 19 | AND ci.movie_id = mc.movie_id 20 | AND ci.movie_id = mk.movie_id 21 | AND mc.movie_id = mk.movie_id; 22 | 23 | -------------------------------------------------------------------------------- /dataset/test/18a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mi.info) AS movie_budget, 2 | MIN(mi_idx.info) AS movie_votes, 3 | MIN(t.title) AS movie_title 4 | FROM cast_info AS ci, 5 | info_type AS it1, 6 | info_type AS it2, 7 | movie_info AS mi, 8 | movie_info_idx AS mi_idx, 9 | name AS n, 10 | title AS t 11 | WHERE ci.note IN ('(producer)', 12 | '(executive producer)') 13 | AND it1.info = 'budget' 14 | AND it2.info = 'votes' 15 | AND n.gender = 'm' 16 | AND n.name LIKE '%Tim%' 17 | AND t.id = mi.movie_id 18 | AND t.id = mi_idx.movie_id 19 | AND t.id = ci.movie_id 20 | AND ci.movie_id = mi.movie_id 21 | AND ci.movie_id = mi_idx.movie_id 22 | AND mi.movie_id = mi_idx.movie_id 23 | AND n.id = ci.person_id 24 | AND it1.id = mi.info_type_id 25 | AND it2.id = mi_idx.info_type_id; 26 | 27 | -------------------------------------------------------------------------------- /dataset/test/1a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mc.note) AS production_note, 2 | MIN(t.title) AS movie_title, 3 | MIN(t.production_year) AS movie_year 4 | FROM company_type AS ct, 5 | info_type AS it, 6 | movie_companies AS mc, 7 | movie_info_idx AS mi_idx, 8 | title AS t 9 | WHERE ct.kind = 'production companies' 10 | AND it.info = 'top 250 rank' 11 | AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' 12 | AND (mc.note LIKE '%(co-production)%' 13 | OR mc.note LIKE '%(presents)%') 14 | AND ct.id = mc.company_type_id 15 | AND t.id = mc.movie_id 16 | AND t.id = mi_idx.movie_id 17 | AND mc.movie_id = mi_idx.movie_id 18 | AND it.id = mi_idx.info_type_id; 19 | 20 | -------------------------------------------------------------------------------- /dataset/test/2a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS movie_title 2 | FROM company_name AS cn, 3 | keyword AS k, 4 | movie_companies AS mc, 5 | movie_keyword AS mk, 6 | title AS t 7 | WHERE cn.country_code ='[de]' 8 | AND k.keyword ='character-name-in-title' 9 | AND cn.id = mc.company_id 10 | AND mc.movie_id = t.id 11 | AND t.id = mk.movie_id 12 | AND mk.keyword_id = k.id 13 | AND mc.movie_id = mk.movie_id; 14 | 15 | -------------------------------------------------------------------------------- /dataset/test/32a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(lt.link) AS link_type, 2 | MIN(t1.title) AS first_movie, 3 | MIN(t2.title) AS second_movie 4 | FROM keyword AS k, 5 | link_type AS lt, 6 | movie_keyword AS mk, 7 | movie_link AS ml, 8 | title AS t1, 9 | title AS t2 10 | WHERE k.keyword ='10,000-mile-club' 11 | AND mk.keyword_id = k.id 12 | AND t1.id = mk.movie_id 13 | AND ml.movie_id = t1.id 14 | AND ml.linked_movie_id = t2.id 15 | AND lt.id = ml.link_type_id 16 | AND mk.movie_id = t1.id; 17 | 18 | -------------------------------------------------------------------------------- /dataset/test/3a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS movie_title 2 | FROM keyword AS k, 3 | movie_info AS mi, 4 | movie_keyword AS mk, 5 | title AS t 6 | WHERE k.keyword LIKE '%sequel%' 7 | AND mi.info IN ('Sweden', 8 | 'Norway', 9 | 'Germany', 10 | 'Denmark', 11 | 'Swedish', 12 | 'Denish', 13 | 'Norwegian', 14 | 'German') 15 | AND t.production_year > 2005 16 | AND t.id = mi.movie_id 17 | AND t.id = mk.movie_id 18 | AND mk.movie_id = mi.movie_id 19 | AND k.id = mk.keyword_id; 20 | 21 | -------------------------------------------------------------------------------- /dataset/test/4a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mi_idx.info) AS rating, 2 | MIN(t.title) AS movie_title 3 | FROM info_type AS it, 4 | keyword AS k, 5 | movie_info_idx AS mi_idx, 6 | movie_keyword AS mk, 7 | title AS t 8 | WHERE it.info ='rating' 9 | AND k.keyword LIKE '%sequel%' 10 | AND mi_idx.info > '5.0' 11 | AND t.production_year > 2005 12 | AND t.id = mi_idx.movie_id 13 | AND t.id = mk.movie_id 14 | AND mk.movie_id = mi_idx.movie_id 15 | AND k.id = mk.keyword_id 16 | AND it.id = mi_idx.info_type_id; 17 | 18 | -------------------------------------------------------------------------------- /dataset/test/5a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS typical_european_movie 2 | FROM company_type AS ct, 3 | info_type AS it, 4 | movie_companies AS mc, 5 | movie_info AS mi, 6 | title AS t 7 | WHERE ct.kind = 'production companies' 8 | AND mc.note LIKE '%(theatrical)%' 9 | AND mc.note LIKE '%(France)%' 10 | AND mi.info IN ('Sweden', 11 | 'Norway', 12 | 'Germany', 13 | 'Denmark', 14 | 'Swedish', 15 | 'Denish', 16 | 'Norwegian', 17 | 'German') 18 | AND t.production_year > 2005 19 | AND t.id = mi.movie_id 20 | AND t.id = mc.movie_id 21 | AND mc.movie_id = mi.movie_id 22 | AND ct.id = mc.company_type_id 23 | AND it.id = mi.info_type_id; 24 | 25 | -------------------------------------------------------------------------------- /dataset/test/6a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(k.keyword) AS movie_keyword, 2 | MIN(n.name) AS actor_name, 3 | MIN(t.title) AS marvel_movie 4 | FROM cast_info AS ci, 5 | keyword AS k, 6 | movie_keyword AS mk, 7 | name AS n, 8 | title AS t 9 | WHERE k.keyword = 'marvel-cinematic-universe' 10 | AND n.name LIKE '%Downey%Robert%' 11 | AND t.production_year > 2010 12 | AND k.id = mk.keyword_id 13 | AND t.id = mk.movie_id 14 | AND t.id = ci.movie_id 15 | AND ci.movie_id = mk.movie_id 16 | AND n.id = ci.person_id; 17 | 18 | -------------------------------------------------------------------------------- /dataset/test/7a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(n.name) AS of_person, 2 | MIN(t.title) AS biography_movie 3 | FROM aka_name AS an, 4 | cast_info AS ci, 5 | info_type AS it, 6 | link_type AS lt, 7 | movie_link AS ml, 8 | name AS n, 9 | person_info AS pi, 10 | title AS t 11 | WHERE an.name LIKE '%a%' 12 | AND it.info ='mini biography' 13 | AND lt.link ='features' 14 | AND n.name_pcode_cf BETWEEN 'A' AND 'F' 15 | AND (n.gender='m' 16 | OR (n.gender = 'f' 17 | AND n.name LIKE 'B%')) 18 | AND pi.note ='Volker Boehm' 19 | AND t.production_year BETWEEN 1980 AND 1995 20 | AND n.id = an.person_id 21 | AND n.id = pi.person_id 22 | AND ci.person_id = n.id 23 | AND t.id = ci.movie_id 24 | AND ml.linked_movie_id = t.id 25 | AND lt.id = ml.link_type_id 26 | AND it.id = pi.info_type_id 27 | AND pi.person_id = an.person_id 28 | AND pi.person_id = ci.person_id 29 | AND an.person_id = ci.person_id 30 | AND ci.movie_id = ml.linked_movie_id; 31 | 32 | -------------------------------------------------------------------------------- /dataset/test/8a.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an1.name) AS actress_pseudonym, 2 | MIN(t.title) AS japanese_movie_dubbed 3 | FROM aka_name AS an1, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | movie_companies AS mc, 7 | name AS n1, 8 | role_type AS rt, 9 | title AS t 10 | WHERE ci.note ='(voice: English version)' 11 | AND cn.country_code ='[jp]' 12 | AND mc.note LIKE '%(Japan)%' 13 | AND mc.note NOT LIKE '%(USA)%' 14 | AND n1.name LIKE '%Yo%' 15 | AND n1.name NOT LIKE '%Yu%' 16 | AND rt.role ='actress' 17 | AND an1.person_id = n1.id 18 | AND n1.id = ci.person_id 19 | AND ci.movie_id = t.id 20 | AND t.id = mc.movie_id 21 | AND mc.company_id = cn.id 22 | AND ci.role_id = rt.id 23 | AND an1.person_id = ci.person_id 24 | AND ci.movie_id = mc.movie_id; 25 | 26 | -------------------------------------------------------------------------------- /dataset/tpcds_test/query27_1.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 0 using template query27.tpl 2 | select i_item_id, 3 | s_state, grouping(s_state) g_state, 4 | avg(ss_quantity) agg1, 5 | avg(ss_list_price) agg2, 6 | avg(ss_coupon_amt) agg3, 7 | avg(ss_sales_price) agg4 8 | from store_sales, customer_demographics, date_dim, store, item 9 | where ss_sold_date_sk = d_date_sk and 10 | ss_item_sk = i_item_sk and 11 | ss_store_sk = s_store_sk and 12 | ss_cdemo_sk = cd_demo_sk and 13 | cd_gender = 'F' and 14 | cd_marital_status = 'W' and 15 | cd_education_status = 'Primary' and 16 | d_year = 1998 and 17 | s_state in ('TN','TN', 'TN', 'TN', 'TN', 'TN') 18 | group by rollup (i_item_id, s_state) 19 | order by i_item_id 20 | ,s_state 21 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_test/query27_2.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 1 using template query27.tpl 2 | select i_item_id, 3 | s_state, grouping(s_state) g_state, 4 | avg(ss_quantity) agg1, 5 | avg(ss_list_price) agg2, 6 | avg(ss_coupon_amt) agg3, 7 | avg(ss_sales_price) agg4 8 | from store_sales, customer_demographics, date_dim, store, item 9 | where ss_sold_date_sk = d_date_sk and 10 | ss_item_sk = i_item_sk and 11 | ss_store_sk = s_store_sk and 12 | ss_cdemo_sk = cd_demo_sk and 13 | cd_gender = 'M' and 14 | cd_marital_status = 'W' and 15 | cd_education_status = 'College' and 16 | d_year = 2000 and 17 | s_state in ('TN','TN', 'TN', 'TN', 'TN', 'TN') 18 | group by rollup (i_item_id, s_state) 19 | order by i_item_id 20 | ,s_state 21 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_test/query27_3.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 2 using template query27.tpl 2 | select i_item_id, 3 | s_state, grouping(s_state) g_state, 4 | avg(ss_quantity) agg1, 5 | avg(ss_list_price) agg2, 6 | avg(ss_coupon_amt) agg3, 7 | avg(ss_sales_price) agg4 8 | from store_sales, customer_demographics, date_dim, store, item 9 | where ss_sold_date_sk = d_date_sk and 10 | ss_item_sk = i_item_sk and 11 | ss_store_sk = s_store_sk and 12 | ss_cdemo_sk = cd_demo_sk and 13 | cd_gender = 'F' and 14 | cd_marital_status = 'U' and 15 | cd_education_status = 'College' and 16 | d_year = 1999 and 17 | s_state in ('TN','TN', 'TN', 'TN', 'TN', 'TN') 18 | group by rollup (i_item_id, s_state) 19 | order by i_item_id 20 | ,s_state 21 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_test/query52_1.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 0 using template query52.tpl 2 | select dt.d_year 3 | ,item.i_brand_id brand_id 4 | ,item.i_brand brand 5 | ,sum(ss_ext_sales_price) ext_price 6 | from date_dim dt 7 | ,store_sales 8 | ,item 9 | where dt.d_date_sk = store_sales.ss_sold_date_sk 10 | and store_sales.ss_item_sk = item.i_item_sk 11 | and item.i_manager_id = 1 12 | and dt.d_moy=12 13 | and dt.d_year=1998 14 | group by dt.d_year 15 | ,item.i_brand 16 | ,item.i_brand_id 17 | order by dt.d_year 18 | ,ext_price desc 19 | ,brand_id 20 | limit 100 ; -------------------------------------------------------------------------------- /dataset/tpcds_test/query52_2.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 1 using template query52.tpl 2 | select dt.d_year 3 | ,item.i_brand_id brand_id 4 | ,item.i_brand brand 5 | ,sum(ss_ext_sales_price) ext_price 6 | from date_dim dt 7 | ,store_sales 8 | ,item 9 | where dt.d_date_sk = store_sales.ss_sold_date_sk 10 | and store_sales.ss_item_sk = item.i_item_sk 11 | and item.i_manager_id = 1 12 | and dt.d_moy=11 13 | and dt.d_year=2001 14 | group by dt.d_year 15 | ,item.i_brand 16 | ,item.i_brand_id 17 | order by dt.d_year 18 | ,ext_price desc 19 | ,brand_id 20 | limit 100 ; -------------------------------------------------------------------------------- /dataset/tpcds_test/query52_3.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 2 using template query52.tpl 2 | select dt.d_year 3 | ,item.i_brand_id brand_id 4 | ,item.i_brand brand 5 | ,sum(ss_ext_sales_price) ext_price 6 | from date_dim dt 7 | ,store_sales 8 | ,item 9 | where dt.d_date_sk = store_sales.ss_sold_date_sk 10 | and store_sales.ss_item_sk = item.i_item_sk 11 | and item.i_manager_id = 1 12 | and dt.d_moy=11 13 | and dt.d_year=1998 14 | group by dt.d_year 15 | ,item.i_brand 16 | ,item.i_brand_id 17 | order by dt.d_year 18 | ,ext_price desc 19 | ,brand_id 20 | limit 100 ; -------------------------------------------------------------------------------- /dataset/tpcds_test/query82_1.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 0 using template query82.tpl 2 | select i_item_id 3 | ,i_item_desc 4 | ,i_current_price 5 | from item, inventory, date_dim, store_sales 6 | where i_current_price between 30 and 30+30 7 | and inv_item_sk = i_item_sk 8 | and d_date_sk=inv_date_sk 9 | and d_date between cast('2002-05-30' as date) and cast('2002-07-29' as date) 10 | and i_manufact_id in (437,129,727,663) 11 | and inv_quantity_on_hand between 100 and 500 12 | and ss_item_sk = i_item_sk 13 | group by i_item_id,i_item_desc,i_current_price 14 | order by i_item_id 15 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_test/query82_2.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 1 using template query82.tpl 2 | select i_item_id 3 | ,i_item_desc 4 | ,i_current_price 5 | from item, inventory, date_dim, store_sales 6 | where i_current_price between 3 and 3+30 7 | and inv_item_sk = i_item_sk 8 | and d_date_sk=inv_date_sk 9 | and d_date between cast('1998-05-20' as date) and cast('1998-07-19' as date) 10 | and i_manufact_id in (59,526,301,399) 11 | and inv_quantity_on_hand between 100 and 500 12 | and ss_item_sk = i_item_sk 13 | group by i_item_id,i_item_desc,i_current_price 14 | order by i_item_id 15 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_test/query82_3.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 2 using template query82.tpl 2 | select i_item_id 3 | ,i_item_desc 4 | ,i_current_price 5 | from item, inventory, date_dim, store_sales 6 | where i_current_price between 34 and 34+30 7 | and inv_item_sk = i_item_sk 8 | and d_date_sk=inv_date_sk 9 | and d_date between cast('1999-01-24' as date) and cast('1999-03-25' as date) 10 | and i_manufact_id in (33,652,78,269) 11 | and inv_quantity_on_hand between 100 and 500 12 | and ss_item_sk = i_item_sk 13 | group by i_item_id,i_item_desc,i_current_price 14 | order by i_item_id 15 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_test/query98_1.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 0 using template query98.tpl 2 | select i_item_id 3 | ,i_item_desc 4 | ,i_category 5 | ,i_class 6 | ,i_current_price 7 | ,sum(ss_ext_sales_price) as itemrevenue 8 | ,sum(ss_ext_sales_price)*100/sum(sum(ss_ext_sales_price)) over 9 | (partition by i_class) as revenueratio 10 | from 11 | store_sales 12 | ,item 13 | ,date_dim 14 | where 15 | ss_item_sk = i_item_sk 16 | and i_category in ('Jewelry', 'Sports', 'Books') 17 | and ss_sold_date_sk = d_date_sk 18 | and d_date between cast('2001-01-12' as date) 19 | and cast('2001-02-11' as date) 20 | group by 21 | i_item_id 22 | ,i_item_desc 23 | ,i_category 24 | ,i_class 25 | ,i_current_price 26 | order by 27 | i_category 28 | ,i_class 29 | ,i_item_id 30 | ,i_item_desc 31 | ,revenueratio; -------------------------------------------------------------------------------- /dataset/tpcds_test/query98_2.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 1 using template query98.tpl 2 | select i_item_id 3 | ,i_item_desc 4 | ,i_category 5 | ,i_class 6 | ,i_current_price 7 | ,sum(ss_ext_sales_price) as itemrevenue 8 | ,sum(ss_ext_sales_price)*100/sum(sum(ss_ext_sales_price)) over 9 | (partition by i_class) as revenueratio 10 | from 11 | store_sales 12 | ,item 13 | ,date_dim 14 | where 15 | ss_item_sk = i_item_sk 16 | and i_category in ('Electronics', 'Home', 'Shoes') 17 | and ss_sold_date_sk = d_date_sk 18 | and d_date between cast('2002-02-10' as date) 19 | and cast('2002-03-12' as date) 20 | group by 21 | i_item_id 22 | ,i_item_desc 23 | ,i_category 24 | ,i_class 25 | ,i_current_price 26 | order by 27 | i_category 28 | ,i_class 29 | ,i_item_id 30 | ,i_item_desc 31 | ,revenueratio; -------------------------------------------------------------------------------- /dataset/tpcds_test/query98_3.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 2 using template query98.tpl 2 | select i_item_id 3 | ,i_item_desc 4 | ,i_category 5 | ,i_class 6 | ,i_current_price 7 | ,sum(ss_ext_sales_price) as itemrevenue 8 | ,sum(ss_ext_sales_price)*100/sum(sum(ss_ext_sales_price)) over 9 | (partition by i_class) as revenueratio 10 | from 11 | store_sales 12 | ,item 13 | ,date_dim 14 | where 15 | ss_item_sk = i_item_sk 16 | and i_category in ('Books', 'Shoes', 'Electronics') 17 | and ss_sold_date_sk = d_date_sk 18 | and d_date between cast('1998-03-21' as date) 19 | and cast('1998-04-20' as date) 20 | group by 21 | i_item_id 22 | ,i_item_desc 23 | ,i_category 24 | ,i_class 25 | ,i_current_price 26 | order by 27 | i_category 28 | ,i_class 29 | ,i_item_id 30 | ,i_item_desc 31 | ,revenueratio; -------------------------------------------------------------------------------- /dataset/tpcds_train/query12_1.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 0 using template query12.tpl 2 | select i_item_id 3 | ,i_item_desc 4 | ,i_category 5 | ,i_class 6 | ,i_current_price 7 | ,sum(ws_ext_sales_price) as itemrevenue 8 | ,sum(ws_ext_sales_price)*100/sum(sum(ws_ext_sales_price)) over 9 | (partition by i_class) as revenueratio 10 | from 11 | web_sales 12 | ,item 13 | ,date_dim 14 | where 15 | ws_item_sk = i_item_sk 16 | and i_category in ('Jewelry', 'Sports', 'Books') 17 | and ws_sold_date_sk = d_date_sk 18 | and d_date between cast('2001-01-12' as date) 19 | and cast('2001-02-11' as date) 20 | group by 21 | i_item_id 22 | ,i_item_desc 23 | ,i_category 24 | ,i_class 25 | ,i_current_price 26 | order by 27 | i_category 28 | ,i_class 29 | ,i_item_id 30 | ,i_item_desc 31 | ,revenueratio 32 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query12_2.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 1 using template query12.tpl 2 | select i_item_id 3 | ,i_item_desc 4 | ,i_category 5 | ,i_class 6 | ,i_current_price 7 | ,sum(ws_ext_sales_price) as itemrevenue 8 | ,sum(ws_ext_sales_price)*100/sum(sum(ws_ext_sales_price)) over 9 | (partition by i_class) as revenueratio 10 | from 11 | web_sales 12 | ,item 13 | ,date_dim 14 | where 15 | ws_item_sk = i_item_sk 16 | and i_category in ('Electronics', 'Home', 'Shoes') 17 | and ws_sold_date_sk = d_date_sk 18 | and d_date between cast('2002-02-10' as date) 19 | and cast('2002-03-12' as date) 20 | group by 21 | i_item_id 22 | ,i_item_desc 23 | ,i_category 24 | ,i_class 25 | ,i_current_price 26 | order by 27 | i_category 28 | ,i_class 29 | ,i_item_id 30 | ,i_item_desc 31 | ,revenueratio 32 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query12_3.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 2 using template query12.tpl 2 | select i_item_id 3 | ,i_item_desc 4 | ,i_category 5 | ,i_class 6 | ,i_current_price 7 | ,sum(ws_ext_sales_price) as itemrevenue 8 | ,sum(ws_ext_sales_price)*100/sum(sum(ws_ext_sales_price)) over 9 | (partition by i_class) as revenueratio 10 | from 11 | web_sales 12 | ,item 13 | ,date_dim 14 | where 15 | ws_item_sk = i_item_sk 16 | and i_category in ('Books', 'Shoes', 'Electronics') 17 | and ws_sold_date_sk = d_date_sk 18 | and d_date between cast('1998-03-21' as date) 19 | and cast('1998-04-20' as date) 20 | group by 21 | i_item_id 22 | ,i_item_desc 23 | ,i_category 24 | ,i_class 25 | ,i_current_price 26 | order by 27 | i_category 28 | ,i_class 29 | ,i_item_id 30 | ,i_item_desc 31 | ,revenueratio 32 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query20_1.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 0 using template query20.tpl 2 | select i_item_id 3 | ,i_item_desc 4 | ,i_category 5 | ,i_class 6 | ,i_current_price 7 | ,sum(cs_ext_sales_price) as itemrevenue 8 | ,sum(cs_ext_sales_price)*100/sum(sum(cs_ext_sales_price)) over 9 | (partition by i_class) as revenueratio 10 | from catalog_sales 11 | ,item 12 | ,date_dim 13 | where cs_item_sk = i_item_sk 14 | and i_category in ('Jewelry', 'Sports', 'Books') 15 | and cs_sold_date_sk = d_date_sk 16 | and d_date between cast('2001-01-12' as date) 17 | and cast('2001-02-11' as date) 18 | group by i_item_id 19 | ,i_item_desc 20 | ,i_category 21 | ,i_class 22 | ,i_current_price 23 | order by i_category 24 | ,i_class 25 | ,i_item_id 26 | ,i_item_desc 27 | ,revenueratio 28 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query20_2.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 1 using template query20.tpl 2 | select i_item_id 3 | ,i_item_desc 4 | ,i_category 5 | ,i_class 6 | ,i_current_price 7 | ,sum(cs_ext_sales_price) as itemrevenue 8 | ,sum(cs_ext_sales_price)*100/sum(sum(cs_ext_sales_price)) over 9 | (partition by i_class) as revenueratio 10 | from catalog_sales 11 | ,item 12 | ,date_dim 13 | where cs_item_sk = i_item_sk 14 | and i_category in ('Electronics', 'Home', 'Shoes') 15 | and cs_sold_date_sk = d_date_sk 16 | and d_date between cast('2002-02-10' as date) 17 | and cast('2002-03-12' as date) 18 | group by i_item_id 19 | ,i_item_desc 20 | ,i_category 21 | ,i_class 22 | ,i_current_price 23 | order by i_category 24 | ,i_class 25 | ,i_item_id 26 | ,i_item_desc 27 | ,revenueratio 28 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query20_3.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 2 using template query20.tpl 2 | select i_item_id 3 | ,i_item_desc 4 | ,i_category 5 | ,i_class 6 | ,i_current_price 7 | ,sum(cs_ext_sales_price) as itemrevenue 8 | ,sum(cs_ext_sales_price)*100/sum(sum(cs_ext_sales_price)) over 9 | (partition by i_class) as revenueratio 10 | from catalog_sales 11 | ,item 12 | ,date_dim 13 | where cs_item_sk = i_item_sk 14 | and i_category in ('Books', 'Shoes', 'Electronics') 15 | and cs_sold_date_sk = d_date_sk 16 | and d_date between cast('1998-03-21' as date) 17 | and cast('1998-04-20' as date) 18 | group by i_item_id 19 | ,i_item_desc 20 | ,i_category 21 | ,i_class 22 | ,i_current_price 23 | order by i_category 24 | ,i_class 25 | ,i_item_id 26 | ,i_item_desc 27 | ,revenueratio 28 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query26_1.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 0 using template query26.tpl 2 | select i_item_id, 3 | avg(cs_quantity) agg1, 4 | avg(cs_list_price) agg2, 5 | avg(cs_coupon_amt) agg3, 6 | avg(cs_sales_price) agg4 7 | from catalog_sales, customer_demographics, date_dim, item, promotion 8 | where cs_sold_date_sk = d_date_sk and 9 | cs_item_sk = i_item_sk and 10 | cs_bill_cdemo_sk = cd_demo_sk and 11 | cs_promo_sk = p_promo_sk and 12 | cd_gender = 'F' and 13 | cd_marital_status = 'W' and 14 | cd_education_status = 'Primary' and 15 | (p_channel_email = 'N' or p_channel_event = 'N') and 16 | d_year = 1998 17 | group by i_item_id 18 | order by i_item_id 19 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query26_2.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 1 using template query26.tpl 2 | select i_item_id, 3 | avg(cs_quantity) agg1, 4 | avg(cs_list_price) agg2, 5 | avg(cs_coupon_amt) agg3, 6 | avg(cs_sales_price) agg4 7 | from catalog_sales, customer_demographics, date_dim, item, promotion 8 | where cs_sold_date_sk = d_date_sk and 9 | cs_item_sk = i_item_sk and 10 | cs_bill_cdemo_sk = cd_demo_sk and 11 | cs_promo_sk = p_promo_sk and 12 | cd_gender = 'F' and 13 | cd_marital_status = 'U' and 14 | cd_education_status = '4 yr Degree' and 15 | (p_channel_email = 'N' or p_channel_event = 'N') and 16 | d_year = 1998 17 | group by i_item_id 18 | order by i_item_id 19 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query26_3.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 2 using template query26.tpl 2 | select i_item_id, 3 | avg(cs_quantity) agg1, 4 | avg(cs_list_price) agg2, 5 | avg(cs_coupon_amt) agg3, 6 | avg(cs_sales_price) agg4 7 | from catalog_sales, customer_demographics, date_dim, item, promotion 8 | where cs_sold_date_sk = d_date_sk and 9 | cs_item_sk = i_item_sk and 10 | cs_bill_cdemo_sk = cd_demo_sk and 11 | cs_promo_sk = p_promo_sk and 12 | cd_gender = 'M' and 13 | cd_marital_status = 'W' and 14 | cd_education_status = 'College' and 15 | (p_channel_email = 'N' or p_channel_event = 'N') and 16 | d_year = 2001 17 | group by i_item_id 18 | order by i_item_id 19 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query37_1.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 0 using template query37.tpl 2 | select i_item_id 3 | ,i_item_desc 4 | ,i_current_price 5 | from item, inventory, date_dim, catalog_sales 6 | where i_current_price between 22 and 22 + 30 7 | and inv_item_sk = i_item_sk 8 | and d_date_sk=inv_date_sk 9 | and d_date between cast('2001-06-02' as date) and cast('2001-08-01' as date) 10 | and i_manufact_id in (678,964,918,849) 11 | and inv_quantity_on_hand between 100 and 500 12 | and cs_item_sk = i_item_sk 13 | group by i_item_id,i_item_desc,i_current_price 14 | order by i_item_id 15 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query37_2.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 1 using template query37.tpl 2 | select i_item_id 3 | ,i_item_desc 4 | ,i_current_price 5 | from item, inventory, date_dim, catalog_sales 6 | where i_current_price between 28 and 28 + 30 7 | and inv_item_sk = i_item_sk 8 | and d_date_sk=inv_date_sk 9 | and d_date between cast('1998-01-16' as date) and cast('1998-03-17' as date) 10 | and i_manufact_id in (831,791,815,826) 11 | and inv_quantity_on_hand between 100 and 500 12 | and cs_item_sk = i_item_sk 13 | group by i_item_id,i_item_desc,i_current_price 14 | order by i_item_id 15 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query37_3.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 2 using template query37.tpl 2 | select i_item_id 3 | ,i_item_desc 4 | ,i_current_price 5 | from item, inventory, date_dim, catalog_sales 6 | where i_current_price between 43 and 43 + 30 7 | and inv_item_sk = i_item_sk 8 | and d_date_sk=inv_date_sk 9 | and d_date between cast('1999-04-12' as date) and cast('1999-06-11' as date) 10 | and i_manufact_id in (913,977,884,822) 11 | and inv_quantity_on_hand between 100 and 500 12 | and cs_item_sk = i_item_sk 13 | group by i_item_id,i_item_desc,i_current_price 14 | order by i_item_id 15 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query3_1.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 0 using template query3.tpl 2 | select dt.d_year 3 | ,item.i_brand_id brand_id 4 | ,item.i_brand brand 5 | ,sum(ss_ext_sales_price) sum_agg 6 | from date_dim dt 7 | ,store_sales 8 | ,item 9 | where dt.d_date_sk = store_sales.ss_sold_date_sk 10 | and store_sales.ss_item_sk = item.i_item_sk 11 | and item.i_manufact_id = 436 12 | and dt.d_moy=12 13 | group by dt.d_year 14 | ,item.i_brand 15 | ,item.i_brand_id 16 | order by dt.d_year 17 | ,sum_agg desc 18 | ,brand_id 19 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query3_2.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 1 using template query3.tpl 2 | select dt.d_year 3 | ,item.i_brand_id brand_id 4 | ,item.i_brand brand 5 | ,sum(ss_ext_sales_price) sum_agg 6 | from date_dim dt 7 | ,store_sales 8 | ,item 9 | where dt.d_date_sk = store_sales.ss_sold_date_sk 10 | and store_sales.ss_item_sk = item.i_item_sk 11 | and item.i_manufact_id = 977 12 | and dt.d_moy=12 13 | group by dt.d_year 14 | ,item.i_brand 15 | ,item.i_brand_id 16 | order by dt.d_year 17 | ,sum_agg desc 18 | ,brand_id 19 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query3_3.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 2 using template query3.tpl 2 | select dt.d_year 3 | ,item.i_brand_id brand_id 4 | ,item.i_brand brand 5 | ,sum(ss_sales_price) sum_agg 6 | from date_dim dt 7 | ,store_sales 8 | ,item 9 | where dt.d_date_sk = store_sales.ss_sold_date_sk 10 | and store_sales.ss_item_sk = item.i_item_sk 11 | and item.i_manufact_id = 890 12 | and dt.d_moy=12 13 | group by dt.d_year 14 | ,item.i_brand 15 | ,item.i_brand_id 16 | order by dt.d_year 17 | ,sum_agg desc 18 | ,brand_id 19 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query42_1.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 0 using template query42.tpl 2 | select dt.d_year 3 | ,item.i_category_id 4 | ,item.i_category 5 | ,sum(ss_ext_sales_price) 6 | from date_dim dt 7 | ,store_sales 8 | ,item 9 | where dt.d_date_sk = store_sales.ss_sold_date_sk 10 | and store_sales.ss_item_sk = item.i_item_sk 11 | and item.i_manager_id = 1 12 | and dt.d_moy=12 13 | and dt.d_year=1998 14 | group by dt.d_year 15 | ,item.i_category_id 16 | ,item.i_category 17 | order by sum(ss_ext_sales_price) desc,dt.d_year 18 | ,item.i_category_id 19 | ,item.i_category 20 | limit 100 ; -------------------------------------------------------------------------------- /dataset/tpcds_train/query42_2.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 1 using template query42.tpl 2 | select dt.d_year 3 | ,item.i_category_id 4 | ,item.i_category 5 | ,sum(ss_ext_sales_price) 6 | from date_dim dt 7 | ,store_sales 8 | ,item 9 | where dt.d_date_sk = store_sales.ss_sold_date_sk 10 | and store_sales.ss_item_sk = item.i_item_sk 11 | and item.i_manager_id = 1 12 | and dt.d_moy=11 13 | and dt.d_year=2001 14 | group by dt.d_year 15 | ,item.i_category_id 16 | ,item.i_category 17 | order by sum(ss_ext_sales_price) desc,dt.d_year 18 | ,item.i_category_id 19 | ,item.i_category 20 | limit 100 ; -------------------------------------------------------------------------------- /dataset/tpcds_train/query42_3.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 2 using template query42.tpl 2 | select dt.d_year 3 | ,item.i_category_id 4 | ,item.i_category 5 | ,sum(ss_ext_sales_price) 6 | from date_dim dt 7 | ,store_sales 8 | ,item 9 | where dt.d_date_sk = store_sales.ss_sold_date_sk 10 | and store_sales.ss_item_sk = item.i_item_sk 11 | and item.i_manager_id = 1 12 | and dt.d_moy=11 13 | and dt.d_year=1998 14 | group by dt.d_year 15 | ,item.i_category_id 16 | ,item.i_category 17 | order by sum(ss_ext_sales_price) desc,dt.d_year 18 | ,item.i_category_id 19 | ,item.i_category 20 | limit 100 ; -------------------------------------------------------------------------------- /dataset/tpcds_train/query55_1.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 0 using template query55.tpl 2 | select i_brand_id brand_id, i_brand brand, 3 | sum(ss_ext_sales_price) ext_price 4 | from date_dim, store_sales, item 5 | where d_date_sk = ss_sold_date_sk 6 | and ss_item_sk = i_item_sk 7 | and i_manager_id=36 8 | and d_moy=12 9 | and d_year=2001 10 | group by i_brand, i_brand_id 11 | order by ext_price desc, i_brand_id 12 | limit 100 ; -------------------------------------------------------------------------------- /dataset/tpcds_train/query55_2.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 1 using template query55.tpl 2 | select i_brand_id brand_id, i_brand brand, 3 | sum(ss_ext_sales_price) ext_price 4 | from date_dim, store_sales, item 5 | where d_date_sk = ss_sold_date_sk 6 | and ss_item_sk = i_item_sk 7 | and i_manager_id=77 8 | and d_moy=12 9 | and d_year=2002 10 | group by i_brand, i_brand_id 11 | order by ext_price desc, i_brand_id 12 | limit 100 ; -------------------------------------------------------------------------------- /dataset/tpcds_train/query55_3.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 2 using template query55.tpl 2 | select i_brand_id brand_id, i_brand brand, 3 | sum(ss_ext_sales_price) ext_price 4 | from date_dim, store_sales, item 5 | where d_date_sk = ss_sold_date_sk 6 | and ss_item_sk = i_item_sk 7 | and i_manager_id=90 8 | and d_moy=12 9 | and d_year=2001 10 | group by i_brand, i_brand_id 11 | order by ext_price desc, i_brand_id 12 | limit 100 ; -------------------------------------------------------------------------------- /dataset/tpcds_train/query7_1.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 0 using template query7.tpl 2 | select i_item_id, 3 | avg(ss_quantity) agg1, 4 | avg(ss_list_price) agg2, 5 | avg(ss_coupon_amt) agg3, 6 | avg(ss_sales_price) agg4 7 | from store_sales, customer_demographics, date_dim, item, promotion 8 | where ss_sold_date_sk = d_date_sk and 9 | ss_item_sk = i_item_sk and 10 | ss_cdemo_sk = cd_demo_sk and 11 | ss_promo_sk = p_promo_sk and 12 | cd_gender = 'F' and 13 | cd_marital_status = 'W' and 14 | cd_education_status = 'Primary' and 15 | (p_channel_email = 'N' or p_channel_event = 'N') and 16 | d_year = 1998 17 | group by i_item_id 18 | order by i_item_id 19 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query7_2.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 1 using template query7.tpl 2 | select i_item_id, 3 | avg(ss_quantity) agg1, 4 | avg(ss_list_price) agg2, 5 | avg(ss_coupon_amt) agg3, 6 | avg(ss_sales_price) agg4 7 | from store_sales, customer_demographics, date_dim, item, promotion 8 | where ss_sold_date_sk = d_date_sk and 9 | ss_item_sk = i_item_sk and 10 | ss_cdemo_sk = cd_demo_sk and 11 | ss_promo_sk = p_promo_sk and 12 | cd_gender = 'F' and 13 | cd_marital_status = 'U' and 14 | cd_education_status = '4 yr Degree' and 15 | (p_channel_email = 'N' or p_channel_event = 'N') and 16 | d_year = 1998 17 | group by i_item_id 18 | order by i_item_id 19 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query7_3.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 2 using template query7.tpl 2 | select i_item_id, 3 | avg(ss_quantity) agg1, 4 | avg(ss_list_price) agg2, 5 | avg(ss_coupon_amt) agg3, 6 | avg(ss_sales_price) agg4 7 | from store_sales, customer_demographics, date_dim, item, promotion 8 | where ss_sold_date_sk = d_date_sk and 9 | ss_item_sk = i_item_sk and 10 | ss_cdemo_sk = cd_demo_sk and 11 | ss_promo_sk = p_promo_sk and 12 | cd_gender = 'M' and 13 | cd_marital_status = 'W' and 14 | cd_education_status = 'College' and 15 | (p_channel_email = 'N' or p_channel_event = 'N') and 16 | d_year = 2001 17 | group by i_item_id 18 | order by i_item_id 19 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query84_1.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 0 using template query84.tpl 2 | select c_customer_id as customer_id 3 | , coalesce(c_last_name,'') || ', ' || coalesce(c_first_name,'') as customername 4 | from customer 5 | ,customer_address 6 | ,customer_demographics 7 | ,household_demographics 8 | ,income_band 9 | ,store_returns 10 | where ca_city = 'Hopewell' 11 | and c_current_addr_sk = ca_address_sk 12 | and ib_lower_bound >= 32287 13 | and ib_upper_bound <= 32287 + 50000 14 | and ib_income_band_sk = hd_income_band_sk 15 | and cd_demo_sk = c_current_cdemo_sk 16 | and hd_demo_sk = c_current_hdemo_sk 17 | and sr_cdemo_sk = cd_demo_sk 18 | order by c_customer_id 19 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query84_2.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 1 using template query84.tpl 2 | select c_customer_id as customer_id 3 | , coalesce(c_last_name,'') || ', ' || coalesce(c_first_name,'') as customername 4 | from customer 5 | ,customer_address 6 | ,customer_demographics 7 | ,household_demographics 8 | ,income_band 9 | ,store_returns 10 | where ca_city = 'Hamilton' 11 | and c_current_addr_sk = ca_address_sk 12 | and ib_lower_bound >= 69245 13 | and ib_upper_bound <= 69245 + 50000 14 | and ib_income_band_sk = hd_income_band_sk 15 | and cd_demo_sk = c_current_cdemo_sk 16 | and hd_demo_sk = c_current_hdemo_sk 17 | and sr_cdemo_sk = cd_demo_sk 18 | order by c_customer_id 19 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query84_3.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 2 using template query84.tpl 2 | select c_customer_id as customer_id 3 | , coalesce(c_last_name,'') || ', ' || coalesce(c_first_name,'') as customername 4 | from customer 5 | ,customer_address 6 | ,customer_demographics 7 | ,household_demographics 8 | ,income_band 9 | ,store_returns 10 | where ca_city = 'Pleasant Hill' 11 | and c_current_addr_sk = ca_address_sk 12 | and ib_lower_bound >= 35577 13 | and ib_upper_bound <= 35577 + 50000 14 | and ib_income_band_sk = hd_income_band_sk 15 | and cd_demo_sk = c_current_cdemo_sk 16 | and hd_demo_sk = c_current_hdemo_sk 17 | and sr_cdemo_sk = cd_demo_sk 18 | order by c_customer_id 19 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query96_1.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 0 using template query96.tpl 2 | select count(*) 3 | from store_sales 4 | ,household_demographics 5 | ,time_dim, store 6 | where ss_sold_time_sk = time_dim.t_time_sk 7 | and ss_hdemo_sk = household_demographics.hd_demo_sk 8 | and ss_store_sk = s_store_sk 9 | and time_dim.t_hour = 8 10 | and time_dim.t_minute >= 30 11 | and household_demographics.hd_dep_count = 5 12 | and store.s_store_name = 'ese' 13 | order by count(*) 14 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query96_2.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 1 using template query96.tpl 2 | select count(*) 3 | from store_sales 4 | ,household_demographics 5 | ,time_dim, store 6 | where ss_sold_time_sk = time_dim.t_time_sk 7 | and ss_hdemo_sk = household_demographics.hd_demo_sk 8 | and ss_store_sk = s_store_sk 9 | and time_dim.t_hour = 20 10 | and time_dim.t_minute >= 30 11 | and household_demographics.hd_dep_count = 8 12 | and store.s_store_name = 'ese' 13 | order by count(*) 14 | limit 100; -------------------------------------------------------------------------------- /dataset/tpcds_train/query96_3.sql: -------------------------------------------------------------------------------- 1 | --start query 1 in stream 2 using template query96.tpl 2 | select count(*) 3 | from store_sales 4 | ,household_demographics 5 | ,time_dim, store 6 | where ss_sold_time_sk = time_dim.t_time_sk 7 | and ss_hdemo_sk = household_demographics.hd_demo_sk 8 | and ss_store_sk = s_store_sk 9 | and time_dim.t_hour = 20 10 | and time_dim.t_minute >= 30 11 | and household_demographics.hd_dep_count = 5 12 | and store.s_store_name = 'ese' 13 | order by count(*) 14 | limit 100; -------------------------------------------------------------------------------- /dataset/train/10b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(chn.name) AS character, 2 | MIN(t.title) AS russian_mov_with_actor_producer 3 | FROM char_name AS chn, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | company_type AS ct, 7 | movie_companies AS mc, 8 | role_type AS rt, 9 | title AS t 10 | WHERE ci.note LIKE '%(producer)%' 11 | AND cn.country_code = '[ru]' 12 | AND rt.role = 'actor' 13 | AND t.production_year > 2010 14 | AND t.id = mc.movie_id 15 | AND t.id = ci.movie_id 16 | AND ci.movie_id = mc.movie_id 17 | AND chn.id = ci.person_role_id 18 | AND rt.id = ci.role_id 19 | AND cn.id = mc.company_id 20 | AND ct.id = mc.company_type_id; 21 | 22 | -------------------------------------------------------------------------------- /dataset/train/10c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(chn.name) AS character, 2 | MIN(t.title) AS movie_with_american_producer 3 | FROM char_name AS chn, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | company_type AS ct, 7 | movie_companies AS mc, 8 | role_type AS rt, 9 | title AS t 10 | WHERE ci.note LIKE '%(producer)%' 11 | AND cn.country_code = '[us]' 12 | AND t.production_year > 1990 13 | AND t.id = mc.movie_id 14 | AND t.id = ci.movie_id 15 | AND ci.movie_id = mc.movie_id 16 | AND chn.id = ci.person_role_id 17 | AND rt.id = ci.role_id 18 | AND cn.id = mc.company_id 19 | AND ct.id = mc.company_type_id; 20 | -------------------------------------------------------------------------------- /dataset/train/11b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(cn.name) AS from_company, 2 | MIN(lt.link) AS movie_link_type, 3 | MIN(t.title) AS sequel_movie 4 | FROM company_name AS cn, 5 | company_type AS ct, 6 | keyword AS k, 7 | link_type AS lt, 8 | movie_companies AS mc, 9 | movie_keyword AS mk, 10 | movie_link AS ml, 11 | title AS t 12 | WHERE cn.country_code !='[pl]' 13 | AND (cn.name LIKE '%Film%' 14 | OR cn.name LIKE '%Warner%') 15 | AND ct.kind ='production companies' 16 | AND k.keyword ='sequel' 17 | AND lt.link LIKE '%follows%' 18 | AND mc.note IS NULL 19 | AND t.production_year = 1998 20 | AND t.title LIKE '%Money%' 21 | AND lt.id = ml.link_type_id 22 | AND ml.movie_id = t.id 23 | AND t.id = mk.movie_id 24 | AND mk.keyword_id = k.id 25 | AND t.id = mc.movie_id 26 | AND mc.company_type_id = ct.id 27 | AND mc.company_id = cn.id 28 | AND ml.movie_id = mk.movie_id 29 | AND ml.movie_id = mc.movie_id 30 | AND mk.movie_id = mc.movie_id; 31 | 32 | -------------------------------------------------------------------------------- /dataset/train/11d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(cn.name) AS from_company, 2 | MIN(mc.note) AS production_note, 3 | MIN(t.title) AS movie_based_on_book 4 | FROM company_name AS cn, 5 | company_type AS ct, 6 | keyword AS k, 7 | link_type AS lt, 8 | movie_companies AS mc, 9 | movie_keyword AS mk, 10 | movie_link AS ml, 11 | title AS t 12 | WHERE cn.country_code !='[pl]' 13 | AND ct.kind != 'production companies' 14 | AND ct.kind IS NOT NULL 15 | AND k.keyword IN ('sequel', 16 | 'revenge', 17 | 'based-on-novel') 18 | AND mc.note IS NOT NULL 19 | AND t.production_year > 1950 20 | AND lt.id = ml.link_type_id 21 | AND ml.movie_id = t.id 22 | AND t.id = mk.movie_id 23 | AND mk.keyword_id = k.id 24 | AND t.id = mc.movie_id 25 | AND mc.company_type_id = ct.id 26 | AND mc.company_id = cn.id 27 | AND ml.movie_id = mk.movie_id 28 | AND ml.movie_id = mc.movie_id 29 | AND mk.movie_id = mc.movie_id; 30 | 31 | -------------------------------------------------------------------------------- /dataset/train/12b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mi.info) AS budget, 2 | MIN(t.title) AS unsuccsessful_movie 3 | FROM company_name AS cn, 4 | company_type AS ct, 5 | info_type AS it1, 6 | info_type AS it2, 7 | movie_companies AS mc, 8 | movie_info AS mi, 9 | movie_info_idx AS mi_idx, 10 | title AS t 11 | WHERE cn.country_code ='[us]' 12 | AND ct.kind IS NOT NULL 13 | AND (ct.kind ='production companies' 14 | OR ct.kind = 'distributors') 15 | AND it1.info ='budget' 16 | AND it2.info ='bottom 10 rank' 17 | AND t.production_year >2000 18 | AND (t.title LIKE 'Birdemic%' 19 | OR t.title LIKE '%Movie%') 20 | AND t.id = mi.movie_id 21 | AND t.id = mi_idx.movie_id 22 | AND mi.info_type_id = it1.id 23 | AND mi_idx.info_type_id = it2.id 24 | AND t.id = mc.movie_id 25 | AND ct.id = mc.company_type_id 26 | AND cn.id = mc.company_id 27 | AND mc.movie_id = mi.movie_id 28 | AND mc.movie_id = mi_idx.movie_id 29 | AND mi.movie_id = mi_idx.movie_id; 30 | 31 | -------------------------------------------------------------------------------- /dataset/train/13d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(cn.name) AS producing_company, 2 | MIN(miidx.info) AS rating, 3 | MIN(t.title) AS movie 4 | FROM company_name AS cn, 5 | company_type AS ct, 6 | info_type AS it, 7 | info_type AS it2, 8 | kind_type AS kt, 9 | movie_companies AS mc, 10 | movie_info AS mi, 11 | movie_info_idx AS miidx, 12 | title AS t 13 | WHERE cn.country_code ='[us]' 14 | AND ct.kind ='production companies' 15 | AND it.info ='rating' 16 | AND it2.info ='release dates' 17 | AND kt.kind ='movie' 18 | AND mi.movie_id = t.id 19 | AND it2.id = mi.info_type_id 20 | AND kt.id = t.kind_id 21 | AND mc.movie_id = t.id 22 | AND cn.id = mc.company_id 23 | AND ct.id = mc.company_type_id 24 | AND miidx.movie_id = t.id 25 | AND it.id = miidx.info_type_id 26 | AND mi.movie_id = miidx.movie_id 27 | AND mi.movie_id = mc.movie_id 28 | AND miidx.movie_id = mc.movie_id; 29 | 30 | -------------------------------------------------------------------------------- /dataset/train/15d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(at.title) AS aka_title, 2 | MIN(t.title) AS internet_movie_title 3 | FROM aka_title AS at, 4 | company_name AS cn, 5 | company_type AS ct, 6 | info_type AS it1, 7 | keyword AS k, 8 | movie_companies AS mc, 9 | movie_info AS mi, 10 | movie_keyword AS mk, 11 | title AS t 12 | WHERE cn.country_code = '[us]' 13 | AND it1.info = 'release dates' 14 | AND mi.note LIKE '%internet%' 15 | AND t.production_year > 1990 16 | AND t.id = at.movie_id 17 | AND t.id = mi.movie_id 18 | AND t.id = mk.movie_id 19 | AND t.id = mc.movie_id 20 | AND mk.movie_id = mi.movie_id 21 | AND mk.movie_id = mc.movie_id 22 | AND mk.movie_id = at.movie_id 23 | AND mi.movie_id = mc.movie_id 24 | AND mi.movie_id = at.movie_id 25 | AND mc.movie_id = at.movie_id 26 | AND k.id = mk.keyword_id 27 | AND it1.id = mi.info_type_id 28 | AND cn.id = mc.company_id 29 | AND ct.id = mc.company_type_id; 30 | 31 | -------------------------------------------------------------------------------- /dataset/train/16b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an.name) AS cool_actor_pseudonym, 2 | MIN(t.title) AS series_named_after_char 3 | FROM aka_name AS an, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | keyword AS k, 7 | movie_companies AS mc, 8 | movie_keyword AS mk, 9 | name AS n, 10 | title AS t 11 | WHERE cn.country_code ='[us]' 12 | AND k.keyword ='character-name-in-title' 13 | AND an.person_id = n.id 14 | AND n.id = ci.person_id 15 | AND ci.movie_id = t.id 16 | AND t.id = mk.movie_id 17 | AND mk.keyword_id = k.id 18 | AND t.id = mc.movie_id 19 | AND mc.company_id = cn.id 20 | AND an.person_id = ci.person_id 21 | AND ci.movie_id = mc.movie_id 22 | AND ci.movie_id = mk.movie_id 23 | AND mc.movie_id = mk.movie_id; 24 | 25 | -------------------------------------------------------------------------------- /dataset/train/16c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an.name) AS cool_actor_pseudonym, 2 | MIN(t.title) AS series_named_after_char 3 | FROM aka_name AS an, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | keyword AS k, 7 | movie_companies AS mc, 8 | movie_keyword AS mk, 9 | name AS n, 10 | title AS t 11 | WHERE cn.country_code ='[us]' 12 | AND k.keyword ='character-name-in-title' 13 | AND t.episode_nr < 100 14 | AND an.person_id = n.id 15 | AND n.id = ci.person_id 16 | AND ci.movie_id = t.id 17 | AND t.id = mk.movie_id 18 | AND mk.keyword_id = k.id 19 | AND t.id = mc.movie_id 20 | AND mc.company_id = cn.id 21 | AND an.person_id = ci.person_id 22 | AND ci.movie_id = mc.movie_id 23 | AND ci.movie_id = mk.movie_id 24 | AND mc.movie_id = mk.movie_id; 25 | 26 | -------------------------------------------------------------------------------- /dataset/train/16d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an.name) AS cool_actor_pseudonym, 2 | MIN(t.title) AS series_named_after_char 3 | FROM aka_name AS an, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | keyword AS k, 7 | movie_companies AS mc, 8 | movie_keyword AS mk, 9 | name AS n, 10 | title AS t 11 | WHERE cn.country_code ='[us]' 12 | AND k.keyword ='character-name-in-title' 13 | AND t.episode_nr >= 5 14 | AND t.episode_nr < 100 15 | AND an.person_id = n.id 16 | AND n.id = ci.person_id 17 | AND ci.movie_id = t.id 18 | AND t.id = mk.movie_id 19 | AND mk.keyword_id = k.id 20 | AND t.id = mc.movie_id 21 | AND mc.company_id = cn.id 22 | AND an.person_id = ci.person_id 23 | AND ci.movie_id = mc.movie_id 24 | AND ci.movie_id = mk.movie_id 25 | AND mc.movie_id = mk.movie_id; 26 | 27 | -------------------------------------------------------------------------------- /dataset/train/17b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(n.name) AS member_in_charnamed_movie, 2 | MIN(n.name) AS a1 3 | FROM cast_info AS ci, 4 | company_name AS cn, 5 | keyword AS k, 6 | movie_companies AS mc, 7 | movie_keyword AS mk, 8 | name AS n, 9 | title AS t 10 | WHERE k.keyword ='character-name-in-title' 11 | AND n.name LIKE 'Z%' 12 | AND n.id = ci.person_id 13 | AND ci.movie_id = t.id 14 | AND t.id = mk.movie_id 15 | AND mk.keyword_id = k.id 16 | AND t.id = mc.movie_id 17 | AND mc.company_id = cn.id 18 | AND ci.movie_id = mc.movie_id 19 | AND ci.movie_id = mk.movie_id 20 | AND mc.movie_id = mk.movie_id; 21 | 22 | -------------------------------------------------------------------------------- /dataset/train/17c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(n.name) AS member_in_charnamed_movie, 2 | MIN(n.name) AS a1 3 | FROM cast_info AS ci, 4 | company_name AS cn, 5 | keyword AS k, 6 | movie_companies AS mc, 7 | movie_keyword AS mk, 8 | name AS n, 9 | title AS t 10 | WHERE k.keyword ='character-name-in-title' 11 | AND n.name LIKE 'X%' 12 | AND n.id = ci.person_id 13 | AND ci.movie_id = t.id 14 | AND t.id = mk.movie_id 15 | AND mk.keyword_id = k.id 16 | AND t.id = mc.movie_id 17 | AND mc.company_id = cn.id 18 | AND ci.movie_id = mc.movie_id 19 | AND ci.movie_id = mk.movie_id 20 | AND mc.movie_id = mk.movie_id; 21 | 22 | -------------------------------------------------------------------------------- /dataset/train/17d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(n.name) AS member_in_charnamed_movie 2 | FROM cast_info AS ci, 3 | company_name AS cn, 4 | keyword AS k, 5 | movie_companies AS mc, 6 | movie_keyword AS mk, 7 | name AS n, 8 | title AS t 9 | WHERE k.keyword ='character-name-in-title' 10 | AND n.name LIKE '%Bert%' 11 | AND n.id = ci.person_id 12 | AND ci.movie_id = t.id 13 | AND t.id = mk.movie_id 14 | AND mk.keyword_id = k.id 15 | AND t.id = mc.movie_id 16 | AND mc.company_id = cn.id 17 | AND ci.movie_id = mc.movie_id 18 | AND ci.movie_id = mk.movie_id 19 | AND mc.movie_id = mk.movie_id; 20 | 21 | -------------------------------------------------------------------------------- /dataset/train/17e.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(n.name) AS member_in_charnamed_movie 2 | FROM cast_info AS ci, 3 | company_name AS cn, 4 | keyword AS k, 5 | movie_companies AS mc, 6 | movie_keyword AS mk, 7 | name AS n, 8 | title AS t 9 | WHERE cn.country_code ='[us]' 10 | AND k.keyword ='character-name-in-title' 11 | AND n.id = ci.person_id 12 | AND ci.movie_id = t.id 13 | AND t.id = mk.movie_id 14 | AND mk.keyword_id = k.id 15 | AND t.id = mc.movie_id 16 | AND mc.company_id = cn.id 17 | AND ci.movie_id = mc.movie_id 18 | AND ci.movie_id = mk.movie_id 19 | AND mc.movie_id = mk.movie_id; 20 | 21 | -------------------------------------------------------------------------------- /dataset/train/17f.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(n.name) AS member_in_charnamed_movie 2 | FROM cast_info AS ci, 3 | company_name AS cn, 4 | keyword AS k, 5 | movie_companies AS mc, 6 | movie_keyword AS mk, 7 | name AS n, 8 | title AS t 9 | WHERE k.keyword ='character-name-in-title' 10 | AND n.name LIKE '%B%' 11 | AND n.id = ci.person_id 12 | AND ci.movie_id = t.id 13 | AND t.id = mk.movie_id 14 | AND mk.keyword_id = k.id 15 | AND t.id = mc.movie_id 16 | AND mc.company_id = cn.id 17 | AND ci.movie_id = mc.movie_id 18 | AND ci.movie_id = mk.movie_id 19 | AND mc.movie_id = mk.movie_id; 20 | 21 | -------------------------------------------------------------------------------- /dataset/train/1b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mc.note) AS production_note, 2 | MIN(t.title) AS movie_title, 3 | MIN(t.production_year) AS movie_year 4 | FROM company_type AS ct, 5 | info_type AS it, 6 | movie_companies AS mc, 7 | movie_info_idx AS mi_idx, 8 | title AS t 9 | WHERE ct.kind = 'production companies' 10 | AND it.info = 'bottom 10 rank' 11 | AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' 12 | AND t.production_year BETWEEN 2005 AND 2010 13 | AND ct.id = mc.company_type_id 14 | AND t.id = mc.movie_id 15 | AND t.id = mi_idx.movie_id 16 | AND mc.movie_id = mi_idx.movie_id 17 | AND it.id = mi_idx.info_type_id; 18 | 19 | -------------------------------------------------------------------------------- /dataset/train/1c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mc.note) AS production_note, 2 | MIN(t.title) AS movie_title, 3 | MIN(t.production_year) AS movie_year 4 | FROM company_type AS ct, 5 | info_type AS it, 6 | movie_companies AS mc, 7 | movie_info_idx AS mi_idx, 8 | title AS t 9 | WHERE ct.kind = 'production companies' 10 | AND it.info = 'top 250 rank' 11 | AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' 12 | AND (mc.note LIKE '%(co-production)%') 13 | AND t.production_year >2010 14 | AND ct.id = mc.company_type_id 15 | AND t.id = mc.movie_id 16 | AND t.id = mi_idx.movie_id 17 | AND mc.movie_id = mi_idx.movie_id 18 | AND it.id = mi_idx.info_type_id; 19 | 20 | -------------------------------------------------------------------------------- /dataset/train/1d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mc.note) AS production_note, 2 | MIN(t.title) AS movie_title, 3 | MIN(t.production_year) AS movie_year 4 | FROM company_type AS ct, 5 | info_type AS it, 6 | movie_companies AS mc, 7 | movie_info_idx AS mi_idx, 8 | title AS t 9 | WHERE ct.kind = 'production companies' 10 | AND it.info = 'bottom 10 rank' 11 | AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' 12 | AND t.production_year >2000 13 | AND ct.id = mc.company_type_id 14 | AND t.id = mc.movie_id 15 | AND t.id = mi_idx.movie_id 16 | AND mc.movie_id = mi_idx.movie_id 17 | AND it.id = mi_idx.info_type_id; 18 | 19 | -------------------------------------------------------------------------------- /dataset/train/2b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS movie_title 2 | FROM company_name AS cn, 3 | keyword AS k, 4 | movie_companies AS mc, 5 | movie_keyword AS mk, 6 | title AS t 7 | WHERE cn.country_code ='[nl]' 8 | AND k.keyword ='character-name-in-title' 9 | AND cn.id = mc.company_id 10 | AND mc.movie_id = t.id 11 | AND t.id = mk.movie_id 12 | AND mk.keyword_id = k.id 13 | AND mc.movie_id = mk.movie_id; 14 | 15 | -------------------------------------------------------------------------------- /dataset/train/2c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS movie_title 2 | FROM company_name AS cn, 3 | keyword AS k, 4 | movie_companies AS mc, 5 | movie_keyword AS mk, 6 | title AS t 7 | WHERE cn.country_code ='[sm]' 8 | AND k.keyword ='character-name-in-title' 9 | AND cn.id = mc.company_id 10 | AND mc.movie_id = t.id 11 | AND t.id = mk.movie_id 12 | AND mk.keyword_id = k.id 13 | AND mc.movie_id = mk.movie_id; 14 | 15 | -------------------------------------------------------------------------------- /dataset/train/2d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS movie_title 2 | FROM company_name AS cn, 3 | keyword AS k, 4 | movie_companies AS mc, 5 | movie_keyword AS mk, 6 | title AS t 7 | WHERE cn.country_code ='[us]' 8 | AND k.keyword ='character-name-in-title' 9 | AND cn.id = mc.company_id 10 | AND mc.movie_id = t.id 11 | AND t.id = mk.movie_id 12 | AND mk.keyword_id = k.id 13 | AND mc.movie_id = mk.movie_id; 14 | 15 | -------------------------------------------------------------------------------- /dataset/train/32b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(lt.link) AS link_type, 2 | MIN(t1.title) AS first_movie, 3 | MIN(t2.title) AS second_movie 4 | FROM keyword AS k, 5 | link_type AS lt, 6 | movie_keyword AS mk, 7 | movie_link AS ml, 8 | title AS t1, 9 | title AS t2 10 | WHERE k.keyword ='character-name-in-title' 11 | AND mk.keyword_id = k.id 12 | AND t1.id = mk.movie_id 13 | AND ml.movie_id = t1.id 14 | AND ml.linked_movie_id = t2.id 15 | AND lt.id = ml.link_type_id 16 | AND mk.movie_id = t1.id; 17 | 18 | -------------------------------------------------------------------------------- /dataset/train/3b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS movie_title 2 | FROM keyword AS k, 3 | movie_info AS mi, 4 | movie_keyword AS mk, 5 | title AS t 6 | WHERE k.keyword LIKE '%sequel%' 7 | AND mi.info IN ('Bulgaria') 8 | AND t.production_year > 2010 9 | AND t.id = mi.movie_id 10 | AND t.id = mk.movie_id 11 | AND mk.movie_id = mi.movie_id 12 | AND k.id = mk.keyword_id; 13 | 14 | -------------------------------------------------------------------------------- /dataset/train/3c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS movie_title 2 | FROM keyword AS k, 3 | movie_info AS mi, 4 | movie_keyword AS mk, 5 | title AS t 6 | WHERE k.keyword LIKE '%sequel%' 7 | AND mi.info IN ('Sweden', 8 | 'Norway', 9 | 'Germany', 10 | 'Denmark', 11 | 'Swedish', 12 | 'Denish', 13 | 'Norwegian', 14 | 'German', 15 | 'USA', 16 | 'American') 17 | AND t.production_year > 1990 18 | AND t.id = mi.movie_id 19 | AND t.id = mk.movie_id 20 | AND mk.movie_id = mi.movie_id 21 | AND k.id = mk.keyword_id; 22 | 23 | -------------------------------------------------------------------------------- /dataset/train/4b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mi_idx.info) AS rating, 2 | MIN(t.title) AS movie_title 3 | FROM info_type AS it, 4 | keyword AS k, 5 | movie_info_idx AS mi_idx, 6 | movie_keyword AS mk, 7 | title AS t 8 | WHERE it.info ='rating' 9 | AND k.keyword LIKE '%sequel%' 10 | AND mi_idx.info > '9.0' 11 | AND t.production_year > 2010 12 | AND t.id = mi_idx.movie_id 13 | AND t.id = mk.movie_id 14 | AND mk.movie_id = mi_idx.movie_id 15 | AND k.id = mk.keyword_id 16 | AND it.id = mi_idx.info_type_id; 17 | 18 | -------------------------------------------------------------------------------- /dataset/train/4c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(mi_idx.info) AS rating, 2 | MIN(t.title) AS movie_title 3 | FROM info_type AS it, 4 | keyword AS k, 5 | movie_info_idx AS mi_idx, 6 | movie_keyword AS mk, 7 | title AS t 8 | WHERE it.info ='rating' 9 | AND k.keyword LIKE '%sequel%' 10 | AND mi_idx.info > '2.0' 11 | AND t.production_year > 1990 12 | AND t.id = mi_idx.movie_id 13 | AND t.id = mk.movie_id 14 | AND mk.movie_id = mi_idx.movie_id 15 | AND k.id = mk.keyword_id 16 | AND it.id = mi_idx.info_type_id; 17 | 18 | -------------------------------------------------------------------------------- /dataset/train/5b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS american_vhs_movie 2 | FROM company_type AS ct, 3 | info_type AS it, 4 | movie_companies AS mc, 5 | movie_info AS mi, 6 | title AS t 7 | WHERE ct.kind = 'production companies' 8 | AND mc.note LIKE '%(VHS)%' 9 | AND mc.note LIKE '%(USA)%' 10 | AND mc.note LIKE '%(1994)%' 11 | AND mi.info IN ('USA', 12 | 'America') 13 | AND t.production_year > 2010 14 | AND t.id = mi.movie_id 15 | AND t.id = mc.movie_id 16 | AND mc.movie_id = mi.movie_id 17 | AND ct.id = mc.company_type_id 18 | AND it.id = mi.info_type_id; 19 | 20 | -------------------------------------------------------------------------------- /dataset/train/5c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(t.title) AS american_movie 2 | FROM company_type AS ct, 3 | info_type AS it, 4 | movie_companies AS mc, 5 | movie_info AS mi, 6 | title AS t 7 | WHERE ct.kind = 'production companies' 8 | AND mc.note NOT LIKE '%(TV)%' 9 | AND mc.note LIKE '%(USA)%' 10 | AND mi.info IN ('Sweden', 11 | 'Norway', 12 | 'Germany', 13 | 'Denmark', 14 | 'Swedish', 15 | 'Denish', 16 | 'Norwegian', 17 | 'German', 18 | 'USA', 19 | 'American') 20 | AND t.production_year > 1990 21 | AND t.id = mi.movie_id 22 | AND t.id = mc.movie_id 23 | AND mc.movie_id = mi.movie_id 24 | AND ct.id = mc.company_type_id 25 | AND it.id = mi.info_type_id; 26 | 27 | -------------------------------------------------------------------------------- /dataset/train/6b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(k.keyword) AS movie_keyword, 2 | MIN(n.name) AS actor_name, 3 | MIN(t.title) AS hero_movie 4 | FROM cast_info AS ci, 5 | keyword AS k, 6 | movie_keyword AS mk, 7 | name AS n, 8 | title AS t 9 | WHERE k.keyword IN ('superhero', 10 | 'sequel', 11 | 'second-part', 12 | 'marvel-comics', 13 | 'based-on-comic', 14 | 'tv-special', 15 | 'fight', 16 | 'violence') 17 | AND n.name LIKE '%Downey%Robert%' 18 | AND t.production_year > 2014 19 | AND k.id = mk.keyword_id 20 | AND t.id = mk.movie_id 21 | AND t.id = ci.movie_id 22 | AND ci.movie_id = mk.movie_id 23 | AND n.id = ci.person_id; 24 | 25 | -------------------------------------------------------------------------------- /dataset/train/6c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(k.keyword) AS movie_keyword, 2 | MIN(n.name) AS actor_name, 3 | MIN(t.title) AS marvel_movie 4 | FROM cast_info AS ci, 5 | keyword AS k, 6 | movie_keyword AS mk, 7 | name AS n, 8 | title AS t 9 | WHERE k.keyword = 'marvel-cinematic-universe' 10 | AND n.name LIKE '%Downey%Robert%' 11 | AND t.production_year > 2014 12 | AND k.id = mk.keyword_id 13 | AND t.id = mk.movie_id 14 | AND t.id = ci.movie_id 15 | AND ci.movie_id = mk.movie_id 16 | AND n.id = ci.person_id; 17 | 18 | -------------------------------------------------------------------------------- /dataset/train/6d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(k.keyword) AS movie_keyword, 2 | MIN(n.name) AS actor_name, 3 | MIN(t.title) AS hero_movie 4 | FROM cast_info AS ci, 5 | keyword AS k, 6 | movie_keyword AS mk, 7 | name AS n, 8 | title AS t 9 | WHERE k.keyword IN ('superhero', 10 | 'sequel', 11 | 'second-part', 12 | 'marvel-comics', 13 | 'based-on-comic', 14 | 'tv-special', 15 | 'fight', 16 | 'violence') 17 | AND n.name LIKE '%Downey%Robert%' 18 | AND t.production_year > 2000 19 | AND k.id = mk.keyword_id 20 | AND t.id = mk.movie_id 21 | AND t.id = ci.movie_id 22 | AND ci.movie_id = mk.movie_id 23 | AND n.id = ci.person_id; 24 | 25 | -------------------------------------------------------------------------------- /dataset/train/6e.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(k.keyword) AS movie_keyword, 2 | MIN(n.name) AS actor_name, 3 | MIN(t.title) AS marvel_movie 4 | FROM cast_info AS ci, 5 | keyword AS k, 6 | movie_keyword AS mk, 7 | name AS n, 8 | title AS t 9 | WHERE k.keyword = 'marvel-cinematic-universe' 10 | AND n.name LIKE '%Downey%Robert%' 11 | AND t.production_year > 2000 12 | AND k.id = mk.keyword_id 13 | AND t.id = mk.movie_id 14 | AND t.id = ci.movie_id 15 | AND ci.movie_id = mk.movie_id 16 | AND n.id = ci.person_id; 17 | 18 | -------------------------------------------------------------------------------- /dataset/train/6f.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(k.keyword) AS movie_keyword, 2 | MIN(n.name) AS actor_name, 3 | MIN(t.title) AS hero_movie 4 | FROM cast_info AS ci, 5 | keyword AS k, 6 | movie_keyword AS mk, 7 | name AS n, 8 | title AS t 9 | WHERE k.keyword IN ('superhero', 10 | 'sequel', 11 | 'second-part', 12 | 'marvel-comics', 13 | 'based-on-comic', 14 | 'tv-special', 15 | 'fight', 16 | 'violence') 17 | AND t.production_year > 2000 18 | AND k.id = mk.keyword_id 19 | AND t.id = mk.movie_id 20 | AND t.id = ci.movie_id 21 | AND ci.movie_id = mk.movie_id 22 | AND n.id = ci.person_id; 23 | 24 | -------------------------------------------------------------------------------- /dataset/train/7b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(n.name) AS of_person, 2 | MIN(t.title) AS biography_movie 3 | FROM aka_name AS an, 4 | cast_info AS ci, 5 | info_type AS it, 6 | link_type AS lt, 7 | movie_link AS ml, 8 | name AS n, 9 | person_info AS pi, 10 | title AS t 11 | WHERE an.name LIKE '%a%' 12 | AND it.info ='mini biography' 13 | AND lt.link ='features' 14 | AND n.name_pcode_cf LIKE 'D%' 15 | AND n.gender='m' 16 | AND pi.note ='Volker Boehm' 17 | AND t.production_year BETWEEN 1980 AND 1984 18 | AND n.id = an.person_id 19 | AND n.id = pi.person_id 20 | AND ci.person_id = n.id 21 | AND t.id = ci.movie_id 22 | AND ml.linked_movie_id = t.id 23 | AND lt.id = ml.link_type_id 24 | AND it.id = pi.info_type_id 25 | AND pi.person_id = an.person_id 26 | AND pi.person_id = ci.person_id 27 | AND an.person_id = ci.person_id 28 | AND ci.movie_id = ml.linked_movie_id; 29 | 30 | -------------------------------------------------------------------------------- /dataset/train/8b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an.name) AS acress_pseudonym, 2 | MIN(t.title) AS japanese_anime_movie 3 | FROM aka_name AS an, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | movie_companies AS mc, 7 | name AS n, 8 | role_type AS rt, 9 | title AS t 10 | WHERE ci.note ='(voice: English version)' 11 | AND cn.country_code ='[jp]' 12 | AND mc.note LIKE '%(Japan)%' 13 | AND mc.note NOT LIKE '%(USA)%' 14 | AND (mc.note LIKE '%(2006)%' 15 | OR mc.note LIKE '%(2007)%') 16 | AND n.name LIKE '%Yo%' 17 | AND n.name NOT LIKE '%Yu%' 18 | AND rt.role ='actress' 19 | AND t.production_year BETWEEN 2006 AND 2007 20 | AND (t.title LIKE 'One Piece%' 21 | OR t.title LIKE 'Dragon Ball Z%') 22 | AND an.person_id = n.id 23 | AND n.id = ci.person_id 24 | AND ci.movie_id = t.id 25 | AND t.id = mc.movie_id 26 | AND mc.company_id = cn.id 27 | AND ci.role_id = rt.id 28 | AND an.person_id = ci.person_id 29 | AND ci.movie_id = mc.movie_id; 30 | 31 | -------------------------------------------------------------------------------- /dataset/train/8c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(a1.name) AS writer_pseudo_name, 2 | MIN(t.title) AS movie_title 3 | FROM aka_name AS a1, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | movie_companies AS mc, 7 | name AS n1, 8 | role_type AS rt, 9 | title AS t 10 | WHERE cn.country_code ='[us]' 11 | AND rt.role ='writer' 12 | AND a1.person_id = n1.id 13 | AND n1.id = ci.person_id 14 | AND ci.movie_id = t.id 15 | AND t.id = mc.movie_id 16 | AND mc.company_id = cn.id 17 | AND ci.role_id = rt.id 18 | AND a1.person_id = ci.person_id 19 | AND ci.movie_id = mc.movie_id; 20 | 21 | -------------------------------------------------------------------------------- /dataset/train/8d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an1.name) AS costume_designer_pseudo, 2 | MIN(t.title) AS movie_with_costumes 3 | FROM aka_name AS an1, 4 | cast_info AS ci, 5 | company_name AS cn, 6 | movie_companies AS mc, 7 | name AS n1, 8 | role_type AS rt, 9 | title AS t 10 | WHERE cn.country_code ='[us]' 11 | AND rt.role ='costume designer' 12 | AND an1.person_id = n1.id 13 | AND n1.id = ci.person_id 14 | AND ci.movie_id = t.id 15 | AND t.id = mc.movie_id 16 | AND mc.company_id = cn.id 17 | AND ci.role_id = rt.id 18 | AND an1.person_id = ci.person_id 19 | AND ci.movie_id = mc.movie_id; 20 | 21 | -------------------------------------------------------------------------------- /dataset/train/9b.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an.name) AS alternative_name, 2 | MIN(chn.name) AS voiced_character, 3 | MIN(n.name) AS voicing_actress, 4 | MIN(t.title) AS american_movie 5 | FROM aka_name AS an, 6 | char_name AS chn, 7 | cast_info AS ci, 8 | company_name AS cn, 9 | movie_companies AS mc, 10 | name AS n, 11 | role_type AS rt, 12 | title AS t 13 | WHERE ci.note = '(voice)' 14 | AND cn.country_code ='[us]' 15 | AND mc.note LIKE '%(200%)%' 16 | AND (mc.note LIKE '%(USA)%' 17 | OR mc.note LIKE '%(worldwide)%') 18 | AND n.gender ='f' 19 | AND n.name LIKE '%Angel%' 20 | AND rt.role ='actress' 21 | AND t.production_year BETWEEN 2007 AND 2010 22 | AND ci.movie_id = t.id 23 | AND t.id = mc.movie_id 24 | AND ci.movie_id = mc.movie_id 25 | AND mc.company_id = cn.id 26 | AND ci.role_id = rt.id 27 | AND n.id = ci.person_id 28 | AND chn.id = ci.person_role_id 29 | AND an.person_id = n.id 30 | AND an.person_id = ci.person_id; 31 | 32 | -------------------------------------------------------------------------------- /dataset/train/9c.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an.name) AS alternative_name, 2 | MIN(chn.name) AS voiced_character_name, 3 | MIN(n.name) AS voicing_actress, 4 | MIN(t.title) AS american_movie 5 | FROM aka_name AS an, 6 | char_name AS chn, 7 | cast_info AS ci, 8 | company_name AS cn, 9 | movie_companies AS mc, 10 | name AS n, 11 | role_type AS rt, 12 | title AS t 13 | WHERE ci.note IN ('(voice)', 14 | '(voice: Japanese version)', 15 | '(voice) (uncredited)', 16 | '(voice: English version)') 17 | AND cn.country_code ='[us]' 18 | AND n.gender ='f' 19 | AND n.name LIKE '%An%' 20 | AND rt.role ='actress' 21 | AND ci.movie_id = t.id 22 | AND t.id = mc.movie_id 23 | AND ci.movie_id = mc.movie_id 24 | AND mc.company_id = cn.id 25 | AND ci.role_id = rt.id 26 | AND n.id = ci.person_id 27 | AND chn.id = ci.person_role_id 28 | AND an.person_id = n.id 29 | AND an.person_id = ci.person_id; 30 | 31 | -------------------------------------------------------------------------------- /dataset/train/9d.sql: -------------------------------------------------------------------------------- 1 | SELECT MIN(an.name) AS alternative_name, 2 | MIN(chn.name) AS voiced_char_name, 3 | MIN(n.name) AS voicing_actress, 4 | MIN(t.title) AS american_movie 5 | FROM aka_name AS an, 6 | char_name AS chn, 7 | cast_info AS ci, 8 | company_name AS cn, 9 | movie_companies AS mc, 10 | name AS n, 11 | role_type AS rt, 12 | title AS t 13 | WHERE ci.note IN ('(voice)', 14 | '(voice: Japanese version)', 15 | '(voice) (uncredited)', 16 | '(voice: English version)') 17 | AND cn.country_code ='[us]' 18 | AND n.gender ='f' 19 | AND rt.role ='actress' 20 | AND ci.movie_id = t.id 21 | AND t.id = mc.movie_id 22 | AND ci.movie_id = mc.movie_id 23 | AND mc.company_id = cn.id 24 | AND ci.role_id = rt.id 25 | AND n.id = ci.person_id 26 | AND chn.id = ci.person_role_id 27 | AND an.person_id = n.id 28 | AND an.person_id = ci.person_id; 29 | 30 | -------------------------------------------------------------------------------- /lib/__init__.py: -------------------------------------------------------------------------------- 1 | from . import filepath, iterator_utils, postgres, timer, log, randomize 2 | -------------------------------------------------------------------------------- /lib/_postgres.py: -------------------------------------------------------------------------------- 1 | try: 2 | import psycopg2 as pg 3 | from psycopg2._psycopg import connection as Connection, cursor as Cursor 4 | except ImportError: 5 | from sys import stderr 6 | print('Error: cannot import psycopg2.', file=stderr) 7 | class Cursor: 8 | def __init__(self, *args, **kwargs): 9 | pass 10 | 11 | def execute(self, *args, **kwargs): 12 | pass 13 | 14 | def fetchall(self): 15 | return [] 16 | 17 | def fetchone(self): 18 | return () 19 | 20 | class Connection: 21 | def __init__(self, *args, **kwargs): 22 | pass 23 | 24 | def cursor(self): 25 | return 26 | 27 | class pg: 28 | @classmethod 29 | def connect(cls, *args, **kwargs): 30 | return Connection() 31 | -------------------------------------------------------------------------------- /lib/log.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | class Logger: 4 | def __init__(self, file=sys.stdout, buffering=None, stdout=False, stderr=False): 5 | if isinstance(file, str): 6 | args = {} 7 | if buffering is not None: 8 | args['buffering'] = buffering 9 | file = open(file, 'a', **args) 10 | self.file = file 11 | self.stdout = stdout 12 | self.stderr = stderr 13 | 14 | def __call__(self, *value, sep=' ', end='\n', flush=False): 15 | value = sep.join(map(str, value)) + end 16 | self.file.write(value) 17 | if self.stdout: 18 | print(value, file=sys.stdout, end='') 19 | if self.stderr: 20 | print(value, file=sys.stderr, end='') 21 | if flush: 22 | self.file.flush() 23 | -------------------------------------------------------------------------------- /lib/randomize.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import numpy as np 3 | import random 4 | from torch import random as torch_random 5 | from torch import cuda 6 | 7 | torch.backends.cudnn.deterministic = True 8 | 9 | def seed(SEED): 10 | torch.manual_seed(SEED) 11 | torch.cuda.manual_seed_all(SEED) 12 | np.random.seed(SEED) 13 | random.seed(SEED) 14 | 15 | def get_random_state(): 16 | torch_state = torch_random.get_rng_state() 17 | cuda_state = cuda.get_rng_state_all() 18 | np_state = np.random.get_state() 19 | state = random.getstate() 20 | return state, np_state, torch_state, cuda_state 21 | 22 | def set_random_state(state): 23 | state, np_state, torch_state, cuda_state = state 24 | random.setstate(state) 25 | np.random.set_state(np_state) 26 | torch_random.set_rng_state(torch_state.to('cpu')) 27 | cuda_state = [s.to('cpu') for s in cuda_state] 28 | cuda.set_rng_state_all(cuda_state) 29 | 30 | -------------------------------------------------------------------------------- /lib/timer.py: -------------------------------------------------------------------------------- 1 | import time as _time 2 | import typing as _typing 3 | 4 | class timer: 5 | def __init__(self, callback: _typing.Callable[[_typing.Any], _typing.Any] = None): 6 | self.__time = None 7 | self.callback = callback 8 | 9 | def __enter__(self): 10 | self.__t = _time.time() 11 | return self 12 | 13 | def __exit__(self, exc_type, exc_val, exc_tb): 14 | self.__time = _time.time() - self.__t 15 | if self.callback is not None: 16 | self.callback(self) 17 | 18 | def reset(self): 19 | self.__time = None 20 | 21 | @property 22 | def time(self): 23 | return self.__time 24 | -------------------------------------------------------------------------------- /log/this-is-an-empty-folder.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TianyiChen0316/LOGER/c5793a900c7275aee3112b6fa89ae081d24c51e2/log/this-is-an-empty-folder.txt -------------------------------------------------------------------------------- /model/__init__.py: -------------------------------------------------------------------------------- 1 | from .graph_transformer_layer import GraphTransformerLayer as GTConv 2 | from .memory import Memory, BestCache 3 | from .lstm import MultiInputLSTM, GatedCell -------------------------------------------------------------------------------- /pretrained/this-is-an-empty-folder.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TianyiChen0316/LOGER/c5793a900c7275aee3112b6fa89ae081d24c51e2/pretrained/this-is-an-empty-folder.txt -------------------------------------------------------------------------------- /psqlparse/__init__.py: -------------------------------------------------------------------------------- 1 | from .parser import parse, parse_dict 2 | -------------------------------------------------------------------------------- /psqlparse/exceptions.py: -------------------------------------------------------------------------------- 1 | import six 2 | 3 | 4 | @six.python_2_unicode_compatible 5 | class PSqlParseError(Exception): 6 | 7 | def __init__(self, message, lineno, cursorpos): 8 | self.message = message 9 | self.lineno = lineno 10 | self.cursorpos = cursorpos 11 | 12 | def __str__(self): 13 | return self.message 14 | -------------------------------------------------------------------------------- /psqlparse/nodes/__init__.py: -------------------------------------------------------------------------------- 1 | from .parsenodes import (SelectStmt, InsertStmt, UpdateStmt, DeleteStmt, 2 | WithClause, CommonTableExpr, RangeSubselect, 3 | ResTarget, ColumnRef, FuncCall, AStar, AExpr, AConst, 4 | TypeCast, TypeName, SortBy, WindowDef, LockingClause, 5 | RangeFunction, AArrayExpr, AIndices, MultiAssignRef) 6 | from .primnodes import (RangeVar, JoinExpr, Alias, IntoClause, BoolExpr, 7 | SubLink, SetToDefault, CaseExpr, CaseWhen, NullTest, 8 | BooleanTest, RowExpr) 9 | from .value import Integer, String, Float 10 | -------------------------------------------------------------------------------- /psqlparse/nodes/nodes.py: -------------------------------------------------------------------------------- 1 | import six 2 | 3 | 4 | class Node(object): 5 | 6 | def tables(self): 7 | """ 8 | Generic method that does a depth-first search on the node attributes. 9 | 10 | Child classes should override this method for better performance. 11 | """ 12 | _tables = set() 13 | 14 | for attr in six.itervalues(self.__dict__): 15 | if isinstance(attr, list): 16 | for item in attr: 17 | if isinstance(item, Node): 18 | _tables |= item.tables() 19 | elif isinstance(attr, Node): 20 | _tables |= attr.tables() 21 | 22 | return _tables 23 | -------------------------------------------------------------------------------- /psqlparse/nodes/utils.py: -------------------------------------------------------------------------------- 1 | import importlib 2 | 3 | from six import next, iterkeys, itervalues 4 | 5 | 6 | module = importlib.import_module('psqlparse.nodes') 7 | 8 | 9 | def get_node_class(class_name): 10 | class_name = class_name.replace('_', '') 11 | return getattr(module, class_name, None) 12 | 13 | 14 | def build_from_obj(obj): 15 | if isinstance(obj, list): 16 | return [build_from_obj(item) for item in obj] 17 | if not isinstance(obj, dict): 18 | return obj 19 | _class = get_node_class(next(iterkeys(obj))) 20 | return _class(next(itervalues(obj))) if _class else obj 21 | 22 | 23 | def build_from_item(obj, key): 24 | return build_from_obj(obj[key]) if key in obj else None 25 | -------------------------------------------------------------------------------- /psqlparse/nodes/value.py: -------------------------------------------------------------------------------- 1 | import abc 2 | 3 | 4 | class Value(object): 5 | __metaclass__ = abc.ABCMeta 6 | 7 | def __str__(self): 8 | return str(self.val) 9 | 10 | @abc.abstractproperty 11 | def val(self): 12 | pass 13 | 14 | 15 | class Integer(Value): 16 | 17 | def __init__(self, obj): 18 | self.ival = obj.get('ival') 19 | 20 | def __int__(self): 21 | return self.ival 22 | 23 | @property 24 | def val(self): 25 | return self.ival 26 | 27 | 28 | class String(Value): 29 | 30 | def __init__(self, obj): 31 | self.str = obj.get('str') 32 | 33 | @property 34 | def val(self): 35 | return self.str 36 | 37 | 38 | class Float(Value): 39 | 40 | def __init__(self, obj): 41 | self.str = obj.get('str') 42 | self.fval = float(self.str) 43 | 44 | def __float__(self): 45 | return self.fval 46 | 47 | @property 48 | def val(self): 49 | return self.fval 50 | -------------------------------------------------------------------------------- /psqlparse/parser.cpython-38-x86_64-linux-gnu.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TianyiChen0316/LOGER/c5793a900c7275aee3112b6fa89ae081d24c51e2/psqlparse/parser.cpython-38-x86_64-linux-gnu.so -------------------------------------------------------------------------------- /psqlparse/parser.py: -------------------------------------------------------------------------------- 1 | def __bootstrap__(): 2 | global __bootstrap__, __loader__, __file__ 3 | import sys, pkg_resources, importlib.util 4 | __file__ = pkg_resources.resource_filename(__name__, 'parser.cpython-38-x86_64-linux-gnu.so') 5 | __loader__ = None; del __bootstrap__, __loader__ 6 | spec = importlib.util.spec_from_file_location(__name__,__file__) 7 | mod = importlib.util.module_from_spec(spec) 8 | spec.loader.exec_module(mod) 9 | __bootstrap__() 10 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | psycopg2==2.9.1 2 | cx-Oracle==8.3.0 3 | -------------------------------------------------------------------------------- /sql/this-is-an-empty-folder.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TianyiChen0316/LOGER/c5793a900c7275aee3112b6fa89ae081d24c51e2/sql/this-is-an-empty-folder.txt -------------------------------------------------------------------------------- /temps/this-is-an-empty-folder.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TianyiChen0316/LOGER/c5793a900c7275aee3112b6fa89ae081d24c51e2/temps/this-is-an-empty-folder.txt --------------------------------------------------------------------------------