db_id
stringclasses
69 values
question
stringlengths
24
325
evidence
stringlengths
0
673
SQL
stringlengths
23
804
db_schema_T
stringlengths
79
5k
db_schema
stringclasses
69 values
difficulty
stringclasses
1 value
question_id
int64
0
9.43k
__index_level_0__
int64
0
9.43k
db_schema_TC
stringlengths
41
1.68k
sql_constructs
listlengths
2
17
sql_complexity
int64
2
46
sql_complexity_buckets
stringclasses
3 values
few_shots
dict
law_episode
What is the full place of birth of Rene Chenevert Balcer?
full place of birth refers to birth_place, birth_region; Rene Chenevert Balcer refers to birth_name = 'Rene Chenevert Balcer'
SELECT birth_place, birth_region FROM Person WHERE birth_name = 'Rene Chenevert Balcer'
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,301
1,301
CREATE TABLE `Person` ( name TEXT, birth_name TEXT, birth_place TEXT, birth_region TEXT, nickname TEXT )
[ "SELECT", "FROM" ]
2
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141 ] }
law_episode
What is the name of the actors born in the USA?
born in the USA refers to birth_country = 'USA'
SELECT name FROM Person WHERE birth_country = 'USA'
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,302
1,302
CREATE TABLE `Person` ( name TEXT, birth_name TEXT, birth_country TEXT, nickname TEXT )
[ "SELECT", "FROM" ]
2
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141 ] }
law_episode
What is the title of the episodes that were least enjoyed?
least enjoyed refers to stars = 1
SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 1
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,303
1,303
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, title TEXT, episode_image TEXT ) CREATE TABLE `Vote` ( episode_id TEXT, stars INTEGER, foreign key episode_id references Episodeepisode_id )
[ "AS", "SELECT", "INNER JOIN", "ON", "FROM" ]
6
simple
{ "case_1": [ 163 ], "case_2": [ 163, 313, 810, 973 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 102, 104, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 506, 507, 508, 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 527, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 657, 658, 659, 660, 661, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 978, 980, 981, 982, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1075, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
What are the names of the two people who won an award for their role as directors?
won an award refers to result = 'Winner'; role as director refers to role = 'director'
SELECT T1.name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.Result = 'Winner' AND T2.role = 'director'
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,304
1,304
CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, person_id TEXT, role TEXT, result TEXT, foreign key person_id references Personperson_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
7
simple
{ "case_1": [ -1 ], "case_2": [ 956 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
How many votes did the episode titled Juvenile get?
the episode titled Juvenile refers to title = 'Juvenile'
SELECT SUM(T2.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Juvenile'
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,305
1,305
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, title TEXT, episode_image TEXT, votes INTEGER ) CREATE TABLE `Vote` ( episode_id TEXT, votes INTEGER, foreign key episode_id references Episodeepisode_id )
[ "AS", "SELECT", "SUM", "INNER JOIN", "ON", "FROM" ]
7
simple
{ "case_1": [ 163 ], "case_2": [ 163, 313, 810, 973 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 104, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 506, 507, 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 527, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
In which episodes was Anthony Azzara not credited?
which episode refers to title; not credited refers to credited = ''
SELECT T1.title FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T2.credited = 'false' AND T3.name = 'Anthony Azzara'
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,306
1,306
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, title TEXT, episode_image TEXT ) CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Credit` ( episode_id TEXT, person_id TEXT, credited TEXT, primary key episode_id, person_id, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
10
simple
{ "case_1": [ 116, 494, 702, 793 ], "case_2": [ 116, 266, 494, 702, 793 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
In what year did the episodes titled DWB get an award?
titled DWB refers to title = 'DWB'; get an award refers to result = 'Winner'
SELECT DISTINCT T1.year FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.title = 'DWB' AND T1.result = 'Winner'
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,307
1,307
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, title TEXT, episode_image TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, year INTEGER, award_category TEXT, award TEXT, episode_id TEXT, result TEXT, foreign key episode_id references Episodeepisode_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
7
simple
{ "case_1": [ -1 ], "case_2": [ 733 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
In which region were the assistant location managers born?
region refers to birth_region; assistant location manager refers to role = 'assistant location manager'
SELECT T2.birth_region FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.role = 'president of NBC West Coast'
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,308
1,308
CREATE TABLE `Person` ( person_id TEXT primary key, birth_region TEXT ) CREATE TABLE `Credit` ( person_id TEXT, role TEXT, person_id, foreign key person_id references Personperson_id )
[ "AS", "SELECT", "INNER JOIN", "ON", "FROM" ]
6
simple
{ "case_1": [ -1 ], "case_2": [ 138 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 102, 104, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 506, 507, 508, 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 527, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 657, 658, 659, 660, 661, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 978, 980, 981, 982, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1075, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
How many stars did the episodes in which Donna Villella worked?
SELECT COUNT(T3.person_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T3.name = 'Donna Villella'
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,309
1,309
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, episode_image TEXT ) CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Credit` ( episode_id TEXT, person_id TEXT, primary key episode_id, person_id, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id )
[ "AS", "SELECT", "INNER JOIN", "ON", "COUNT", "FROM" ]
10
simple
{ "case_1": [ 116, 494, 702, 793 ], "case_2": [ 116, 266, 494, 702, 793 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 661, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
What role was Julia Roberts nominated for?
nominated refers to result = 'Nominee'
SELECT T2.role FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.Result = 'Nominee' AND T1.name = 'Julia Roberts'
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,310
1,310
CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, person_id TEXT, role TEXT, result TEXT, foreign key person_id references Personperson_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
7
simple
{ "case_1": [ -1 ], "case_2": [ 956 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
What role does the tallest person play?
the tallest refers to max(height_meters)
SELECT T2.role FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.person_id = T2.person_id INNER JOIN Award AS T3 ON T2.episode_id = T3.episode_id ORDER BY T1.height_meters DESC LIMIT 1
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,311
1,311
CREATE TABLE `Person` ( person_id TEXT primary key, height_meters REAL ) CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, episode_id TEXT, person_id TEXT, role TEXT, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id ) CREATE TABLE `Credit` ( episode_id TEXT, person_id TEXT, role TEXT, primary key episode_id, person_id, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id )
[ "AS", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "FROM" ]
12
medium
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 33, 34, 36, 37, 38, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 85, 86, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 108, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 173, 174, 175, 176, 177, 179, 180, 181, 183, 184, 185, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 208, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 252, 254, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 285, 286, 287, 289, 290, 291, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 352, 353, 354, 356, 357, 358, 359, 360, 361, 363, 364, 365, 368, 369, 370, 371, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 619, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 664, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 708, 710, 711, 712, 714, 715, 717, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 732, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 815, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 836, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 869, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 943, 944, 946, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 972, 973, 974, 975, 977, 980, 981, 983, 985, 986, 987, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1010, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1030, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1057, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1076, 1077, 1078, 1080, 1082, 1083, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1139, 1141 ] }
law_episode
What is the title of the episode with the most nominations?
the most nominations refers to max(count(episode_id where result = 'Nominee'))
SELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.result = 'Nominee' GROUP BY T2.episode_id ORDER BY COUNT(T1.result) DESC LIMIT 1
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,312
1,312
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, title TEXT, episode_image TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, episode_id TEXT, result TEXT, foreign key episode_id references Episodeepisode_id )
[ "GROUP BY", "AS", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "COUNT", "FROM" ]
11
medium
{ "case_1": [ 733 ], "case_2": [ 733 ], "case_3": [ 138, 163, 175, 261, 313, 733, 752, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 4, 6, 10, 11, 13, 15, 16, 20, 22, 27, 28, 29, 30, 36, 37, 47, 49, 51, 53, 55, 59, 62, 63, 68, 69, 73, 74, 75, 77, 78, 82, 86, 88, 89, 91, 93, 96, 98, 106, 108, 113, 115, 117, 118, 119, 121, 125, 126, 131, 138, 140, 142, 143, 146, 148, 150, 152, 159, 160, 162, 163, 164, 167, 169, 170, 173, 175, 179, 183, 184, 185, 187, 188, 189, 190, 191, 196, 197, 199, 200, 202, 206, 212, 213, 214, 225, 226, 227, 229, 233, 234, 239, 243, 244, 247, 252, 254, 256, 261, 262, 267, 268, 269, 275, 276, 277, 278, 281, 285, 286, 291, 299, 301, 309, 311, 313, 314, 316, 317, 319, 320, 323, 324, 325, 329, 330, 334, 335, 336, 338, 339, 341, 342, 344, 345, 348, 349, 352, 353, 354, 356, 358, 359, 360, 364, 365, 370, 371, 373, 374, 375, 378, 379, 381, 382, 383, 384, 385, 391, 392, 394, 395, 401, 403, 406, 409, 411, 412, 416, 417, 424, 426, 428, 429, 434, 435, 436, 444, 445, 448, 451, 454, 460, 462, 464, 465, 467, 469, 471, 473, 476, 477, 478, 482, 484, 487, 488, 490, 493, 495, 497, 500, 505, 509, 515, 516, 519, 520, 526, 530, 532, 535, 536, 537, 538, 542, 544, 547, 548, 552, 558, 559, 560, 563, 564, 566, 567, 573, 578, 579, 580, 581, 582, 584, 586, 590, 592, 595, 596, 597, 606, 608, 611, 613, 620, 621, 625, 626, 627, 630, 632, 633, 634, 637, 638, 641, 645, 646, 649, 651, 654, 657, 658, 659, 662, 663, 664, 665, 668, 669, 671, 681, 687, 688, 690, 691, 694, 696, 698, 701, 703, 705, 712, 714, 719, 720, 721, 727, 733, 734, 735, 736, 739, 740, 743, 748, 749, 750, 751, 752, 753, 756, 759, 760, 762, 768, 769, 772, 778, 779, 787, 790, 796, 797, 799, 800, 802, 803, 804, 810, 812, 813, 814, 818, 819, 823, 824, 827, 830, 838, 839, 841, 849, 850, 851, 853, 857, 861, 866, 867, 869, 870, 874, 876, 877, 882, 886, 888, 889, 891, 893, 896, 897, 898, 901, 902, 909, 911, 912, 915, 917, 918, 922, 923, 924, 926, 927, 929, 930, 932, 934, 935, 943, 950, 951, 953, 954, 956, 958, 961, 962, 963, 966, 967, 969, 970, 972, 973, 975, 977, 981, 983, 985, 986, 987, 993, 994, 996, 1004, 1005, 1006, 1010, 1013, 1015, 1017, 1022, 1023, 1025, 1030, 1034, 1037, 1038, 1042, 1043, 1047, 1049, 1050, 1051, 1056, 1057, 1058, 1062, 1064, 1065, 1067, 1068, 1071, 1072, 1076, 1077, 1078, 1082, 1084, 1086, 1087, 1091, 1094, 1100, 1101, 1103, 1104, 1106, 1112, 1119, 1123, 1124, 1128, 1131, 1133, 1134, 1135, 1137 ] }
law_episode
What was the rating of the episodes that Jace Alexander worked on?
SELECT T1.rating FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T3.name = 'Jace Alexander'
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,313
1,313
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, episode_image TEXT, rating REAL ) CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Credit` ( episode_id TEXT, person_id TEXT, primary key episode_id, person_id, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id )
[ "AS", "SELECT", "INNER JOIN", "ON", "FROM" ]
9
simple
{ "case_1": [ 116, 494, 702, 793 ], "case_2": [ 116, 266, 494, 702, 793 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 102, 104, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 506, 507, 508, 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 527, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 657, 658, 659, 660, 661, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 978, 980, 981, 982, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1075, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
What are the names of all the people who worked on episode 19 of season 9?
SELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.episode = 19 AND T1.season = 9
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,314
1,314
CREATE TABLE `Episode` ( episode_id TEXT primary key, season INTEGER, episode INTEGER, episode_image TEXT ) CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Credit` ( episode_id TEXT, person_id TEXT, primary key episode_id, person_id, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
10
simple
{ "case_1": [ 116, 494, 702, 793 ], "case_2": [ 116, 266, 494, 702, 793 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
What is the average star rating of the episodes Jim Bracchitta has worked on?
average star rating = divide(sum(stars), count(episode_id)) where name = 'Jim Bracchitta'
SELECT CAST(SUM(T3.stars) AS REAL) / COUNT(T2.episode_id) FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.person_id = T2.person_id INNER JOIN Vote AS T3 ON T2.episode_id = T3.episode_id WHERE T3.stars = 1 AND T1.name = 'Jim Bracchitta'
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,315
1,315
CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Credit` ( episode_id TEXT, person_id TEXT, primary key episode_id, person_id, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id ) CREATE TABLE `Vote` ( episode_id TEXT, stars INTEGER, foreign key episode_id references Episodeepisode_id )
[ "AS", "AND", "SELECT", "SUM", "INNER JOIN", "ON", "CAST", "COUNT", "FROM" ]
14
medium
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 527, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 661, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
What percentage of people have worked on the True North episode as additional crew?
the True North episode refers to title = 'True North'; additional crew refers to role = 'Additional Crew'; percentage = divide(count(episode_id where role = 'Additional Crew'), count(episode_id)) * 100% where title = 'True North'
SELECT CAST(SUM(CASE WHEN T2.role = 'Additional Crew' THEN 1 ELSE 0 END) AS REAL ) * 100 / COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'True North'
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,316
1,316
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, title TEXT, episode_image TEXT ) CREATE TABLE `Credit` ( episode_id TEXT, role TEXT, primary key episode_id, foreign key episode_id references Episodeepisode_id )
[ "CASE WHEN", "AS", "SELECT", "SUM", "CASE", "INNER JOIN", "ON", "CAST", "COUNT", "FROM" ]
12
medium
{ "case_1": [ 175, 261 ], "case_2": [ 175, 261 ], "case_3": [ 175, 261, 313, 623, 733, 752, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 4, 6, 11, 16, 22, 24, 27, 30, 35, 36, 37, 39, 42, 47, 51, 53, 55, 61, 62, 63, 64, 68, 69, 71, 73, 74, 75, 77, 81, 82, 83, 86, 87, 88, 91, 93, 94, 96, 98, 104, 106, 112, 113, 115, 117, 118, 119, 120, 121, 125, 126, 127, 129, 131, 140, 141, 142, 143, 146, 148, 152, 153, 155, 158, 159, 160, 164, 167, 169, 170, 171, 173, 175, 179, 183, 184, 186, 187, 188, 189, 190, 191, 192, 195, 196, 197, 199, 201, 202, 206, 207, 212, 213, 214, 215, 219, 223, 225, 226, 227, 228, 229, 233, 234, 236, 243, 244, 247, 248, 254, 256, 258, 261, 264, 267, 268, 269, 271, 276, 277, 278, 279, 298, 299, 300, 301, 304, 311, 313, 314, 316, 317, 319, 320, 322, 323, 325, 330, 334, 335, 336, 338, 339, 341, 344, 345, 347, 349, 354, 356, 358, 360, 363, 364, 365, 370, 373, 374, 375, 378, 379, 381, 382, 383, 384, 391, 392, 393, 394, 398, 401, 402, 403, 406, 409, 411, 412, 415, 416, 417, 423, 424, 426, 427, 436, 438, 444, 445, 448, 450, 451, 452, 453, 454, 458, 460, 462, 464, 465, 467, 469, 470, 471, 473, 476, 477, 478, 479, 483, 484, 485, 486, 487, 488, 490, 493, 500, 504, 505, 509, 510, 514, 515, 516, 517, 518, 519, 520, 526, 528, 532, 535, 536, 537, 538, 540, 544, 547, 548, 550, 552, 558, 559, 560, 563, 564, 566, 571, 573, 575, 579, 580, 581, 582, 595, 596, 597, 606, 608, 609, 611, 612, 613, 620, 623, 627, 628, 630, 632, 633, 634, 638, 640, 641, 645, 646, 649, 650, 654, 658, 659, 662, 663, 665, 666, 668, 669, 671, 672, 676, 681, 682, 686, 687, 688, 690, 694, 695, 696, 701, 705, 706, 710, 712, 714, 717, 721, 723, 727, 733, 734, 735, 736, 739, 740, 743, 744, 745, 747, 749, 750, 752, 753, 756, 760, 762, 768, 769, 772, 776, 777, 778, 779, 787, 788, 790, 795, 796, 797, 798, 799, 800, 802, 804, 805, 808, 810, 812, 813, 814, 818, 819, 823, 824, 825, 827, 830, 832, 838, 839, 841, 844, 848, 849, 851, 853, 857, 866, 867, 868, 870, 871, 874, 876, 877, 880, 886, 888, 893, 894, 896, 897, 898, 901, 902, 909, 911, 912, 913, 915, 917, 918, 922, 923, 924, 926, 927, 930, 934, 935, 941, 943, 944, 950, 951, 954, 956, 958, 959, 961, 962, 963, 969, 973, 975, 977, 981, 985, 986, 993, 996, 998, 1005, 1006, 1008, 1010, 1012, 1013, 1015, 1022, 1023, 1027, 1031, 1037, 1038, 1042, 1043, 1047, 1050, 1051, 1058, 1062, 1064, 1066, 1067, 1068, 1069, 1071, 1072, 1078, 1082, 1084, 1086, 1087, 1092, 1094, 1098, 1100, 1101, 1103, 1104, 1106, 1112, 1119, 1121, 1123, 1124, 1128, 1131, 1133, 1134, 1135, 1137 ] }
law_episode
Write down the title, summary, and air date of the episode that garnered 72 10-star votes.
72 10-star votes refers to stars = 10 and votes = 72
SELECT T2.title, T2.summary, T2.air_date FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.stars = 10 AND T1.votes = 72
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,317
1,317
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, votes INTEGER ) CREATE TABLE `Vote` ( episode_id TEXT, stars INTEGER, votes INTEGER, foreign key episode_id references Episodeepisode_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
7
simple
{ "case_1": [ 163 ], "case_2": [ 163, 313, 810, 973 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
How many 6-star votes did episode 12 get? Please include the air date and rating.
6-star vote refers to stars = 6
SELECT T2.air_date, T2.rating FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.stars = 6 AND T2.episode = 12
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,318
1,318
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, air_date DATE, episode_image TEXT, rating REAL ) CREATE TABLE `Vote` ( episode_id TEXT, stars INTEGER, foreign key episode_id references Episodeepisode_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
7
simple
{ "case_1": [ 163 ], "case_2": [ 163, 313, 810, 973 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
Who is the winner of the Best Television Episode award for the Edgar category in 2000? Include his or her name and role.
the Best Television Episode award refers to award = 'Best Television Episode'; the Edgar category refers to award_category = 'Edgar'; in 2000 refers to year = 2000
SELECT T1.name, T2.role FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.year = 2000 AND T2.award_category = 'Edgar' AND T2.award = 'Best Television Episode'
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,319
1,319
CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, year INTEGER, award_category TEXT, award TEXT, person_id TEXT, role TEXT, foreign key person_id references Personperson_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
8
simple
{ "case_1": [ -1 ], "case_2": [ 956 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
Write down the organization, year, award, and award category in which Rene Balcer is the winner.
Rene Balcer refers to name = 'Rene Balcer'; the winner refers to result = 'Winner'
SELECT T2.organization, T2.year, T2.award, T2.award_category FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.name = 'Rene Balcer' AND T2.result = 'Winner'
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,320
1,320
CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, person_id TEXT, result TEXT, foreign key person_id references Personperson_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
7
simple
{ "case_1": [ -1 ], "case_2": [ 956 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
Give me the years and episode IDs in which Constantine Makris was the winner of the Television Silver Gavel Award at the American Bar Association Silver Gavel Awards for Media and the Arts for two consecutive years.
the winner refers to result = 'Winner'; the Television refers to award = 'Television'; Silver Gavel Award refers to award_category = 'Silver Gavel Award'; the American Bar Association Silver Gavel Awards for Media and the Arts refers to organization = 'American Bar Association Silver Gavel Awards for Media and the Arts'
SELECT t3.years, t3.episode_id FROM ( SELECT DISTINCT T2.year AS years, T2.episode_id, row_number() OVER (PARTITION BY T2.episode_id ORDER BY T2.year) AS rm FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.award = 'Television' AND T2.award_category = 'Silver Gavel Award' AND T1.name = 'Constantine Makris' AND T2.result = 'Winner' AND T2.organization = 'American Bar Association Silver Gavel Awards for Media and the Arts' ) AS T3 GROUP BY t3.episode_id HAVING COUNT(t3.years - t3.rm) >= 2
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,321
1,321
CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, episode_id TEXT, person_id TEXT, result TEXT, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id )
[ "GROUP BY", "AS", "AND", "SELECT", "HAVING", "and", "ORDER BY", "INNER JOIN", "ON", "PARTITION BY", "OVER", "COUNT", "FROM" ]
22
challenging
{ "case_1": [ -1 ], "case_2": [ 956 ], "case_3": [ 138, 163, 175, 313, 733, 752, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 1, 4, 11, 20, 22, 30, 36, 37, 47, 51, 53, 55, 62, 63, 68, 69, 73, 74, 75, 86, 88, 93, 96, 98, 113, 115, 117, 118, 119, 121, 125, 126, 131, 138, 140, 142, 143, 146, 152, 159, 160, 163, 164, 167, 169, 170, 175, 179, 183, 184, 187, 188, 191, 197, 199, 202, 206, 213, 214, 227, 229, 233, 244, 247, 256, 262, 267, 268, 275, 276, 277, 278, 301, 311, 313, 314, 317, 319, 320, 325, 330, 334, 336, 339, 341, 344, 345, 349, 356, 364, 365, 370, 373, 374, 376, 378, 379, 381, 382, 383, 385, 391, 394, 395, 403, 406, 409, 411, 416, 417, 424, 426, 428, 436, 444, 445, 448, 451, 454, 460, 462, 464, 469, 473, 476, 477, 482, 490, 493, 497, 500, 505, 515, 516, 519, 520, 526, 530, 532, 536, 537, 538, 544, 548, 552, 558, 559, 560, 563, 566, 579, 581, 582, 584, 586, 595, 608, 611, 613, 625, 626, 627, 630, 632, 633, 634, 637, 638, 641, 645, 649, 651, 654, 659, 663, 665, 668, 669, 671, 681, 687, 688, 690, 696, 701, 712, 714, 721, 727, 733, 734, 735, 739, 740, 743, 749, 752, 753, 756, 760, 768, 778, 779, 790, 797, 799, 800, 804, 810, 814, 818, 819, 823, 824, 827, 830, 838, 849, 851, 853, 861, 866, 867, 870, 876, 877, 886, 888, 889, 893, 896, 901, 902, 911, 917, 918, 923, 924, 927, 930, 932, 934, 935, 950, 951, 954, 956, 958, 961, 962, 963, 969, 973, 975, 977, 981, 985, 986, 991, 993, 996, 1005, 1006, 1010, 1013, 1017, 1022, 1023, 1025, 1037, 1042, 1043, 1047, 1050, 1051, 1058, 1064, 1067, 1068, 1071, 1072, 1084, 1086, 1094, 1100, 1101, 1103, 1104, 1106, 1119, 1123, 1124, 1128, 1131, 1135, 1137 ] }
law_episode
Who was the Law and Order series writer who also won the Television Silver Gavel Award at the American Bar Association Silver Gavel Awards for Media and the Arts for two consecutive years?
who refers to name; writer refers to role = 'writer'; won refers to result = 'Winner'; the Television refers to award = 'Television'; Silver Gavel Award refers to award_category = 'Silver Gavel Award'; the American Bar Association Silver Gavel Awards for Media and the Arts refers to organization = 'American Bar Association Silver Gavel Awards for Media and the Arts'
SELECT t3.name FROM ( SELECT DISTINCT T2.year AS years, T1.name, row_number() OVER (PARTITION BY T1.name ORDER BY T2.year) AS rm FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.award = 'Television' AND T2.award_category = 'Silver Gavel Award' AND T2.series = 'Law and Order' AND T2.result = 'Winner' AND T2.organization = 'American Bar Association Silver Gavel Awards for Media and the Arts' ) AS T3 GROUP BY t3.name HAVING COUNT(t3.years - t3.rm) >= 2
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,322
1,322
CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, person_id TEXT, result TEXT, foreign key person_id references Personperson_id )
[ "GROUP BY", "AS", "AND", "SELECT", "HAVING", "and", "ORDER BY", "INNER JOIN", "ON", "PARTITION BY", "OVER", "COUNT", "FROM" ]
23
challenging
{ "case_1": [ -1 ], "case_2": [ 956 ], "case_3": [ 138, 163, 175, 313, 733, 752, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 1, 4, 11, 20, 22, 30, 36, 37, 47, 51, 53, 55, 62, 63, 68, 69, 73, 74, 75, 86, 88, 93, 96, 98, 113, 115, 117, 118, 119, 121, 125, 126, 131, 138, 140, 142, 143, 146, 152, 159, 160, 163, 164, 167, 169, 170, 175, 179, 183, 184, 187, 188, 191, 197, 199, 202, 206, 213, 214, 227, 229, 233, 244, 247, 256, 262, 267, 268, 275, 276, 277, 278, 301, 311, 313, 314, 317, 319, 320, 325, 330, 334, 336, 339, 341, 344, 345, 349, 356, 364, 365, 370, 373, 374, 376, 378, 379, 381, 382, 383, 385, 391, 394, 395, 403, 406, 409, 411, 416, 417, 424, 426, 428, 436, 444, 445, 448, 451, 454, 460, 462, 464, 469, 473, 476, 477, 482, 490, 493, 497, 500, 505, 515, 516, 519, 520, 526, 530, 532, 536, 537, 538, 544, 548, 552, 558, 559, 560, 563, 566, 579, 581, 582, 584, 586, 595, 608, 611, 613, 625, 626, 627, 630, 632, 633, 634, 637, 638, 641, 645, 649, 651, 654, 659, 663, 665, 668, 669, 671, 681, 687, 688, 690, 696, 701, 712, 714, 721, 727, 733, 734, 735, 739, 740, 743, 749, 752, 753, 756, 760, 768, 778, 779, 790, 797, 799, 800, 804, 810, 814, 818, 819, 823, 824, 827, 830, 838, 849, 851, 853, 861, 866, 867, 870, 876, 877, 886, 888, 889, 893, 896, 901, 902, 911, 917, 918, 923, 924, 927, 930, 932, 934, 935, 950, 951, 954, 956, 958, 961, 962, 963, 969, 973, 975, 977, 981, 985, 986, 991, 993, 996, 1005, 1006, 1010, 1013, 1017, 1022, 1023, 1025, 1037, 1042, 1043, 1047, 1050, 1051, 1058, 1064, 1067, 1068, 1071, 1072, 1084, 1086, 1094, 1100, 1101, 1103, 1104, 1106, 1119, 1123, 1124, 1128, 1131, 1135, 1137 ] }
law_episode
How many times was episode 20 of the Law and Order series nominated for the Primetime Emmy Awards in 1999?
nominated refers to result = 'nominee'; the Law and Order series refers to series = 'Law and Order'; the Primetime Emmy Awards refers to organization = 'Primetime Emmy Awards'; in 1999 refers to year = 1999
SELECT COUNT(T2.award_id) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.year = 1999 AND T2.result = 'Nominee' AND T1.episode = 20 AND T2.organization = 'Primetime Emmy Awards' AND T1.series = 'Law and Order'
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,323
1,323
CREATE TABLE `Episode` ( episode_id TEXT primary key, series TEXT, episode INTEGER, number_in_series INTEGER, episode_image TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, result TEXT, foreign key episode_id references Episodeepisode_id )
[ "AS", "AND", "SELECT", "and", "INNER JOIN", "ON", "COUNT", "FROM" ]
12
medium
{ "case_1": [ 733 ], "case_2": [ 733 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
On what episode did Julia Roberts win the "Outstanding Guest Actress in a Drama Series" award during the 1999 Primetime Emmy Awards? Tell me her role.
win refers to result = 'Winner'; the "Outstanding Guest Actress in a Drama Series" award refers to award = 'Outstanding Guest Actress in a Drama Series'; the 1999 refers to year = 1999; Primetime Emmy Awards refers to organization = 'Primetime Emmy Awards'
SELECT T3.episode_id, T2.role FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id INNER JOIN Episode AS T3 ON T2.episode_id = T3.episode_id WHERE T2.year = 1999 AND T2.award = 'Outstanding Guest Actress in a Drama Series' AND T2.organization = 'Primetime Emmy Awards' AND T1.name = 'Julia Roberts' AND T2.result = 'Nominee'
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,324
1,324
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, episode_image TEXT ) CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "in", "FROM" ]
14
medium
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
List the titles and air dates of episodes that were produced by Billy Fox.
produced refers to role = 'producer'
SELECT T1.title, T1.air_date FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T2.category = 'Produced by' AND T2.role = 'producer' AND T3.name = 'Billy Fox'
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,325
1,325
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, title TEXT, air_date DATE, episode_image TEXT ) CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Credit` ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, primary key episode_id, person_id, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
11
medium
{ "case_1": [ 266 ], "case_2": [ 116, 266, 494, 702, 793 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
Among the American casts, how many were uncredited on episode ID tt0629228?
American refers to birth_country = 'USA'; cast refers to category = 'Cast'; uncredited refers to credited = ''
SELECT COUNT(T1.person_id) FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.episode_id = 'tt0629228' AND T1.category = 'Cast' AND T1.credited = 'false' AND T2.birth_country = 'USA'
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,326
1,326
CREATE TABLE `Person` ( person_id TEXT primary key, birth_country TEXT ) CREATE TABLE `Credit` ( episode_id TEXT, person_id TEXT, category TEXT, credited TEXT, primary key episode_id, person_id, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id )
[ "AS", "AND", "SELECT", "Cast", "INNER JOIN", "ON", "COUNT", "FROM" ]
11
medium
{ "case_1": [ 138 ], "case_2": [ 138 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
What was the role of Jason Kuschner in episode 9?
SELECT T1.role FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id INNER JOIN Episode AS T3 ON T1.episode_id = T3.episode_id WHERE T3.episode = 9 AND T2.name = 'Jason Kuschner'
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,327
1,327
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, episode_image TEXT ) CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Credit` ( episode_id TEXT, person_id TEXT, role TEXT, primary key episode_id, person_id, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
10
simple
{ "case_1": [ 116, 494, 702, 793 ], "case_2": [ 116, 266, 494, 702, 793 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
Who played the role of the "president of NBC West Coast" in the first episode?
who refers to name; the role of the "president of NBC West Coast" refers to role = 'president of NBC West Coast'; the first episode refers to episode = 1
SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id INNER JOIN Episode AS T3 ON T1.episode_id = T3.episode_id WHERE T3.episode = 1 AND T1.role = 'president of NBC West Coast'
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,328
1,328
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, episode_image TEXT ) CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Credit` ( episode_id TEXT, person_id TEXT, role TEXT, primary key episode_id, person_id, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
10
simple
{ "case_1": [ 116, 494, 702, 793 ], "case_2": [ 116, 266, 494, 702, 793 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
List down the titles of the top 3 episodes, from highest to lowest, in terms of their weighted stars.
weighted stars = divide(sum(stars, percent), 100)
SELECT T2.title FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.stars BETWEEN 1 AND 10 GROUP BY T2.title ORDER BY CAST(SUM(T1.stars * T1.percent) AS REAL) / 100 DESC LIMIT 3
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,329
1,329
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, title TEXT, episode_image TEXT ) CREATE TABLE `Vote` ( episode_id TEXT, stars INTEGER, percent REAL, foreign key episode_id references Episodeepisode_id )
[ "GROUP BY", "AS", "AND", "SELECT", "SUM", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "CAST", "BETWEEN", "FROM" ]
15
medium
{ "case_1": [ 313, 810, 973 ], "case_2": [ 163, 313, 810, 973 ], "case_3": [ 138, 163, 261, 313, 623, 733, 752, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 1, 6, 10, 11, 20, 22, 24, 29, 36, 39, 49, 55, 59, 62, 64, 69, 71, 73, 74, 75, 76, 77, 86, 89, 93, 98, 112, 113, 115, 119, 120, 121, 125, 127, 129, 138, 141, 142, 143, 148, 150, 152, 159, 162, 163, 167, 169, 173, 179, 184, 187, 188, 191, 195, 199, 200, 201, 202, 206, 212, 213, 214, 219, 223, 225, 226, 229, 233, 234, 236, 239, 247, 248, 254, 256, 261, 262, 264, 267, 275, 278, 281, 285, 286, 300, 304, 309, 311, 313, 314, 316, 317, 319, 320, 323, 324, 325, 329, 334, 335, 336, 339, 341, 342, 345, 347, 349, 353, 356, 360, 364, 365, 373, 378, 379, 381, 383, 385, 394, 395, 402, 403, 406, 409, 411, 412, 424, 427, 428, 429, 434, 435, 438, 444, 445, 448, 451, 452, 454, 460, 462, 463, 469, 470, 476, 482, 483, 487, 493, 495, 497, 500, 505, 530, 532, 535, 536, 537, 538, 540, 542, 544, 547, 548, 552, 559, 560, 562, 563, 564, 566, 567, 575, 578, 579, 580, 581, 584, 586, 590, 592, 595, 597, 611, 612, 621, 623, 625, 626, 630, 634, 637, 638, 645, 651, 654, 657, 658, 659, 662, 665, 666, 669, 676, 677, 681, 686, 688, 690, 691, 701, 710, 719, 733, 735, 740, 743, 744, 747, 750, 752, 753, 759, 760, 762, 768, 776, 777, 778, 787, 788, 790, 796, 798, 800, 802, 803, 808, 810, 813, 818, 823, 825, 827, 830, 832, 841, 848, 849, 850, 851, 861, 866, 870, 874, 876, 886, 889, 891, 893, 896, 901, 909, 911, 912, 917, 918, 922, 924, 927, 929, 932, 934, 943, 944, 950, 951, 953, 954, 956, 958, 959, 962, 963, 966, 967, 970, 973, 975, 977, 981, 985, 987, 994, 1004, 1005, 1006, 1010, 1013, 1017, 1023, 1025, 1027, 1031, 1034, 1037, 1038, 1047, 1049, 1050, 1051, 1056, 1064, 1065, 1067, 1068, 1072, 1078, 1082, 1087, 1092, 1094, 1100, 1123, 1124, 1128, 1135, 1137 ] }
law_episode
What is the ratio of American casts on episode 2 of the series? Please include their roles.
American refers to birth_country = 'USA'; cast refers to category = 'Cast'; ratio = divide(count(person_id where birth_country = 'USA'), total(category)) where category = 'Cast'
SELECT CAST(SUM(CASE WHEN T2.category = 'Cast' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.category), T1.role FROM Award AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Episode AS T3 ON T2.episode_id = T3.episode_id INNER JOIN Person AS T4 ON T2.person_id = T4.person_id WHERE T3.episode = 2 AND T4.birth_country = 'USA'
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,330
1,330
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, episode_image TEXT ) CREATE TABLE `Person` ( person_id TEXT primary key, birth_country TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, episode_id TEXT, person_id TEXT, role TEXT, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id ) CREATE TABLE `Credit` ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, primary key episode_id, person_id, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id )
[ "CASE WHEN", "AS", "AND", "SELECT", "SUM", "Cast", "CASE", "INNER JOIN", "ON", "CAST", "COUNT", "FROM" ]
20
challenging
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 175, 261, 623, 810, 956 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 4, 6, 16, 22, 24, 30, 37, 39, 42, 47, 51, 53, 61, 63, 64, 68, 69, 71, 73, 74, 75, 77, 81, 88, 93, 96, 98, 106, 112, 113, 115, 117, 118, 119, 120, 125, 127, 129, 131, 141, 142, 143, 146, 148, 152, 153, 155, 158, 160, 164, 169, 170, 175, 183, 184, 187, 189, 191, 192, 195, 197, 201, 207, 212, 214, 215, 219, 223, 225, 226, 227, 234, 236, 244, 248, 254, 256, 258, 261, 264, 267, 268, 271, 276, 277, 278, 279, 299, 300, 301, 304, 314, 316, 317, 319, 322, 323, 325, 330, 335, 339, 341, 347, 356, 360, 370, 374, 375, 382, 383, 391, 393, 398, 402, 403, 406, 409, 412, 415, 416, 417, 423, 424, 426, 427, 436, 438, 444, 448, 451, 452, 453, 458, 464, 469, 470, 476, 477, 478, 483, 485, 486, 487, 488, 490, 493, 500, 504, 510, 514, 515, 516, 517, 518, 519, 520, 526, 528, 535, 537, 540, 544, 547, 550, 558, 559, 560, 563, 564, 571, 573, 575, 580, 581, 582, 595, 597, 608, 612, 613, 620, 623, 627, 628, 630, 632, 633, 640, 641, 646, 658, 662, 663, 666, 668, 671, 676, 682, 686, 687, 690, 710, 712, 714, 723, 727, 734, 735, 739, 740, 743, 744, 747, 749, 750, 753, 756, 760, 762, 768, 772, 776, 777, 787, 788, 795, 796, 797, 798, 799, 800, 802, 804, 808, 810, 813, 814, 819, 824, 825, 827, 830, 832, 838, 841, 844, 848, 849, 851, 853, 867, 868, 870, 871, 874, 877, 886, 888, 894, 896, 898, 902, 909, 912, 917, 922, 923, 924, 926, 930, 935, 943, 944, 954, 956, 958, 959, 961, 969, 985, 986, 996, 998, 1008, 1012, 1022, 1023, 1027, 1031, 1042, 1058, 1062, 1064, 1067, 1068, 1069, 1071, 1072, 1078, 1082, 1084, 1086, 1087, 1092, 1098, 1100, 1101, 1103, 1104, 1119, 1121, 1123, 1128, 1131, 1133, 1134, 1135 ] }
law_episode
How many people from Canada are nominated for an award?
from Canada refers to birth_country = Canada; nominated refers to award is NOT NULL
SELECT COUNT(T1.person_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.birth_country = 'Canada'
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,331
1,331
CREATE TABLE `Person` ( person_id TEXT primary key, birth_country TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, person_id TEXT, foreign key person_id references Personperson_id )
[ "AS", "SELECT", "INNER JOIN", "ON", "COUNT", "FROM" ]
7
simple
{ "case_1": [ -1 ], "case_2": [ 956 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 661, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
How many episodes are credited to Jerry Orbach?
SELECT COUNT(T2.person_id) FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Jerry Orbach'
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,332
1,332
CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Credit` ( person_id TEXT, person_id, foreign key person_id references Personperson_id )
[ "AS", "SELECT", "INNER JOIN", "ON", "COUNT", "FROM" ]
7
simple
{ "case_1": [ -1 ], "case_2": [ 138 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 661, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
List out all the credit names for episode 9.
credit name refers to name
SELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.episode = 9
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,333
1,333
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, episode_image TEXT ) CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Credit` ( episode_id TEXT, person_id TEXT, primary key episode_id, person_id, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id )
[ "AS", "SELECT", "INNER JOIN", "ON", "FROM" ]
9
simple
{ "case_1": [ 116, 494, 702, 793 ], "case_2": [ 116, 266, 494, 702, 793 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 102, 104, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 506, 507, 508, 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 527, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 657, 658, 659, 660, 661, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 978, 980, 981, 982, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1075, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
List out all award titles nominated for episode 20.
award title refers to title; nominated refers to result = 'Winner' or result = 'Nominee'
SELECT T2.award FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T1.episode = 20 AND T2.result IN ('Winner', 'Nominee')
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,334
1,334
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, episode_image TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, episode_id TEXT, result TEXT, foreign key episode_id references Episodeepisode_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "IN", "ON", "FROM" ]
8
simple
{ "case_1": [ -1 ], "case_2": [ 733 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 109, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 270, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 399, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 903, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
Which role have won at least two awards for the entire season and list out the name?
at least two awards refers to count(role) >1
SELECT T1.name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id GROUP BY T2.role HAVING COUNT(T2.award_id) > 1
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,335
1,335
CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, person_id TEXT, role TEXT, foreign key person_id references Personperson_id )
[ "GROUP BY", "AS", "SELECT", "HAVING", "INNER JOIN", "ON", "COUNT", "FROM" ]
9
simple
{ "case_1": [ -1 ], "case_2": [ 956 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 179, 180, 182, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 718, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1005, 1006, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
List out director names that received an award along with the episode number.
director refers to role = 'director'; received an award refers to result = 'Winner'; episode number refers to episode
SELECT T3.name, T1.episode_id FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T2.person_id = T3.person_id WHERE T2.role = 'director' AND T2.result = 'Winner'
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,336
1,336
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, episode_image TEXT ) CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
10
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
Which episodes are nominated for an awards but not win?
nominated for an award but not win refers to result = 'Nominee'
SELECT T1.episode FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.result = 'Nominee'
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,337
1,337
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, episode_image TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, episode_id TEXT, result TEXT, foreign key episode_id references Episodeepisode_id )
[ "AS", "SELECT", "INNER JOIN", "ON", "FROM" ]
6
simple
{ "case_1": [ -1 ], "case_2": [ 733 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 102, 104, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 506, 507, 508, 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 527, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 657, 658, 659, 660, 661, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 978, 980, 981, 982, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1075, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
What is the average rating for each episode in season 9?
average rating = divide(sum(rating), count(episode_id))
SELECT SUM(rating) / COUNT(episode_id) FROM Episode WHERE season = 9
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,338
1,338
CREATE TABLE `Episode` ( episode_id TEXT primary key, season INTEGER, episode INTEGER, episode_image TEXT, rating REAL )
[ "COUNT", "SUM", "SELECT", "FROM" ]
4
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 175, 261, 313, 623, 733, 752, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 4, 6, 9, 11, 13, 15, 16, 22, 24, 25, 27, 28, 30, 32, 35, 36, 37, 39, 40, 42, 47, 51, 53, 54, 55, 61, 62, 63, 64, 67, 68, 69, 71, 73, 74, 75, 77, 78, 81, 82, 83, 86, 87, 88, 89, 91, 93, 94, 96, 98, 104, 106, 108, 109, 112, 113, 115, 117, 118, 119, 120, 121, 122, 124, 125, 126, 127, 129, 131, 140, 141, 142, 143, 146, 147, 148, 152, 153, 155, 157, 159, 160, 164, 167, 169, 170, 173, 175, 179, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 195, 196, 197, 198, 199, 201, 202, 203, 205, 206, 207, 210, 212, 213, 214, 215, 216, 219, 223, 224, 225, 226, 227, 228, 229, 230, 233, 234, 236, 243, 244, 245, 247, 248, 252, 254, 256, 259, 261, 264, 267, 268, 269, 271, 273, 276, 277, 279, 285, 286, 291, 293, 294, 299, 300, 301, 303, 304, 311, 313, 314, 316, 317, 319, 320, 323, 325, 330, 334, 335, 336, 338, 339, 341, 344, 345, 347, 348, 349, 350, 352, 354, 356, 358, 359, 360, 363, 364, 365, 370, 371, 373, 374, 375, 378, 379, 380, 381, 382, 383, 384, 391, 392, 394, 399, 401, 402, 403, 406, 409, 410, 411, 412, 415, 416, 417, 420, 421, 423, 424, 426, 427, 436, 438, 443, 444, 445, 447, 448, 450, 452, 453, 454, 458, 460, 462, 464, 465, 466, 467, 469, 470, 471, 473, 476, 477, 478, 481, 483, 484, 485, 486, 487, 488, 490, 493, 500, 504, 505, 506, 509, 510, 512, 515, 516, 517, 518, 519, 520, 526, 527, 531, 532, 535, 536, 537, 538, 540, 542, 543, 544, 545, 547, 548, 550, 552, 554, 558, 559, 560, 563, 564, 566, 571, 573, 575, 579, 580, 581, 582, 585, 591, 594, 595, 596, 597, 598, 603, 606, 608, 609, 611, 612, 613, 618, 620, 623, 627, 628, 629, 630, 632, 633, 634, 638, 640, 641, 645, 646, 649, 650, 654, 656, 658, 659, 661, 662, 663, 664, 665, 666, 667, 668, 669, 671, 673, 676, 680, 681, 682, 686, 687, 688, 689, 690, 692, 694, 695, 696, 698, 701, 703, 705, 707, 709, 710, 712, 714, 717, 718, 719, 721, 723, 727, 730, 733, 734, 735, 736, 737, 739, 740, 743, 744, 745, 747, 748, 749, 750, 752, 753, 756, 757, 760, 762, 768, 769, 770, 772, 776, 777, 778, 779, 787, 788, 790, 795, 796, 797, 798, 799, 800, 802, 804, 808, 810, 811, 812, 813, 814, 817, 818, 819, 820, 821, 823, 824, 825, 827, 830, 831, 832, 838, 839, 841, 843, 848, 849, 851, 853, 857, 865, 866, 867, 868, 869, 870, 871, 872, 874, 876, 877, 886, 888, 890, 893, 894, 896, 897, 898, 899, 901, 902, 903, 909, 911, 912, 913, 915, 917, 918, 922, 923, 924, 926, 927, 929, 930, 934, 935, 939, 941, 942, 943, 944, 945, 950, 951, 954, 956, 958, 959, 960, 961, 962, 963, 965, 968, 969, 972, 973, 975, 976, 977, 979, 981, 983, 985, 986, 987, 993, 996, 998, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1014, 1015, 1020, 1022, 1023, 1027, 1030, 1031, 1037, 1038, 1042, 1043, 1047, 1050, 1051, 1053, 1055, 1057, 1058, 1059, 1062, 1064, 1067, 1068, 1069, 1070, 1071, 1072, 1076, 1077, 1078, 1079, 1082, 1084, 1086, 1087, 1090, 1092, 1093, 1094, 1096, 1098, 1100, 1101, 1103, 1104, 1106, 1110, 1112, 1113, 1119, 1121, 1123, 1124, 1126, 1127, 1128, 1131, 1133, 1134, 1135, 1137 ] }
law_episode
What is the difference of 10 stars votes between the first episode and the last episode?
the first episode refers to episode = 1; the last episode refers to episode = 24; 10 stars vote refers to stars = 10; the difference = subtract(votes where episode = 1, votes where episode = 24) where stars = 10
SELECT SUM(CASE WHEN T2.episode = 24 THEN T1.votes ELSE 0 END) - SUM(CASE WHEN T2.episode = 1 THEN T1.votes ELSE 0 END) FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.stars = 10
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,339
1,339
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, episode_image TEXT, votes INTEGER ) CREATE TABLE `Vote` ( episode_id TEXT, stars INTEGER, votes INTEGER, foreign key episode_id references Episodeepisode_id )
[ "CASE WHEN", "AS", "SELECT", "SUM", "CASE", "INNER JOIN", "ON", "FROM" ]
12
medium
{ "case_1": [ 313, 810, 973 ], "case_2": [ 163, 313, 810, 973 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 104, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 122, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 173, 175, 176, 177, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 205, 206, 207, 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 508, 509, 511, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 709, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 939, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 979, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1093, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1110, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1122, 1123, 1124, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
What is the episode rating with the most award won?
the most award won refers to max(episode_id where result = 'Winner')
SELECT T1.rating FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.result = 'Winner' GROUP BY T1.episode_id ORDER BY COUNT(T2.award_id) DESC LIMIT 1
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,340
1,340
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, episode_image TEXT, rating REAL ) CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, episode_id TEXT, result TEXT, foreign key episode_id references Episodeepisode_id )
[ "GROUP BY", "AS", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "COUNT", "FROM" ]
11
medium
{ "case_1": [ 733 ], "case_2": [ 733 ], "case_3": [ 138, 163, 175, 261, 313, 733, 752, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 4, 6, 10, 11, 13, 15, 16, 20, 22, 27, 28, 29, 30, 36, 37, 47, 49, 51, 53, 55, 59, 62, 63, 68, 69, 73, 74, 75, 77, 78, 82, 86, 88, 89, 91, 93, 96, 98, 106, 108, 113, 115, 117, 118, 119, 121, 125, 126, 131, 138, 140, 142, 143, 146, 148, 150, 152, 159, 160, 162, 163, 164, 167, 169, 170, 173, 175, 179, 183, 184, 185, 187, 188, 189, 190, 191, 196, 197, 199, 200, 202, 206, 212, 213, 214, 225, 226, 227, 229, 233, 234, 239, 243, 244, 247, 252, 254, 256, 261, 262, 267, 268, 269, 275, 276, 277, 278, 281, 285, 286, 291, 299, 301, 309, 311, 313, 314, 316, 317, 319, 320, 323, 324, 325, 329, 330, 334, 335, 336, 338, 339, 341, 342, 344, 345, 348, 349, 352, 353, 354, 356, 358, 359, 360, 364, 365, 370, 371, 373, 374, 375, 378, 379, 381, 382, 383, 384, 385, 391, 392, 394, 395, 401, 403, 406, 409, 411, 412, 416, 417, 424, 426, 428, 429, 434, 435, 436, 444, 445, 448, 451, 454, 460, 462, 464, 465, 467, 469, 471, 473, 476, 477, 478, 482, 484, 487, 488, 490, 493, 495, 497, 500, 505, 509, 515, 516, 519, 520, 526, 530, 532, 535, 536, 537, 538, 542, 544, 547, 548, 552, 558, 559, 560, 563, 564, 566, 567, 573, 578, 579, 580, 581, 582, 584, 586, 590, 592, 595, 596, 597, 606, 608, 611, 613, 620, 621, 625, 626, 627, 630, 632, 633, 634, 637, 638, 641, 645, 646, 649, 651, 654, 657, 658, 659, 662, 663, 664, 665, 668, 669, 671, 681, 687, 688, 690, 691, 694, 696, 698, 701, 703, 705, 712, 714, 719, 720, 721, 727, 733, 734, 735, 736, 739, 740, 743, 748, 749, 750, 751, 752, 753, 756, 759, 760, 762, 768, 769, 772, 778, 779, 787, 790, 796, 797, 799, 800, 802, 803, 804, 810, 812, 813, 814, 818, 819, 823, 824, 827, 830, 838, 839, 841, 849, 850, 851, 853, 857, 861, 866, 867, 869, 870, 874, 876, 877, 882, 886, 888, 889, 891, 893, 896, 897, 898, 901, 902, 909, 911, 912, 915, 917, 918, 922, 923, 924, 926, 927, 929, 930, 932, 934, 935, 943, 950, 951, 953, 954, 956, 958, 961, 962, 963, 966, 967, 969, 970, 972, 973, 975, 977, 981, 983, 985, 986, 987, 993, 994, 996, 1004, 1005, 1006, 1010, 1013, 1015, 1017, 1022, 1023, 1025, 1030, 1034, 1037, 1038, 1042, 1043, 1047, 1049, 1050, 1051, 1056, 1057, 1058, 1062, 1064, 1065, 1067, 1068, 1071, 1072, 1076, 1077, 1078, 1082, 1084, 1086, 1087, 1091, 1094, 1100, 1101, 1103, 1104, 1106, 1112, 1119, 1123, 1124, 1128, 1131, 1133, 1134, 1135, 1137 ] }
law_episode
How many credits have been displayed from episode 1 until 10?
credit displayed refers to credited = 'true'; from episode 1 until 10 refers to episode > = 1 AND episode < = 10
SELECT COUNT(T1.person_id) FROM Credit AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.credited = 'true' AND T2.episode BETWEEN 1 AND 10
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,341
1,341
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, episode_image TEXT ) CREATE TABLE `Credit` ( episode_id TEXT, person_id TEXT, credited TEXT, primary key episode_id, person_id, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "COUNT", "BETWEEN", "FROM" ]
10
simple
{ "case_1": [ -1 ], "case_2": [ 175, 261 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 399, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 421, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 656, 657, 658, 659, 660, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
What is the episode that has mafia keyword?
mafia keyword refers to Keyword = 'mafia'
SELECT T1.episode FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.Keyword = 'mafia'
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,342
1,342
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, episode_image TEXT ) CREATE TABLE `Keyword` ( episode_id TEXT, keyword TEXT, primary key episode_id, keyword, foreign key episode_id references Episodeepisode_id )
[ "AS", "SELECT", "INNER JOIN", "ON", "FROM" ]
6
simple
{ "case_1": [ 474 ], "case_2": [ 474, 623, 752 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 102, 104, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 506, 507, 508, 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 527, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 657, 658, 659, 660, 661, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 978, 980, 981, 982, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1075, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
What is the average star with highest percentage for episodes that have received award?
received award refers to result = 'Winner'; the highest percentage refers to max(percent); average star = divide(sum(stars), count(episode_id))
SELECT T2.person_id FROM Vote AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id ORDER BY T1.percent DESC LIMIT 1
CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,343
1,343
CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, episode_id TEXT, person_id TEXT, foreign key episode_id references Episodeepisode_id, foreign key person_id references Personperson_id ) CREATE TABLE `Vote` ( episode_id TEXT, percent REAL, foreign key episode_id references Episodeepisode_id )
[ "AS", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "FROM" ]
9
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 33, 34, 36, 37, 38, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 85, 86, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 108, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 173, 174, 175, 176, 177, 179, 180, 181, 183, 184, 185, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 208, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 252, 254, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 285, 286, 287, 289, 290, 291, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 352, 353, 354, 356, 357, 358, 359, 360, 361, 363, 364, 365, 368, 369, 370, 371, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 619, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 664, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 708, 710, 711, 712, 714, 715, 717, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 732, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 815, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 836, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 869, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 943, 944, 946, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 972, 973, 974, 975, 977, 980, 981, 983, 985, 986, 987, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1010, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1030, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1057, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1076, 1077, 1078, 1080, 1082, 1083, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1139, 1141 ] }
law_episode
What is the average ranking episodes that are nominated for an award?
average ranking = divide(sum(rating), sum(episode_id))
SELECT SUM(T1.rating) / COUNT(T1.episode) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,344
1,344
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, episode_image TEXT, rating REAL ) CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, episode_id TEXT, foreign key episode_id references Episodeepisode_id )
[ "AS", "SELECT", "SUM", "INNER JOIN", "ON", "COUNT", "FROM" ]
8
simple
{ "case_1": [ -1 ], "case_2": [ 733 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 104, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 173, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 506, 507, 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 527, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 661, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
How many winners have been awarded a Television award by the "American Bar Association Silver Gavel Awards for Media and the Arts"?
winner refers to result = 'Winner'; Television award refers to award = 'Television'; the "American Bar Association Silver Gavel Awards for Media and the Arts" refers to organization = 'American Bar Association Silver Gavel Awards for Media and the Arts'
SELECT COUNT(award_id) FROM Award WHERE result = 'Winner' AND award = 'Television' AND organization = 'American Bar Association Silver Gavel Awards for Media and the Arts'
CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,345
1,345
CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT )
[ "AND", "SELECT", "and", "COUNT", "FROM" ]
6
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 116, 138, 163, 175, 261, 266, 494, 702, 733, 752, 793, 810, 956 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 4, 5, 6, 8, 9, 10, 11, 12, 13, 15, 16, 19, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 33, 35, 36, 37, 38, 39, 40, 43, 44, 45, 47, 50, 51, 52, 53, 55, 56, 57, 61, 62, 63, 66, 67, 68, 69, 71, 73, 74, 75, 76, 77, 78, 79, 82, 85, 86, 87, 88, 89, 90, 91, 93, 95, 96, 98, 99, 100, 106, 108, 109, 111, 112, 113, 115, 116, 117, 118, 119, 121, 124, 125, 126, 127, 128, 129, 131, 138, 140, 141, 142, 143, 144, 146, 147, 148, 152, 154, 157, 158, 159, 160, 163, 164, 167, 168, 169, 170, 172, 173, 175, 176, 177, 179, 180, 182, 183, 184, 185, 187, 188, 189, 190, 191, 192, 196, 197, 198, 199, 200, 202, 203, 206, 210, 212, 214, 216, 219, 223, 224, 225, 226, 227, 229, 230, 233, 234, 239, 240, 243, 244, 247, 252, 254, 255, 256, 258, 259, 261, 262, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 282, 286, 290, 291, 293, 294, 296, 299, 301, 303, 305, 311, 314, 315, 316, 317, 319, 320, 323, 325, 330, 334, 335, 336, 338, 339, 341, 344, 345, 347, 348, 349, 350, 352, 354, 356, 358, 359, 360, 361, 362, 364, 367, 368, 370, 371, 373, 374, 375, 376, 380, 382, 383, 384, 385, 391, 392, 393, 394, 395, 398, 399, 401, 402, 403, 405, 406, 408, 409, 410, 411, 412, 413, 414, 416, 417, 418, 419, 420, 421, 423, 424, 425, 426, 427, 428, 433, 436, 437, 438, 439, 440, 443, 444, 445, 446, 447, 448, 451, 452, 453, 454, 455, 458, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 473, 475, 476, 477, 478, 480, 481, 482, 484, 485, 487, 488, 490, 492, 493, 494, 496, 497, 498, 500, 504, 505, 507, 509, 510, 512, 514, 515, 516, 517, 519, 520, 522, 524, 526, 528, 529, 530, 531, 532, 533, 535, 536, 537, 538, 539, 541, 542, 543, 544, 545, 547, 548, 551, 552, 554, 557, 558, 559, 560, 561, 562, 563, 564, 566, 573, 580, 581, 582, 584, 585, 586, 588, 589, 591, 594, 595, 596, 597, 598, 599, 601, 603, 605, 606, 608, 610, 611, 612, 613, 615, 618, 620, 622, 624, 625, 626, 627, 629, 630, 632, 633, 634, 637, 641, 643, 645, 646, 648, 649, 651, 654, 656, 658, 659, 661, 662, 663, 664, 665, 666, 667, 668, 669, 671, 673, 675, 677, 678, 679, 680, 681, 683, 684, 685, 686, 687, 688, 689, 690, 692, 693, 694, 696, 697, 698, 699, 702, 703, 705, 707, 712, 714, 715, 716, 718, 719, 721, 726, 727, 730, 733, 734, 735, 736, 737, 739, 740, 741, 743, 746, 747, 748, 749, 750, 752, 753, 754, 756, 757, 758, 760, 762, 763, 765, 767, 768, 769, 770, 772, 773, 775, 776, 777, 778, 779, 780, 783, 785, 787, 788, 790, 793, 794, 795, 796, 797, 798, 799, 800, 802, 804, 806, 807, 808, 810, 811, 812, 813, 814, 817, 818, 819, 820, 821, 824, 825, 827, 829, 830, 831, 832, 835, 838, 839, 840, 841, 843, 844, 848, 849, 851, 853, 855, 857, 858, 859, 860, 861, 864, 865, 866, 867, 869, 870, 873, 874, 875, 876, 877, 878, 879, 886, 888, 890, 892, 893, 894, 895, 896, 897, 898, 899, 901, 902, 903, 905, 907, 909, 911, 912, 913, 915, 917, 918, 920, 922, 923, 924, 926, 927, 928, 930, 931, 932, 933, 934, 935, 941, 942, 943, 944, 945, 949, 950, 951, 953, 954, 956, 958, 960, 961, 963, 965, 968, 969, 972, 974, 975, 976, 977, 981, 983, 985, 986, 991, 993, 996, 998, 1000, 1001, 1005, 1006, 1008, 1009, 1010, 1011, 1013, 1014, 1015, 1017, 1018, 1019, 1020, 1022, 1023, 1027, 1030, 1031, 1037, 1039, 1042, 1043, 1044, 1046, 1047, 1050, 1051, 1053, 1055, 1057, 1058, 1059, 1061, 1062, 1063, 1064, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1084, 1086, 1087, 1090, 1092, 1094, 1096, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1112, 1113, 1115, 1117, 1119, 1121, 1123, 1124, 1126, 1127, 1128, 1131, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
Which continent was Michael Preston born on?
continent refers to birth_country
SELECT birth_country FROM Person WHERE name = 'Michael Preston'
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,346
1,346
CREATE TABLE `Person` ( name TEXT, birth_name TEXT, birth_country TEXT, nickname TEXT )
[ "SELECT", "FROM" ]
2
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141 ] }
law_episode
Who was the nominee playing the role of Katrina Ludlow in the Law & Order series?
nominee refers to result = 'Nominee'; the role of Katrina Ludlow refers to role = 'Katrina Ludlow'
SELECT T2.name FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person_id = T2.person_id WHERE T1.result = 'Nominee' AND T1.role = 'Katrina Ludlow' AND T1.series = 'Law and Order'
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,347
1,347
CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, series TEXT, person_id TEXT, role TEXT, result TEXT, foreign key person_id references Personperson_id )
[ "AS", "AND", "SELECT", "and", "INNER JOIN", "ON", "FROM" ]
9
simple
{ "case_1": [ -1 ], "case_2": [ 956 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
Who played the role of a teleplay in the episode that won "Best Television Episode"?
the role of a teleplay refers to role = 'teleplay'; won refers to result = 'Winner'; "Best Television Episode" refers to award = 'Best Television Episode'
SELECT T2.name FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person_id = T2.person_id WHERE T1.result = 'Winner' AND T1.award = 'Best Television Episode'
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,348
1,348
CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, person_id TEXT, result TEXT, foreign key person_id references Personperson_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
7
simple
{ "case_1": [ -1 ], "case_2": [ 956 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
What is the date of birth of the actor who played the role of a "writer"?
date of birth refers to birthdate
SELECT T2.birthdate FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person_id = T2.person_id WHERE T1.role = 'writer'
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,349
1,349
CREATE TABLE `Person` ( person_id TEXT primary key, birthdate DATE ) CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, person_id TEXT, role TEXT, foreign key person_id references Personperson_id )
[ "AS", "SELECT", "INNER JOIN", "ON", "FROM" ]
6
simple
{ "case_1": [ -1 ], "case_2": [ 956 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 102, 104, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 506, 507, 508, 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 527, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 657, 658, 659, 660, 661, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 978, 980, 981, 982, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1075, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
Which episode was nominated for the award for "Outstanding Costume Design for a Series"?
episode refers to title; "Outstanding Costume Design for a Series" refers to award = 'Outstanding Costume Design for a Series'
SELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.award = 'Outstanding Costume Design for a Series'
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,350
1,350
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, title TEXT, episode_image TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, episode_id TEXT, foreign key episode_id references Episodeepisode_id )
[ "AS", "SELECT", "INNER JOIN", "ON", "FROM" ]
6
simple
{ "case_1": [ -1 ], "case_2": [ 733 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 102, 104, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 506, 507, 508, 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 527, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 657, 658, 659, 660, 661, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 978, 980, 981, 982, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1075, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
Which episode has the highest total number of viewer votes?
episode refers to title; the highest total number of viewer votes refers to max(sum(votes))
SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id GROUP BY T1.title ORDER BY SUM(T1.votes) DESC LIMIT 1
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,351
1,351
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, title TEXT, episode_image TEXT, votes INTEGER ) CREATE TABLE `Vote` ( episode_id TEXT, votes INTEGER, foreign key episode_id references Episodeepisode_id )
[ "GROUP BY", "AS", "SELECT", "SUM", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "FROM" ]
11
medium
{ "case_1": [ 313, 810, 973 ], "case_2": [ 163, 313, 810, 973 ], "case_3": [ 138, 163, 261, 313, 623, 733, 752, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 1, 6, 10, 11, 13, 15, 20, 22, 24, 28, 29, 36, 39, 42, 49, 55, 59, 62, 64, 69, 71, 73, 75, 77, 78, 81, 83, 86, 89, 93, 94, 108, 112, 113, 115, 120, 121, 125, 126, 127, 129, 138, 140, 141, 142, 143, 148, 150, 153, 155, 159, 162, 163, 167, 169, 173, 179, 184, 186, 187, 188, 189, 191, 195, 199, 200, 201, 202, 206, 207, 212, 213, 214, 219, 225, 226, 228, 229, 233, 234, 236, 239, 247, 248, 252, 254, 261, 262, 264, 275, 278, 279, 281, 285, 286, 300, 304, 309, 311, 313, 314, 316, 317, 319, 320, 323, 324, 329, 334, 335, 336, 341, 342, 344, 345, 347, 348, 349, 352, 353, 356, 359, 360, 363, 364, 365, 371, 373, 378, 379, 381, 383, 385, 394, 395, 402, 403, 409, 411, 412, 415, 424, 427, 428, 429, 434, 435, 438, 444, 445, 448, 450, 451, 452, 454, 460, 462, 469, 470, 473, 476, 482, 483, 486, 487, 488, 495, 497, 500, 505, 518, 530, 532, 535, 536, 537, 538, 540, 542, 547, 548, 550, 552, 560, 563, 564, 566, 567, 571, 575, 578, 579, 580, 581, 584, 586, 590, 592, 595, 597, 609, 611, 612, 621, 623, 625, 626, 628, 630, 634, 637, 638, 640, 645, 650, 651, 654, 657, 658, 659, 662, 664, 665, 666, 669, 676, 681, 682, 686, 688, 690, 691, 695, 696, 698, 701, 703, 710, 717, 719, 720, 721, 723, 733, 735, 740, 743, 744, 745, 747, 748, 750, 751, 752, 753, 759, 760, 762, 768, 776, 777, 778, 779, 787, 788, 790, 796, 800, 802, 803, 808, 810, 813, 818, 823, 825, 827, 830, 832, 841, 848, 850, 851, 861, 866, 868, 869, 870, 871, 874, 876, 882, 886, 889, 891, 893, 896, 901, 909, 911, 912, 918, 922, 924, 927, 929, 932, 934, 943, 944, 950, 951, 953, 954, 956, 958, 959, 962, 963, 966, 967, 970, 972, 973, 975, 977, 981, 987, 993, 994, 1004, 1005, 1006, 1010, 1012, 1013, 1017, 1023, 1025, 1027, 1030, 1031, 1034, 1037, 1038, 1043, 1047, 1049, 1050, 1051, 1056, 1057, 1064, 1065, 1067, 1068, 1076, 1077, 1078, 1082, 1087, 1091, 1092, 1094, 1098, 1100, 1106, 1124, 1135, 1137 ] }
law_episode
Who was the actor who was portraying "Alex Brown" and has been credited?
who refers to name; portraying "Alex Brown" refers to role = 'Alex Brown'; has been credited refers to credited = 'true'
SELECT T1.name FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.person_id = T2.person_id WHERE T2.role = 'Alex Brown' AND T2.credited = 'true'
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,352
1,352
CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, nickname TEXT ) CREATE TABLE `Credit` ( person_id TEXT, role TEXT, credited TEXT, person_id, foreign key person_id references Personperson_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
7
simple
{ "case_1": [ -1 ], "case_2": [ 138 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
Where is the place of birth of the actor with the number nm0007064 who has not been credited for playing the role of a "Narrator"?
place of birth refers to birth_place; actor with the number nm0007064 refers to person_id = 'nm007064'; has not been credited refers to credited = ''; the role of a "Narrator" refers to role = 'narrator'
SELECT DISTINCT T1.birth_place FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.person_id = T2.person_id WHERE T1.person_id = 'nm0007064' AND T2.role = 'Narrator' AND T2.credited = 'false'
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,353
1,353
CREATE TABLE `Person` ( person_id TEXT primary key, birth_place TEXT ) CREATE TABLE `Credit` ( person_id TEXT, role TEXT, credited TEXT, person_id, foreign key person_id references Personperson_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
8
simple
{ "case_1": [ -1 ], "case_2": [ 138 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
What are the keywords of the episode "Shield"?
the episode "Shield" refers to title = 'Shield'
SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Shield'
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,354
1,354
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, title TEXT, episode_image TEXT ) CREATE TABLE `Keyword` ( episode_id TEXT, keyword TEXT, primary key episode_id, keyword, foreign key episode_id references Episodeepisode_id )
[ "AS", "SELECT", "INNER JOIN", "ON", "FROM" ]
6
simple
{ "case_1": [ 474 ], "case_2": [ 474, 623, 752 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 102, 104, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 506, 507, 508, 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 527, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 657, 658, 659, 660, 661, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 978, 980, 981, 982, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1075, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
Who are the actors with a height of over 1.80m in an episode that won an award?
who refers to name; a height of over 1.80m refers to height_meters > 1.80; won an award refers to result = 'Winner'
SELECT T2.name FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person_id = T2.person_id WHERE T1.result = 'Winner' AND T2.height_meters > 1.80
CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,355
1,355
CREATE TABLE `Person` ( person_id TEXT primary key, name TEXT, birth_name TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, person_id TEXT, result TEXT, foreign key person_id references Personperson_id )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
7
simple
{ "case_1": [ -1 ], "case_2": [ 956 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
Which episode has the two keywords "nun" and "priest"?
episode refers to title; the two keywords "nun" and "priest" refers to keyword = 'nun' or keyword = 'priest';
SELECT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword IN ('nun', 'priest')
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,356
1,356
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, title TEXT, episode_image TEXT ) CREATE TABLE `Keyword` ( episode_id TEXT, keyword TEXT, primary key episode_id, keyword, foreign key episode_id references Episodeepisode_id )
[ "AS", "SELECT", "INNER JOIN", "IN", "ON", "FROM" ]
7
simple
{ "case_1": [ 474 ], "case_2": [ 474, 623, 752 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1005, 1006, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
law_episode
Which episode number has the second highest positive viewer comments and has been awarded "Best Television Episode"?
episode number refers to episode_id; awarded "Best Television Episode" refers to award = 'Best Television Episode' and result = 'Winner'; the second highest positive viewer comments refers to rating = 8.5
SELECT T2.episode_id FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.award = 'Best Television Episode' AND T1.result = 'Winner' ORDER BY T2.rating DESC LIMIT 2
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,357
1,357
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, episode_image TEXT, rating REAL ) CREATE TABLE `Award` ( award_id INTEGER primary key, award_category TEXT, award TEXT, episode_id TEXT, result TEXT, foreign key episode_id references Episodeepisode_id )
[ "AS", "AND", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "FROM" ]
10
simple
{ "case_1": [ -1 ], "case_2": [ 733 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 33, 34, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 85, 86, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 108, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 173, 174, 175, 176, 177, 179, 180, 181, 183, 184, 185, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 208, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 252, 254, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 285, 286, 287, 289, 290, 291, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 352, 353, 354, 356, 357, 358, 359, 360, 361, 363, 364, 365, 368, 369, 370, 371, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 619, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 664, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 708, 710, 711, 712, 714, 715, 717, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 732, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 815, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 836, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 869, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 943, 944, 946, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 972, 973, 974, 975, 977, 980, 981, 983, 985, 986, 987, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1010, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1030, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1057, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1076, 1077, 1078, 1080, 1082, 1083, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1139, 1141 ] }
law_episode
Please list any three episodes that were most enjoyed by the viewers.
episode refers to title; most enjoyed by the viewers refers to stars = 10
SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 10 LIMIT 3
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
CREATE TABLE Episode ( episode_id TEXT primary key, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER ) CREATE TABLE Keyword ( episode_id TEXT, keyword TEXT, primary key (episode_id, keyword), foreign key (episode_id) references Episode(episode_id) ) CREATE TABLE Person ( person_id TEXT primary key, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT ) CREATE TABLE Award ( award_id INTEGER primary key, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Credit ( episode_id TEXT, person_id TEXT, category TEXT, role TEXT, credited TEXT, primary key (episode_id, person_id), foreign key (episode_id) references Episode(episode_id), foreign key (person_id) references Person(person_id) ) CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, foreign key (episode_id) references Episode(episode_id) )
na
1,358
1,358
CREATE TABLE `Episode` ( episode_id TEXT primary key, episode INTEGER, title TEXT, episode_image TEXT ) CREATE TABLE `Vote` ( episode_id TEXT, stars INTEGER, foreign key episode_id references Episodeepisode_id )
[ "AS", "SELECT", "LIMIT", "INNER JOIN", "ON", "FROM" ]
7
simple
{ "case_1": [ 163 ], "case_2": [ 163, 313, 810, 973 ], "case_3": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_4": [ 116, 138, 163, 175, 261, 266, 313, 474, 494, 623, 702, 733, 752, 793, 810, 956, 973 ], "case_5": [ 0, 1, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1075, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
According to the observation on 2008/3/11, what was the height of Elly Koss?
2008/3/11 refers to date = '2008-03-11'; height refers to DESCRIPTION = 'Body Height' from observations;
SELECT T2.value, T2.units FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.date = '2008-03-11' AND T2.description = 'Body Height'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,359
1,359
CREATE TABLE `patients` ( patient TEXT primary key, first TEXT, last TEXT ) CREATE TABLE `observations` ( DATE DATE, PATIENT TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "-", "INNER JOIN", "ON", "FROM" ]
11
medium
{ "case_1": [ -1 ], "case_2": [ 519, 1046 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 36, 37, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 362, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 679, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 785, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 864, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
By how much did Elly Koss's weight increase from the observation in 2008 to the observation in 2009?
SUBTRACT((DATE like '2009%'), (DATE like '2008%')) where DESCRIPTION = 'Body Weight';
SELECT SUM(CASE WHEN strftime('%Y', T2.date) = '2009' THEN T2.VALUE END) - SUM(CASE WHEN strftime('%Y', T2.date) = '2008' THEN T2.VALUE END) AS increase , T2.units FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description = 'Body Height'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,360
1,360
CREATE TABLE `patients` ( patient TEXT primary key, first TEXT, last TEXT ) CREATE TABLE `observations` ( DATE DATE, PATIENT TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key PATIENT references patientspatient )
[ "CASE WHEN", "AS", "AND", "SELECT", "SUM", "strftime", "CASE", "INNER JOIN", "ON", "FROM" ]
17
challenging
{ "case_1": [ -1 ], "case_2": [ 519, 1046 ], "case_3": [ 30, 53, 172, 374, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 4, 5, 6, 8, 12, 16, 19, 20, 21, 22, 24, 26, 30, 33, 37, 39, 42, 44, 45, 47, 51, 52, 53, 57, 61, 63, 64, 66, 68, 69, 71, 73, 74, 75, 76, 77, 81, 83, 85, 88, 90, 93, 94, 95, 96, 98, 99, 104, 106, 111, 112, 113, 115, 116, 117, 118, 119, 120, 125, 127, 128, 129, 131, 138, 141, 142, 143, 144, 146, 148, 152, 153, 154, 155, 158, 160, 163, 164, 169, 170, 171, 172, 175, 176, 177, 180, 183, 184, 186, 187, 189, 191, 192, 195, 197, 200, 201, 207, 212, 213, 214, 215, 219, 223, 225, 226, 227, 228, 234, 236, 239, 240, 244, 248, 254, 256, 258, 261, 262, 264, 265, 266, 267, 268, 271, 272, 275, 276, 277, 278, 279, 282, 296, 298, 299, 300, 301, 304, 313, 314, 315, 316, 317, 319, 322, 323, 325, 330, 335, 339, 341, 347, 356, 360, 361, 363, 365, 368, 370, 374, 375, 376, 378, 379, 381, 382, 383, 385, 391, 393, 395, 398, 402, 403, 405, 406, 408, 409, 412, 413, 414, 415, 416, 417, 419, 424, 425, 426, 427, 428, 433, 436, 437, 438, 440, 444, 446, 448, 450, 451, 452, 453, 455, 463, 464, 469, 470, 475, 476, 477, 478, 479, 480, 482, 483, 486, 487, 488, 490, 493, 494, 496, 497, 498, 500, 504, 507, 514, 515, 516, 517, 518, 519, 520, 522, 524, 526, 528, 529, 530, 533, 535, 537, 539, 540, 541, 544, 547, 550, 557, 558, 559, 561, 562, 563, 564, 571, 573, 575, 579, 580, 581, 582, 584, 586, 588, 589, 595, 597, 605, 608, 609, 610, 612, 613, 615, 620, 623, 624, 625, 626, 627, 628, 630, 632, 633, 637, 638, 640, 641, 643, 646, 648, 650, 651, 658, 662, 663, 666, 668, 671, 672, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 690, 693, 695, 697, 699, 701, 702, 706, 710, 712, 714, 715, 717, 723, 726, 727, 734, 735, 739, 740, 741, 743, 744, 745, 746, 747, 749, 750, 753, 754, 756, 758, 760, 762, 763, 765, 767, 768, 772, 773, 775, 776, 777, 780, 783, 787, 788, 793, 795, 796, 797, 798, 799, 800, 802, 804, 805, 806, 807, 808, 810, 813, 814, 819, 823, 824, 825, 827, 829, 830, 832, 835, 838, 841, 844, 848, 849, 851, 853, 858, 859, 860, 861, 867, 868, 870, 871, 873, 874, 877, 878, 879, 880, 886, 888, 892, 895, 896, 902, 905, 907, 909, 912, 917, 922, 923, 924, 926, 928, 930, 931, 932, 935, 943, 944, 949, 953, 954, 956, 958, 959, 961, 962, 969, 973, 974, 985, 986, 991, 996, 998, 1000, 1001, 1008, 1012, 1017, 1019, 1022, 1023, 1027, 1031, 1038, 1039, 1042, 1044, 1046, 1058, 1061, 1062, 1063, 1064, 1066, 1067, 1068, 1069, 1071, 1072, 1078, 1080, 1082, 1084, 1086, 1087, 1092, 1098, 1100, 1101, 1103, 1104, 1105, 1109, 1115, 1119, 1123, 1128, 1131, 1133, 1134, 1135, 1136 ] }
synthea
During all the observations of Elly Koss, what was the highest Systolic Blood Pressure observed?
the highest Systolic Blood Pressure refers to MAX(DESCRIPTION = 'Systolic Blood Pressure') from observations;
SELECT T2.value, T2.units FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description = 'Systolic Blood Pressure' ORDER BY T2.VALUE DESC LIMIT 1
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,361
1,361
CREATE TABLE `patients` ( patient TEXT primary key, first TEXT, last TEXT ) CREATE TABLE `observations` ( PATIENT TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "FROM" ]
11
medium
{ "case_1": [ -1 ], "case_2": [ 519, 1046 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 33, 34, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 85, 86, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 108, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 173, 174, 175, 176, 177, 179, 180, 181, 183, 184, 185, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 208, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 252, 254, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 285, 286, 287, 289, 290, 291, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 352, 353, 354, 356, 357, 358, 359, 360, 361, 363, 364, 365, 368, 369, 370, 371, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 619, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 664, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 708, 710, 711, 712, 714, 715, 717, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 732, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 815, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 836, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 869, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 943, 944, 946, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 972, 973, 974, 975, 977, 980, 981, 983, 985, 986, 987, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1010, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1030, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1057, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1076, 1077, 1078, 1080, 1082, 1083, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1139, 1141 ] }
synthea
For how many times had Elly Koss have her Systolic Blood Pressure observed?
Systolic Blood Pressure refers to DESCRIPTION = 'Systolic Blood Pressure';
SELECT COUNT(T2.description) FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description = 'Systolic Blood Pressure'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,362
1,362
CREATE TABLE `patients` ( patient TEXT primary key, first TEXT, last TEXT ) CREATE TABLE `observations` ( PATIENT TEXT, DESCRIPTION TEXT, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "COUNT", "FROM" ]
9
simple
{ "case_1": [ 519, 1046 ], "case_2": [ 519, 1046 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 109, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 399, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 509, 510, 511, 512, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 554, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 618, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 680, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 692, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 707, 710, 711, 712, 714, 715, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 730, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 820, 822, 823, 824, 825, 827, 828, 829, 830, 831, 832, 833, 834, 835, 837, 838, 839, 841, 843, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 903, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 945, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 965, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1019, 1020, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1078, 1079, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1126, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
The highest Systolic Blood Pressure was observed in which patient? Please give his or her full name.
the highest Systolic Blood Pressure refers to MAX(DESCRIPTION = 'Systolic Blood Pressure') from observations; full name refers to first, last;
SELECT T1.first, T1.last FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T2.VALUE = ( SELECT MAX(VALUE) FROM observations WHERE description = 'Systolic Blood Pressure' ) LIMIT 1
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,363
1,363
CREATE TABLE `patients` ( patient TEXT primary key, first TEXT, last TEXT ) CREATE TABLE `observations` ( PATIENT TEXT, DESCRIPTION TEXT, VALUE REAL, foreign key PATIENT references patientspatient )
[ "AS", "SELECT", "LIMIT", "INNER JOIN", "ON", "FROM", "MAX" ]
10
simple
{ "case_1": [ 519, 1046 ], "case_2": [ 519, 1046 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1075, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
For how long was Elly Koss required to take Acetaminophen?
SUM(MULTIPLY(365, SUBTRACT(strftime('%Y', STOP), strftime('%Y', START))), MULTIPLY(30, SUBTRACT(strftime('%m', STOP), strftime('%m', START))), SUBTRACT(strftime('%d', STOP), strftime('%d', START))) where DESCRIPTION like 'Acetaminophen%';
SELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS days FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description LIKE 'Acetaminophen%'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,364
1,364
CREATE TABLE `patients` ( patient TEXT primary key, first TEXT, last TEXT ) CREATE TABLE `medications` ( START DATE, STOP DATE, PATIENT TEXT, DESCRIPTION TEXT, REASONDESCRIPTION TEXT, primary key START, PATIENT, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "strftime", "LIKE", "INNER JOIN", "ON", "FROM" ]
12
medium
{ "case_1": [ 53, 433, 693 ], "case_2": [ 53, 433, 693 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1005, 1006, 1010, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
Please list all the medication that are prescribed to Elly Koss.
medication that are prescribed refers to DESCRIPTION from medications;
SELECT DISTINCT T2.description FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,365
1,365
CREATE TABLE `patients` ( patient TEXT primary key, first TEXT, last TEXT ) CREATE TABLE `medications` ( PATIENT TEXT, DESCRIPTION TEXT, REASONDESCRIPTION TEXT, PATIENT, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
7
simple
{ "case_1": [ -1 ], "case_2": [ 53, 433, 693 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
Why did Elly Koss need to take Acetaminophen?
why need to take Acetaminophen refers to REASONDESCRIPTION  where DESCRIPTION like 'Acetaminophen%' from medications;
SELECT T2.REASONDESCRIPTION FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description LIKE 'Acetaminophen%'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,366
1,366
CREATE TABLE `patients` ( patient TEXT primary key, first TEXT, last TEXT ) CREATE TABLE `medications` ( PATIENT TEXT, DESCRIPTION TEXT, REASONDESCRIPTION TEXT, PATIENT, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "LIKE", "INNER JOIN", "ON", "FROM" ]
9
simple
{ "case_1": [ -1 ], "case_2": [ 53, 433, 693 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 38, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 421, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 591, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1018, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1117, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
What medication did Elly Koss take when she had Streptococcal sore throat?
medication refers to DESCRIPTION from medications; Streptococcal sore throat refers to REASONDESCRIPTION like 'Streptococcal sore throat%';
SELECT T2.description FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.reasondescription = 'Streptococcal sore throat (disorder)'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,367
1,367
CREATE TABLE `patients` ( patient TEXT primary key, first TEXT, last TEXT ) CREATE TABLE `medications` ( PATIENT TEXT, DESCRIPTION TEXT, REASONDESCRIPTION TEXT, PATIENT, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
8
simple
{ "case_1": [ -1 ], "case_2": [ 53, 433, 693 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
Please give the full names of all the patients who had been prescribed with Acetaminophen.
full name refers to first, last; prescribed with Acetaminophen refer to DESCRIPTION like 'Acetaminophen%' from medications;
SELECT DISTINCT T1.first, T1.last FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.description LIKE 'Acetaminophen%'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,368
1,368
CREATE TABLE `patients` ( patient TEXT primary key, first TEXT, last TEXT ) CREATE TABLE `medications` ( PATIENT TEXT, DESCRIPTION TEXT, REASONDESCRIPTION TEXT, PATIENT, foreign key PATIENT references patientspatient )
[ "AS", "SELECT", "LIKE", "INNER JOIN", "ON", "FROM" ]
7
simple
{ "case_1": [ -1 ], "case_2": [ 53, 433, 693 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1005, 1006, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
What was the condition of Elly Koss on 2009/1/8?
condition on 2009/1/8 refers to DESCRIPTION from conditions where START = '2009-01-08';
SELECT T2.description FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.START = '2009-01-08'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,369
1,369
CREATE TABLE `patients` ( patient TEXT primary key, first TEXT, last TEXT ) CREATE TABLE `conditions` ( START DATE, PATIENT TEXT, DESCRIPTION TEXT, foreign key PATIENT references patientspatient, foreign key DESCRIPTION references all_prevalencesITEM )
[ "AS", "AND", "SELECT", "-", "INNER JOIN", "ON", "FROM" ]
10
simple
{ "case_1": [ 1086 ], "case_2": [ 628, 746, 760, 1086 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 36, 37, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 362, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 679, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 785, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 864, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
For how long did Elly Koss's cystitis last?
SUM(MULTIPLY(365, SUBTRACT(strftime('%Y', STOP), strftime('%Y', START))), MULTIPLY(30, SUBTRACT(strftime('%m', STOP), strftime('%m', START))), SUBTRACT(strftime('%d', STOP), strftime('%d', START))) where DESCRIPTION = 'Cystitis';
SELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS days FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description = 'Cystitis'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,370
1,370
CREATE TABLE `patients` ( patient TEXT primary key, first TEXT, last TEXT ) CREATE TABLE `conditions` ( START DATE, STOP DATE, PATIENT TEXT, DESCRIPTION TEXT, foreign key PATIENT references patientspatient, foreign key DESCRIPTION references all_prevalencesITEM )
[ "AS", "AND", "SELECT", "strftime", "INNER JOIN", "ON", "FROM" ]
11
medium
{ "case_1": [ 628, 746, 760 ], "case_2": [ 628, 746, 760, 1086 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
According to all the observations of Elly Koss, what was her average weight?
DIVIDE(SUM(VALUE), COUNT(VALUE)) WHERE DESCRIPTION = 'Body Weight';
SELECT AVG(T2.VALUE), T2.units FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description = 'Body Weight'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,371
1,371
CREATE TABLE `patients` ( patient TEXT primary key, first TEXT, last TEXT ) CREATE TABLE `observations` ( PATIENT TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "AVG", "FROM" ]
9
simple
{ "case_1": [ 519, 1046 ], "case_2": [ 519, 1046 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 864, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1081, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
Among all the patients who once had cystitis, what was the percentage of them being married?
DIVIDE(COUNT(marital = 'M'), COUNT(patient)) as percentage where DESCRIPTION = 'Cystitis';
SELECT CAST(SUM(CASE WHEN T1.marital = 'M' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T2.description = 'Cystitis'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,372
1,372
CREATE TABLE `patients` ( patient TEXT primary key, marital TEXT ) CREATE TABLE `conditions` ( PATIENT TEXT, DESCRIPTION TEXT, foreign key PATIENT references patientspatient, foreign key DESCRIPTION references all_prevalencesITEM )
[ "CASE WHEN", "AS", "SELECT", "SUM", "CASE", "INNER JOIN", "ON", "CAST", "COUNT", "FROM" ]
12
medium
{ "case_1": [ 628, 760 ], "case_2": [ 628, 760, 1086 ], "case_3": [ 30, 53, 374, 516, 519, 544, 581, 628, 760, 923, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 4, 6, 11, 16, 22, 24, 27, 30, 35, 36, 37, 39, 42, 47, 51, 53, 55, 61, 62, 63, 64, 68, 69, 71, 73, 74, 75, 77, 81, 82, 83, 86, 87, 88, 91, 93, 94, 96, 98, 104, 106, 112, 113, 115, 117, 118, 119, 120, 121, 125, 126, 127, 129, 131, 140, 141, 142, 143, 146, 148, 152, 153, 155, 158, 159, 160, 164, 167, 169, 170, 171, 173, 175, 179, 183, 184, 186, 187, 188, 189, 190, 191, 192, 195, 196, 197, 199, 201, 202, 206, 207, 212, 213, 214, 215, 219, 223, 225, 226, 227, 228, 229, 233, 234, 236, 243, 244, 247, 248, 254, 256, 258, 261, 264, 267, 268, 269, 271, 276, 277, 278, 279, 298, 299, 300, 301, 304, 311, 313, 314, 316, 317, 319, 320, 322, 323, 325, 330, 334, 335, 336, 338, 339, 341, 344, 345, 347, 349, 354, 356, 358, 360, 363, 364, 365, 370, 373, 374, 375, 378, 379, 381, 382, 383, 384, 391, 392, 393, 394, 398, 401, 402, 403, 406, 409, 411, 412, 415, 416, 417, 423, 424, 426, 427, 436, 438, 444, 445, 448, 450, 451, 452, 453, 454, 458, 460, 462, 464, 465, 467, 469, 470, 471, 473, 476, 477, 478, 479, 483, 484, 485, 486, 487, 488, 490, 493, 500, 504, 505, 509, 510, 514, 515, 516, 517, 518, 519, 520, 526, 528, 532, 535, 536, 537, 538, 540, 544, 547, 548, 550, 552, 558, 559, 560, 563, 564, 566, 571, 573, 575, 579, 580, 581, 582, 595, 596, 597, 606, 608, 609, 611, 612, 613, 620, 623, 627, 628, 630, 632, 633, 634, 638, 640, 641, 645, 646, 649, 650, 654, 658, 659, 662, 663, 665, 666, 668, 669, 671, 672, 676, 681, 682, 686, 687, 688, 690, 694, 695, 696, 701, 705, 706, 710, 712, 714, 717, 721, 723, 727, 733, 734, 735, 736, 739, 740, 743, 744, 745, 747, 749, 750, 752, 753, 756, 760, 762, 768, 769, 772, 776, 777, 778, 779, 787, 788, 790, 795, 796, 797, 798, 799, 800, 802, 804, 805, 808, 810, 812, 813, 814, 818, 819, 823, 824, 825, 827, 830, 832, 838, 839, 841, 844, 848, 849, 851, 853, 857, 866, 867, 868, 870, 871, 874, 876, 877, 880, 886, 888, 893, 894, 896, 897, 898, 901, 902, 909, 911, 912, 913, 915, 917, 918, 922, 923, 924, 926, 927, 930, 934, 935, 941, 943, 944, 950, 951, 954, 956, 958, 959, 961, 962, 963, 969, 973, 975, 977, 981, 985, 986, 993, 996, 998, 1005, 1006, 1008, 1010, 1012, 1013, 1015, 1022, 1023, 1027, 1031, 1037, 1038, 1042, 1043, 1047, 1050, 1051, 1058, 1062, 1064, 1066, 1067, 1068, 1069, 1071, 1072, 1078, 1082, 1084, 1086, 1087, 1092, 1094, 1098, 1100, 1101, 1103, 1104, 1106, 1112, 1119, 1121, 1123, 1124, 1128, 1131, 1133, 1134, 1135, 1137 ] }
synthea
Give the body height status of Mr. Vincent Wyman on 2010/8/2.
body height status refers to DESCRIPTION = 'Body Height' from observations; on 2010/8/2 refers to DATE = '2010-08-02';
SELECT T2.description, T2.VALUE, T2.units FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mr.' AND T1.first = 'Vincent' AND T1.last = 'Wyman' AND T2.date = '2010-08-02' AND T2.description = 'Body Height'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,373
1,373
CREATE TABLE `patients` ( patient TEXT primary key, prefix TEXT, first TEXT, last TEXT ) CREATE TABLE `observations` ( DATE DATE, PATIENT TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "-", "INNER JOIN", "ON", "FROM" ]
12
medium
{ "case_1": [ -1 ], "case_2": [ 519, 1046 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 36, 37, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 362, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 679, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 785, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 864, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
How many care plans has Mrs. Norman Berge taken?
SELECT COUNT(T2.PATIENT) FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mrs.' AND T1.first = 'Norman' AND T1.last = 'Berge'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,374
1,374
CREATE TABLE `patients` ( patient TEXT primary key, prefix TEXT, first TEXT, last TEXT ) CREATE TABLE `careplans` ( PATIENT TEXT, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "COUNT", "FROM" ]
9
simple
{ "case_1": [ 30 ], "case_2": [ 30 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 109, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 399, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 509, 510, 511, 512, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 554, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 618, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 680, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 692, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 707, 710, 711, 712, 714, 715, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 730, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 820, 822, 823, 824, 825, 827, 828, 829, 830, 831, 832, 833, 834, 835, 837, 838, 839, 841, 843, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 903, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 945, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 965, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1019, 1020, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1078, 1079, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1126, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
Why did Mrs. Annabelle Pouros take leucovorin 100 mg injection on 1970/12/19? State the reason.
reason why take leucovorin 100 mg injection refers to REASONDESCRIPTION where DESCRIPTION = 'Leucovorin 100 MG Injection'; on 1970/12/19 refers to START = '1970-12-19';
SELECT T2.reasondescription FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mrs.' AND T1.first = 'Annabelle' AND T1.last = 'Pouros' AND T2.start = '1970-12-19' AND T2.description = 'Leucovorin 100 MG Injection'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,375
1,375
CREATE TABLE `patients` ( patient TEXT primary key, prefix TEXT, first TEXT, last TEXT ) CREATE TABLE `medications` ( START DATE, PATIENT TEXT, DESCRIPTION TEXT, REASONDESCRIPTION TEXT, primary key START, PATIENT, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "-", "INNER JOIN", "ON", "FROM" ]
12
medium
{ "case_1": [ 53, 433, 693 ], "case_2": [ 53, 433, 693 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 36, 37, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 362, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 679, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 785, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 864, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
What is the prevalence percentage of condition no. 64859006?
condition no. 64859006 refers to conditions where CODE = '64859006';
SELECT DISTINCT T1."PREVALENCE PERCENTAGE" FROM all_prevalences AS T1 INNER JOIN conditions AS T2 ON lower(T1.ITEM) = lower(T2.DESCRIPTION) WHERE T2.code = '64859006'
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,376
1,376
CREATE TABLE `all_prevalences` ( ITEM TEXT primary key, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE `conditions` ( CODE INTEGER, DESCRIPTION TEXT, foreign key DESCRIPTION references all_prevalencesITEM )
[ "AS", "SELECT", "INNER JOIN", "ON", "FROM" ]
6
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 102, 104, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 506, 507, 508, 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 527, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 657, 658, 659, 660, 661, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 978, 980, 981, 982, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1075, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
State the prevalence rate of condition no. 368581000119106.
condition no. 368581000119106 refers to conditions where CODE = '368581000119106';
SELECT DISTINCT T1."PREVALENCE RATE" FROM all_prevalences AS T1 INNER JOIN conditions AS T2 ON lower(T1.ITEM) = lower(T2.DESCRIPTION) WHERE T2.code = '368581000119106'
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,377
1,377
CREATE TABLE `all_prevalences` ( ITEM TEXT primary key, "PREVALENCE RATE" REAL ) CREATE TABLE `conditions` ( CODE INTEGER, DESCRIPTION TEXT, foreign key DESCRIPTION references all_prevalencesITEM )
[ "AS", "SELECT", "INNER JOIN", "ON", "FROM" ]
6
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 35, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 102, 104, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 506, 507, 508, 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 527, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 657, 658, 659, 660, 661, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 978, 980, 981, 982, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1075, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
Give the procedure description of Ms. Jacquelyn Shanahan on 2009/8/9.
on 2009/8/9 refers to DATE = '2009-08-09';
SELECT DISTINCT T2.description FROM patients AS T1 INNER JOIN procedures AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Ms.' AND T1.first = 'Jacquelyn' AND T1.last = 'Shanahan' AND T2.DATE = '2009-08-09'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,378
1,378
CREATE TABLE `patients` ( patient TEXT primary key, prefix TEXT, first TEXT, last TEXT ) CREATE TABLE `procedures` ( DATE DATE, PATIENT TEXT, DESCRIPTION TEXT, REASONDESCRIPTION TEXT, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "-", "INNER JOIN", "ON", "FROM" ]
11
medium
{ "case_1": [ 516, 974 ], "case_2": [ 431, 516, 974 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 36, 37, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 362, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 679, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 785, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 864, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
Give the number of claims did Ms. Abbie Cole have in the year of 2011.
in the year of 2011 refers to BILLABLEPERIOD between '2010-12-31' and '2012-01-01';
SELECT COUNT(T2.BILLABLEPERIOD) FROM patients AS T1 INNER JOIN claims AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Ms.' AND T1.first = 'Abbie' AND T1.last = 'Cole' AND T2.BILLABLEPERIOD BETWEEN '2010-12-31' AND '2012-01-01'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,379
1,379
CREATE TABLE `patients` ( patient TEXT primary key, prefix TEXT, first TEXT, last TEXT ) CREATE TABLE `claims` ( PATIENT TEXT references patients, BILLABLEPERIOD DATE )
[ "AS", "AND", "SELECT", "-", "INNER JOIN", "ON", "COUNT", "BETWEEN", "FROM" ]
16
challenging
{ "case_1": [ 544 ], "case_2": [ 544 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 36, 37, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 173, 175, 176, 177, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 399, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 421, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 656, 657, 658, 659, 660, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 864, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
How many allergies does Mrs. Saundra Monahan have?
allergies refer to PATIENT from allergies;
SELECT COUNT(DISTINCT T2.code) FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mrs.' AND T1.first = 'Saundra' AND T1.last = 'Monahan'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,380
1,380
CREATE TABLE `patients` ( patient TEXT primary key, prefix TEXT, first TEXT, last TEXT ) CREATE TABLE `allergies` ( PATIENT TEXT, CODE INTEGER, primary key PATIENT, CODE, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "COUNT", "FROM" ]
9
simple
{ "case_1": [ 132 ], "case_2": [ 132 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 109, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 286, 287, 289, 290, 292, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 399, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 504, 505, 507, 509, 510, 511, 512, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 554, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 618, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 680, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 692, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 707, 710, 711, 712, 714, 715, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 730, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 820, 822, 823, 824, 825, 827, 828, 829, 830, 831, 832, 833, 834, 835, 837, 838, 839, 841, 843, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 903, 904, 905, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 945, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 965, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1019, 1020, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1078, 1079, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1113, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1126, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
Provide the name of the patient who had a claim on 1947/9/11.
name of the patient implies full name and refers to first, last; on 1947/9/11 refers to BILLABLEPERIOD = '1947-09-11';
SELECT T1.first, T1.last FROM patients AS T1 INNER JOIN claims AS T2 ON T1.patient = T2.PATIENT WHERE T2.billableperiod = '1947-09-11'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,381
1,381
CREATE TABLE `patients` ( patient TEXT primary key, first TEXT, last TEXT ) CREATE TABLE `claims` ( PATIENT TEXT references patients, BILLABLEPERIOD DATE )
[ "AS", "SELECT", "-", "INNER JOIN", "ON", "FROM" ]
8
simple
{ "case_1": [ -1 ], "case_2": [ 544 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1005, 1006, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
Describe the encounter of Mr. Hubert Baumbach on 2008/10/25.
encounter refers to DESCRIPTION from encounters; on 2008/10/25 refers to DATE = '2008-10-25';
SELECT T2.description FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mr.' AND T1.first = 'Hubert' AND T1.last = 'Baumbach' AND T2.date = '2008-10-25'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,382
1,382
CREATE TABLE `patients` ( patient TEXT primary key, prefix TEXT, first TEXT, last TEXT ) CREATE TABLE `encounters` ( DATE DATE, PATIENT TEXT, DESCRIPTION TEXT, REASONDESCRIPTION TEXT, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "-", "INNER JOIN", "ON", "FROM" ]
11
medium
{ "case_1": [ 172, 581 ], "case_2": [ 172, 581 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 36, 37, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 362, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 679, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 785, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 864, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
What kind of condition did Keven Kuhn have from 2016/9/24 to 2016/10/10? Describe the condition.
kind of condition refers to DESCRIPTION from conditions; from 2016/9/24 to 2016/10/10 refers to START = '2016-09-24' and STOP = '2016-10-10';
SELECT T2.description FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Keven' AND T1.last = 'Kuhn' AND T2.start = '2016-09-24' AND T2.stop = '2016-10-10'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,383
1,383
CREATE TABLE `patients` ( patient TEXT primary key, first TEXT, last TEXT ) CREATE TABLE `conditions` ( START DATE, STOP DATE, PATIENT TEXT, DESCRIPTION TEXT, foreign key PATIENT references patientspatient, foreign key DESCRIPTION references all_prevalencesITEM )
[ "AS", "AND", "SELECT", "-", "INNER JOIN", "ON", "FROM" ]
13
medium
{ "case_1": [ 628, 746, 760 ], "case_2": [ 628, 746, 760, 1086 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 32, 33, 34, 36, 37, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 362, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 667, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 679, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 785, 786, 787, 788, 790, 792, 793, 795, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 817, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 864, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
When did Mrs. Ira Deckow have the standard pregnancy test?
standard pregnancy test refers to DESCRIPTION = 'Standard pregnancy test' from procedures;
SELECT T2.date FROM patients AS T1 INNER JOIN procedures AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mrs.' AND T1.first = 'Ira' AND T1.last = 'Deckow' AND T2.description = 'Standard pregnancy test'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,384
1,384
CREATE TABLE `patients` ( patient TEXT primary key, prefix TEXT, first TEXT, last TEXT ) CREATE TABLE `procedures` ( DATE DATE, PATIENT TEXT, DESCRIPTION TEXT, REASONDESCRIPTION TEXT, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "INNER JOIN", "ON", "FROM" ]
9
simple
{ "case_1": [ 431 ], "case_2": [ 431, 516, 974 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
Calculate the average period of Mr. Wesley Lemke's care plans.
DIVIDE(SUBTRACT(stop time - start time), COUNT(ID)));
SELECT CAST(SUM(strftime('%J', T2.STOP) - strftime('%J', T2.START)) AS REAL) / COUNT(T1.patient) FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mr.' AND T1.first = 'Wesley' AND T1.last = 'Lemke'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,385
1,385
CREATE TABLE `patients` ( patient TEXT primary key, prefix TEXT, first TEXT, last TEXT ) CREATE TABLE `careplans` ( START DATE, STOP DATE, PATIENT TEXT, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "SUM", "strftime", "INNER JOIN", "ON", "CAST", "COUNT", "FROM" ]
14
medium
{ "case_1": [ -1 ], "case_2": [ 30 ], "case_3": [ 30, 53, 172, 374, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 4, 5, 6, 8, 11, 12, 16, 19, 20, 21, 22, 24, 26, 27, 30, 33, 35, 36, 37, 39, 42, 44, 45, 47, 51, 52, 53, 55, 57, 61, 62, 63, 64, 66, 68, 69, 71, 73, 74, 75, 76, 77, 81, 82, 83, 85, 86, 87, 88, 90, 91, 93, 94, 95, 96, 98, 99, 106, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 131, 138, 140, 141, 142, 143, 144, 146, 148, 152, 153, 154, 155, 158, 159, 160, 163, 164, 167, 169, 170, 172, 175, 176, 177, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 195, 196, 197, 199, 200, 201, 202, 206, 207, 212, 213, 214, 219, 223, 225, 226, 227, 228, 229, 233, 234, 236, 239, 240, 243, 244, 247, 248, 254, 256, 258, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 282, 296, 299, 300, 301, 304, 311, 313, 314, 315, 316, 317, 319, 320, 322, 323, 325, 330, 334, 335, 336, 338, 339, 341, 344, 345, 347, 349, 354, 356, 358, 360, 361, 363, 364, 365, 368, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 424, 425, 426, 427, 428, 433, 436, 437, 438, 440, 444, 445, 446, 448, 450, 451, 452, 453, 454, 455, 460, 462, 463, 464, 465, 467, 469, 470, 471, 473, 475, 476, 477, 478, 480, 482, 483, 484, 486, 487, 488, 490, 493, 494, 496, 497, 498, 500, 504, 505, 507, 509, 510, 514, 515, 516, 517, 518, 519, 520, 522, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 557, 558, 559, 560, 561, 562, 563, 564, 566, 571, 573, 575, 579, 580, 581, 582, 584, 586, 588, 589, 595, 596, 597, 605, 606, 608, 609, 610, 611, 612, 613, 615, 620, 623, 624, 625, 626, 627, 628, 630, 632, 633, 634, 637, 638, 640, 641, 643, 645, 646, 648, 649, 650, 651, 654, 658, 659, 662, 663, 665, 666, 668, 669, 671, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 693, 694, 695, 696, 697, 699, 701, 702, 705, 710, 712, 714, 715, 717, 721, 723, 726, 727, 733, 734, 735, 736, 739, 740, 741, 743, 744, 745, 746, 747, 749, 750, 752, 753, 754, 756, 758, 760, 762, 763, 765, 767, 768, 769, 772, 773, 775, 776, 777, 778, 779, 780, 783, 787, 788, 790, 793, 795, 796, 797, 798, 799, 800, 802, 804, 806, 807, 808, 810, 812, 813, 814, 818, 819, 823, 824, 825, 827, 829, 830, 832, 835, 838, 839, 841, 844, 848, 849, 851, 853, 857, 858, 859, 860, 861, 866, 867, 868, 870, 871, 873, 874, 876, 877, 878, 879, 886, 888, 892, 893, 894, 895, 896, 897, 898, 901, 902, 905, 907, 909, 911, 912, 913, 915, 917, 918, 922, 923, 924, 926, 927, 928, 930, 931, 932, 934, 935, 943, 944, 949, 950, 951, 953, 954, 956, 958, 959, 961, 962, 963, 969, 973, 974, 975, 977, 981, 985, 986, 991, 993, 996, 998, 1000, 1001, 1005, 1006, 1008, 1010, 1012, 1013, 1015, 1017, 1019, 1022, 1023, 1027, 1031, 1037, 1038, 1039, 1042, 1043, 1044, 1046, 1047, 1050, 1051, 1058, 1061, 1062, 1063, 1064, 1067, 1068, 1069, 1071, 1072, 1078, 1080, 1082, 1084, 1086, 1087, 1092, 1094, 1098, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1112, 1115, 1119, 1121, 1123, 1124, 1128, 1131, 1133, 1134, 1135, 1136, 1137 ] }
synthea
State the average period of Ms. Angelena Kertzmann's several normal pregnancies.
DIVIDE(SUBTRACT(stop time - start time), COUNT(DESCRIPTION = 'Normal pregnancy')));
SELECT CAST(SUM(strftime('%J', T2.STOP) - strftime('%J', T2.START)) AS REAL) / COUNT(T2.PATIENT) FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Ms.' AND T1.first = 'Angelena' AND T1.last = 'Kertzmann' AND T2.description = 'Normal pregnancy'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,386
1,386
CREATE TABLE `patients` ( patient TEXT primary key, prefix TEXT, first TEXT, last TEXT ) CREATE TABLE `conditions` ( START DATE, STOP DATE, PATIENT TEXT, DESCRIPTION TEXT, foreign key PATIENT references patientspatient, foreign key DESCRIPTION references all_prevalencesITEM )
[ "AS", "AND", "SELECT", "SUM", "strftime", "INNER JOIN", "ON", "CAST", "COUNT", "FROM" ]
15
medium
{ "case_1": [ 628, 746, 760 ], "case_2": [ 628, 746, 760, 1086 ], "case_3": [ 30, 53, 172, 374, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 4, 5, 6, 8, 11, 12, 16, 19, 20, 21, 22, 24, 26, 27, 30, 33, 35, 36, 37, 39, 42, 44, 45, 47, 51, 52, 53, 55, 57, 61, 62, 63, 64, 66, 68, 69, 71, 73, 74, 75, 76, 77, 81, 82, 83, 85, 86, 87, 88, 90, 91, 93, 94, 95, 96, 98, 99, 106, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 131, 138, 140, 141, 142, 143, 144, 146, 148, 152, 153, 154, 155, 158, 159, 160, 163, 164, 167, 169, 170, 172, 175, 176, 177, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 192, 195, 196, 197, 199, 200, 201, 202, 206, 207, 212, 213, 214, 219, 223, 225, 226, 227, 228, 229, 233, 234, 236, 239, 240, 243, 244, 247, 248, 254, 256, 258, 261, 262, 264, 265, 266, 267, 268, 269, 271, 272, 275, 276, 277, 278, 279, 282, 296, 299, 300, 301, 304, 311, 313, 314, 315, 316, 317, 319, 320, 322, 323, 325, 330, 334, 335, 336, 338, 339, 341, 344, 345, 347, 349, 354, 356, 358, 360, 361, 363, 364, 365, 368, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 424, 425, 426, 427, 428, 433, 436, 437, 438, 440, 444, 445, 446, 448, 450, 451, 452, 453, 454, 455, 460, 462, 463, 464, 465, 467, 469, 470, 471, 473, 475, 476, 477, 478, 480, 482, 483, 484, 486, 487, 488, 490, 493, 494, 496, 497, 498, 500, 504, 505, 507, 509, 510, 514, 515, 516, 517, 518, 519, 520, 522, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 557, 558, 559, 560, 561, 562, 563, 564, 566, 571, 573, 575, 579, 580, 581, 582, 584, 586, 588, 589, 595, 596, 597, 605, 606, 608, 609, 610, 611, 612, 613, 615, 620, 623, 624, 625, 626, 627, 628, 630, 632, 633, 634, 637, 638, 640, 641, 643, 645, 646, 648, 649, 650, 651, 654, 658, 659, 662, 663, 665, 666, 668, 669, 671, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 693, 694, 695, 696, 697, 699, 701, 702, 705, 710, 712, 714, 715, 717, 721, 723, 726, 727, 733, 734, 735, 736, 739, 740, 741, 743, 744, 745, 746, 747, 749, 750, 752, 753, 754, 756, 758, 760, 762, 763, 765, 767, 768, 769, 772, 773, 775, 776, 777, 778, 779, 780, 783, 787, 788, 790, 793, 795, 796, 797, 798, 799, 800, 802, 804, 806, 807, 808, 810, 812, 813, 814, 818, 819, 823, 824, 825, 827, 829, 830, 832, 835, 838, 839, 841, 844, 848, 849, 851, 853, 857, 858, 859, 860, 861, 866, 867, 868, 870, 871, 873, 874, 876, 877, 878, 879, 886, 888, 892, 893, 894, 895, 896, 897, 898, 901, 902, 905, 907, 909, 911, 912, 913, 915, 917, 918, 922, 923, 924, 926, 927, 928, 930, 931, 932, 934, 935, 943, 944, 949, 950, 951, 953, 954, 956, 958, 959, 961, 962, 963, 969, 973, 974, 975, 977, 981, 985, 986, 991, 993, 996, 998, 1000, 1001, 1005, 1006, 1008, 1010, 1012, 1013, 1015, 1017, 1019, 1022, 1023, 1027, 1031, 1037, 1038, 1039, 1042, 1043, 1044, 1046, 1047, 1050, 1051, 1058, 1061, 1062, 1063, 1064, 1067, 1068, 1069, 1071, 1072, 1078, 1080, 1082, 1084, 1086, 1087, 1092, 1094, 1098, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1112, 1115, 1119, 1121, 1123, 1124, 1128, 1131, 1133, 1134, 1135, 1136, 1137 ] }
synthea
What is the id of the patient who has the longest allergy period?
id of the patient refers to PATIENT from allergies where STOP is not null; the longest allergy period refers to MAX(SUBTRACT((SUBSTR(STOP, - 2, 1)! = '9' then substr(STOP, length(STOP) - 1) + 2000 end), (SUBSTR(START, - 2, 1) = '9' then substr(START, length(START) - 1) + 1900 else substr(START, length(START) - 1) + 2000 end)));
SELECT PATIENT FROM allergies WHERE STOP IS NOT NULL GROUP BY PATIENT ORDER BY CASE WHEN SUBSTR(STOP, -2, 1) != '9' THEN SUBSTR(STOP, LENGTH(STOP) - 1) + 2000 END - CASE WHEN SUBSTR(START, -2, 1) = '9' THEN SUBSTR(START, LENGTH(START) - 1) + 1900 ELSE SUBSTR(START, LENGTH(START) - 1) + 2000 END LIMIT 1
CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,387
1,387
CREATE TABLE `allergies` ( PATIENT TEXT, primary key PATIENT, foreign key PATIENT references patientspatient )
[ "GROUP BY", "CASE WHEN", "SELECT", "ORDER BY", "CASE", "LIMIT", "NULL", "LENGTH", "SUBSTR", "NOT", "IS", "FROM" ]
20
challenging
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ -1 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 89, 138, 150, 173, 195, 263, 395, 476, 508, 637, 827, 927, 1036, 1048, 1069, 1129 ] }
synthea
How many patients have diabetes that started in 1988?
diabetes that started in 1988 refers to DESCRIPTION = 'Diabetes' from conditions and START like '1988%';
SELECT COUNT(PATIENT) FROM conditions WHERE DESCRIPTION = 'Diabetes' AND strftime('%Y', START) = '1988'
CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,388
1,388
CREATE TABLE `conditions` ( PATIENT TEXT, DESCRIPTION TEXT, foreign key PATIENT references patientspatient, foreign key DESCRIPTION references all_prevalencesITEM )
[ "AND", "SELECT", "strftime", "COUNT", "FROM" ]
5
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 30, 53, 172, 374, 433, 516, 519, 544, 581, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 4, 5, 6, 8, 9, 10, 11, 12, 13, 15, 16, 19, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 33, 35, 36, 37, 38, 39, 40, 43, 44, 45, 47, 50, 51, 52, 53, 55, 56, 57, 61, 62, 63, 66, 67, 68, 69, 71, 73, 74, 75, 76, 77, 78, 79, 82, 85, 86, 87, 88, 89, 90, 91, 93, 95, 96, 98, 99, 100, 106, 108, 109, 111, 112, 113, 115, 116, 117, 118, 119, 121, 124, 125, 126, 127, 128, 129, 131, 138, 140, 141, 142, 143, 144, 146, 147, 148, 152, 154, 157, 158, 159, 160, 163, 164, 167, 168, 169, 170, 172, 173, 175, 176, 177, 179, 180, 182, 183, 184, 185, 187, 188, 189, 190, 191, 192, 196, 197, 198, 199, 200, 202, 203, 206, 210, 212, 214, 216, 219, 223, 224, 225, 226, 227, 229, 230, 233, 234, 239, 240, 243, 244, 247, 252, 254, 255, 256, 258, 259, 261, 262, 265, 266, 267, 268, 269, 270, 271, 272, 273, 275, 276, 277, 278, 282, 286, 291, 293, 294, 296, 299, 301, 303, 305, 311, 314, 315, 316, 317, 319, 320, 323, 325, 330, 334, 335, 336, 338, 339, 341, 344, 345, 348, 349, 350, 352, 354, 356, 358, 359, 360, 361, 362, 364, 367, 368, 370, 371, 373, 374, 375, 376, 380, 382, 383, 384, 385, 391, 392, 393, 394, 395, 398, 399, 401, 402, 403, 405, 406, 408, 409, 410, 411, 412, 413, 414, 416, 417, 418, 419, 420, 421, 423, 424, 425, 426, 427, 428, 433, 436, 437, 438, 439, 440, 443, 444, 445, 446, 447, 448, 451, 452, 453, 454, 455, 458, 460, 462, 463, 464, 465, 466, 467, 469, 470, 471, 473, 475, 476, 477, 478, 480, 481, 482, 484, 485, 487, 488, 490, 492, 493, 494, 496, 497, 498, 500, 504, 505, 507, 509, 510, 512, 514, 515, 516, 517, 519, 520, 522, 524, 526, 528, 529, 530, 531, 532, 533, 535, 536, 537, 538, 539, 541, 542, 543, 544, 545, 547, 548, 551, 552, 554, 557, 558, 559, 560, 561, 562, 563, 564, 566, 573, 580, 581, 582, 584, 585, 586, 588, 589, 591, 594, 595, 596, 597, 598, 599, 601, 603, 605, 606, 608, 610, 611, 612, 613, 615, 618, 620, 622, 624, 625, 626, 627, 629, 630, 632, 633, 634, 637, 641, 643, 645, 646, 648, 649, 651, 654, 656, 658, 659, 661, 662, 663, 664, 665, 666, 667, 668, 669, 671, 673, 675, 677, 678, 679, 680, 681, 683, 684, 685, 686, 687, 688, 689, 690, 692, 693, 694, 696, 697, 698, 699, 702, 703, 705, 707, 712, 714, 715, 716, 718, 719, 721, 726, 727, 730, 733, 734, 735, 736, 737, 739, 740, 741, 743, 746, 747, 748, 749, 750, 752, 753, 754, 756, 757, 758, 760, 762, 763, 765, 767, 768, 769, 770, 772, 773, 775, 776, 777, 778, 779, 780, 783, 785, 787, 788, 790, 793, 794, 795, 796, 797, 798, 799, 800, 802, 804, 806, 807, 808, 810, 811, 812, 813, 814, 817, 818, 819, 820, 821, 824, 825, 827, 829, 830, 831, 832, 835, 838, 839, 840, 841, 843, 844, 848, 849, 851, 853, 855, 857, 858, 859, 860, 861, 864, 865, 866, 867, 869, 870, 873, 874, 876, 877, 878, 879, 886, 888, 890, 892, 893, 894, 895, 896, 897, 898, 899, 901, 902, 903, 905, 907, 909, 911, 912, 913, 915, 917, 918, 920, 922, 923, 924, 926, 927, 928, 930, 931, 932, 934, 935, 941, 942, 943, 944, 945, 949, 950, 951, 953, 954, 956, 958, 960, 961, 963, 965, 968, 969, 972, 974, 975, 976, 977, 981, 983, 985, 986, 991, 993, 996, 998, 1000, 1001, 1005, 1006, 1008, 1009, 1010, 1011, 1013, 1014, 1015, 1017, 1018, 1019, 1020, 1022, 1023, 1027, 1030, 1031, 1037, 1039, 1042, 1043, 1044, 1046, 1047, 1050, 1051, 1053, 1055, 1057, 1058, 1059, 1061, 1062, 1063, 1064, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1084, 1086, 1087, 1090, 1092, 1094, 1096, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1112, 1113, 1115, 1117, 1119, 1121, 1123, 1124, 1126, 1127, 1128, 1131, 1133, 1134, 1135, 1136, 1137 ] }
synthea
How many patients are allergic to eggs?
allergic to eggs refer to DESCRIPTION = 'Allergy to eggs' from allergies;
SELECT COUNT(PATIENT) FROM allergies WHERE DESCRIPTION = 'Allergy to eggs'
CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,389
1,389
CREATE TABLE `allergies` ( PATIENT TEXT, DESCRIPTION TEXT, primary key PATIENT, foreign key PATIENT references patientspatient )
[ "COUNT", "SELECT", "FROM" ]
3
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141 ] }
synthea
What is the id of the patient whose hypertension started most recently?
id of the patient refers to PATIENT from conditions;  hypertension refers to DESCRIPTION = 'Hypertension'; most recently refers to MAX(START);
SELECT PATIENT FROM conditions WHERE START = ( SELECT MAX(START) FROM conditions WHERE DESCRIPTION = 'Hypertension' )
CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,390
1,390
CREATE TABLE `conditions` ( PATIENT TEXT, DESCRIPTION TEXT, foreign key PATIENT references patientspatient, foreign key DESCRIPTION references all_prevalencesITEM )
[ "SELECT", "FROM", "MAX" ]
5
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141 ] }
synthea
What is the most common allergy among patients?
the most common allergy refers to MAX(COUNT(DESCRIPTION)) from allergies;
SELECT DESCRIPTION FROM allergies GROUP BY DESCRIPTION ORDER BY COUNT(DESCRIPTION) DESC LIMIT 1
CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,391
1,391
CREATE TABLE `allergies` ( DESCRIPTION TEXT )
[ "GROUP BY", "SELECT", "ORDER BY", "LIMIT", "COUNT", "FROM", "DESC" ]
7
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 760 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 1, 10, 11, 13, 15, 17, 20, 22, 28, 29, 36, 38, 43, 49, 55, 59, 62, 69, 73, 75, 78, 86, 89, 108, 115, 121, 125, 126, 133, 138, 140, 142, 143, 150, 159, 162, 163, 167, 169, 173, 174, 179, 181, 182, 185, 187, 188, 191, 199, 202, 206, 208, 213, 214, 229, 233, 247, 252, 262, 263, 275, 278, 281, 285, 286, 291, 309, 311, 313, 314, 319, 320, 324, 329, 334, 336, 337, 341, 342, 344, 345, 348, 349, 352, 353, 356, 359, 364, 365, 371, 373, 378, 379, 381, 385, 394, 395, 400, 403, 404, 409, 411, 424, 428, 429, 434, 435, 444, 445, 451, 454, 460, 462, 466, 469, 473, 481, 482, 495, 497, 505, 530, 532, 534, 536, 538, 542, 548, 552, 555, 560, 566, 567, 576, 578, 579, 583, 584, 586, 590, 592, 595, 611, 619, 621, 625, 626, 630, 634, 637, 638, 645, 654, 657, 659, 664, 665, 669, 681, 688, 690, 691, 696, 698, 701, 703, 708, 713, 718, 719, 721, 732, 733, 735, 743, 748, 752, 759, 760, 768, 778, 779, 790, 803, 810, 815, 817, 818, 823, 827, 830, 836, 850, 851, 861, 866, 869, 876, 886, 889, 891, 893, 901, 911, 918, 927, 929, 934, 946, 950, 951, 954, 956, 962, 963, 966, 967, 970, 972, 973, 975, 977, 981, 983, 987, 989, 993, 994, 1004, 1005, 1006, 1010, 1013, 1017, 1024, 1025, 1030, 1034, 1037, 1038, 1043, 1047, 1049, 1050, 1051, 1056, 1057, 1065, 1067, 1068, 1070, 1076, 1077, 1083, 1094, 1106, 1124, 1135, 1137, 1139, 1141 ] }
synthea
What is/are the ids of the tallest patient/s?
id of the tallest patient/s refers to PATIENT from observations where MAX(DESCRIPTION = 'Body Height');
SELECT PATIENT FROM observations WHERE DESCRIPTION = 'Body Height' AND UNITS = 'cm' ORDER BY VALUE DESC LIMIT 1
CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,392
1,392
CREATE TABLE `observations` ( PATIENT TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key PATIENT references patientspatient )
[ "AND", "SELECT", "ORDER BY", "LIMIT", "DESC", "FROM" ]
6
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 760 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 1, 10, 11, 13, 15, 17, 20, 28, 29, 36, 38, 43, 49, 55, 59, 62, 69, 73, 75, 78, 86, 89, 108, 121, 125, 133, 138, 150, 159, 162, 163, 167, 173, 174, 179, 181, 185, 187, 188, 199, 200, 202, 206, 208, 213, 229, 233, 239, 247, 252, 262, 263, 275, 278, 281, 285, 286, 291, 309, 311, 313, 314, 319, 320, 324, 329, 334, 336, 337, 341, 342, 345, 348, 349, 352, 353, 356, 359, 364, 365, 371, 373, 378, 379, 381, 385, 394, 395, 400, 403, 404, 409, 411, 428, 429, 434, 435, 444, 445, 451, 454, 460, 462, 469, 482, 495, 497, 505, 530, 532, 534, 536, 538, 542, 548, 552, 555, 560, 566, 567, 576, 578, 579, 583, 584, 586, 590, 592, 595, 611, 619, 621, 625, 626, 634, 637, 638, 645, 654, 657, 659, 664, 665, 669, 681, 688, 690, 691, 698, 701, 703, 708, 713, 719, 732, 733, 735, 748, 752, 759, 760, 768, 778, 790, 803, 810, 815, 818, 823, 827, 830, 836, 850, 851, 861, 866, 869, 876, 886, 889, 891, 893, 901, 911, 918, 927, 929, 934, 946, 950, 951, 953, 954, 956, 962, 963, 966, 967, 970, 972, 973, 975, 977, 981, 983, 987, 989, 994, 1004, 1005, 1006, 1010, 1013, 1017, 1024, 1025, 1030, 1034, 1037, 1038, 1047, 1049, 1050, 1051, 1056, 1057, 1065, 1067, 1068, 1076, 1077, 1083, 1094, 1124, 1137, 1139, 1141 ] }
synthea
What is the most common condition among the female Americans?
the most common condition refers to MAX(COUNT(DESCRIPTION)); among the female Americans refer to PATIENT where gender = 'F' and ethnicity = 'american';
SELECT T2.DESCRIPTION FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.gender = 'F' AND T1.ethnicity = 'american' GROUP BY T2.DESCRIPTION ORDER BY COUNT(T2.DESCRIPTION) DESC LIMIT 1
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,393
1,393
CREATE TABLE `patients` ( patient TEXT primary key, ethnicity TEXT, gender TEXT ) CREATE TABLE `conditions` ( PATIENT TEXT, DESCRIPTION TEXT, foreign key PATIENT references patientspatient, foreign key DESCRIPTION references all_prevalencesITEM )
[ "GROUP BY", "AS", "AND", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "COUNT", "FROM" ]
12
medium
{ "case_1": [ 746, 760 ], "case_2": [ 746, 760, 1086 ], "case_3": [ 30, 53, 172, 374, 433, 516, 519, 544, 581, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 4, 5, 6, 8, 10, 11, 12, 13, 15, 16, 19, 20, 21, 22, 24, 26, 27, 28, 29, 30, 33, 36, 37, 38, 39, 44, 45, 47, 49, 51, 52, 53, 55, 57, 59, 62, 63, 66, 68, 69, 71, 73, 74, 75, 76, 77, 78, 82, 85, 86, 88, 89, 90, 91, 93, 95, 96, 98, 99, 106, 108, 111, 112, 113, 115, 116, 117, 118, 119, 121, 125, 126, 127, 128, 129, 131, 138, 140, 141, 142, 143, 144, 146, 148, 150, 152, 154, 158, 159, 160, 162, 163, 164, 167, 169, 170, 172, 173, 175, 176, 177, 179, 180, 183, 184, 185, 187, 188, 189, 190, 191, 196, 197, 199, 200, 202, 206, 212, 213, 214, 219, 225, 226, 227, 229, 233, 234, 239, 240, 243, 244, 247, 252, 254, 256, 258, 261, 262, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 281, 282, 285, 286, 291, 296, 299, 301, 309, 311, 313, 314, 315, 316, 317, 319, 320, 323, 324, 325, 329, 330, 334, 335, 336, 338, 339, 341, 342, 344, 345, 348, 349, 352, 353, 354, 356, 358, 359, 360, 361, 364, 365, 368, 370, 371, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 408, 409, 411, 412, 413, 414, 416, 417, 419, 424, 425, 426, 427, 428, 429, 433, 434, 435, 436, 437, 438, 440, 444, 445, 446, 448, 451, 452, 454, 455, 460, 462, 463, 464, 465, 467, 469, 470, 471, 473, 475, 476, 477, 478, 480, 482, 484, 487, 488, 490, 493, 494, 495, 496, 497, 498, 500, 505, 507, 509, 514, 515, 516, 519, 520, 522, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 541, 542, 544, 547, 548, 552, 557, 558, 559, 560, 561, 562, 563, 564, 566, 567, 573, 578, 579, 580, 581, 582, 584, 586, 588, 589, 590, 592, 595, 596, 597, 605, 606, 608, 610, 611, 612, 613, 615, 620, 621, 624, 625, 626, 627, 630, 632, 633, 634, 637, 638, 641, 643, 645, 646, 648, 649, 651, 654, 657, 658, 659, 662, 663, 664, 665, 666, 668, 669, 671, 675, 677, 678, 681, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 696, 697, 698, 699, 701, 702, 703, 705, 712, 714, 715, 719, 720, 721, 726, 727, 733, 734, 735, 736, 739, 740, 741, 743, 746, 747, 748, 749, 750, 751, 752, 753, 754, 756, 758, 759, 760, 762, 763, 765, 767, 768, 769, 772, 773, 775, 776, 777, 778, 779, 780, 783, 787, 788, 790, 793, 796, 797, 799, 800, 802, 803, 804, 806, 807, 808, 810, 812, 813, 814, 818, 819, 823, 824, 825, 827, 829, 830, 832, 835, 838, 839, 841, 844, 848, 849, 850, 851, 853, 857, 858, 859, 860, 861, 866, 867, 869, 870, 873, 874, 876, 877, 878, 879, 882, 886, 888, 889, 891, 892, 893, 895, 896, 897, 898, 901, 902, 905, 907, 909, 911, 912, 915, 917, 918, 922, 923, 924, 926, 927, 928, 929, 930, 931, 932, 934, 935, 943, 944, 949, 950, 951, 953, 954, 956, 958, 961, 962, 963, 966, 967, 969, 970, 972, 973, 974, 975, 977, 981, 983, 985, 986, 987, 991, 993, 994, 996, 1000, 1001, 1004, 1005, 1006, 1010, 1013, 1015, 1017, 1019, 1022, 1023, 1025, 1027, 1030, 1031, 1034, 1037, 1038, 1039, 1042, 1043, 1044, 1046, 1047, 1049, 1050, 1051, 1056, 1057, 1058, 1061, 1062, 1063, 1064, 1065, 1067, 1068, 1071, 1072, 1076, 1077, 1078, 1080, 1082, 1084, 1086, 1087, 1091, 1092, 1094, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1112, 1115, 1119, 1123, 1124, 1128, 1131, 1133, 1134, 1135, 1136, 1137 ] }
synthea
Among the patients that started taking Ibuprofen 200mg Oral Tablet in 2016, how many Dominican patients stopped taking the medicine after exactly one month?
Ibuprofen 200mg Oral Tablet refers to DESCRIPTION = 'Ibuprofen 200 MG Oral Tablet' from medications; started in 2016 refers to START like '2016%'; Dominican patients refer to ethnicity = 'dominican'; stopped taking the medicine after exactly one month refers to SUBTRACT(strftime('%m', STOP), strftime('%m', START)) = 1;
SELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Ibuprofen 200 MG Oral Tablet' AND T1.ethnicity = 'dominican' AND strftime('%Y', T2.START) = '2016' AND strftime('%m', T2.STOP) - strftime('%m', T2.START) = 1
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,394
1,394
CREATE TABLE `patients` ( patient TEXT primary key, ethnicity TEXT ) CREATE TABLE `medications` ( START DATE, STOP DATE, PATIENT TEXT, DESCRIPTION TEXT, REASONDESCRIPTION TEXT, primary key START, PATIENT, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "strftime", "INNER JOIN", "ON", "COUNT", "FROM" ]
13
medium
{ "case_1": [ 53, 433, 693 ], "case_2": [ 53, 433, 693 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
How many of the patients born in 1920s had pneumonia?
patients born in 1920s refer to patient where birthdate like '192%'; pneumonia refers to DESCRIPTION = 'Pneumonia' from conditions;
SELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE DESCRIPTION = 'Pneumonia' AND strftime('%Y', T1.birthdate) LIKE '192%'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,395
1,395
CREATE TABLE `patients` ( patient TEXT primary key, birthdate DATE ) CREATE TABLE `conditions` ( PATIENT TEXT, DESCRIPTION TEXT, foreign key PATIENT references patientspatient, foreign key DESCRIPTION references all_prevalencesITEM )
[ "AS", "AND", "SELECT", "strftime", "LIKE", "INNER JOIN", "ON", "COUNT", "FROM" ]
10
simple
{ "case_1": [ 1086 ], "case_2": [ 628, 746, 760, 1086 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 421, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 591, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1070, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
What are the full names of the patients who started taking Yaz 28 Day Pack in 2011?
full name refers to first, last; Yaz 28 Day Pack refers to DESCRIPTION = 'Yaz 28 Day Pack' from medications; started taking in 2011 refers to START like '2011%';
SELECT DISTINCT T1.first, T1.last, T1.suffix FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Yaz 28 Day Pack' AND strftime('%Y', T2.START) = '2011'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,396
1,396
CREATE TABLE `patients` ( patient TEXT primary key, first TEXT, last TEXT, suffix TEXT ) CREATE TABLE `medications` ( START DATE, PATIENT TEXT, DESCRIPTION TEXT, REASONDESCRIPTION TEXT, primary key START, PATIENT, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "strftime", "INNER JOIN", "ON", "FROM" ]
8
simple
{ "case_1": [ -1 ], "case_2": [ 53, 433, 693 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 367, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 601, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 998, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
How many Black patients were immunized with DTaP in 2013?
Black patients refer to patient where race = 'black'; immunized with DTaP refers to DESCRIPTION = 'DTaP' from immunizations; in 2013 refers to DATE like '2013%';
SELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T1.race = 'black' AND T2.DESCRIPTION = 'DTaP' AND strftime('%Y', T2.DATE) = '2013'
CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,397
1,397
CREATE TABLE `patients` ( patient TEXT primary key, race TEXT ) CREATE TABLE `immunizations` ( DATE DATE, PATIENT TEXT, DESCRIPTION TEXT, primary key DATE, PATIENT, foreign key PATIENT references patientspatient )
[ "AS", "AND", "SELECT", "strftime", "INNER JOIN", "ON", "COUNT", "FROM" ]
10
simple
{ "case_1": [ 923 ], "case_2": [ 923, 1123 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 175, 176, 177, 179, 180, 183, 184, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 254, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 287, 289, 290, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 353, 354, 356, 357, 358, 360, 361, 363, 364, 365, 368, 369, 370, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 401, 402, 403, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 510, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 535, 536, 537, 538, 539, 540, 541, 544, 547, 548, 550, 552, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, 582, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 699, 700, 701, 702, 704, 705, 706, 710, 711, 712, 714, 715, 717, 720, 721, 722, 723, 724, 725, 726, 727, 728, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 798, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 973, 974, 975, 977, 980, 981, 985, 986, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1005, 1006, 1008, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1078, 1080, 1082, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1121, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137 ] }
synthea
How many immunizations did the patient with the most prevalent condition that started recently get?
patient with the most prevalent condition refers to patient where MAX(PREVALENCE RATE); started recently refers to MAX(START);
SELECT COUNT(T2.patient) FROM all_prevalences AS T1 INNER JOIN conditions AS T2 ON lower(T1.ITEM) = lower(T2.DESCRIPTION) INNER JOIN immunizations AS T3 ON T2.PATIENT = T3.PATIENT GROUP BY T2.PATIENT ORDER BY T2.START DESC, T1."PREVALENCE RATE" DESC LIMIT 1
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,398
1,398
CREATE TABLE `all_prevalences` ( ITEM TEXT primary key, "PREVALENCE RATE" REAL ) CREATE TABLE `conditions` ( START DATE, PATIENT TEXT, DESCRIPTION TEXT, foreign key PATIENT references patientspatient, foreign key DESCRIPTION references all_prevalencesITEM ) CREATE TABLE `immunizations` ( PATIENT TEXT, DESCRIPTION TEXT, PATIENT, foreign key PATIENT references patientspatient )
[ "GROUP BY", "AS", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "COUNT", "FROM" ]
15
medium
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 30, 53, 374, 516, 519, 544, 581, 760, 923, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 4, 6, 10, 11, 13, 15, 16, 20, 22, 27, 28, 29, 30, 36, 37, 47, 49, 51, 53, 55, 59, 62, 63, 68, 69, 73, 74, 75, 77, 78, 82, 86, 88, 89, 91, 93, 96, 98, 106, 108, 113, 115, 117, 118, 119, 121, 125, 126, 131, 138, 140, 142, 143, 146, 148, 150, 152, 159, 160, 162, 163, 164, 167, 169, 170, 173, 175, 179, 183, 184, 185, 187, 188, 189, 190, 191, 196, 197, 199, 200, 202, 206, 212, 213, 214, 225, 226, 227, 229, 233, 234, 239, 243, 244, 247, 252, 254, 256, 261, 262, 267, 268, 269, 275, 276, 277, 278, 281, 285, 286, 291, 299, 301, 309, 311, 313, 314, 316, 317, 319, 320, 323, 324, 325, 329, 330, 334, 335, 336, 338, 339, 341, 342, 344, 345, 348, 349, 352, 353, 354, 356, 358, 359, 360, 364, 365, 370, 371, 373, 374, 375, 378, 379, 381, 382, 383, 384, 385, 391, 392, 394, 395, 401, 403, 406, 409, 411, 412, 416, 417, 424, 426, 428, 429, 434, 435, 436, 444, 445, 448, 451, 454, 460, 462, 464, 465, 467, 469, 471, 473, 476, 477, 478, 482, 484, 487, 488, 490, 493, 495, 497, 500, 505, 509, 515, 516, 519, 520, 526, 530, 532, 535, 536, 537, 538, 542, 544, 547, 548, 552, 558, 559, 560, 563, 564, 566, 567, 573, 578, 579, 580, 581, 582, 584, 586, 590, 592, 595, 596, 597, 606, 608, 611, 613, 620, 621, 625, 626, 627, 630, 632, 633, 634, 637, 638, 641, 645, 646, 649, 651, 654, 657, 658, 659, 662, 663, 664, 665, 668, 669, 671, 681, 687, 688, 690, 691, 694, 696, 698, 701, 703, 705, 712, 714, 719, 720, 721, 727, 733, 734, 735, 736, 739, 740, 743, 748, 749, 750, 751, 752, 753, 756, 759, 760, 762, 768, 769, 772, 778, 779, 787, 790, 796, 797, 799, 800, 802, 803, 804, 810, 812, 813, 814, 818, 819, 823, 824, 827, 830, 838, 839, 841, 849, 850, 851, 853, 857, 861, 866, 867, 869, 870, 874, 876, 877, 882, 886, 888, 889, 891, 893, 896, 897, 898, 901, 902, 909, 911, 912, 915, 917, 918, 922, 923, 924, 926, 927, 929, 930, 932, 934, 935, 943, 950, 951, 953, 954, 956, 958, 961, 962, 963, 966, 967, 969, 970, 972, 973, 975, 977, 981, 983, 985, 986, 987, 993, 994, 996, 1004, 1005, 1006, 1010, 1013, 1015, 1017, 1022, 1023, 1025, 1030, 1034, 1037, 1038, 1042, 1043, 1047, 1049, 1050, 1051, 1056, 1057, 1058, 1062, 1064, 1065, 1067, 1068, 1071, 1072, 1076, 1077, 1078, 1082, 1084, 1086, 1087, 1091, 1094, 1100, 1101, 1103, 1104, 1106, 1112, 1119, 1123, 1124, 1128, 1131, 1133, 1134, 1135, 1137 ] }
synthea
How many patients have the most prevalent conditions?
the most prevalent conditions refer to MAX(PREVALENCE RATE);
SELECT COUNT(DISTINCT T2.patient) FROM all_prevalences AS T1 INNER JOIN conditions AS T2 ON lower(T1.ITEM) = lower(T2.DESCRIPTION) ORDER BY T1."PREVALENCE RATE" DESC LIMIT 1
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,399
1,399
CREATE TABLE `all_prevalences` ( ITEM TEXT primary key, "PREVALENCE RATE" REAL ) CREATE TABLE `conditions` ( PATIENT TEXT, DESCRIPTION TEXT, foreign key PATIENT references patientspatient, foreign key DESCRIPTION references all_prevalencesITEM )
[ "AS", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "COUNT", "FROM" ]
10
simple
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 33, 34, 36, 37, 38, 39, 41, 42, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 85, 86, 88, 89, 90, 91, 93, 94, 95, 96, 97, 98, 99, 101, 102, 105, 106, 107, 108, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 150, 151, 152, 153, 154, 155, 158, 159, 160, 162, 163, 164, 165, 166, 167, 169, 170, 171, 172, 173, 174, 175, 176, 177, 179, 180, 181, 183, 184, 185, 186, 187, 188, 189, 190, 191, 194, 195, 196, 197, 199, 200, 201, 202, 206, 207, 208, 211, 212, 213, 214, 217, 218, 219, 220, 221, 225, 226, 227, 228, 229, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 246, 247, 248, 250, 252, 254, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 272, 275, 276, 277, 278, 279, 280, 281, 282, 284, 285, 286, 287, 289, 290, 291, 292, 295, 296, 297, 298, 299, 300, 301, 302, 304, 307, 308, 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 329, 330, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 352, 353, 354, 356, 357, 358, 359, 360, 361, 363, 364, 365, 368, 369, 370, 371, 373, 374, 375, 376, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 398, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 417, 419, 422, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 440, 441, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 482, 483, 484, 486, 487, 488, 489, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 501, 503, 505, 507, 509, 511, 514, 515, 516, 518, 519, 520, 521, 522, 523, 524, 526, 528, 529, 530, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 544, 547, 548, 550, 552, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 586, 587, 588, 589, 590, 592, 593, 595, 596, 597, 600, 602, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 619, 620, 621, 623, 624, 625, 626, 627, 628, 630, 631, 632, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 654, 655, 657, 658, 659, 660, 662, 663, 664, 665, 666, 668, 669, 670, 671, 672, 674, 675, 676, 677, 678, 681, 682, 683, 684, 685, 686, 687, 688, 690, 691, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 708, 710, 711, 712, 714, 715, 717, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 732, 733, 734, 735, 736, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 782, 783, 784, 786, 787, 788, 790, 792, 793, 796, 797, 799, 800, 802, 803, 804, 805, 806, 807, 808, 809, 810, 812, 813, 814, 815, 818, 819, 822, 823, 824, 825, 827, 828, 829, 830, 832, 833, 834, 835, 836, 837, 838, 839, 841, 844, 845, 846, 848, 849, 850, 851, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 866, 867, 868, 869, 870, 871, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 885, 886, 887, 888, 889, 891, 892, 893, 894, 895, 896, 897, 898, 900, 901, 902, 904, 905, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 918, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 934, 935, 936, 937, 938, 940, 941, 943, 944, 946, 949, 950, 951, 952, 953, 954, 956, 958, 959, 961, 962, 963, 964, 966, 967, 969, 970, 971, 972, 973, 974, 975, 977, 980, 981, 983, 985, 986, 987, 988, 991, 993, 994, 996, 997, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1010, 1011, 1012, 1013, 1015, 1016, 1017, 1019, 1022, 1023, 1025, 1027, 1029, 1030, 1031, 1033, 1034, 1035, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1056, 1057, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1074, 1076, 1077, 1078, 1080, 1082, 1083, 1084, 1085, 1086, 1087, 1089, 1091, 1092, 1094, 1095, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1109, 1111, 1112, 1114, 1115, 1116, 1118, 1119, 1122, 1123, 1124, 1128, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1139, 1141 ] }
synthea
What is the most common condition among the patients who received influenza seasonal injectable preservative free immunization?
the most common condition refers to MAX(DESCRIPTION) from conditions; patients who received influenza seasonal injectable preservative free immunization refer to PATIENT where DESCRIPTION = 'Influenza seasonal injectable preservative free' from immunizations;
SELECT T2.DESCRIPTION FROM immunizations AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.DESCRIPTION = 'Influenza seasonal injectable preservative free' GROUP BY T2.DESCRIPTION ORDER BY COUNT(T2.DESCRIPTION) DESC LIMIT 1
CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) )
CREATE TABLE all_prevalences ( ITEM TEXT primary key, "POPULATION TYPE" TEXT, OCCURRENCES INTEGER, "POPULATION COUNT" INTEGER, "PREVALENCE RATE" REAL, "PREVALENCE PERCENTAGE" REAL ) CREATE TABLE patients ( patient TEXT primary key, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT ) CREATE TABLE encounters ( ID TEXT primary key, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (PATIENT) references patients(patient) ) CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient), foreign key (DESCRIPTION) references all_prevalences(ITEM) ) CREATE TABLE immunizations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, primary key (DATE, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE medications ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, primary key (START, PATIENT, ENCOUNTER, CODE), foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, foreign key (ENCOUNTER) references encounters(ID), foreign key (PATIENT) references patients(patient) ) CREATE TABLE "claims" ( ID TEXT primary key, PATIENT TEXT references patients, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT references encounters, DIAGNOSIS TEXT, TOTAL INTEGER )
na
1,400
1,400
CREATE TABLE `conditions` ( PATIENT TEXT, DESCRIPTION TEXT, foreign key PATIENT references patientspatient, foreign key DESCRIPTION references all_prevalencesITEM ) CREATE TABLE `immunizations` ( PATIENT TEXT, DESCRIPTION TEXT, PATIENT, foreign key PATIENT references patientspatient )
[ "GROUP BY", "AS", "SELECT", "ORDER BY", "LIMIT", "INNER JOIN", "ON", "DESC", "COUNT", "FROM" ]
11
medium
{ "case_1": [ -1 ], "case_2": [ -1 ], "case_3": [ 30, 53, 374, 516, 519, 544, 581, 760, 923, 1086, 1123 ], "case_4": [ 30, 53, 132, 172, 374, 431, 433, 516, 519, 544, 581, 628, 693, 746, 760, 923, 974, 1046, 1086, 1123 ], "case_5": [ 0, 1, 4, 6, 10, 11, 13, 15, 16, 20, 22, 27, 28, 29, 30, 36, 37, 47, 49, 51, 53, 55, 59, 62, 63, 68, 69, 73, 74, 75, 77, 78, 82, 86, 88, 89, 91, 93, 96, 98, 106, 108, 113, 115, 117, 118, 119, 121, 125, 126, 131, 138, 140, 142, 143, 146, 148, 150, 152, 159, 160, 162, 163, 164, 167, 169, 170, 173, 175, 179, 183, 184, 185, 187, 188, 189, 190, 191, 196, 197, 199, 200, 202, 206, 212, 213, 214, 225, 226, 227, 229, 233, 234, 239, 243, 244, 247, 252, 254, 256, 261, 262, 267, 268, 269, 275, 276, 277, 278, 281, 285, 286, 291, 299, 301, 309, 311, 313, 314, 316, 317, 319, 320, 323, 324, 325, 329, 330, 334, 335, 336, 338, 339, 341, 342, 344, 345, 348, 349, 352, 353, 354, 356, 358, 359, 360, 364, 365, 370, 371, 373, 374, 375, 378, 379, 381, 382, 383, 384, 385, 391, 392, 394, 395, 401, 403, 406, 409, 411, 412, 416, 417, 424, 426, 428, 429, 434, 435, 436, 444, 445, 448, 451, 454, 460, 462, 464, 465, 467, 469, 471, 473, 476, 477, 478, 482, 484, 487, 488, 490, 493, 495, 497, 500, 505, 509, 515, 516, 519, 520, 526, 530, 532, 535, 536, 537, 538, 542, 544, 547, 548, 552, 558, 559, 560, 563, 564, 566, 567, 573, 578, 579, 580, 581, 582, 584, 586, 590, 592, 595, 596, 597, 606, 608, 611, 613, 620, 621, 625, 626, 627, 630, 632, 633, 634, 637, 638, 641, 645, 646, 649, 651, 654, 657, 658, 659, 662, 663, 664, 665, 668, 669, 671, 681, 687, 688, 690, 691, 694, 696, 698, 701, 703, 705, 712, 714, 719, 720, 721, 727, 733, 734, 735, 736, 739, 740, 743, 748, 749, 750, 751, 752, 753, 756, 759, 760, 762, 768, 769, 772, 778, 779, 787, 790, 796, 797, 799, 800, 802, 803, 804, 810, 812, 813, 814, 818, 819, 823, 824, 827, 830, 838, 839, 841, 849, 850, 851, 853, 857, 861, 866, 867, 869, 870, 874, 876, 877, 882, 886, 888, 889, 891, 893, 896, 897, 898, 901, 902, 909, 911, 912, 915, 917, 918, 922, 923, 924, 926, 927, 929, 930, 932, 934, 935, 943, 950, 951, 953, 954, 956, 958, 961, 962, 963, 966, 967, 969, 970, 972, 973, 975, 977, 981, 983, 985, 986, 987, 993, 994, 996, 1004, 1005, 1006, 1010, 1013, 1015, 1017, 1022, 1023, 1025, 1030, 1034, 1037, 1038, 1042, 1043, 1047, 1049, 1050, 1051, 1056, 1057, 1058, 1062, 1064, 1065, 1067, 1068, 1071, 1072, 1076, 1077, 1078, 1082, 1084, 1086, 1087, 1091, 1094, 1100, 1101, 1103, 1104, 1106, 1112, 1119, 1123, 1124, 1128, 1131, 1133, 1134, 1135, 1137 ] }