db_id
stringclasses 31
values | schema
stringclasses 22
values | schemaComEx
stringclasses 22
values | question
stringlengths 18
181
| query
stringlengths 20
577
| answer
stringlengths 14
41.7k
⌀ | complexity
stringclasses 4
values | distinct
bool 2
classes | like
bool 2
classes | between
bool 2
classes | order_by
bool 2
classes | limit
bool 2
classes | grouby_by
bool 2
classes | having
bool 2
classes | single_join
bool 2
classes | multiple_join
bool 2
classes | multiple_select
bool 2
classes | intersect
bool 2
classes | except
bool 2
classes | union
bool 2
classes |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | Return the country name and the numbers of languages spoken for each country that speaks at least 3 languages. | SELECT COUNT(T2.Language) , T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Name HAVING COUNT(*) > 2 | [{'COUNT(T2.Language)': 5, 'Name': 'Afghanistan'}, {'COUNT(T2.Language)': 3, 'Name': 'Albania'}, {'COUNT(T2.Language)': 3, 'Name': 'American Samoa'}, {'COUNT(T2.Language)': 4, 'Name': 'Andorra'}, {'COUNT(T2.Language)': 9, 'Name': 'Angola'}, {'COUNT(T2.Language)': 3, 'Name': 'Argentina'}, {'COUNT(T2.Language)': 4, 'Name': 'Aruba'}, {'COUNT(T2.Language)': 8, 'Name': 'Australia'}, {'COUNT(T2.Language)': 8, 'Name': 'Austria'}, {'COUNT(T2.Language)': 4, 'Name': 'Azerbaijan'}, {'COUNT(T2.Language)': 7, 'Name': 'Bangladesh'}, {'COUNT(T2.Language)': 4, 'Name': 'Belarus'}, {'COUNT(T2.Language)': 6, 'Name': 'Belgium'}, {'COUNT(T2.Language)': 4, 'Name': 'Belize'}, {'COUNT(T2.Language)': 7, 'Name': 'Benin'}, {'COUNT(T2.Language)': 3, 'Name': 'Bhutan'}, {'COUNT(T2.Language)': 4, 'Name': 'Bolivia'}, {'COUNT(T2.Language)': 5, 'Name': 'Botswana'}, {'COUNT(T2.Language)': 5, 'Name': 'Brazil'}, {'COUNT(T2.Language)': 4, 'Name': 'Brunei'}, {'COUNT(T2.Language)': 4, 'Name': 'Bulgaria'}, {'COUNT(T2.Language)': 6, 'Name': 'Burkina Faso'}, {'COUNT(T2.Language)': 3, 'Name': 'Burundi'}, {'COUNT(T2.Language)': 4, 'Name': 'Cambodia'}, {'COUNT(T2.Language)': 8, 'Name': 'Cameroon'}, {'COUNT(T2.Language)': 12, 'Name': 'Canada'}, {'COUNT(T2.Language)': 6, 'Name': 'Central African Republic'}, {'COUNT(T2.Language)': 8, 'Name': 'Chad'}, {'COUNT(T2.Language)': 4, 'Name': 'Chile'}, {'COUNT(T2.Language)': 12, 'Name': 'China'}, {'COUNT(T2.Language)': 5, 'Name': 'Colombia'}, {'COUNT(T2.Language)': 5, 'Name': 'Comoros'}, {'COUNT(T2.Language)': 6, 'Name': 'Congo'}, {'COUNT(T2.Language)': 10, 'Name': 'Congo, The Democratic Republic of the'}, {'COUNT(T2.Language)': 4, 'Name': 'Costa Rica'}, {'COUNT(T2.Language)': 8, 'Name': 'Czech Republic'}, {'COUNT(T2.Language)': 5, 'Name': 'Côte d’Ivoire'}, {'COUNT(T2.Language)': 7, 'Name': 'Denmark'}, {'COUNT(T2.Language)': 3, 'Name': 'Djibouti'}, {'COUNT(T2.Language)': 6, 'Name': 'Eritrea'}, {'COUNT(T2.Language)': 5, 'Name': 'Estonia'}, {'COUNT(T2.Language)': 7, 'Name': 'Ethiopia'}, {'COUNT(T2.Language)': 5, 'Name': 'Finland'}, {'COUNT(T2.Language)': 6, 'Name': 'France'}, {'COUNT(T2.Language)': 3, 'Name': 'French Polynesia'}, {'COUNT(T2.Language)': 4, 'Name': 'Gabon'}, {'COUNT(T2.Language)': 5, 'Name': 'Gambia'}, {'COUNT(T2.Language)': 6, 'Name': 'Georgia'}, {'COUNT(T2.Language)': 6, 'Name': 'Germany'}, {'COUNT(T2.Language)': 6, 'Name': 'Ghana'}, {'COUNT(T2.Language)': 5, 'Name': 'Guam'}, {'COUNT(T2.Language)': 5, 'Name': 'Guatemala'}, {'COUNT(T2.Language)': 7, 'Name': 'Guinea'}, {'COUNT(T2.Language)': 6, 'Name': 'Guinea-Bissau'}, {'COUNT(T2.Language)': 3, 'Name': 'Guyana'}, {'COUNT(T2.Language)': 4, 'Name': 'Honduras'}, {'COUNT(T2.Language)': 5, 'Name': 'Hong Kong'}, {'COUNT(T2.Language)': 6, 'Name': 'Hungary'}, {'COUNT(T2.Language)': 12, 'Name': 'India'}, {'COUNT(T2.Language)': 9, 'Name': 'Indonesia'}, {'COUNT(T2.Language)': 10, 'Name': 'Iran'}, {'COUNT(T2.Language)': 5, 'Name': 'Iraq'}, {'COUNT(T2.Language)': 3, 'Name': 'Israel'}, {'COUNT(T2.Language)': 8, 'Name': 'Italy'}, {'COUNT(T2.Language)': 6, 'Name': 'Japan'}, {'COUNT(T2.Language)': 3, 'Name': 'Jordan'}, {'COUNT(T2.Language)': 6, 'Name': 'Kazakstan'}, {'COUNT(T2.Language)': 10, 'Name': 'Kenya'}, {'COUNT(T2.Language)': 7, 'Name': 'Kyrgyzstan'}, {'COUNT(T2.Language)': 4, 'Name': 'Laos'}, {'COUNT(T2.Language)': 6, 'Name': 'Latvia'}, {'COUNT(T2.Language)': 3, 'Name': 'Lebanon'}, {'COUNT(T2.Language)': 3, 'Name': 'Lesotho'}, {'COUNT(T2.Language)': 8, 'Name': 'Liberia'}, {'COUNT(T2.Language)': 3, 'Name': 'Liechtenstein'}, {'COUNT(T2.Language)': 5, 'Name': 'Lithuania'}, {'COUNT(T2.Language)': 5, 'Name': 'Luxembourg'}, {'COUNT(T2.Language)': 4, 'Name': 'Macao'}, {'COUNT(T2.Language)': 5, 'Name': 'Macedonia'}, {'COUNT(T2.Language)': 4, 'Name': 'Malawi'}, {'COUNT(T2.Language)': 6, 'Name': 'Malaysia'}, {'COUNT(T2.Language)': 6, 'Name': 'Mali'}, {'COUNT(T2.Language)': 6, 'Name': 'Mauritania'}, {'COUNT(T2.Language)': 6, 'Name': 'Mauritius'}, {'COUNT(T2.Language)': 3, 'Name': 'Mayotte'}, {'COUNT(T2.Language)': 6, 'Name': 'Mexico'}, {'COUNT(T2.Language)': 6, 'Name': 'Micronesia, Federated States of'}, {'COUNT(T2.Language)': 5, 'Name': 'Moldova'}, {'COUNT(T2.Language)': 4, 'Name': 'Monaco'}, {'COUNT(T2.Language)': 6, 'Name': 'Mongolia'}, {'COUNT(T2.Language)': 10, 'Name': 'Mozambique'}, {'COUNT(T2.Language)': 8, 'Name': 'Myanmar'}, {'COUNT(T2.Language)': 8, 'Name': 'Namibia'}, {'COUNT(T2.Language)': 5, 'Name': 'Nauru'}, {'COUNT(T2.Language)': 7, 'Name': 'Nepal'}, {'COUNT(T2.Language)': 4, 'Name': 'Netherlands'}, {'COUNT(T2.Language)': 3, 'Name': 'Netherlands Antilles'}, {'COUNT(T2.Language)': 3, 'Name': 'New Caledonia'}, {'COUNT(T2.Language)': 4, 'Name': 'Nicaragua'}, {'COUNT(T2.Language)': 5, 'Name': 'Niger'}, {'COUNT(T2.Language)': 10, 'Name': 'Nigeria'}, {'COUNT(T2.Language)': 6, 'Name': 'Northern Mariana Islands'}, {'COUNT(T2.Language)': 5, 'Name': 'Norway'}, {'COUNT(T2.Language)': 8, 'Name': 'Pakistan'}, {'COUNT(T2.Language)': 4, 'Name': 'Palau'}, {'COUNT(T2.Language)': 6, 'Name': 'Panama'}, {'COUNT(T2.Language)': 4, 'Name': 'Paraguay'}, {'COUNT(T2.Language)': 3, 'Name': 'Peru'}, {'COUNT(T2.Language)': 10, 'Name': 'Philippines'}, {'COUNT(T2.Language)': 4, 'Name': 'Poland'}, {'COUNT(T2.Language)': 6, 'Name': 'Romania'}, {'COUNT(T2.Language)': 12, 'Name': 'Russian Federation'}, {'COUNT(T2.Language)': 5, 'Name': 'Réunion'}, {'COUNT(T2.Language)': 3, 'Name': 'Samoa'}, {'COUNT(T2.Language)': 6, 'Name': 'Senegal'}, {'COUNT(T2.Language)': 3, 'Name': 'Seychelles'}, {'COUNT(T2.Language)': 8, 'Name': 'Sierra Leone'}, {'COUNT(T2.Language)': 3, 'Name': 'Singapore'}, {'COUNT(T2.Language)': 5, 'Name': 'Slovakia'}, {'COUNT(T2.Language)': 3, 'Name': 'Slovenia'}, {'COUNT(T2.Language)': 3, 'Name': 'Solomon Islands'}, {'COUNT(T2.Language)': 11, 'Name': 'South Africa'}, {'COUNT(T2.Language)': 4, 'Name': 'Spain'}, {'COUNT(T2.Language)': 3, 'Name': 'Sri Lanka'}, {'COUNT(T2.Language)': 10, 'Name': 'Sudan'}, {'COUNT(T2.Language)': 6, 'Name': 'Sweden'}, {'COUNT(T2.Language)': 4, 'Name': 'Switzerland'}, {'COUNT(T2.Language)': 6, 'Name': 'Taiwan'}, {'COUNT(T2.Language)': 3, 'Name': 'Tajikistan'}, {'COUNT(T2.Language)': 11, 'Name': 'Tanzania'}, {'COUNT(T2.Language)': 6, 'Name': 'Thailand'}, {'COUNT(T2.Language)': 8, 'Name': 'Togo'}, {'COUNT(T2.Language)': 3, 'Name': 'Trinidad and Tobago'}, {'COUNT(T2.Language)': 3, 'Name': 'Tunisia'}, {'COUNT(T2.Language)': 3, 'Name': 'Turkey'}, {'COUNT(T2.Language)': 4, 'Name': 'Turkmenistan'}, {'COUNT(T2.Language)': 3, 'Name': 'Tuvalu'}, {'COUNT(T2.Language)': 10, 'Name': 'Uganda'}, {'COUNT(T2.Language)': 7, 'Name': 'Ukraine'}, {'COUNT(T2.Language)': 3, 'Name': 'United Kingdom'}, {'COUNT(T2.Language)': 12, 'Name': 'United States'}, {'COUNT(T2.Language)': 6, 'Name': 'Uzbekistan'}, {'COUNT(T2.Language)': 3, 'Name': 'Vanuatu'}, {'COUNT(T2.Language)': 3, 'Name': 'Venezuela'}, {'COUNT(T2.Language)': 9, 'Name': 'Vietnam'}, {'COUNT(T2.Language)': 3, 'Name': 'Virgin Islands, U.S.'}, {'COUNT(T2.Language)': 6, 'Name': 'Yugoslavia'}, {'COUNT(T2.Language)': 6, 'Name': 'Zambia'}, {'COUNT(T2.Language)': 4, 'Name': 'Zimbabwe'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | What are the names of countries that speak more than 2 languages, as well as how many languages they speak? | SELECT COUNT(T2.Language) , T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Name HAVING COUNT(*) > 2 | [{'COUNT(T2.Language)': 5, 'Name': 'Afghanistan'}, {'COUNT(T2.Language)': 3, 'Name': 'Albania'}, {'COUNT(T2.Language)': 3, 'Name': 'American Samoa'}, {'COUNT(T2.Language)': 4, 'Name': 'Andorra'}, {'COUNT(T2.Language)': 9, 'Name': 'Angola'}, {'COUNT(T2.Language)': 3, 'Name': 'Argentina'}, {'COUNT(T2.Language)': 4, 'Name': 'Aruba'}, {'COUNT(T2.Language)': 8, 'Name': 'Australia'}, {'COUNT(T2.Language)': 8, 'Name': 'Austria'}, {'COUNT(T2.Language)': 4, 'Name': 'Azerbaijan'}, {'COUNT(T2.Language)': 7, 'Name': 'Bangladesh'}, {'COUNT(T2.Language)': 4, 'Name': 'Belarus'}, {'COUNT(T2.Language)': 6, 'Name': 'Belgium'}, {'COUNT(T2.Language)': 4, 'Name': 'Belize'}, {'COUNT(T2.Language)': 7, 'Name': 'Benin'}, {'COUNT(T2.Language)': 3, 'Name': 'Bhutan'}, {'COUNT(T2.Language)': 4, 'Name': 'Bolivia'}, {'COUNT(T2.Language)': 5, 'Name': 'Botswana'}, {'COUNT(T2.Language)': 5, 'Name': 'Brazil'}, {'COUNT(T2.Language)': 4, 'Name': 'Brunei'}, {'COUNT(T2.Language)': 4, 'Name': 'Bulgaria'}, {'COUNT(T2.Language)': 6, 'Name': 'Burkina Faso'}, {'COUNT(T2.Language)': 3, 'Name': 'Burundi'}, {'COUNT(T2.Language)': 4, 'Name': 'Cambodia'}, {'COUNT(T2.Language)': 8, 'Name': 'Cameroon'}, {'COUNT(T2.Language)': 12, 'Name': 'Canada'}, {'COUNT(T2.Language)': 6, 'Name': 'Central African Republic'}, {'COUNT(T2.Language)': 8, 'Name': 'Chad'}, {'COUNT(T2.Language)': 4, 'Name': 'Chile'}, {'COUNT(T2.Language)': 12, 'Name': 'China'}, {'COUNT(T2.Language)': 5, 'Name': 'Colombia'}, {'COUNT(T2.Language)': 5, 'Name': 'Comoros'}, {'COUNT(T2.Language)': 6, 'Name': 'Congo'}, {'COUNT(T2.Language)': 10, 'Name': 'Congo, The Democratic Republic of the'}, {'COUNT(T2.Language)': 4, 'Name': 'Costa Rica'}, {'COUNT(T2.Language)': 8, 'Name': 'Czech Republic'}, {'COUNT(T2.Language)': 5, 'Name': 'Côte d’Ivoire'}, {'COUNT(T2.Language)': 7, 'Name': 'Denmark'}, {'COUNT(T2.Language)': 3, 'Name': 'Djibouti'}, {'COUNT(T2.Language)': 6, 'Name': 'Eritrea'}, {'COUNT(T2.Language)': 5, 'Name': 'Estonia'}, {'COUNT(T2.Language)': 7, 'Name': 'Ethiopia'}, {'COUNT(T2.Language)': 5, 'Name': 'Finland'}, {'COUNT(T2.Language)': 6, 'Name': 'France'}, {'COUNT(T2.Language)': 3, 'Name': 'French Polynesia'}, {'COUNT(T2.Language)': 4, 'Name': 'Gabon'}, {'COUNT(T2.Language)': 5, 'Name': 'Gambia'}, {'COUNT(T2.Language)': 6, 'Name': 'Georgia'}, {'COUNT(T2.Language)': 6, 'Name': 'Germany'}, {'COUNT(T2.Language)': 6, 'Name': 'Ghana'}, {'COUNT(T2.Language)': 5, 'Name': 'Guam'}, {'COUNT(T2.Language)': 5, 'Name': 'Guatemala'}, {'COUNT(T2.Language)': 7, 'Name': 'Guinea'}, {'COUNT(T2.Language)': 6, 'Name': 'Guinea-Bissau'}, {'COUNT(T2.Language)': 3, 'Name': 'Guyana'}, {'COUNT(T2.Language)': 4, 'Name': 'Honduras'}, {'COUNT(T2.Language)': 5, 'Name': 'Hong Kong'}, {'COUNT(T2.Language)': 6, 'Name': 'Hungary'}, {'COUNT(T2.Language)': 12, 'Name': 'India'}, {'COUNT(T2.Language)': 9, 'Name': 'Indonesia'}, {'COUNT(T2.Language)': 10, 'Name': 'Iran'}, {'COUNT(T2.Language)': 5, 'Name': 'Iraq'}, {'COUNT(T2.Language)': 3, 'Name': 'Israel'}, {'COUNT(T2.Language)': 8, 'Name': 'Italy'}, {'COUNT(T2.Language)': 6, 'Name': 'Japan'}, {'COUNT(T2.Language)': 3, 'Name': 'Jordan'}, {'COUNT(T2.Language)': 6, 'Name': 'Kazakstan'}, {'COUNT(T2.Language)': 10, 'Name': 'Kenya'}, {'COUNT(T2.Language)': 7, 'Name': 'Kyrgyzstan'}, {'COUNT(T2.Language)': 4, 'Name': 'Laos'}, {'COUNT(T2.Language)': 6, 'Name': 'Latvia'}, {'COUNT(T2.Language)': 3, 'Name': 'Lebanon'}, {'COUNT(T2.Language)': 3, 'Name': 'Lesotho'}, {'COUNT(T2.Language)': 8, 'Name': 'Liberia'}, {'COUNT(T2.Language)': 3, 'Name': 'Liechtenstein'}, {'COUNT(T2.Language)': 5, 'Name': 'Lithuania'}, {'COUNT(T2.Language)': 5, 'Name': 'Luxembourg'}, {'COUNT(T2.Language)': 4, 'Name': 'Macao'}, {'COUNT(T2.Language)': 5, 'Name': 'Macedonia'}, {'COUNT(T2.Language)': 4, 'Name': 'Malawi'}, {'COUNT(T2.Language)': 6, 'Name': 'Malaysia'}, {'COUNT(T2.Language)': 6, 'Name': 'Mali'}, {'COUNT(T2.Language)': 6, 'Name': 'Mauritania'}, {'COUNT(T2.Language)': 6, 'Name': 'Mauritius'}, {'COUNT(T2.Language)': 3, 'Name': 'Mayotte'}, {'COUNT(T2.Language)': 6, 'Name': 'Mexico'}, {'COUNT(T2.Language)': 6, 'Name': 'Micronesia, Federated States of'}, {'COUNT(T2.Language)': 5, 'Name': 'Moldova'}, {'COUNT(T2.Language)': 4, 'Name': 'Monaco'}, {'COUNT(T2.Language)': 6, 'Name': 'Mongolia'}, {'COUNT(T2.Language)': 10, 'Name': 'Mozambique'}, {'COUNT(T2.Language)': 8, 'Name': 'Myanmar'}, {'COUNT(T2.Language)': 8, 'Name': 'Namibia'}, {'COUNT(T2.Language)': 5, 'Name': 'Nauru'}, {'COUNT(T2.Language)': 7, 'Name': 'Nepal'}, {'COUNT(T2.Language)': 4, 'Name': 'Netherlands'}, {'COUNT(T2.Language)': 3, 'Name': 'Netherlands Antilles'}, {'COUNT(T2.Language)': 3, 'Name': 'New Caledonia'}, {'COUNT(T2.Language)': 4, 'Name': 'Nicaragua'}, {'COUNT(T2.Language)': 5, 'Name': 'Niger'}, {'COUNT(T2.Language)': 10, 'Name': 'Nigeria'}, {'COUNT(T2.Language)': 6, 'Name': 'Northern Mariana Islands'}, {'COUNT(T2.Language)': 5, 'Name': 'Norway'}, {'COUNT(T2.Language)': 8, 'Name': 'Pakistan'}, {'COUNT(T2.Language)': 4, 'Name': 'Palau'}, {'COUNT(T2.Language)': 6, 'Name': 'Panama'}, {'COUNT(T2.Language)': 4, 'Name': 'Paraguay'}, {'COUNT(T2.Language)': 3, 'Name': 'Peru'}, {'COUNT(T2.Language)': 10, 'Name': 'Philippines'}, {'COUNT(T2.Language)': 4, 'Name': 'Poland'}, {'COUNT(T2.Language)': 6, 'Name': 'Romania'}, {'COUNT(T2.Language)': 12, 'Name': 'Russian Federation'}, {'COUNT(T2.Language)': 5, 'Name': 'Réunion'}, {'COUNT(T2.Language)': 3, 'Name': 'Samoa'}, {'COUNT(T2.Language)': 6, 'Name': 'Senegal'}, {'COUNT(T2.Language)': 3, 'Name': 'Seychelles'}, {'COUNT(T2.Language)': 8, 'Name': 'Sierra Leone'}, {'COUNT(T2.Language)': 3, 'Name': 'Singapore'}, {'COUNT(T2.Language)': 5, 'Name': 'Slovakia'}, {'COUNT(T2.Language)': 3, 'Name': 'Slovenia'}, {'COUNT(T2.Language)': 3, 'Name': 'Solomon Islands'}, {'COUNT(T2.Language)': 11, 'Name': 'South Africa'}, {'COUNT(T2.Language)': 4, 'Name': 'Spain'}, {'COUNT(T2.Language)': 3, 'Name': 'Sri Lanka'}, {'COUNT(T2.Language)': 10, 'Name': 'Sudan'}, {'COUNT(T2.Language)': 6, 'Name': 'Sweden'}, {'COUNT(T2.Language)': 4, 'Name': 'Switzerland'}, {'COUNT(T2.Language)': 6, 'Name': 'Taiwan'}, {'COUNT(T2.Language)': 3, 'Name': 'Tajikistan'}, {'COUNT(T2.Language)': 11, 'Name': 'Tanzania'}, {'COUNT(T2.Language)': 6, 'Name': 'Thailand'}, {'COUNT(T2.Language)': 8, 'Name': 'Togo'}, {'COUNT(T2.Language)': 3, 'Name': 'Trinidad and Tobago'}, {'COUNT(T2.Language)': 3, 'Name': 'Tunisia'}, {'COUNT(T2.Language)': 3, 'Name': 'Turkey'}, {'COUNT(T2.Language)': 4, 'Name': 'Turkmenistan'}, {'COUNT(T2.Language)': 3, 'Name': 'Tuvalu'}, {'COUNT(T2.Language)': 10, 'Name': 'Uganda'}, {'COUNT(T2.Language)': 7, 'Name': 'Ukraine'}, {'COUNT(T2.Language)': 3, 'Name': 'United Kingdom'}, {'COUNT(T2.Language)': 12, 'Name': 'United States'}, {'COUNT(T2.Language)': 6, 'Name': 'Uzbekistan'}, {'COUNT(T2.Language)': 3, 'Name': 'Vanuatu'}, {'COUNT(T2.Language)': 3, 'Name': 'Venezuela'}, {'COUNT(T2.Language)': 9, 'Name': 'Vietnam'}, {'COUNT(T2.Language)': 3, 'Name': 'Virgin Islands, U.S.'}, {'COUNT(T2.Language)': 6, 'Name': 'Yugoslavia'}, {'COUNT(T2.Language)': 6, 'Name': 'Zambia'}, {'COUNT(T2.Language)': 4, 'Name': 'Zimbabwe'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
orchestra |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
) |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
/*
2 rows from conductor table:
Conductor_ID Name Age Nationality Year_of_Work
1 Antal Doráti 40 USA 10
2 Igor Stravinsky 41 UK 11
*/
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
/*
2 rows from orchestra table:
Orchestra_ID Orchestra Conductor_ID Record_Company Year_of_Founded Major_Record_Format
1 London Symphony Orchestra 1 Mercury Records 2003.0 CD
2 Columbia Symphony Orchestra 2 Columbia Masterworks 2009.0 CD / LP
*/
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
/*
2 rows from performance table:
Performance_ID Orchestra_ID Type Date Official_ratings_(millions) Weekly_rank Share
1 1 Auditions 1 9 June 5.2 12 22.7%
2 2 Auditions 2 10 June 6.73 8 28.0%
*/
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
)
/*
2 rows from show table:
Show_ID Performance_ID If_first_show Result Attendance
1 1 True T 1026.0
2 2 True T 695.0
*/ | Show the names of conductors and the orchestras they have conducted. | SELECT T1.Name , T2.Orchestra FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID | [{'Name': 'Antal Doráti', 'Orchestra': 'London Symphony Orchestra'}, {'Name': 'Igor Stravinsky', 'Orchestra': 'Columbia Symphony Orchestra'}, {'Name': 'Colin Davis', 'Orchestra': 'Royal Concertgebouw Orchestra'}, {'Name': 'Paul Jorgensen', 'Orchestra': 'Royal Danish Orchestra'}, {'Name': 'Antal Brown', 'Orchestra': 'Detroit Symphony Orchestra'}, {'Name': 'Charles Dutoit', 'Orchestra': 'Montreal Symphony Orchestra'}, {'Name': 'Gerard Schwarz', 'Orchestra': 'Seattle Symphony Orchestra'}, {'Name': 'Pierre Boulez', 'Orchestra': 'Chicago Symphony Orchestra'}, {'Name': 'Valeri Gergiev', 'Orchestra': 'Kirov Orchestra'}, {'Name': 'Robert Craft', 'Orchestra': 'Philharmonia Orchestra'}, {'Name': 'Seiji Ozawa', 'Orchestra': 'Orchestre de Paris'}, {'Name': 'Michael Tilson Thomas', 'Orchestra': 'San Francisco Symphony Orchestra'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
orchestra |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
) |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
/*
2 rows from conductor table:
Conductor_ID Name Age Nationality Year_of_Work
1 Antal Doráti 40 USA 10
2 Igor Stravinsky 41 UK 11
*/
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
/*
2 rows from orchestra table:
Orchestra_ID Orchestra Conductor_ID Record_Company Year_of_Founded Major_Record_Format
1 London Symphony Orchestra 1 Mercury Records 2003.0 CD
2 Columbia Symphony Orchestra 2 Columbia Masterworks 2009.0 CD / LP
*/
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
/*
2 rows from performance table:
Performance_ID Orchestra_ID Type Date Official_ratings_(millions) Weekly_rank Share
1 1 Auditions 1 9 June 5.2 12 22.7%
2 2 Auditions 2 10 June 6.73 8 28.0%
*/
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
)
/*
2 rows from show table:
Show_ID Performance_ID If_first_show Result Attendance
1 1 True T 1026.0
2 2 True T 695.0
*/ | What are the names of conductors as well as the corresonding orchestras that they have conducted? | SELECT T1.Name , T2.Orchestra FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID | [{'Name': 'Antal Doráti', 'Orchestra': 'London Symphony Orchestra'}, {'Name': 'Igor Stravinsky', 'Orchestra': 'Columbia Symphony Orchestra'}, {'Name': 'Colin Davis', 'Orchestra': 'Royal Concertgebouw Orchestra'}, {'Name': 'Paul Jorgensen', 'Orchestra': 'Royal Danish Orchestra'}, {'Name': 'Antal Brown', 'Orchestra': 'Detroit Symphony Orchestra'}, {'Name': 'Charles Dutoit', 'Orchestra': 'Montreal Symphony Orchestra'}, {'Name': 'Gerard Schwarz', 'Orchestra': 'Seattle Symphony Orchestra'}, {'Name': 'Pierre Boulez', 'Orchestra': 'Chicago Symphony Orchestra'}, {'Name': 'Valeri Gergiev', 'Orchestra': 'Kirov Orchestra'}, {'Name': 'Robert Craft', 'Orchestra': 'Philharmonia Orchestra'}, {'Name': 'Seiji Ozawa', 'Orchestra': 'Orchestre de Paris'}, {'Name': 'Michael Tilson Thomas', 'Orchestra': 'San Francisco Symphony Orchestra'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
orchestra |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
) |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
/*
2 rows from conductor table:
Conductor_ID Name Age Nationality Year_of_Work
1 Antal Doráti 40 USA 10
2 Igor Stravinsky 41 UK 11
*/
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
/*
2 rows from orchestra table:
Orchestra_ID Orchestra Conductor_ID Record_Company Year_of_Founded Major_Record_Format
1 London Symphony Orchestra 1 Mercury Records 2003.0 CD
2 Columbia Symphony Orchestra 2 Columbia Masterworks 2009.0 CD / LP
*/
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
/*
2 rows from performance table:
Performance_ID Orchestra_ID Type Date Official_ratings_(millions) Weekly_rank Share
1 1 Auditions 1 9 June 5.2 12 22.7%
2 2 Auditions 2 10 June 6.73 8 28.0%
*/
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
)
/*
2 rows from show table:
Show_ID Performance_ID If_first_show Result Attendance
1 1 True T 1026.0
2 2 True T 695.0
*/ | Show the names of conductors that have conducted more than one orchestras. | SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID HAVING COUNT(*) > 1 | [{'Nenhum': 'Nenhum resultado encontrado'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
orchestra |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
) |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
/*
2 rows from conductor table:
Conductor_ID Name Age Nationality Year_of_Work
1 Antal Doráti 40 USA 10
2 Igor Stravinsky 41 UK 11
*/
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
/*
2 rows from orchestra table:
Orchestra_ID Orchestra Conductor_ID Record_Company Year_of_Founded Major_Record_Format
1 London Symphony Orchestra 1 Mercury Records 2003.0 CD
2 Columbia Symphony Orchestra 2 Columbia Masterworks 2009.0 CD / LP
*/
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
/*
2 rows from performance table:
Performance_ID Orchestra_ID Type Date Official_ratings_(millions) Weekly_rank Share
1 1 Auditions 1 9 June 5.2 12 22.7%
2 2 Auditions 2 10 June 6.73 8 28.0%
*/
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
)
/*
2 rows from show table:
Show_ID Performance_ID If_first_show Result Attendance
1 1 True T 1026.0
2 2 True T 695.0
*/ | What are the names of conductors who have conducted at more than one orchestra? | SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID HAVING COUNT(*) > 1 | [{'Nenhum': 'Nenhum resultado encontrado'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
orchestra |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
) |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
/*
2 rows from conductor table:
Conductor_ID Name Age Nationality Year_of_Work
1 Antal Doráti 40 USA 10
2 Igor Stravinsky 41 UK 11
*/
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
/*
2 rows from orchestra table:
Orchestra_ID Orchestra Conductor_ID Record_Company Year_of_Founded Major_Record_Format
1 London Symphony Orchestra 1 Mercury Records 2003.0 CD
2 Columbia Symphony Orchestra 2 Columbia Masterworks 2009.0 CD / LP
*/
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
/*
2 rows from performance table:
Performance_ID Orchestra_ID Type Date Official_ratings_(millions) Weekly_rank Share
1 1 Auditions 1 9 June 5.2 12 22.7%
2 2 Auditions 2 10 June 6.73 8 28.0%
*/
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
)
/*
2 rows from show table:
Show_ID Performance_ID If_first_show Result Attendance
1 1 True T 1026.0
2 2 True T 695.0
*/ | Show the name of the conductor that has conducted the most number of orchestras. | SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID ORDER BY COUNT(*) DESC LIMIT 1 | [{'Name': 'Michael Tilson Thomas'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
orchestra |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
) |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
/*
2 rows from conductor table:
Conductor_ID Name Age Nationality Year_of_Work
1 Antal Doráti 40 USA 10
2 Igor Stravinsky 41 UK 11
*/
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
/*
2 rows from orchestra table:
Orchestra_ID Orchestra Conductor_ID Record_Company Year_of_Founded Major_Record_Format
1 London Symphony Orchestra 1 Mercury Records 2003.0 CD
2 Columbia Symphony Orchestra 2 Columbia Masterworks 2009.0 CD / LP
*/
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
/*
2 rows from performance table:
Performance_ID Orchestra_ID Type Date Official_ratings_(millions) Weekly_rank Share
1 1 Auditions 1 9 June 5.2 12 22.7%
2 2 Auditions 2 10 June 6.73 8 28.0%
*/
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
)
/*
2 rows from show table:
Show_ID Performance_ID If_first_show Result Attendance
1 1 True T 1026.0
2 2 True T 695.0
*/ | What is the name of the conductor who has conducted the most orchestras? | SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID ORDER BY COUNT(*) DESC LIMIT 1 | [{'Name': 'Michael Tilson Thomas'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
orchestra |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
) |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
/*
2 rows from conductor table:
Conductor_ID Name Age Nationality Year_of_Work
1 Antal Doráti 40 USA 10
2 Igor Stravinsky 41 UK 11
*/
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
/*
2 rows from orchestra table:
Orchestra_ID Orchestra Conductor_ID Record_Company Year_of_Founded Major_Record_Format
1 London Symphony Orchestra 1 Mercury Records 2003.0 CD
2 Columbia Symphony Orchestra 2 Columbia Masterworks 2009.0 CD / LP
*/
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
/*
2 rows from performance table:
Performance_ID Orchestra_ID Type Date Official_ratings_(millions) Weekly_rank Share
1 1 Auditions 1 9 June 5.2 12 22.7%
2 2 Auditions 2 10 June 6.73 8 28.0%
*/
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
)
/*
2 rows from show table:
Show_ID Performance_ID If_first_show Result Attendance
1 1 True T 1026.0
2 2 True T 695.0
*/ | Please show the name of the conductor that has conducted orchestras founded after 2008. | SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID WHERE Year_of_Founded > 2008 | [{'Name': 'Igor Stravinsky'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
orchestra |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
) |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
/*
2 rows from conductor table:
Conductor_ID Name Age Nationality Year_of_Work
1 Antal Doráti 40 USA 10
2 Igor Stravinsky 41 UK 11
*/
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
/*
2 rows from orchestra table:
Orchestra_ID Orchestra Conductor_ID Record_Company Year_of_Founded Major_Record_Format
1 London Symphony Orchestra 1 Mercury Records 2003.0 CD
2 Columbia Symphony Orchestra 2 Columbia Masterworks 2009.0 CD / LP
*/
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
/*
2 rows from performance table:
Performance_ID Orchestra_ID Type Date Official_ratings_(millions) Weekly_rank Share
1 1 Auditions 1 9 June 5.2 12 22.7%
2 2 Auditions 2 10 June 6.73 8 28.0%
*/
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
)
/*
2 rows from show table:
Show_ID Performance_ID If_first_show Result Attendance
1 1 True T 1026.0
2 2 True T 695.0
*/ | What are the names of conductors who have conducted orchestras founded after the year 2008? | SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID WHERE Year_of_Founded > 2008 | [{'Name': 'Igor Stravinsky'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
orchestra |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
) |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
/*
2 rows from conductor table:
Conductor_ID Name Age Nationality Year_of_Work
1 Antal Doráti 40 USA 10
2 Igor Stravinsky 41 UK 11
*/
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
/*
2 rows from orchestra table:
Orchestra_ID Orchestra Conductor_ID Record_Company Year_of_Founded Major_Record_Format
1 London Symphony Orchestra 1 Mercury Records 2003.0 CD
2 Columbia Symphony Orchestra 2 Columbia Masterworks 2009.0 CD / LP
*/
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
/*
2 rows from performance table:
Performance_ID Orchestra_ID Type Date Official_ratings_(millions) Weekly_rank Share
1 1 Auditions 1 9 June 5.2 12 22.7%
2 2 Auditions 2 10 June 6.73 8 28.0%
*/
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
)
/*
2 rows from show table:
Show_ID Performance_ID If_first_show Result Attendance
1 1 True T 1026.0
2 2 True T 695.0
*/ | Show the years in which orchestras that have given more than one performance are founded. | SELECT Year_of_Founded FROM orchestra AS T1 JOIN performance AS T2 ON T1.Orchestra_ID = T2.Orchestra_ID GROUP BY T2.Orchestra_ID HAVING COUNT(*) > 1 | [{'Nenhum': 'Nenhum resultado encontrado'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
orchestra |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
) |
CREATE TABLE conductor (
"Conductor_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"Nationality" TEXT,
"Year_of_Work" INTEGER,
PRIMARY KEY ("Conductor_ID")
)
/*
2 rows from conductor table:
Conductor_ID Name Age Nationality Year_of_Work
1 Antal Doráti 40 USA 10
2 Igor Stravinsky 41 UK 11
*/
CREATE TABLE orchestra (
"Orchestra_ID" INTEGER,
"Orchestra" TEXT,
"Conductor_ID" INTEGER,
"Record_Company" TEXT,
"Year_of_Founded" REAL,
"Major_Record_Format" TEXT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY("Conductor_ID") REFERENCES conductor ("Conductor_ID")
)
/*
2 rows from orchestra table:
Orchestra_ID Orchestra Conductor_ID Record_Company Year_of_Founded Major_Record_Format
1 London Symphony Orchestra 1 Mercury Records 2003.0 CD
2 Columbia Symphony Orchestra 2 Columbia Masterworks 2009.0 CD / LP
*/
CREATE TABLE performance (
"Performance_ID" INTEGER,
"Orchestra_ID" INTEGER,
"Type" TEXT,
"Date" TEXT,
"Official_ratings_(millions)" REAL,
"Weekly_rank" TEXT,
"Share" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY("Orchestra_ID") REFERENCES orchestra ("Orchestra_ID")
)
/*
2 rows from performance table:
Performance_ID Orchestra_ID Type Date Official_ratings_(millions) Weekly_rank Share
1 1 Auditions 1 9 June 5.2 12 22.7%
2 2 Auditions 2 10 June 6.73 8 28.0%
*/
CREATE TABLE show (
"Show_ID" INTEGER,
"Performance_ID" INTEGER,
"If_first_show" BOOLEAN,
"Result" TEXT,
"Attendance" REAL,
FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID")
)
/*
2 rows from show table:
Show_ID Performance_ID If_first_show Result Attendance
1 1 True T 1026.0
2 2 True T 695.0
*/ | What are years of founding for orchestras that have had more than a single performance? | SELECT Year_of_Founded FROM orchestra AS T1 JOIN performance AS T2 ON T1.Orchestra_ID = T2.Orchestra_ID GROUP BY T2.Orchestra_ID HAVING COUNT(*) > 1 | [{'Nenhum': 'Nenhum resultado encontrado'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | Show the names of high school students and their corresponding number of friends. | SELECT T2.name , count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id | [{'name': 'Haley', 'count(*)': 1}, {'name': 'Alexis', 'count(*)': 2}, {'name': 'Jordan', 'count(*)': 1}, {'name': 'Austin', 'count(*)': 1}, {'name': 'Tiffany', 'count(*)': 1}, {'name': 'Kris', 'count(*)': 2}, {'name': 'Jessica', 'count(*)': 1}, {'name': 'Jordan', 'count(*)': 2}, {'name': 'Logan', 'count(*)': 1}, {'name': 'Gabriel', 'count(*)': 2}, {'name': 'Cassandra', 'count(*)': 1}, {'name': 'Andrew', 'count(*)': 3}, {'name': 'Gabriel', 'count(*)': 1}, {'name': 'Kyle', 'count(*)': 1}] | Medium | false | false | false | false | false | true | false | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | What are the names of the high schoolers and how many friends does each have? | SELECT T2.name , count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id | [{'name': 'Haley', 'count(*)': 1}, {'name': 'Alexis', 'count(*)': 2}, {'name': 'Jordan', 'count(*)': 1}, {'name': 'Austin', 'count(*)': 1}, {'name': 'Tiffany', 'count(*)': 1}, {'name': 'Kris', 'count(*)': 2}, {'name': 'Jessica', 'count(*)': 1}, {'name': 'Jordan', 'count(*)': 2}, {'name': 'Logan', 'count(*)': 1}, {'name': 'Gabriel', 'count(*)': 2}, {'name': 'Cassandra', 'count(*)': 1}, {'name': 'Andrew', 'count(*)': 3}, {'name': 'Gabriel', 'count(*)': 1}, {'name': 'Kyle', 'count(*)': 1}] | Medium | false | false | false | false | false | true | false | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | What is the name of the high schooler who has the greatest number of friends? | SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1 | [{'name': 'Andrew'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | Return the name of the high school student with the most friends. | SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1 | [{'name': 'Andrew'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | Show the names of high schoolers who have at least 3 friends. | SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id HAVING count(*) >= 3 | [{'name': 'Andrew'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | What are the names of high schoolers who have 3 or more friends? | SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id HAVING count(*) >= 3 | [{'name': 'Andrew'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | How many friends does the high school student Kyle have? | SELECT count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = "Kyle" | [{'count(*)': 1}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | Count the number of friends Kyle has. | SELECT count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = "Kyle" | [{'count(*)': 1}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | Show the names of high schoolers who have likes, and numbers of likes for each. | SELECT T2.name , count(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id | [{'name': 'John', 'count(*)': 1}, {'name': 'Alexis', 'count(*)': 1}, {'name': 'Austin', 'count(*)': 1}, {'name': 'Jessica', 'count(*)': 1}, {'name': 'Brittany', 'count(*)': 1}, {'name': 'Gabriel', 'count(*)': 1}, {'name': 'Cassandra', 'count(*)': 1}, {'name': 'Andrew', 'count(*)': 1}, {'name': 'Gabriel', 'count(*)': 1}, {'name': 'Kyle', 'count(*)': 1}] | Medium | false | false | false | false | false | true | false | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | What are the names of high schoolers who have likes, and how many likes does each have? | SELECT T2.name , count(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id | [{'name': 'John', 'count(*)': 1}, {'name': 'Alexis', 'count(*)': 1}, {'name': 'Austin', 'count(*)': 1}, {'name': 'Jessica', 'count(*)': 1}, {'name': 'Brittany', 'count(*)': 1}, {'name': 'Gabriel', 'count(*)': 1}, {'name': 'Cassandra', 'count(*)': 1}, {'name': 'Andrew', 'count(*)': 1}, {'name': 'Gabriel', 'count(*)': 1}, {'name': 'Kyle', 'count(*)': 1}] | Medium | false | false | false | false | false | true | false | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | What is the name of the high schooler who has the greatest number of likes? | SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1 | [{'name': 'John'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | Give the name of the student with the most likes. | SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1 | [{'name': 'John'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | Show the names of students who have at least 2 likes. | SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id HAVING count(*) >= 2 | [{'Nenhum': 'Nenhum resultado encontrado'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | What are the names of students who have 2 or more likes? | SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id HAVING count(*) >= 2 | [{'Nenhum': 'Nenhum resultado encontrado'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | Show the names of students who have a grade higher than 5 and have at least 2 friends. | SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.grade > 5 GROUP BY T1.student_id HAVING count(*) >= 2 | [{'name': 'Alexis'}, {'name': 'Kris'}, {'name': 'Jordan'}, {'name': 'Gabriel'}, {'name': 'Andrew'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | What are the names of high schoolers who have a grade of over 5 and have 2 or more friends? | SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.grade > 5 GROUP BY T1.student_id HAVING count(*) >= 2 | [{'name': 'Alexis'}, {'name': 'Kris'}, {'name': 'Jordan'}, {'name': 'Gabriel'}, {'name': 'Andrew'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | How many likes does Kyle have? | SELECT count(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = "Kyle" | [{'count(*)': 1}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | Return the number of likes that the high schooler named Kyle has. | SELECT count(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = "Kyle" | [{'count(*)': 1}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | Find the average grade of all students who have some friends. | SELECT avg(grade) FROM Highschooler WHERE id IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id) | [{'avg(grade)': 10.428571428571429}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | What is the average grade of students who have friends? | SELECT avg(grade) FROM Highschooler WHERE id IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id) | [{'avg(grade)': 10.428571428571429}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | Find the minimum grade of students who have no friends. | SELECT min(grade) FROM Highschooler WHERE id NOT IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id) | [{'min(grade)': 10}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | What is the lowest grade of students who do not have any friends? | SELECT min(grade) FROM Highschooler WHERE id NOT IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id) | [{'min(grade)': 10}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Which owner owns the most dogs? List the owner id, first name and last name. | SELECT T1.owner_id , T2.first_name , T2.last_name FROM Dogs AS T1 JOIN Owners AS T2 ON T1.owner_id = T2.owner_id GROUP BY T1.owner_id ORDER BY count(*) DESC LIMIT 1 | [{'owner_id': 14, 'first_name': 'Rachelle', 'last_name': 'Funk'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Return the owner id, first name and last name of the owner who has the most dogs. | SELECT T1.owner_id , T2.first_name , T2.last_name FROM Dogs AS T1 JOIN Owners AS T2 ON T1.owner_id = T2.owner_id GROUP BY T1.owner_id ORDER BY count(*) DESC LIMIT 1 | [{'owner_id': 14, 'first_name': 'Rachelle', 'last_name': 'Funk'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Which professionals have done at least two treatments? List the professional's id, role, and first name. | SELECT T1.professional_id , T1.role_code , T1.first_name FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING count(*) >= 2 | [{'professional_id': 4, 'role_code': 'Veterenarian', 'first_name': 'Vernice'}, {'professional_id': 6, 'role_code': 'Veterenarian', 'first_name': 'Ruben'}, {'professional_id': 8, 'role_code': 'Employee', 'first_name': 'Karley'}, {'professional_id': 9, 'role_code': 'Veterenarian', 'first_name': 'Monte'}, {'professional_id': 10, 'role_code': 'Employee', 'first_name': 'Domenica'}, {'professional_id': 14, 'role_code': 'Employee', 'first_name': 'Sigurd'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | What are the id, role, and first name of the professionals who have performed two or more treatments? | SELECT T1.professional_id , T1.role_code , T1.first_name FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING count(*) >= 2 | [{'professional_id': 4, 'role_code': 'Veterenarian', 'first_name': 'Vernice'}, {'professional_id': 6, 'role_code': 'Veterenarian', 'first_name': 'Ruben'}, {'professional_id': 8, 'role_code': 'Employee', 'first_name': 'Karley'}, {'professional_id': 9, 'role_code': 'Veterenarian', 'first_name': 'Monte'}, {'professional_id': 10, 'role_code': 'Employee', 'first_name': 'Domenica'}, {'professional_id': 14, 'role_code': 'Employee', 'first_name': 'Sigurd'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | What is the name of the breed with the most dogs? | SELECT T1.breed_name FROM Breeds AS T1 JOIN Dogs AS T2 ON T1.breed_code = T2.breed_code GROUP BY T1.breed_name ORDER BY count(*) DESC LIMIT 1 | [{'breed_name': 'Bulldog'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Which breed do the most dogs have? Give me the breed name. | SELECT T1.breed_name FROM Breeds AS T1 JOIN Dogs AS T2 ON T1.breed_code = T2.breed_code GROUP BY T1.breed_name ORDER BY count(*) DESC LIMIT 1 | [{'breed_name': 'Bulldog'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | What is the description of the treatment type that costs the least money in total? | SELECT T1.treatment_type_description FROM Treatment_types AS T1 JOIN Treatments AS T2 ON T1.treatment_type_code = T2.treatment_type_code GROUP BY T1.treatment_type_code ORDER BY sum(cost_of_treatment) ASC LIMIT 1 | [{'treatment_type_description': 'Take for a Walk'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Give me the description of the treatment type whose total cost is the lowest. | SELECT T1.treatment_type_description FROM Treatment_types AS T1 JOIN Treatments AS T2 ON T1.treatment_type_code = T2.treatment_type_code GROUP BY T1.treatment_type_code ORDER BY sum(cost_of_treatment) ASC LIMIT 1 | [{'treatment_type_description': 'Take for a Walk'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Which professionals have done at least two types of treatments? List the professional id and cell phone. | SELECT T1.professional_id , T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING count(*) >= 2 | [{'professional_id': 4, 'cell_number': '00230569697'}, {'professional_id': 6, 'cell_number': '139-321-7313'}, {'professional_id': 8, 'cell_number': '328.842.3792'}, {'professional_id': 9, 'cell_number': '962-983-8109x3509'}, {'professional_id': 10, 'cell_number': '461-801-2600'}, {'professional_id': 14, 'cell_number': '1-185-137-1945x409'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Find the id and cell phone of the professionals who operate two or more types of treatments. | SELECT T1.professional_id , T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING count(*) >= 2 | [{'professional_id': 4, 'cell_number': '00230569697'}, {'professional_id': 6, 'cell_number': '139-321-7313'}, {'professional_id': 8, 'cell_number': '328.842.3792'}, {'professional_id': 9, 'cell_number': '962-983-8109x3509'}, {'professional_id': 10, 'cell_number': '461-801-2600'}, {'professional_id': 14, 'cell_number': '1-185-137-1945x409'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | List the date of each treatment, together with the first name of the professional who operated it. | SELECT T1.date_of_treatment , T2.first_name FROM Treatments AS T1 JOIN Professionals AS T2 ON T1.professional_id = T2.professional_id | [{'date_of_treatment': '2018-03-19 04:39:54', 'first_name': 'Monte'}, {'date_of_treatment': '2018-03-15 20:25:34', 'first_name': 'Domenica'}, {'date_of_treatment': '2018-03-08 05:26:23', 'first_name': 'Vernice'}, {'date_of_treatment': '2018-03-01 04:14:46', 'first_name': 'Karley'}, {'date_of_treatment': '2018-03-23 13:52:10', 'first_name': 'Sigurd'}, {'date_of_treatment': '2018-03-11 04:23:15', 'first_name': 'Vernice'}, {'date_of_treatment': '2018-03-10 11:45:58', 'first_name': 'Sigurd'}, {'date_of_treatment': '2018-03-24 22:25:58', 'first_name': 'Ruben'}, {'date_of_treatment': '2018-03-14 19:10:40', 'first_name': 'Domenica'}, {'date_of_treatment': '2018-02-28 17:09:43', 'first_name': 'Velva'}, {'date_of_treatment': '2018-03-13 12:22:58', 'first_name': 'Danny'}, {'date_of_treatment': '2018-03-16 10:27:36', 'first_name': 'Monte'}, {'date_of_treatment': '2018-02-26 09:08:53', 'first_name': 'Karley'}, {'date_of_treatment': '2018-03-04 20:33:43', 'first_name': 'Monte'}, {'date_of_treatment': '2018-03-15 19:10:02', 'first_name': 'Ruben'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | What are the date and the operating professional's first name of each treatment? | SELECT T1.date_of_treatment , T2.first_name FROM Treatments AS T1 JOIN Professionals AS T2 ON T1.professional_id = T2.professional_id | [{'date_of_treatment': '2018-03-19 04:39:54', 'first_name': 'Monte'}, {'date_of_treatment': '2018-03-15 20:25:34', 'first_name': 'Domenica'}, {'date_of_treatment': '2018-03-08 05:26:23', 'first_name': 'Vernice'}, {'date_of_treatment': '2018-03-01 04:14:46', 'first_name': 'Karley'}, {'date_of_treatment': '2018-03-23 13:52:10', 'first_name': 'Sigurd'}, {'date_of_treatment': '2018-03-11 04:23:15', 'first_name': 'Vernice'}, {'date_of_treatment': '2018-03-10 11:45:58', 'first_name': 'Sigurd'}, {'date_of_treatment': '2018-03-24 22:25:58', 'first_name': 'Ruben'}, {'date_of_treatment': '2018-03-14 19:10:40', 'first_name': 'Domenica'}, {'date_of_treatment': '2018-02-28 17:09:43', 'first_name': 'Velva'}, {'date_of_treatment': '2018-03-13 12:22:58', 'first_name': 'Danny'}, {'date_of_treatment': '2018-03-16 10:27:36', 'first_name': 'Monte'}, {'date_of_treatment': '2018-02-26 09:08:53', 'first_name': 'Karley'}, {'date_of_treatment': '2018-03-04 20:33:43', 'first_name': 'Monte'}, {'date_of_treatment': '2018-03-15 19:10:02', 'first_name': 'Ruben'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | List the cost of each treatment and the corresponding treatment type description. | SELECT T1.cost_of_treatment , T2.treatment_type_description FROM Treatments AS T1 JOIN treatment_types AS T2 ON T1.treatment_type_code = T2.treatment_type_code | [{'cost_of_treatment': 567, 'treatment_type_description': 'Take for a Walk'}, {'cost_of_treatment': 147, 'treatment_type_description': 'Vaccination'}, {'cost_of_treatment': 429, 'treatment_type_description': 'Physical examination'}, {'cost_of_treatment': 266, 'treatment_type_description': 'Vaccination'}, {'cost_of_treatment': 668, 'treatment_type_description': 'Vaccination'}, {'cost_of_treatment': 313, 'treatment_type_description': 'Physical examination'}, {'cost_of_treatment': 852, 'treatment_type_description': 'Physical examination'}, {'cost_of_treatment': 407, 'treatment_type_description': 'Physical examination'}, {'cost_of_treatment': 139, 'treatment_type_description': 'Take for a Walk'}, {'cost_of_treatment': 681, 'treatment_type_description': 'Take for a Walk'}, {'cost_of_treatment': 514, 'treatment_type_description': 'Vaccination'}, {'cost_of_treatment': 428, 'treatment_type_description': 'Physical examination'}, {'cost_of_treatment': 945, 'treatment_type_description': 'Vaccination'}, {'cost_of_treatment': 349, 'treatment_type_description': 'Take for a Walk'}, {'cost_of_treatment': 656, 'treatment_type_description': 'Take for a Walk'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | What are the cost and treatment type description of each treatment? | SELECT T1.cost_of_treatment , T2.treatment_type_description FROM Treatments AS T1 JOIN treatment_types AS T2 ON T1.treatment_type_code = T2.treatment_type_code | [{'cost_of_treatment': 567, 'treatment_type_description': 'Take for a Walk'}, {'cost_of_treatment': 147, 'treatment_type_description': 'Vaccination'}, {'cost_of_treatment': 429, 'treatment_type_description': 'Physical examination'}, {'cost_of_treatment': 266, 'treatment_type_description': 'Vaccination'}, {'cost_of_treatment': 668, 'treatment_type_description': 'Vaccination'}, {'cost_of_treatment': 313, 'treatment_type_description': 'Physical examination'}, {'cost_of_treatment': 852, 'treatment_type_description': 'Physical examination'}, {'cost_of_treatment': 407, 'treatment_type_description': 'Physical examination'}, {'cost_of_treatment': 139, 'treatment_type_description': 'Take for a Walk'}, {'cost_of_treatment': 681, 'treatment_type_description': 'Take for a Walk'}, {'cost_of_treatment': 514, 'treatment_type_description': 'Vaccination'}, {'cost_of_treatment': 428, 'treatment_type_description': 'Physical examination'}, {'cost_of_treatment': 945, 'treatment_type_description': 'Vaccination'}, {'cost_of_treatment': 349, 'treatment_type_description': 'Take for a Walk'}, {'cost_of_treatment': 656, 'treatment_type_description': 'Take for a Walk'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | List each owner's first name, last name, and the size of his for her dog. | SELECT T1.first_name , T1.last_name , T2.size_code FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id | [{'first_name': 'Jaclyn', 'last_name': 'Stoltenberg', 'size_code': 'LGE'}, {'first_name': 'Gay', 'last_name': 'Feil', 'size_code': 'LGE'}, {'first_name': 'Nora', 'last_name': 'Haley', 'size_code': 'MED'}, {'first_name': 'Rachelle', 'last_name': 'Funk', 'size_code': 'LGE'}, {'first_name': 'Emelie', 'last_name': 'Mertz', 'size_code': 'MED'}, {'first_name': 'Johann', 'last_name': 'Fisher', 'size_code': 'MED'}, {'first_name': 'Jaclyn', 'last_name': 'Stoltenberg', 'size_code': 'MED'}, {'first_name': 'Rachelle', 'last_name': 'Funk', 'size_code': 'SML'}, {'first_name': 'Melisa', 'last_name': 'DuBuque', 'size_code': 'MED'}, {'first_name': 'Kade', 'last_name': 'Rippin', 'size_code': 'MED'}, {'first_name': 'Cindy', 'last_name': 'Schmitt', 'size_code': 'LGE'}, {'first_name': 'Orlando', 'last_name': 'Price', 'size_code': 'MED'}, {'first_name': 'Rolando', 'last_name': 'Prohaska', 'size_code': 'SML'}, {'first_name': 'Rachelle', 'last_name': 'Funk', 'size_code': 'MED'}, {'first_name': 'Lorenz', 'last_name': 'Nicolas', 'size_code': 'MED'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | What are each owner's first name, last name, and the size of their dog? | SELECT T1.first_name , T1.last_name , T2.size_code FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id | [{'first_name': 'Jaclyn', 'last_name': 'Stoltenberg', 'size_code': 'LGE'}, {'first_name': 'Gay', 'last_name': 'Feil', 'size_code': 'LGE'}, {'first_name': 'Nora', 'last_name': 'Haley', 'size_code': 'MED'}, {'first_name': 'Rachelle', 'last_name': 'Funk', 'size_code': 'LGE'}, {'first_name': 'Emelie', 'last_name': 'Mertz', 'size_code': 'MED'}, {'first_name': 'Johann', 'last_name': 'Fisher', 'size_code': 'MED'}, {'first_name': 'Jaclyn', 'last_name': 'Stoltenberg', 'size_code': 'MED'}, {'first_name': 'Rachelle', 'last_name': 'Funk', 'size_code': 'SML'}, {'first_name': 'Melisa', 'last_name': 'DuBuque', 'size_code': 'MED'}, {'first_name': 'Kade', 'last_name': 'Rippin', 'size_code': 'MED'}, {'first_name': 'Cindy', 'last_name': 'Schmitt', 'size_code': 'LGE'}, {'first_name': 'Orlando', 'last_name': 'Price', 'size_code': 'MED'}, {'first_name': 'Rolando', 'last_name': 'Prohaska', 'size_code': 'SML'}, {'first_name': 'Rachelle', 'last_name': 'Funk', 'size_code': 'MED'}, {'first_name': 'Lorenz', 'last_name': 'Nicolas', 'size_code': 'MED'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | List pairs of the owner's first name and the dogs's name. | SELECT T1.first_name , T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id | [{'first_name': 'Jaclyn', 'name': 'Kacey'}, {'first_name': 'Gay', 'name': 'Hipolito'}, {'first_name': 'Nora', 'name': 'Mavis'}, {'first_name': 'Rachelle', 'name': 'Houston'}, {'first_name': 'Emelie', 'name': 'Jeffrey'}, {'first_name': 'Johann', 'name': 'Merritt'}, {'first_name': 'Jaclyn', 'name': 'Narciso'}, {'first_name': 'Rachelle', 'name': 'George'}, {'first_name': 'Melisa', 'name': 'Bessie'}, {'first_name': 'Kade', 'name': 'Troy'}, {'first_name': 'Cindy', 'name': 'Betty'}, {'first_name': 'Orlando', 'name': 'Holden'}, {'first_name': 'Rolando', 'name': 'Jesus'}, {'first_name': 'Rachelle', 'name': 'Lyric'}, {'first_name': 'Lorenz', 'name': 'Evangeline'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | What are each owner's first name and their dogs's name? | SELECT T1.first_name , T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id | [{'first_name': 'Jaclyn', 'name': 'Kacey'}, {'first_name': 'Gay', 'name': 'Hipolito'}, {'first_name': 'Nora', 'name': 'Mavis'}, {'first_name': 'Rachelle', 'name': 'Houston'}, {'first_name': 'Emelie', 'name': 'Jeffrey'}, {'first_name': 'Johann', 'name': 'Merritt'}, {'first_name': 'Jaclyn', 'name': 'Narciso'}, {'first_name': 'Rachelle', 'name': 'George'}, {'first_name': 'Melisa', 'name': 'Bessie'}, {'first_name': 'Kade', 'name': 'Troy'}, {'first_name': 'Cindy', 'name': 'Betty'}, {'first_name': 'Orlando', 'name': 'Holden'}, {'first_name': 'Rolando', 'name': 'Jesus'}, {'first_name': 'Rachelle', 'name': 'Lyric'}, {'first_name': 'Lorenz', 'name': 'Evangeline'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Which dogs are owned by someone who lives in Virginia? List the owner's first name and the dog's name. | SELECT T1.first_name , T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T1.state = 'Virginia' | [{'first_name': 'Melisa', 'name': 'Bessie'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Find the first names of owners living in Virginia and the names of dogs they own. | SELECT T1.first_name , T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T1.state = 'Virginia' | [{'first_name': 'Melisa', 'name': 'Bessie'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | What are the arriving date and the departing date of the dogs who have gone through a treatment? | SELECT DISTINCT T1.date_arrived , T1.date_departed FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id | [{'date_arrived': '2017-06-18 19:45:38', 'date_departed': '2018-03-24 23:48:59'}, {'date_arrived': '2017-04-20 00:58:55', 'date_departed': '2018-03-24 19:12:22'}, {'date_arrived': '2017-12-22 05:02:02', 'date_departed': '2018-03-25 02:11:32'}, {'date_arrived': '2017-10-24 04:45:13', 'date_departed': '2018-03-25 14:15:41'}, {'date_arrived': '2017-12-29 06:08:26', 'date_departed': '2018-03-25 04:42:14'}, {'date_arrived': '2017-12-29 23:24:13', 'date_departed': '2018-03-24 19:36:59'}, {'date_arrived': '2018-01-02 03:15:29', 'date_departed': '2018-03-25 05:07:47'}, {'date_arrived': '2017-05-06 08:03:52', 'date_departed': '2018-03-25 06:29:10'}, {'date_arrived': '2017-09-08 20:10:13', 'date_departed': '2018-03-25 06:58:44'}] | Medium | true | false | false | false | false | false | false | true | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Find the arriving date and the departing date of the dogs that received a treatment. | SELECT DISTINCT T1.date_arrived , T1.date_departed FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id | [{'date_arrived': '2017-06-18 19:45:38', 'date_departed': '2018-03-24 23:48:59'}, {'date_arrived': '2017-04-20 00:58:55', 'date_departed': '2018-03-24 19:12:22'}, {'date_arrived': '2017-12-22 05:02:02', 'date_departed': '2018-03-25 02:11:32'}, {'date_arrived': '2017-10-24 04:45:13', 'date_departed': '2018-03-25 14:15:41'}, {'date_arrived': '2017-12-29 06:08:26', 'date_departed': '2018-03-25 04:42:14'}, {'date_arrived': '2017-12-29 23:24:13', 'date_departed': '2018-03-24 19:36:59'}, {'date_arrived': '2018-01-02 03:15:29', 'date_departed': '2018-03-25 05:07:47'}, {'date_arrived': '2017-05-06 08:03:52', 'date_departed': '2018-03-25 06:29:10'}, {'date_arrived': '2017-09-08 20:10:13', 'date_departed': '2018-03-25 06:58:44'}] | Medium | true | false | false | false | false | false | false | true | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | Show titles of songs and names of singers. | SELECT T2.Title , T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID | [{'Title': "Do They Know It's Christmas", 'Name': 'Liliane Bettencourt'}, {'Title': "F**k It (I Don't Want You Back)", 'Name': 'Liliane Bettencourt'}, {'Title': 'Cha Cha Slide', 'Name': 'Christy Walton'}, {'Title': 'Call on Me', 'Name': 'Iris Fontbona'}, {'Title': 'Yeah', 'Name': 'Christy Walton'}, {'Title': 'All This Time', 'Name': 'Gina Rinehart'}, {'Title': 'Left Outside Alone', 'Name': 'Jacqueline Mars'}, {'Title': 'Mysterious Girl', 'Name': 'Susanne Klatten'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | What are the song titles and singer names? | SELECT T2.Title , T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID | [{'Title': "Do They Know It's Christmas", 'Name': 'Liliane Bettencourt'}, {'Title': "F**k It (I Don't Want You Back)", 'Name': 'Liliane Bettencourt'}, {'Title': 'Cha Cha Slide', 'Name': 'Christy Walton'}, {'Title': 'Call on Me', 'Name': 'Iris Fontbona'}, {'Title': 'Yeah', 'Name': 'Christy Walton'}, {'Title': 'All This Time', 'Name': 'Gina Rinehart'}, {'Title': 'Left Outside Alone', 'Name': 'Jacqueline Mars'}, {'Title': 'Mysterious Girl', 'Name': 'Susanne Klatten'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | Show distinct names of singers that have songs with sales more than 300000. | SELECT DISTINCT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID WHERE T2.Sales > 300000 | [{'Name': 'Liliane Bettencourt'}, {'Name': 'Christy Walton'}, {'Name': 'Iris Fontbona'}] | Medium | true | false | false | false | false | false | false | true | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | what are the different names of the singers that have sales more than 300000? | SELECT DISTINCT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID WHERE T2.Sales > 300000 | [{'Name': 'Liliane Bettencourt'}, {'Name': 'Christy Walton'}, {'Name': 'Iris Fontbona'}] | Medium | true | false | false | false | false | false | false | true | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | Show the names of singers that have more than one song. | SELECT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID GROUP BY T1.Name HAVING COUNT(*) > 1 | [{'Name': 'Christy Walton'}, {'Name': 'Liliane Bettencourt'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | What are the names of the singers that have more than one songs? | SELECT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID GROUP BY T1.Name HAVING COUNT(*) > 1 | [{'Name': 'Christy Walton'}, {'Name': 'Liliane Bettencourt'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | Show the names of singers and the total sales of their songs. | SELECT T1.Name , sum(T2.Sales) FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID GROUP BY T1.Name | [{'Name': 'Christy Walton', 'sum(T2.Sales)': 651421.0}, {'Name': 'Gina Rinehart', 'sum(T2.Sales)': 292000.0}, {'Name': 'Iris Fontbona', 'sum(T2.Sales)': 335000.0}, {'Name': 'Jacqueline Mars', 'sum(T2.Sales)': 275000.0}, {'Name': 'Liliane Bettencourt', 'sum(T2.Sales)': 1646407.0}, {'Name': 'Susanne Klatten', 'sum(T2.Sales)': 261000.0}] | Medium | false | false | false | false | false | true | false | true | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | For each singer name, what is the total sales for their songs? | SELECT T1.Name , sum(T2.Sales) FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID GROUP BY T1.Name | [{'Name': 'Christy Walton', 'sum(T2.Sales)': 651421.0}, {'Name': 'Gina Rinehart', 'sum(T2.Sales)': 292000.0}, {'Name': 'Iris Fontbona', 'sum(T2.Sales)': 335000.0}, {'Name': 'Jacqueline Mars', 'sum(T2.Sales)': 275000.0}, {'Name': 'Liliane Bettencourt', 'sum(T2.Sales)': 1646407.0}, {'Name': 'Susanne Klatten', 'sum(T2.Sales)': 261000.0}] | Medium | false | false | false | false | false | true | false | true | false | false | false | false | false |
real_estate_properties |
CREATE TABLE "Other_Available_Features" (
feature_id INTEGER,
feature_type_code VARCHAR(20) NOT NULL,
feature_name VARCHAR(80),
feature_description VARCHAR(80),
PRIMARY KEY (feature_id),
FOREIGN KEY(feature_type_code) REFERENCES "Ref_Feature_Types" (feature_type_code)
)
CREATE TABLE "Other_Property_Features" (
property_id INTEGER NOT NULL,
feature_id INTEGER NOT NULL,
property_feature_description VARCHAR(80),
FOREIGN KEY(property_id) REFERENCES "Properties" (property_id),
FOREIGN KEY(feature_id) REFERENCES "Other_Available_Features" (feature_id)
)
CREATE TABLE "Properties" (
property_id INTEGER,
property_type_code VARCHAR(20) NOT NULL,
date_on_market DATETIME,
date_sold DATETIME,
property_name VARCHAR(80),
property_address VARCHAR(255),
room_count INTEGER,
vendor_requested_price DECIMAL(19, 4),
buyer_offered_price DECIMAL(19, 4),
agreed_selling_price DECIMAL(19, 4),
apt_feature_1 VARCHAR(255),
apt_feature_2 VARCHAR(255),
apt_feature_3 VARCHAR(255),
fld_feature_1 VARCHAR(255),
fld_feature_2 VARCHAR(255),
fld_feature_3 VARCHAR(255),
hse_feature_1 VARCHAR(255),
hse_feature_2 VARCHAR(255),
hse_feature_3 VARCHAR(255),
oth_feature_1 VARCHAR(255),
oth_feature_2 VARCHAR(255),
oth_feature_3 VARCHAR(255),
shp_feature_1 VARCHAR(255),
shp_feature_2 VARCHAR(255),
shp_feature_3 VARCHAR(255),
other_property_details VARCHAR(255),
PRIMARY KEY (property_id),
FOREIGN KEY(property_type_code) REFERENCES "Ref_Property_Types" (property_type_code)
)
CREATE TABLE "Ref_Feature_Types" (
feature_type_code VARCHAR(20),
feature_type_name VARCHAR(80),
PRIMARY KEY (feature_type_code)
)
CREATE TABLE "Ref_Property_Types" (
property_type_code VARCHAR(20),
property_type_description VARCHAR(80),
PRIMARY KEY (property_type_code)
) |
CREATE TABLE "Other_Available_Features" (
feature_id INTEGER,
feature_type_code VARCHAR(20) NOT NULL,
feature_name VARCHAR(80),
feature_description VARCHAR(80),
PRIMARY KEY (feature_id),
FOREIGN KEY(feature_type_code) REFERENCES "Ref_Feature_Types" (feature_type_code)
)
/*
2 rows from Other_Available_Features table:
feature_id feature_type_code feature_name feature_description
2 Amenity AirCon Air Conditioning.
3 Amenity Pool Swimming Pool.
*/
CREATE TABLE "Other_Property_Features" (
property_id INTEGER NOT NULL,
feature_id INTEGER NOT NULL,
property_feature_description VARCHAR(80),
FOREIGN KEY(property_id) REFERENCES "Properties" (property_id),
FOREIGN KEY(feature_id) REFERENCES "Other_Available_Features" (feature_id)
)
/*
2 rows from Other_Property_Features table:
property_id feature_id property_feature_description
15 3 dolorem
12 4 earum
*/
CREATE TABLE "Properties" (
property_id INTEGER,
property_type_code VARCHAR(20) NOT NULL,
date_on_market DATETIME,
date_sold DATETIME,
property_name VARCHAR(80),
property_address VARCHAR(255),
room_count INTEGER,
vendor_requested_price DECIMAL(19, 4),
buyer_offered_price DECIMAL(19, 4),
agreed_selling_price DECIMAL(19, 4),
apt_feature_1 VARCHAR(255),
apt_feature_2 VARCHAR(255),
apt_feature_3 VARCHAR(255),
fld_feature_1 VARCHAR(255),
fld_feature_2 VARCHAR(255),
fld_feature_3 VARCHAR(255),
hse_feature_1 VARCHAR(255),
hse_feature_2 VARCHAR(255),
hse_feature_3 VARCHAR(255),
oth_feature_1 VARCHAR(255),
oth_feature_2 VARCHAR(255),
oth_feature_3 VARCHAR(255),
shp_feature_1 VARCHAR(255),
shp_feature_2 VARCHAR(255),
shp_feature_3 VARCHAR(255),
other_property_details VARCHAR(255),
PRIMARY KEY (property_id),
FOREIGN KEY(property_type_code) REFERENCES "Ref_Property_Types" (property_type_code)
)
/*
2 rows from Properties table:
property_id property_type_code date_on_market date_sold property_name property_address room_count vendor_requested_price buyer_offered_price agreed_selling_price apt_feature_1 apt_feature_2 apt_feature_3 fld_feature_1 fld_feature_2 fld_feature_3 hse_feature_1 hse_feature_2 hse_feature_3 oth_feature_1 oth_feature_2 oth_feature_3 shp_feature_1 shp_feature_2 shp_feature_3 other_property_details
1 House 1991-06-21 23:52:10 1979-05-13 16:58:06 park 4745 Emerson Stravenue Suite 829
South Garret, IN 16772-5682 7 372652.2909 1.6800 4201.8000 aut suscipit None None None None None None None None None None None None None None
2 House 1990-05-25 23:01:51 1990-11-14 19:16:38 the cole 098 Tremaine Highway Suite 569
South Wilford, NJ 46587-3537 1 661536468.4429 8.7122 21769471.8328 est est None None None None None None None None None None None None None None
*/
CREATE TABLE "Ref_Feature_Types" (
feature_type_code VARCHAR(20),
feature_type_name VARCHAR(80),
PRIMARY KEY (feature_type_code)
)
/*
2 rows from Ref_Feature_Types table:
feature_type_code feature_type_name
Amenity Amenity, eg Pool.
Security Securiyt, eg Burglar Alarm.
*/
CREATE TABLE "Ref_Property_Types" (
property_type_code VARCHAR(20),
property_type_description VARCHAR(80),
PRIMARY KEY (property_type_code)
)
/*
2 rows from Ref_Property_Types table:
property_type_code property_type_description
House House, Bungalow, etc.
Apartment Apartment, Flat, Condo, etc.
*/ | What is the feature type name of feature AirCon? | SELECT T2.feature_type_name FROM Other_Available_Features AS T1 JOIN Ref_Feature_Types AS T2 ON T1.feature_type_code = T2.feature_type_code WHERE T1.feature_name = "AirCon" | [{'feature_type_name': 'Amenity, eg Pool.'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
real_estate_properties |
CREATE TABLE "Other_Available_Features" (
feature_id INTEGER,
feature_type_code VARCHAR(20) NOT NULL,
feature_name VARCHAR(80),
feature_description VARCHAR(80),
PRIMARY KEY (feature_id),
FOREIGN KEY(feature_type_code) REFERENCES "Ref_Feature_Types" (feature_type_code)
)
CREATE TABLE "Other_Property_Features" (
property_id INTEGER NOT NULL,
feature_id INTEGER NOT NULL,
property_feature_description VARCHAR(80),
FOREIGN KEY(property_id) REFERENCES "Properties" (property_id),
FOREIGN KEY(feature_id) REFERENCES "Other_Available_Features" (feature_id)
)
CREATE TABLE "Properties" (
property_id INTEGER,
property_type_code VARCHAR(20) NOT NULL,
date_on_market DATETIME,
date_sold DATETIME,
property_name VARCHAR(80),
property_address VARCHAR(255),
room_count INTEGER,
vendor_requested_price DECIMAL(19, 4),
buyer_offered_price DECIMAL(19, 4),
agreed_selling_price DECIMAL(19, 4),
apt_feature_1 VARCHAR(255),
apt_feature_2 VARCHAR(255),
apt_feature_3 VARCHAR(255),
fld_feature_1 VARCHAR(255),
fld_feature_2 VARCHAR(255),
fld_feature_3 VARCHAR(255),
hse_feature_1 VARCHAR(255),
hse_feature_2 VARCHAR(255),
hse_feature_3 VARCHAR(255),
oth_feature_1 VARCHAR(255),
oth_feature_2 VARCHAR(255),
oth_feature_3 VARCHAR(255),
shp_feature_1 VARCHAR(255),
shp_feature_2 VARCHAR(255),
shp_feature_3 VARCHAR(255),
other_property_details VARCHAR(255),
PRIMARY KEY (property_id),
FOREIGN KEY(property_type_code) REFERENCES "Ref_Property_Types" (property_type_code)
)
CREATE TABLE "Ref_Feature_Types" (
feature_type_code VARCHAR(20),
feature_type_name VARCHAR(80),
PRIMARY KEY (feature_type_code)
)
CREATE TABLE "Ref_Property_Types" (
property_type_code VARCHAR(20),
property_type_description VARCHAR(80),
PRIMARY KEY (property_type_code)
) |
CREATE TABLE "Other_Available_Features" (
feature_id INTEGER,
feature_type_code VARCHAR(20) NOT NULL,
feature_name VARCHAR(80),
feature_description VARCHAR(80),
PRIMARY KEY (feature_id),
FOREIGN KEY(feature_type_code) REFERENCES "Ref_Feature_Types" (feature_type_code)
)
/*
2 rows from Other_Available_Features table:
feature_id feature_type_code feature_name feature_description
2 Amenity AirCon Air Conditioning.
3 Amenity Pool Swimming Pool.
*/
CREATE TABLE "Other_Property_Features" (
property_id INTEGER NOT NULL,
feature_id INTEGER NOT NULL,
property_feature_description VARCHAR(80),
FOREIGN KEY(property_id) REFERENCES "Properties" (property_id),
FOREIGN KEY(feature_id) REFERENCES "Other_Available_Features" (feature_id)
)
/*
2 rows from Other_Property_Features table:
property_id feature_id property_feature_description
15 3 dolorem
12 4 earum
*/
CREATE TABLE "Properties" (
property_id INTEGER,
property_type_code VARCHAR(20) NOT NULL,
date_on_market DATETIME,
date_sold DATETIME,
property_name VARCHAR(80),
property_address VARCHAR(255),
room_count INTEGER,
vendor_requested_price DECIMAL(19, 4),
buyer_offered_price DECIMAL(19, 4),
agreed_selling_price DECIMAL(19, 4),
apt_feature_1 VARCHAR(255),
apt_feature_2 VARCHAR(255),
apt_feature_3 VARCHAR(255),
fld_feature_1 VARCHAR(255),
fld_feature_2 VARCHAR(255),
fld_feature_3 VARCHAR(255),
hse_feature_1 VARCHAR(255),
hse_feature_2 VARCHAR(255),
hse_feature_3 VARCHAR(255),
oth_feature_1 VARCHAR(255),
oth_feature_2 VARCHAR(255),
oth_feature_3 VARCHAR(255),
shp_feature_1 VARCHAR(255),
shp_feature_2 VARCHAR(255),
shp_feature_3 VARCHAR(255),
other_property_details VARCHAR(255),
PRIMARY KEY (property_id),
FOREIGN KEY(property_type_code) REFERENCES "Ref_Property_Types" (property_type_code)
)
/*
2 rows from Properties table:
property_id property_type_code date_on_market date_sold property_name property_address room_count vendor_requested_price buyer_offered_price agreed_selling_price apt_feature_1 apt_feature_2 apt_feature_3 fld_feature_1 fld_feature_2 fld_feature_3 hse_feature_1 hse_feature_2 hse_feature_3 oth_feature_1 oth_feature_2 oth_feature_3 shp_feature_1 shp_feature_2 shp_feature_3 other_property_details
1 House 1991-06-21 23:52:10 1979-05-13 16:58:06 park 4745 Emerson Stravenue Suite 829
South Garret, IN 16772-5682 7 372652.2909 1.6800 4201.8000 aut suscipit None None None None None None None None None None None None None None
2 House 1990-05-25 23:01:51 1990-11-14 19:16:38 the cole 098 Tremaine Highway Suite 569
South Wilford, NJ 46587-3537 1 661536468.4429 8.7122 21769471.8328 est est None None None None None None None None None None None None None None
*/
CREATE TABLE "Ref_Feature_Types" (
feature_type_code VARCHAR(20),
feature_type_name VARCHAR(80),
PRIMARY KEY (feature_type_code)
)
/*
2 rows from Ref_Feature_Types table:
feature_type_code feature_type_name
Amenity Amenity, eg Pool.
Security Securiyt, eg Burglar Alarm.
*/
CREATE TABLE "Ref_Property_Types" (
property_type_code VARCHAR(20),
property_type_description VARCHAR(80),
PRIMARY KEY (property_type_code)
)
/*
2 rows from Ref_Property_Types table:
property_type_code property_type_description
House House, Bungalow, etc.
Apartment Apartment, Flat, Condo, etc.
*/ | Show the property type descriptions of properties belonging to that code. | SELECT T2.property_type_description FROM Properties AS T1 JOIN Ref_Property_Types AS T2 ON T1.property_type_code = T2.property_type_code GROUP BY T1.property_type_code | [{'property_type_description': 'Apartment, Flat, Condo, etc.'}, {'property_type_description': 'Field, Meadow.'}, {'property_type_description': 'House, Bungalow, etc.'}, {'property_type_description': 'Other, to be determined.'}, {'property_type_description': 'Shop, Retail Outlet.'}] | Medium | false | false | false | false | false | true | false | true | false | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the number of papers in PVLDB after 2000 in " University of Michigan " . | SELECT COUNT ( DISTINCT t5.title ) FROM ORGANIZATION AS t2 JOIN author AS t1 ON t2.oid = t1.oid JOIN writes AS t4 ON t4.aid = t1.aid JOIN publication AS t5 ON t4.pid = t5.pid JOIN journal AS t3 ON t5.jid = t3.jid WHERE t3.name = "PVLDB" AND t2.name = "University of Michigan" AND t5.year > 2000; | [{'COUNT ( DISTINCT t5.title )': 0}] | Hard | true | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the total citations of the papers in " University of Michigan " . | SELECT SUM ( t4.citation_num ) FROM ORGANIZATION AS t2 JOIN author AS t1 ON t2.oid = t1.oid JOIN writes AS t3 ON t3.aid = t1.aid JOIN publication AS t4 ON t3.pid = t4.pid WHERE t2.name = "University of Michigan"; | [{'SUM ( t4.citation_num )': None}] | Hard | false | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the number of researchers in Databases area in " University of Michigan " . | SELECT COUNT ( DISTINCT t1.name ) FROM domain_author AS t4 JOIN author AS t1 ON t4.aid = t1.aid JOIN DOMAIN AS t3 ON t3.did = t4.did JOIN ORGANIZATION AS t2 ON t2.oid = t1.oid WHERE t3.name = "Databases" AND t2.name = "University of Michigan"; | [{'COUNT ( DISTINCT t1.name )': 0}] | Hard | true | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the number of authors who have papers in PVLDB . | SELECT COUNT ( DISTINCT t1.name ) FROM publication AS t4 JOIN journal AS t2 ON t4.jid = t2.jid JOIN writes AS t3 ON t3.pid = t4.pid JOIN author AS t1 ON t3.aid = t1.aid WHERE t2.name = "PVLDB"; | [{'COUNT ( DISTINCT t1.name )': 0}] | Hard | true | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the number of authors who have papers in the VLDB conference . | SELECT COUNT ( DISTINCT t1.name ) FROM publication AS t4 JOIN conference AS t2 ON t4.cid = t2.cid JOIN writes AS t3 ON t3.pid = t4.pid JOIN author AS t1 ON t3.aid = t1.aid WHERE t2.name = "VLDB"; | [{'COUNT ( DISTINCT t1.name )': 0}] | Hard | true | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the authors who have cooperated both with " H. V. Jagadish " and " Divesh Srivastava " . | SELECT t2.name FROM writes AS t4 JOIN author AS t2 ON t4.aid = t2.aid JOIN publication AS t7 ON t4.pid = t7.pid JOIN writes AS t5 ON t5.pid = t7.pid JOIN writes AS t6 ON t6.pid = t7.pid JOIN author AS t1 ON t5.aid = t1.aid JOIN author AS t3 ON t6.aid = t3.aid WHERE t1.name = "H. V. Jagadish" AND t3.name = "Divesh Srivastava"; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | false | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the authors who have cooperated with " H. V. Jagadish " after 2000 . | SELECT t2.name FROM writes AS t3 JOIN author AS t2 ON t3.aid = t2.aid JOIN publication AS t5 ON t3.pid = t5.pid JOIN writes AS t4 ON t4.pid = t5.pid JOIN author AS t1 ON t4.aid = t1.aid WHERE t1.name = "H. V. Jagadish" AND t5.year > 2000; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | false | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the papers written by " H. V. Jagadish " and " Divesh Srivastava " . | SELECT t5.title FROM writes AS t3 JOIN author AS t2 ON t3.aid = t2.aid JOIN publication AS t5 ON t3.pid = t5.pid JOIN writes AS t4 ON t4.pid = t5.pid JOIN author AS t1 ON t4.aid = t1.aid WHERE t2.name = "H. V. Jagadish" AND t1.name = "Divesh Srivastava"; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | false | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the papers written by " H. V. Jagadish " and " Yunyao Li " after 2005 . | SELECT t5.title FROM writes AS t3 JOIN author AS t2 ON t3.aid = t2.aid JOIN publication AS t5 ON t3.pid = t5.pid JOIN writes AS t4 ON t4.pid = t5.pid JOIN author AS t1 ON t4.aid = t1.aid WHERE t2.name = "H. V. Jagadish" AND t1.name = "Yunyao Li" AND t5.year > 2005; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | false | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the papers written by " H. V. Jagadish " and " Yunyao Li " on PVLDB . | SELECT t6.title FROM publication AS t6 JOIN journal AS t4 ON t6.jid = t4.jid JOIN writes AS t3 ON t3.pid = t6.pid JOIN writes AS t5 ON t5.pid = t6.pid JOIN author AS t1 ON t5.aid = t1.aid JOIN author AS t2 ON t3.aid = t2.aid WHERE t2.name = "H. V. Jagadish" AND t1.name = "Yunyao Li" AND t4.name = "PVLDB"; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | false | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the papers written by " H. V. Jagadish " and " Yunyao Li " on PVLDB after 2005 . | SELECT t6.title FROM publication AS t6 JOIN journal AS t4 ON t6.jid = t4.jid JOIN writes AS t3 ON t3.pid = t6.pid JOIN writes AS t5 ON t5.pid = t6.pid JOIN author AS t1 ON t5.aid = t1.aid JOIN author AS t2 ON t3.aid = t2.aid WHERE t2.name = "H. V. Jagadish" AND t1.name = "Yunyao Li" AND t4.name = "PVLDB" AND t6.year > 2005; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | false | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the authors who have cooperated with " H. V. Jagadish " . | SELECT t2.name FROM writes AS t3 JOIN author AS t2 ON t3.aid = t2.aid JOIN publication AS t5 ON t3.pid = t5.pid JOIN writes AS t4 ON t4.pid = t5.pid JOIN author AS t1 ON t4.aid = t1.aid WHERE t1.name = "H. V. Jagadish"; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | false | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the papers written by " H. V. Jagadish " and " Divesh Srivastava " before 2000 . | SELECT t5.title FROM writes AS t3 JOIN author AS t2 ON t3.aid = t2.aid JOIN publication AS t5 ON t3.pid = t5.pid JOIN writes AS t4 ON t4.pid = t5.pid JOIN author AS t1 ON t4.aid = t1.aid WHERE t2.name = "H. V. Jagadish" AND t1.name = "Divesh Srivastava" AND t5.year < 2000; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | false | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the authors who have cited the papers by " H. V. Jagadish " . | SELECT t2.name FROM publication AS t7 JOIN cite AS t5 ON t7.pid = t5.citing JOIN publication AS t6 ON t6.pid = t5.cited JOIN writes AS t3 ON t3.pid = t7.pid JOIN writes AS t4 ON t4.pid = t6.pid JOIN author AS t2 ON t3.aid = t2.aid JOIN author AS t1 ON t4.aid = t1.aid WHERE t1.name = "H. V. Jagadish"; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | false | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the number of papers written by " H. V. Jagadish " and " Divesh Srivastava " . | SELECT COUNT ( DISTINCT t5.title ) FROM writes AS t3 JOIN author AS t2 ON t3.aid = t2.aid JOIN publication AS t5 ON t3.pid = t5.pid JOIN writes AS t4 ON t4.pid = t5.pid JOIN author AS t1 ON t4.aid = t1.aid WHERE t2.name = "H. V. Jagadish" AND t1.name = "Divesh Srivastava"; | [{'COUNT ( DISTINCT t5.title )': 0}] | Hard | true | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the number of papers written by " H. V. Jagadish " and " Divesh Srivastava " before 2000 . | SELECT COUNT ( DISTINCT t5.title ) FROM writes AS t3 JOIN author AS t2 ON t3.aid = t2.aid JOIN publication AS t5 ON t3.pid = t5.pid JOIN writes AS t4 ON t4.pid = t5.pid JOIN author AS t1 ON t4.aid = t1.aid WHERE t2.name = "H. V. Jagadish" AND t1.name = "Divesh Srivastava" AND t5.year < 2000; | [{'COUNT ( DISTINCT t5.title )': 0}] | Hard | true | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the number of papers written by " H. V. Jagadish " , " Yunyao Li " , and " Cong Yu " . | SELECT COUNT ( DISTINCT t7.title ) FROM writes AS t4 JOIN author AS t2 ON t4.aid = t2.aid JOIN publication AS t7 ON t4.pid = t7.pid JOIN writes AS t5 ON t5.pid = t7.pid JOIN writes AS t6 ON t6.pid = t7.pid JOIN author AS t1 ON t5.aid = t1.aid JOIN author AS t3 ON t6.aid = t3.aid WHERE t2.name = "Cong Yu" AND t1.name = "H. V. Jagadish" AND t3.name = "Yunyao Li"; | [{'COUNT ( DISTINCT t7.title )': 0}] | Hard | true | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the number of authors who have cooperated with " H. V. Jagadish " . | SELECT COUNT ( DISTINCT t2.name ) FROM writes AS t3 JOIN author AS t2 ON t3.aid = t2.aid JOIN publication AS t5 ON t3.pid = t5.pid JOIN writes AS t4 ON t4.pid = t5.pid JOIN author AS t1 ON t4.aid = t1.aid WHERE t1.name = "H. V. Jagadish"; | [{'COUNT ( DISTINCT t2.name )': 0}] | Hard | true | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the number of authors who have cited the papers by " H. V. Jagadish " . | SELECT COUNT ( DISTINCT t2.name ) FROM publication AS t7 JOIN cite AS t5 ON t7.pid = t5.citing JOIN publication AS t6 ON t6.pid = t5.cited JOIN writes AS t3 ON t3.pid = t7.pid JOIN writes AS t4 ON t4.pid = t6.pid JOIN author AS t2 ON t3.aid = t2.aid JOIN author AS t1 ON t4.aid = t1.aid WHERE t1.name = "H. V. Jagadish"; | [{'COUNT ( DISTINCT t2.name )': 0}] | Hard | true | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the papers written by " H. V. Jagadish " and " Divesh Srivastava " with more than 200 citations . | SELECT t5.title FROM writes AS t3 JOIN author AS t2 ON t3.aid = t2.aid JOIN publication AS t5 ON t3.pid = t5.pid JOIN writes AS t4 ON t4.pid = t5.pid JOIN author AS t1 ON t4.aid = t1.aid WHERE t2.name = "H. V. Jagadish" AND t1.name = "Divesh Srivastava" AND t5.citation_num > 200; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | false | false | false | false | false | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the author who has the most number of papers containing keyword " Relational Database " . | SELECT t2.name FROM publication_keyword AS t5 JOIN keyword AS t1 ON t5.kid = t1.kid JOIN publication AS t3 ON t3.pid = t5.pid JOIN writes AS t4 ON t4.pid = t3.pid JOIN author AS t2 ON t4.aid = t2.aid WHERE t1.keyword = "Relational Database" GROUP BY t2.name ORDER BY COUNT ( DISTINCT t3.title ) DESC LIMIT 1; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | true | false | false | true | true | true | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the conference that has the most number of papers containing keyword " Relational Database " . | SELECT t2.name FROM publication_keyword AS t4 JOIN keyword AS t1 ON t4.kid = t1.kid JOIN publication AS t3 ON t3.pid = t4.pid JOIN conference AS t2 ON t3.cid = t2.cid WHERE t1.keyword = "Relational Database" GROUP BY t2.name ORDER BY COUNT ( DISTINCT t3.title ) DESC LIMIT 1; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | true | false | false | true | true | true | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the conference, which has the most number of papers containing keyword " Relational Database " . | SELECT t2.name FROM publication_keyword AS t4 JOIN keyword AS t1 ON t4.kid = t1.kid JOIN publication AS t3 ON t3.pid = t4.pid JOIN conference AS t2 ON t3.cid = t2.cid WHERE t1.keyword = "Relational Database" GROUP BY t2.name ORDER BY COUNT ( DISTINCT t3.title ) DESC LIMIT 1; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | true | false | false | true | true | true | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the journal that has the most number of papers containing keyword " Relational Database " . | SELECT t3.name FROM publication_keyword AS t4 JOIN keyword AS t1 ON t4.kid = t1.kid JOIN publication AS t2 ON t2.pid = t4.pid JOIN journal AS t3 ON t2.jid = t3.jid WHERE t1.keyword = "Relational Database" GROUP BY t3.name ORDER BY COUNT ( DISTINCT t2.title ) DESC LIMIT 1; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | true | false | false | true | true | true | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the journal, which has the most number of papers containing keyword " Relational Database " . | SELECT t3.name FROM publication_keyword AS t4 JOIN keyword AS t1 ON t4.kid = t1.kid JOIN publication AS t2 ON t2.pid = t4.pid JOIN journal AS t3 ON t2.jid = t3.jid WHERE t1.keyword = "Relational Database" GROUP BY t3.name ORDER BY COUNT ( DISTINCT t2.title ) DESC LIMIT 1; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | true | false | false | true | true | true | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the keyword, which have been contained by the most number of papers in VLDB conference . | SELECT t1.keyword FROM publication_keyword AS t4 JOIN keyword AS t1 ON t4.kid = t1.kid JOIN publication AS t3 ON t3.pid = t4.pid JOIN conference AS t2 ON t3.cid = t2.cid WHERE t2.name = "VLDB" GROUP BY t1.keyword ORDER BY COUNT ( DISTINCT t3.title ) DESC LIMIT 1; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | true | false | false | true | true | true | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the keyword, which have been contained by the most number of papers in PVLDB . | SELECT t1.keyword FROM publication_keyword AS t4 JOIN keyword AS t1 ON t4.kid = t1.kid JOIN publication AS t2 ON t2.pid = t4.pid JOIN journal AS t3 ON t2.jid = t3.jid WHERE t3.name = "PVLDB" GROUP BY t1.keyword ORDER BY COUNT ( DISTINCT t2.title ) DESC LIMIT 1; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | true | false | false | true | true | true | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the keyword, which have been contained by the most number of papers by " H. V. Jagadish " . | SELECT t1.keyword FROM publication_keyword AS t5 JOIN keyword AS t1 ON t5.kid = t1.kid JOIN publication AS t3 ON t3.pid = t5.pid JOIN writes AS t4 ON t4.pid = t3.pid JOIN author AS t2 ON t4.aid = t2.aid WHERE t2.name = "H. V. Jagadish" GROUP BY t1.keyword ORDER BY COUNT ( DISTINCT t3.title ) DESC LIMIT 1; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | true | false | false | true | true | true | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the author in the " University of Michigan " whose papers have the most total citations . | SELECT t1.name FROM ORGANIZATION AS t2 JOIN author AS t1 ON t2.oid = t1.oid JOIN writes AS t3 ON t3.aid = t1.aid JOIN publication AS t4 ON t3.pid = t4.pid WHERE t2.name = "University of Michigan" GROUP BY t1.name ORDER BY SUM ( t4.citation_num ) DESC LIMIT 1; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | false | false | false | true | true | true | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the author in the " University of Michigan " whose papers in Databases area have the most total citations . | SELECT t1.name FROM DOMAIN AS t4 JOIN domain_publication AS t2 ON t4.did = t2.did JOIN publication AS t5 ON t5.pid = t2.pid JOIN writes AS t3 ON t3.pid = t5.pid JOIN author AS t1 ON t3.aid = t1.aid JOIN ORGANIZATION AS t6 ON t6.oid = t1.oid WHERE t4.name = "Databases" AND t6.name = "University of Michigan" GROUP BY t1.name ORDER BY SUM ( t5.citation_num ) DESC LIMIT 1; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | false | false | false | true | true | true | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the papers written by " H. V. Jagadish " and " Divesh Srivastava " with the most number of citations . | SELECT t5.title FROM writes AS t3 JOIN author AS t2 ON t3.aid = t2.aid JOIN publication AS t5 ON t3.pid = t5.pid JOIN writes AS t4 ON t4.pid = t5.pid JOIN author AS t1 ON t4.aid = t1.aid WHERE t2.name = "Divesh Srivastava" AND t1.name = "H. V. Jagadish" ORDER BY t5.citation_num DESC LIMIT 1; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | false | false | false | true | true | false | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the conferences, which have more than 10 papers by " H. V. Jagadish " . | SELECT t2.name FROM publication AS t4 JOIN conference AS t2 ON t4.cid = t2.cid JOIN writes AS t3 ON t3.pid = t4.pid JOIN author AS t1 ON t3.aid = t1.aid WHERE t1.name = "H. V. Jagadish" GROUP BY t2.name HAVING COUNT ( DISTINCT t4.title ) > 10; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | true | false | false | false | false | true | true | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the conference, which have the most number of papers by " H. V. Jagadish " . | SELECT t2.name FROM publication AS t4 JOIN conference AS t2 ON t4.cid = t2.cid JOIN writes AS t3 ON t3.pid = t4.pid JOIN author AS t1 ON t3.aid = t1.aid WHERE t1.name = "H. V. Jagadish" GROUP BY t2.name ORDER BY COUNT ( DISTINCT t4.title ) DESC LIMIT 1; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | true | false | false | true | true | true | false | false | true | false | false | false | false |
academic |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
) |
CREATE TABLE author (
aid INTEGER,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (aid)
)
/*
2 rows from author table:
aid homepage name oid
*/
CREATE TABLE cite (
cited INTEGER,
citing INTEGER,
FOREIGN KEY(cited) REFERENCES publication (pid),
FOREIGN KEY(citing) REFERENCES publication (pid)
)
/*
2 rows from cite table:
cited citing
*/
CREATE TABLE conference (
cid INTEGER,
homepage TEXT,
name TEXT,
PRIMARY KEY (cid)
)
/*
2 rows from conference table:
cid homepage name
*/
CREATE TABLE domain (
did INTEGER,
name TEXT,
PRIMARY KEY (did)
)
/*
2 rows from domain table:
did name
*/
CREATE TABLE domain_author (
aid INTEGER,
did INTEGER,
PRIMARY KEY (did, aid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from domain_author table:
aid did
*/
CREATE TABLE domain_conference (
cid INTEGER,
did INTEGER,
PRIMARY KEY (did, cid),
FOREIGN KEY(did) REFERENCES domain (did),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from domain_conference table:
cid did
*/
CREATE TABLE domain_journal (
did INTEGER,
jid INTEGER,
PRIMARY KEY (did, jid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_journal table:
did jid
*/
CREATE TABLE domain_keyword (
did INTEGER,
kid INTEGER,
PRIMARY KEY (did, kid),
FOREIGN KEY(kid) REFERENCES keyword (kid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_keyword table:
did kid
*/
CREATE TABLE domain_publication (
did INTEGER,
pid INTEGER,
PRIMARY KEY (did, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(did) REFERENCES domain (did)
)
/*
2 rows from domain_publication table:
did pid
*/
CREATE TABLE journal (
homepage TEXT,
jid INTEGER,
name TEXT,
PRIMARY KEY (jid)
)
/*
2 rows from journal table:
homepage jid name
*/
CREATE TABLE keyword (
keyword TEXT,
kid INTEGER,
PRIMARY KEY (kid)
)
/*
2 rows from keyword table:
keyword kid
*/
CREATE TABLE organization (
continent TEXT,
homepage TEXT,
name TEXT,
oid INTEGER,
PRIMARY KEY (oid)
)
/*
2 rows from organization table:
continent homepage name oid
*/
CREATE TABLE publication (
abstract TEXT,
cid TEXT,
citation_num INTEGER,
jid INTEGER,
pid INTEGER,
reference_num INTEGER,
title TEXT,
year INTEGER,
PRIMARY KEY (pid),
FOREIGN KEY(jid) REFERENCES journal (jid),
FOREIGN KEY(cid) REFERENCES conference (cid)
)
/*
2 rows from publication table:
abstract cid citation_num jid pid reference_num title year
*/
CREATE TABLE publication_keyword (
pid INTEGER,
kid INTEGER,
PRIMARY KEY (kid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(kid) REFERENCES keyword (kid)
)
/*
2 rows from publication_keyword table:
pid kid
*/
CREATE TABLE writes (
aid INTEGER,
pid INTEGER,
PRIMARY KEY (aid, pid),
FOREIGN KEY(pid) REFERENCES publication (pid),
FOREIGN KEY(aid) REFERENCES author (aid)
)
/*
2 rows from writes table:
aid pid
*/ | return me the journals, which have more than 10 papers by " H. V. Jagadish " . | SELECT t2.name FROM publication AS t4 JOIN journal AS t2 ON t4.jid = t2.jid JOIN writes AS t3 ON t3.pid = t4.pid JOIN author AS t1 ON t3.aid = t1.aid WHERE t1.name = "H. V. Jagadish" GROUP BY t2.name HAVING COUNT ( DISTINCT t4.title ) > 10; | [{'Nenhum': 'Nenhum resultado encontrado'}] | Hard | true | false | false | false | false | true | true | false | true | false | false | false | false |