db_id stringclasses 140 values | schema listlengths 0 26 | question stringlengths 16 224 | query stringlengths 18 577 | query_toks listlengths 4 90 | query_toks_no_value listlengths 4 125 | question_toks listlengths 4 44 |
|---|---|---|---|---|---|---|
voter_2 | [
"create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );",
"create table Voting_record (\n StuID \tINTEGER,\n Registration_Date\t\tVARCHAR(12),\n Election_Cycle\t\tVARCHAR(12),\n President_Vote\t\tINTEGER,\n Vice_President_Vote\t\tINTEGER,\n Secretary_Vote\t\tINTEGER,\n Treasurer_Vote\t\tINTEGER,\n Class_President_Vote\t\tINTEGER,\n Class_Senator_Vote\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID), \n FOREIGN KEY(President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)\n);"
] | For each advisor, report the total number of students advised by him or her. | SELECT Advisor , count(*) FROM STUDENT GROUP BY Advisor | [
"SELECT",
"Advisor",
",",
"count",
"(",
"*",
")",
"FROM",
"STUDENT",
"GROUP",
"BY",
"Advisor"
] | [
"select",
"advisor",
",",
"count",
"(",
"*",
")",
"from",
"student",
"group",
"by",
"advisor"
] | [
"For",
"each",
"advisor",
",",
"report",
"the",
"total",
"number",
"of",
"students",
"advised",
"by",
"him",
"or",
"her",
"."
] |
voter_2 | [
"create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );",
"create table Voting_record (\n StuID \tINTEGER,\n Registration_Date\t\tVARCHAR(12),\n Election_Cycle\t\tVARCHAR(12),\n President_Vote\t\tINTEGER,\n Vice_President_Vote\t\tINTEGER,\n Secretary_Vote\t\tINTEGER,\n Treasurer_Vote\t\tINTEGER,\n Class_President_Vote\t\tINTEGER,\n Class_Senator_Vote\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID), \n FOREIGN KEY(President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)\n);"
] | How many students does each advisor have? | SELECT Advisor , count(*) FROM STUDENT GROUP BY Advisor | [
"SELECT",
"Advisor",
",",
"count",
"(",
"*",
")",
"FROM",
"STUDENT",
"GROUP",
"BY",
"Advisor"
] | [
"select",
"advisor",
",",
"count",
"(",
"*",
")",
"from",
"student",
"group",
"by",
"advisor"
] | [
"How",
"many",
"students",
"does",
"each",
"advisor",
"have",
"?"
] |
voter_2 | [
"create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );",
"create table Voting_record (\n StuID \tINTEGER,\n Registration_Date\t\tVARCHAR(12),\n Election_Cycle\t\tVARCHAR(12),\n President_Vote\t\tINTEGER,\n Vice_President_Vote\t\tINTEGER,\n Secretary_Vote\t\tINTEGER,\n Treasurer_Vote\t\tINTEGER,\n Class_President_Vote\t\tINTEGER,\n Class_Senator_Vote\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID), \n FOREIGN KEY(President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)\n);"
] | Report all advisors that advise more than 2 students. | SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2 | [
"SELECT",
"Advisor",
"FROM",
"STUDENT",
"GROUP",
"BY",
"Advisor",
"HAVING",
"COUNT",
"(",
"*",
")",
">",
"2"
] | [
"select",
"advisor",
"from",
"student",
"group",
"by",
"advisor",
"having",
"count",
"(",
"*",
")",
">",
"value"
] | [
"Report",
"all",
"advisors",
"that",
"advise",
"more",
"than",
"2",
"students",
"."
] |
voter_2 | [
"create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );",
"create table Voting_record (\n StuID \tINTEGER,\n Registration_Date\t\tVARCHAR(12),\n Election_Cycle\t\tVARCHAR(12),\n President_Vote\t\tINTEGER,\n Vice_President_Vote\t\tINTEGER,\n Secretary_Vote\t\tINTEGER,\n Treasurer_Vote\t\tINTEGER,\n Class_President_Vote\t\tINTEGER,\n Class_Senator_Vote\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID), \n FOREIGN KEY(President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)\n);"
] | Which advisors have more than two students? | SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2 | [
"SELECT",
"Advisor",
"FROM",
"STUDENT",
"GROUP",
"BY",
"Advisor",
"HAVING",
"COUNT",
"(",
"*",
")",
">",
"2"
] | [
"select",
"advisor",
"from",
"student",
"group",
"by",
"advisor",
"having",
"count",
"(",
"*",
")",
">",
"value"
] | [
"Which",
"advisors",
"have",
"more",
"than",
"two",
"students",
"?"
] |
voter_2 | [
"create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );",
"create table Voting_record (\n StuID \tINTEGER,\n Registration_Date\t\tVARCHAR(12),\n Election_Cycle\t\tVARCHAR(12),\n President_Vote\t\tINTEGER,\n Vice_President_Vote\t\tINTEGER,\n Secretary_Vote\t\tINTEGER,\n Treasurer_Vote\t\tINTEGER,\n Class_President_Vote\t\tINTEGER,\n Class_Senator_Vote\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID), \n FOREIGN KEY(President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)\n);"
] | Report all majors that have less than 3 students. | SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3 | [
"SELECT",
"Major",
"FROM",
"STUDENT",
"GROUP",
"BY",
"Major",
"HAVING",
"COUNT",
"(",
"*",
")",
"<",
"3"
] | [
"select",
"major",
"from",
"student",
"group",
"by",
"major",
"having",
"count",
"(",
"*",
")",
"<",
"value"
] | [
"Report",
"all",
"majors",
"that",
"have",
"less",
"than",
"3",
"students",
"."
] |
voter_2 | [
"create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );",
"create table Voting_record (\n StuID \tINTEGER,\n Registration_Date\t\tVARCHAR(12),\n Election_Cycle\t\tVARCHAR(12),\n President_Vote\t\tINTEGER,\n Vice_President_Vote\t\tINTEGER,\n Secretary_Vote\t\tINTEGER,\n Treasurer_Vote\t\tINTEGER,\n Class_President_Vote\t\tINTEGER,\n Class_Senator_Vote\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID), \n FOREIGN KEY(President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)\n);"
] | What are the majors only less than three students are studying? | SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3 | [
"SELECT",
"Major",
"FROM",
"STUDENT",
"GROUP",
"BY",
"Major",
"HAVING",
"COUNT",
"(",
"*",
")",
"<",
"3"
] | [
"select",
"major",
"from",
"student",
"group",
"by",
"major",
"having",
"count",
"(",
"*",
")",
"<",
"value"
] | [
"What",
"are",
"the",
"majors",
"only",
"less",
"than",
"three",
"students",
"are",
"studying",
"?"
] |
voter_2 | [
"create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );",
"create table Voting_record (\n StuID \tINTEGER,\n Registration_Date\t\tVARCHAR(12),\n Election_Cycle\t\tVARCHAR(12),\n President_Vote\t\tINTEGER,\n Vice_President_Vote\t\tINTEGER,\n Secretary_Vote\t\tINTEGER,\n Treasurer_Vote\t\tINTEGER,\n Class_President_Vote\t\tINTEGER,\n Class_Senator_Vote\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID), \n FOREIGN KEY(President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)\n);"
] | For each election cycle, report the number of voting records. | SELECT Election_Cycle , count(*) FROM VOTING_RECORD GROUP BY Election_Cycle | [
"SELECT",
"Election_Cycle",
",",
"count",
"(",
"*",
")",
"FROM",
"VOTING_RECORD",
"GROUP",
"BY",
"Election_Cycle"
] | [
"select",
"election_cycle",
",",
"count",
"(",
"*",
")",
"from",
"voting_record",
"group",
"by",
"election_cycle"
] | [
"For",
"each",
"election",
"cycle",
",",
"report",
"the",
"number",
"of",
"voting",
"records",
"."
] |
voter_2 | [
"create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );",
"create table Voting_record (\n StuID \tINTEGER,\n Registration_Date\t\tVARCHAR(12),\n Election_Cycle\t\tVARCHAR(12),\n President_Vote\t\tINTEGER,\n Vice_President_Vote\t\tINTEGER,\n Secretary_Vote\t\tINTEGER,\n Treasurer_Vote\t\tINTEGER,\n Class_President_Vote\t\tINTEGER,\n Class_Senator_Vote\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID), \n FOREIGN KEY(President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)\n);"
] | Count the number of voting records for each election cycle. | SELECT Election_Cycle , count(*) FROM VOTING_RECORD GROUP BY Election_Cycle | [
"SELECT",
"Election_Cycle",
",",
"count",
"(",
"*",
")",
"FROM",
"VOTING_RECORD",
"GROUP",
"BY",
"Election_Cycle"
] | [
"select",
"election_cycle",
",",
"count",
"(",
"*",
")",
"from",
"voting_record",
"group",
"by",
"election_cycle"
] | [
"Count",
"the",
"number",
"of",
"voting",
"records",
"for",
"each",
"election",
"cycle",
"."
] |
voter_2 | [
"create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );",
"create table Voting_record (\n StuID \tINTEGER,\n Registration_Date\t\tVARCHAR(12),\n Election_Cycle\t\tVARCHAR(12),\n President_Vote\t\tINTEGER,\n Vice_President_Vote\t\tINTEGER,\n Secretary_Vote\t\tINTEGER,\n Treasurer_Vote\t\tINTEGER,\n Class_President_Vote\t\tINTEGER,\n Class_Senator_Vote\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID), \n FOREIGN KEY(President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)\n);"
] | Which major has the most students? | SELECT Major FROM STUDENT GROUP BY major ORDER BY count(*) DESC LIMIT 1 | [
"SELECT",
"Major",
"FROM",
"STUDENT",
"GROUP",
"BY",
"major",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"DESC",
"LIMIT",
"1"
] | [
"select",
"major",
"from",
"student",
"group",
"by",
"major",
"order",
"by",
"count",
"(",
"*",
")",
"desc",
"limit",
"value"
] | [
"Which",
"major",
"has",
"the",
"most",
"students",
"?"
] |
voter_2 | [
"create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );",
"create table Voting_record (\n StuID \tINTEGER,\n Registration_Date\t\tVARCHAR(12),\n Election_Cycle\t\tVARCHAR(12),\n President_Vote\t\tINTEGER,\n Vice_President_Vote\t\tINTEGER,\n Secretary_Vote\t\tINTEGER,\n Treasurer_Vote\t\tINTEGER,\n Class_President_Vote\t\tINTEGER,\n Class_Senator_Vote\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID), \n FOREIGN KEY(President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)\n);"
] | Find the major that is studied by the largest number of students. | SELECT Major FROM STUDENT GROUP BY major ORDER BY count(*) DESC LIMIT 1 | [
"SELECT",
"Major",
"FROM",
"STUDENT",
"GROUP",
"BY",
"major",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"DESC",
"LIMIT",
"1"
] | [
"select",
"major",
"from",
"student",
"group",
"by",
"major",
"order",
"by",
"count",
"(",
"*",
")",
"desc",
"limit",
"value"
] | [
"Find",
"the",
"major",
"that",
"is",
"studied",
"by",
"the",
"largest",
"number",
"of",
"students",
"."
] |
voter_2 | [
"create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );",
"create table Voting_record (\n StuID \tINTEGER,\n Registration_Date\t\tVARCHAR(12),\n Election_Cycle\t\tVARCHAR(12),\n President_Vote\t\tINTEGER,\n Vice_President_Vote\t\tINTEGER,\n Secretary_Vote\t\tINTEGER,\n Treasurer_Vote\t\tINTEGER,\n Class_President_Vote\t\tINTEGER,\n Class_Senator_Vote\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID), \n FOREIGN KEY(President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)\n);"
] | What is the most common major among female (sex is F) students? | SELECT Major FROM STUDENT WHERE Sex = "F" GROUP BY major ORDER BY count(*) DESC LIMIT 1 | [
"SELECT",
"Major",
"FROM",
"STUDENT",
"WHERE",
"Sex",
"=",
"``",
"F",
"''",
"GROUP",
"BY",
"major",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"DESC",
"LIMIT",
"1"
] | [
"select",
"major",
"from",
"student",
"where",
"sex",
"=",
"value",
"group",
"by",
"major",
"order",
"by",
"count",
"(",
"*",
")",
"desc",
"limit",
"value"
] | [
"What",
"is",
"the",
"most",
"common",
"major",
"among",
"female",
"(",
"sex",
"is",
"F",
")",
"students",
"?"
] |
voter_2 | [
"create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );",
"create table Voting_record (\n StuID \tINTEGER,\n Registration_Date\t\tVARCHAR(12),\n Election_Cycle\t\tVARCHAR(12),\n President_Vote\t\tINTEGER,\n Vice_President_Vote\t\tINTEGER,\n Secretary_Vote\t\tINTEGER,\n Treasurer_Vote\t\tINTEGER,\n Class_President_Vote\t\tINTEGER,\n Class_Senator_Vote\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID), \n FOREIGN KEY(President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)\n);"
] | Find the major that is studied by the most female students. | SELECT Major FROM STUDENT WHERE Sex = "F" GROUP BY major ORDER BY count(*) DESC LIMIT 1 | [
"SELECT",
"Major",
"FROM",
"STUDENT",
"WHERE",
"Sex",
"=",
"``",
"F",
"''",
"GROUP",
"BY",
"major",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"DESC",
"LIMIT",
"1"
] | [
"select",
"major",
"from",
"student",
"where",
"sex",
"=",
"value",
"group",
"by",
"major",
"order",
"by",
"count",
"(",
"*",
")",
"desc",
"limit",
"value"
] | [
"Find",
"the",
"major",
"that",
"is",
"studied",
"by",
"the",
"most",
"female",
"students",
"."
] |
voter_2 | [
"create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );",
"create table Voting_record (\n StuID \tINTEGER,\n Registration_Date\t\tVARCHAR(12),\n Election_Cycle\t\tVARCHAR(12),\n President_Vote\t\tINTEGER,\n Vice_President_Vote\t\tINTEGER,\n Secretary_Vote\t\tINTEGER,\n Treasurer_Vote\t\tINTEGER,\n Class_President_Vote\t\tINTEGER,\n Class_Senator_Vote\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID), \n FOREIGN KEY(President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)\n);"
] | What is the city_code of the city that the most students live in? | SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY count(*) DESC LIMIT 1 | [
"SELECT",
"city_code",
"FROM",
"STUDENT",
"GROUP",
"BY",
"city_code",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"DESC",
"LIMIT",
"1"
] | [
"select",
"city_code",
"from",
"student",
"group",
"by",
"city_code",
"order",
"by",
"count",
"(",
"*",
")",
"desc",
"limit",
"value"
] | [
"What",
"is",
"the",
"city_code",
"of",
"the",
"city",
"that",
"the",
"most",
"students",
"live",
"in",
"?"
] |
voter_2 | [
"create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );",
"create table Voting_record (\n StuID \tINTEGER,\n Registration_Date\t\tVARCHAR(12),\n Election_Cycle\t\tVARCHAR(12),\n President_Vote\t\tINTEGER,\n Vice_President_Vote\t\tINTEGER,\n Secretary_Vote\t\tINTEGER,\n Treasurer_Vote\t\tINTEGER,\n Class_President_Vote\t\tINTEGER,\n Class_Senator_Vote\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID), \n FOREIGN KEY(President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)\n);"
] | Return the code of the city that has the most students. | SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY count(*) DESC LIMIT 1 | [
"SELECT",
"city_code",
"FROM",
"STUDENT",
"GROUP",
"BY",
"city_code",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"DESC",
"LIMIT",
"1"
] | [
"select",
"city_code",
"from",
"student",
"group",
"by",
"city_code",
"order",
"by",
"count",
"(",
"*",
")",
"desc",
"limit",
"value"
] | [
"Return",
"the",
"code",
"of",
"the",
"city",
"that",
"has",
"the",
"most",
"students",
"."
] |
voter_2 | [
"create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );",
"create table Voting_record (\n StuID \tINTEGER,\n Registration_Date\t\tVARCHAR(12),\n Election_Cycle\t\tVARCHAR(12),\n President_Vote\t\tINTEGER,\n Vice_President_Vote\t\tINTEGER,\n Secretary_Vote\t\tINTEGER,\n Treasurer_Vote\t\tINTEGER,\n Class_President_Vote\t\tINTEGER,\n Class_Senator_Vote\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID), \n FOREIGN KEY(President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)\n);"
] | Report the distinct advisors who have more than 2 students. | SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING count(*) > 2 | [
"SELECT",
"Advisor",
"FROM",
"STUDENT",
"GROUP",
"BY",
"Advisor",
"HAVING",
"count",
"(",
"*",
")",
">",
"2"
] | [
"select",
"advisor",
"from",
"student",
"group",
"by",
"advisor",
"having",
"count",
"(",
"*",
")",
">",
"value"
] | [
"Report",
"the",
"distinct",
"advisors",
"who",
"have",
"more",
"than",
"2",
"students",
"."
] |
voter_2 | [
"create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );",
"create table Voting_record (\n StuID \tINTEGER,\n Registration_Date\t\tVARCHAR(12),\n Election_Cycle\t\tVARCHAR(12),\n President_Vote\t\tINTEGER,\n Vice_President_Vote\t\tINTEGER,\n Secretary_Vote\t\tINTEGER,\n Treasurer_Vote\t\tINTEGER,\n Class_President_Vote\t\tINTEGER,\n Class_Senator_Vote\t\tINTEGER,\n FOREIGN KEY(StuID) REFERENCES Student(StuID), \n FOREIGN KEY(President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Vice_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Secretary_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Treasurer_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_President_Vote) REFERENCES Student(StuID),\n FOREIGN KEY(Class_Senator_Vote) REFERENCES Student(StuID)\n);"
] | Which advisors are advising more than 2 students? | SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING count(*) > 2 | [
"SELECT",
"Advisor",
"FROM",
"STUDENT",
"GROUP",
"BY",
"Advisor",
"HAVING",
"count",
"(",
"*",
")",
">",
"2"
] | [
"select",
"advisor",
"from",
"student",
"group",
"by",
"advisor",
"having",
"count",
"(",
"*",
")",
">",
"value"
] | [
"Which",
"advisors",
"are",
"advising",
"more",
"than",
"2",
"students",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | How many products are there? | SELECT count(*) FROM products | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"products"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"products"
] | [
"How",
"many",
"products",
"are",
"there",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Count the number of products. | SELECT count(*) FROM products | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"products"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"products"
] | [
"Count",
"the",
"number",
"of",
"products",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | How many colors are there? | SELECT count(*) FROM ref_colors | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"ref_colors"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"ref_colors"
] | [
"How",
"many",
"colors",
"are",
"there",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Count the number of colors. | SELECT count(*) FROM ref_colors | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"ref_colors"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"ref_colors"
] | [
"Count",
"the",
"number",
"of",
"colors",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | How many characteristics are there? | SELECT count(*) FROM CHARACTERISTICS | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"CHARACTERISTICS"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"characteristics"
] | [
"How",
"many",
"characteristics",
"are",
"there",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Count the number of characteristics. | SELECT count(*) FROM CHARACTERISTICS | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"CHARACTERISTICS"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"characteristics"
] | [
"Count",
"the",
"number",
"of",
"characteristics",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What are the names and buying prices of all the products? | SELECT product_name , typical_buying_price FROM products | [
"SELECT",
"product_name",
",",
"typical_buying_price",
"FROM",
"products"
] | [
"select",
"product_name",
",",
"typical_buying_price",
"from",
"products"
] | [
"What",
"are",
"the",
"names",
"and",
"buying",
"prices",
"of",
"all",
"the",
"products",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Return the names and typical buying prices for all products. | SELECT product_name , typical_buying_price FROM products | [
"SELECT",
"product_name",
",",
"typical_buying_price",
"FROM",
"products"
] | [
"select",
"product_name",
",",
"typical_buying_price",
"from",
"products"
] | [
"Return",
"the",
"names",
"and",
"typical",
"buying",
"prices",
"for",
"all",
"products",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | List the description of all the colors. | SELECT color_description FROM ref_colors | [
"SELECT",
"color_description",
"FROM",
"ref_colors"
] | [
"select",
"color_description",
"from",
"ref_colors"
] | [
"List",
"the",
"description",
"of",
"all",
"the",
"colors",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What are the descriptions for each color? | SELECT color_description FROM ref_colors | [
"SELECT",
"color_description",
"FROM",
"ref_colors"
] | [
"select",
"color_description",
"from",
"ref_colors"
] | [
"What",
"are",
"the",
"descriptions",
"for",
"each",
"color",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Find the names of all the product characteristics. | SELECT DISTINCT characteristic_name FROM CHARACTERISTICS | [
"SELECT",
"DISTINCT",
"characteristic_name",
"FROM",
"CHARACTERISTICS"
] | [
"select",
"distinct",
"characteristic_name",
"from",
"characteristics"
] | [
"Find",
"the",
"names",
"of",
"all",
"the",
"product",
"characteristics",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What are the different names of the product characteristics? | SELECT DISTINCT characteristic_name FROM CHARACTERISTICS | [
"SELECT",
"DISTINCT",
"characteristic_name",
"FROM",
"CHARACTERISTICS"
] | [
"select",
"distinct",
"characteristic_name",
"from",
"characteristics"
] | [
"What",
"are",
"the",
"different",
"names",
"of",
"the",
"product",
"characteristics",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What are the names of products with category "Spices"? | SELECT product_name FROM products WHERE product_category_code = "Spices" | [
"SELECT",
"product_name",
"FROM",
"products",
"WHERE",
"product_category_code",
"=",
"``",
"Spices",
"''"
] | [
"select",
"product_name",
"from",
"products",
"where",
"product_category_code",
"=",
"value"
] | [
"What",
"are",
"the",
"names",
"of",
"products",
"with",
"category",
"``",
"Spices",
"''",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Return the names of products in the category 'Spices'. | SELECT product_name FROM products WHERE product_category_code = "Spices" | [
"SELECT",
"product_name",
"FROM",
"products",
"WHERE",
"product_category_code",
"=",
"``",
"Spices",
"''"
] | [
"select",
"product_name",
"from",
"products",
"where",
"product_category_code",
"=",
"value"
] | [
"Return",
"the",
"names",
"of",
"products",
"in",
"the",
"category",
"'Spices",
"'",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | List the names, color descriptions and product descriptions of products with category "Herbs". | SELECT T1.product_name , T2.color_description , T1.product_description FROM products AS T1 JOIN Ref_colors AS T2 ON T1.color_code = T2.color_code WHERE product_category_code = "Herbs" | [
"SELECT",
"T1.product_name",
",",
"T2.color_description",
",",
"T1.product_description",
"FROM",
"products",
"AS",
"T1",
"JOIN",
"Ref_colors",
"AS",
"T2",
"ON",
"T1.color_code",
"=",
"T2.color_code",
"WHERE",
"product_category_code",
"=",
"``",
"Herbs",
"''"
] | [
"select",
"t1",
".",
"product_name",
",",
"t2",
".",
"color_description",
",",
"t1",
".",
"product_description",
"from",
"products",
"as",
"t1",
"join",
"ref_colors",
"as",
"t2",
"on",
"t1",
".",
"color_code",
"=",
"t2",
".",
"color_code",
"where",
"product_category_code",
"=",
"value"
] | [
"List",
"the",
"names",
",",
"color",
"descriptions",
"and",
"product",
"descriptions",
"of",
"products",
"with",
"category",
"``",
"Herbs",
"''",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What are the names, color descriptions, and product descriptions for products in the 'Herbs' category? | SELECT T1.product_name , T2.color_description , T1.product_description FROM products AS T1 JOIN Ref_colors AS T2 ON T1.color_code = T2.color_code WHERE product_category_code = "Herbs" | [
"SELECT",
"T1.product_name",
",",
"T2.color_description",
",",
"T1.product_description",
"FROM",
"products",
"AS",
"T1",
"JOIN",
"Ref_colors",
"AS",
"T2",
"ON",
"T1.color_code",
"=",
"T2.color_code",
"WHERE",
"product_category_code",
"=",
"``",
"Herbs",
"''"
] | [
"select",
"t1",
".",
"product_name",
",",
"t2",
".",
"color_description",
",",
"t1",
".",
"product_description",
"from",
"products",
"as",
"t1",
"join",
"ref_colors",
"as",
"t2",
"on",
"t1",
".",
"color_code",
"=",
"t2",
".",
"color_code",
"where",
"product_category_code",
"=",
"value"
] | [
"What",
"are",
"the",
"names",
",",
"color",
"descriptions",
",",
"and",
"product",
"descriptions",
"for",
"products",
"in",
"the",
"'Herbs",
"'",
"category",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | How many products are there under the category "Seeds"? | SELECT count(*) FROM products WHERE product_category_code = "Seeds" | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"products",
"WHERE",
"product_category_code",
"=",
"``",
"Seeds",
"''"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"products",
"where",
"product_category_code",
"=",
"value"
] | [
"How",
"many",
"products",
"are",
"there",
"under",
"the",
"category",
"``",
"Seeds",
"''",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Count the number of products in the category 'Seeds'. | SELECT count(*) FROM products WHERE product_category_code = "Seeds" | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"products",
"WHERE",
"product_category_code",
"=",
"``",
"Seeds",
"''"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"products",
"where",
"product_category_code",
"=",
"value"
] | [
"Count",
"the",
"number",
"of",
"products",
"in",
"the",
"category",
"'Seeds",
"'",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Find the number of products with category "Spices" and typically sold above 1000. | SELECT count(*) FROM products WHERE product_category_code = "Spices" AND typical_buying_price > 1000 | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"products",
"WHERE",
"product_category_code",
"=",
"``",
"Spices",
"''",
"AND",
"typical_buying_price",
">",
"1000"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"products",
"where",
"product_category_code",
"=",
"value",
"and",
"typical_buying_price",
">",
"value"
] | [
"Find",
"the",
"number",
"of",
"products",
"with",
"category",
"``",
"Spices",
"''",
"and",
"typically",
"sold",
"above",
"1000",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | How many products are in the 'Spices' category and have a typical price of over 1000? | SELECT count(*) FROM products WHERE product_category_code = "Spices" AND typical_buying_price > 1000 | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"products",
"WHERE",
"product_category_code",
"=",
"``",
"Spices",
"''",
"AND",
"typical_buying_price",
">",
"1000"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"products",
"where",
"product_category_code",
"=",
"value",
"and",
"typical_buying_price",
">",
"value"
] | [
"How",
"many",
"products",
"are",
"in",
"the",
"'Spices",
"'",
"category",
"and",
"have",
"a",
"typical",
"price",
"of",
"over",
"1000",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What is the category and typical buying price of the product with name "cumin"? | SELECT product_category_code , typical_buying_price FROM products WHERE product_name = "cumin" | [
"SELECT",
"product_category_code",
",",
"typical_buying_price",
"FROM",
"products",
"WHERE",
"product_name",
"=",
"``",
"cumin",
"''"
] | [
"select",
"product_category_code",
",",
"typical_buying_price",
"from",
"products",
"where",
"product_name",
"=",
"value"
] | [
"What",
"is",
"the",
"category",
"and",
"typical",
"buying",
"price",
"of",
"the",
"product",
"with",
"name",
"``",
"cumin",
"''",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Return the category code and typical price of 'cumin'. | SELECT product_category_code , typical_buying_price FROM products WHERE product_name = "cumin" | [
"SELECT",
"product_category_code",
",",
"typical_buying_price",
"FROM",
"products",
"WHERE",
"product_name",
"=",
"``",
"cumin",
"''"
] | [
"select",
"product_category_code",
",",
"typical_buying_price",
"from",
"products",
"where",
"product_name",
"=",
"value"
] | [
"Return",
"the",
"category",
"code",
"and",
"typical",
"price",
"of",
"'cumin",
"'",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Which category does the product named "flax" belong to? | SELECT product_category_code FROM products WHERE product_name = "flax" | [
"SELECT",
"product_category_code",
"FROM",
"products",
"WHERE",
"product_name",
"=",
"``",
"flax",
"''"
] | [
"select",
"product_category_code",
"from",
"products",
"where",
"product_name",
"=",
"value"
] | [
"Which",
"category",
"does",
"the",
"product",
"named",
"``",
"flax",
"''",
"belong",
"to",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What is the code of the category that the product with the name 'flax' belongs to? | SELECT product_category_code FROM products WHERE product_name = "flax" | [
"SELECT",
"product_category_code",
"FROM",
"products",
"WHERE",
"product_name",
"=",
"``",
"flax",
"''"
] | [
"select",
"product_category_code",
"from",
"products",
"where",
"product_name",
"=",
"value"
] | [
"What",
"is",
"the",
"code",
"of",
"the",
"category",
"that",
"the",
"product",
"with",
"the",
"name",
"'flax",
"'",
"belongs",
"to",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What is the name of the product with the color description 'yellow'? | SELECT T1.product_name FROM products AS T1 JOIN ref_colors AS T2 ON T1.color_code = T2.color_code WHERE T2.color_description = 'yellow' | [
"SELECT",
"T1.product_name",
"FROM",
"products",
"AS",
"T1",
"JOIN",
"ref_colors",
"AS",
"T2",
"ON",
"T1.color_code",
"=",
"T2.color_code",
"WHERE",
"T2.color_description",
"=",
"'yellow",
"'"
] | [
"select",
"t1",
".",
"product_name",
"from",
"products",
"as",
"t1",
"join",
"ref_colors",
"as",
"t2",
"on",
"t1",
".",
"color_code",
"=",
"t2",
".",
"color_code",
"where",
"t2",
".",
"color_description",
"=",
"value"
] | [
"What",
"is",
"the",
"name",
"of",
"the",
"product",
"with",
"the",
"color",
"description",
"'yellow",
"'",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Give the name of the products that have a color description 'yellow'. | SELECT T1.product_name FROM products AS T1 JOIN ref_colors AS T2 ON T1.color_code = T2.color_code WHERE T2.color_description = 'yellow' | [
"SELECT",
"T1.product_name",
"FROM",
"products",
"AS",
"T1",
"JOIN",
"ref_colors",
"AS",
"T2",
"ON",
"T1.color_code",
"=",
"T2.color_code",
"WHERE",
"T2.color_description",
"=",
"'yellow",
"'"
] | [
"select",
"t1",
".",
"product_name",
"from",
"products",
"as",
"t1",
"join",
"ref_colors",
"as",
"t2",
"on",
"t1",
".",
"color_code",
"=",
"t2",
".",
"color_code",
"where",
"t2",
".",
"color_description",
"=",
"value"
] | [
"Give",
"the",
"name",
"of",
"the",
"products",
"that",
"have",
"a",
"color",
"description",
"'yellow",
"'",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Find the category descriptions of the products whose descriptions include letter 't'. | SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' | [
"SELECT",
"T1.product_category_description",
"FROM",
"ref_product_categories",
"AS",
"T1",
"JOIN",
"products",
"AS",
"T2",
"ON",
"T1.product_category_code",
"=",
"T2.product_category_code",
"WHERE",
"T2.product_description",
"LIKE",
"'",
"%",
"t",
"%",
"'"
] | [
"select",
"t1",
".",
"product_category_description",
"from",
"ref_product_categories",
"as",
"t1",
"join",
"products",
"as",
"t2",
"on",
"t1",
".",
"product_category_code",
"=",
"t2",
".",
"product_category_code",
"where",
"t2",
".",
"product_description",
"like",
"value"
] | [
"Find",
"the",
"category",
"descriptions",
"of",
"the",
"products",
"whose",
"descriptions",
"include",
"letter",
"'t",
"'",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What are the descriptions of the categories that products with product descriptions that contain the letter t are in? | SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' | [
"SELECT",
"T1.product_category_description",
"FROM",
"ref_product_categories",
"AS",
"T1",
"JOIN",
"products",
"AS",
"T2",
"ON",
"T1.product_category_code",
"=",
"T2.product_category_code",
"WHERE",
"T2.product_description",
"LIKE",
"'",
"%",
"t",
"%",
"'"
] | [
"select",
"t1",
".",
"product_category_description",
"from",
"ref_product_categories",
"as",
"t1",
"join",
"products",
"as",
"t2",
"on",
"t1",
".",
"product_category_code",
"=",
"t2",
".",
"product_category_code",
"where",
"t2",
".",
"product_description",
"like",
"value"
] | [
"What",
"are",
"the",
"descriptions",
"of",
"the",
"categories",
"that",
"products",
"with",
"product",
"descriptions",
"that",
"contain",
"the",
"letter",
"t",
"are",
"in",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What is the color description of the product with name "catnip"? | SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = "catnip" | [
"SELECT",
"t2.color_description",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_colors",
"AS",
"t2",
"ON",
"t1.color_code",
"=",
"t2.color_code",
"WHERE",
"t1.product_name",
"=",
"``",
"catnip",
"''"
] | [
"select",
"t2",
".",
"color_description",
"from",
"products",
"as",
"t1",
"join",
"ref_colors",
"as",
"t2",
"on",
"t1",
".",
"color_code",
"=",
"t2",
".",
"color_code",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"What",
"is",
"the",
"color",
"description",
"of",
"the",
"product",
"with",
"name",
"``",
"catnip",
"''",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Give the color description for the product 'catnip'. | SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = "catnip" | [
"SELECT",
"t2.color_description",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_colors",
"AS",
"t2",
"ON",
"t1.color_code",
"=",
"t2.color_code",
"WHERE",
"t1.product_name",
"=",
"``",
"catnip",
"''"
] | [
"select",
"t2",
".",
"color_description",
"from",
"products",
"as",
"t1",
"join",
"ref_colors",
"as",
"t2",
"on",
"t1",
".",
"color_code",
"=",
"t2",
".",
"color_code",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"Give",
"the",
"color",
"description",
"for",
"the",
"product",
"'catnip",
"'",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What is the color code and description of the product named "chervil"? | SELECT t1.color_code , t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = "chervil" | [
"SELECT",
"t1.color_code",
",",
"t2.color_description",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_colors",
"AS",
"t2",
"ON",
"t1.color_code",
"=",
"t2.color_code",
"WHERE",
"t1.product_name",
"=",
"``",
"chervil",
"''"
] | [
"select",
"t1",
".",
"color_code",
",",
"t2",
".",
"color_description",
"from",
"products",
"as",
"t1",
"join",
"ref_colors",
"as",
"t2",
"on",
"t1",
".",
"color_code",
"=",
"t2",
".",
"color_code",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"What",
"is",
"the",
"color",
"code",
"and",
"description",
"of",
"the",
"product",
"named",
"``",
"chervil",
"''",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Return the color code and description for the product with the name 'chervil'. | SELECT t1.color_code , t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = "chervil" | [
"SELECT",
"t1.color_code",
",",
"t2.color_description",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_colors",
"AS",
"t2",
"ON",
"t1.color_code",
"=",
"t2.color_code",
"WHERE",
"t1.product_name",
"=",
"``",
"chervil",
"''"
] | [
"select",
"t1",
".",
"color_code",
",",
"t2",
".",
"color_description",
"from",
"products",
"as",
"t1",
"join",
"ref_colors",
"as",
"t2",
"on",
"t1",
".",
"color_code",
"=",
"t2",
".",
"color_code",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"Return",
"the",
"color",
"code",
"and",
"description",
"for",
"the",
"product",
"with",
"the",
"name",
"'chervil",
"'",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Find the id and color description of the products with at least 2 characteristics. | SELECT t1.product_id , t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code JOIN product_characteristics AS t3 ON t1.product_id = t3.product_id GROUP BY t1.product_id HAVING count(*) >= 2 | [
"SELECT",
"t1.product_id",
",",
"t2.color_description",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_colors",
"AS",
"t2",
"ON",
"t1.color_code",
"=",
"t2.color_code",
"JOIN",
"product_characteristics",
"AS",
"t3",
"ON",
"t1.product_id",
"=",
"t3.product_id",
"GROUP",
"BY",
"t1.product_id",
"HAVING",
"count",
"(",
"*",
")",
">",
"=",
"2"
] | [
"select",
"t1",
".",
"product_id",
",",
"t2",
".",
"color_description",
"from",
"products",
"as",
"t1",
"join",
"ref_colors",
"as",
"t2",
"on",
"t1",
".",
"color_code",
"=",
"t2",
".",
"color_code",
"join",
"product_characteristics",
"as",
"t3",
"on",
"t1",
".",
"product_id",
"=",
"t3",
".",
"product_id",
"group",
"by",
"t1",
".",
"product_id",
"having",
"count",
"(",
"*",
")",
">",
"=",
"value"
] | [
"Find",
"the",
"id",
"and",
"color",
"description",
"of",
"the",
"products",
"with",
"at",
"least",
"2",
"characteristics",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What are the product ids and color descriptions for products with two or more characteristics? | SELECT t1.product_id , t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code JOIN product_characteristics AS t3 ON t1.product_id = t3.product_id GROUP BY t1.product_id HAVING count(*) >= 2 | [
"SELECT",
"t1.product_id",
",",
"t2.color_description",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_colors",
"AS",
"t2",
"ON",
"t1.color_code",
"=",
"t2.color_code",
"JOIN",
"product_characteristics",
"AS",
"t3",
"ON",
"t1.product_id",
"=",
"t3.product_id",
"GROUP",
"BY",
"t1.product_id",
"HAVING",
"count",
"(",
"*",
")",
">",
"=",
"2"
] | [
"select",
"t1",
".",
"product_id",
",",
"t2",
".",
"color_description",
"from",
"products",
"as",
"t1",
"join",
"ref_colors",
"as",
"t2",
"on",
"t1",
".",
"color_code",
"=",
"t2",
".",
"color_code",
"join",
"product_characteristics",
"as",
"t3",
"on",
"t1",
".",
"product_id",
"=",
"t3",
".",
"product_id",
"group",
"by",
"t1",
".",
"product_id",
"having",
"count",
"(",
"*",
")",
">",
"=",
"value"
] | [
"What",
"are",
"the",
"product",
"ids",
"and",
"color",
"descriptions",
"for",
"products",
"with",
"two",
"or",
"more",
"characteristics",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | List all the product names with the color description "white". | SELECT t1.product_name FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = "white" | [
"SELECT",
"t1.product_name",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_colors",
"AS",
"t2",
"ON",
"t1.color_code",
"=",
"t2.color_code",
"WHERE",
"t2.color_description",
"=",
"``",
"white",
"''"
] | [
"select",
"t1",
".",
"product_name",
"from",
"products",
"as",
"t1",
"join",
"ref_colors",
"as",
"t2",
"on",
"t1",
".",
"color_code",
"=",
"t2",
".",
"color_code",
"where",
"t2",
".",
"color_description",
"=",
"value"
] | [
"List",
"all",
"the",
"product",
"names",
"with",
"the",
"color",
"description",
"``",
"white",
"''",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What are the names of products with 'white' as their color description? | SELECT t1.product_name FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = "white" | [
"SELECT",
"t1.product_name",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_colors",
"AS",
"t2",
"ON",
"t1.color_code",
"=",
"t2.color_code",
"WHERE",
"t2.color_description",
"=",
"``",
"white",
"''"
] | [
"select",
"t1",
".",
"product_name",
"from",
"products",
"as",
"t1",
"join",
"ref_colors",
"as",
"t2",
"on",
"t1",
".",
"color_code",
"=",
"t2",
".",
"color_code",
"where",
"t2",
".",
"color_description",
"=",
"value"
] | [
"What",
"are",
"the",
"names",
"of",
"products",
"with",
"'white",
"'",
"as",
"their",
"color",
"description",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What are the name and typical buying and selling prices of the products that have color described as "yellow"? | SELECT t1.product_name , t1.typical_buying_price , t1.typical_selling_price FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = "yellow" | [
"SELECT",
"t1.product_name",
",",
"t1.typical_buying_price",
",",
"t1.typical_selling_price",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_colors",
"AS",
"t2",
"ON",
"t1.color_code",
"=",
"t2.color_code",
"WHERE",
"t2.color_description",
"=",
"``",
"yellow",
"''"
] | [
"select",
"t1",
".",
"product_name",
",",
"t1",
".",
"typical_buying_price",
",",
"t1",
".",
"typical_selling_price",
"from",
"products",
"as",
"t1",
"join",
"ref_colors",
"as",
"t2",
"on",
"t1",
".",
"color_code",
"=",
"t2",
".",
"color_code",
"where",
"t2",
".",
"color_description",
"=",
"value"
] | [
"What",
"are",
"the",
"name",
"and",
"typical",
"buying",
"and",
"selling",
"prices",
"of",
"the",
"products",
"that",
"have",
"color",
"described",
"as",
"``",
"yellow",
"''",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Return the names and typical buying and selling prices for products that have 'yellow' as their color description. | SELECT t1.product_name , t1.typical_buying_price , t1.typical_selling_price FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = "yellow" | [
"SELECT",
"t1.product_name",
",",
"t1.typical_buying_price",
",",
"t1.typical_selling_price",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_colors",
"AS",
"t2",
"ON",
"t1.color_code",
"=",
"t2.color_code",
"WHERE",
"t2.color_description",
"=",
"``",
"yellow",
"''"
] | [
"select",
"t1",
".",
"product_name",
",",
"t1",
".",
"typical_buying_price",
",",
"t1",
".",
"typical_selling_price",
"from",
"products",
"as",
"t1",
"join",
"ref_colors",
"as",
"t2",
"on",
"t1",
".",
"color_code",
"=",
"t2",
".",
"color_code",
"where",
"t2",
".",
"color_description",
"=",
"value"
] | [
"Return",
"the",
"names",
"and",
"typical",
"buying",
"and",
"selling",
"prices",
"for",
"products",
"that",
"have",
"'yellow",
"'",
"as",
"their",
"color",
"description",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | How many characteristics does the product named "sesame" have? | SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.product_name = "sesame" | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"WHERE",
"t1.product_name",
"=",
"``",
"sesame",
"''"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"How",
"many",
"characteristics",
"does",
"the",
"product",
"named",
"``",
"sesame",
"''",
"have",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Count the number of characteristics the product 'sesame' has. | SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.product_name = "sesame" | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"WHERE",
"t1.product_name",
"=",
"``",
"sesame",
"''"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"Count",
"the",
"number",
"of",
"characteristics",
"the",
"product",
"'sesame",
"'",
"has",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | How many distinct characteristic names does the product "cumin" have? | SELECT count(DISTINCT t3.characteristic_name) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame" | [
"SELECT",
"count",
"(",
"DISTINCT",
"t3.characteristic_name",
")",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"WHERE",
"t1.product_name",
"=",
"``",
"sesame",
"''"
] | [
"select",
"count",
"(",
"distinct",
"t3",
".",
"characteristic_name",
")",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"How",
"many",
"distinct",
"characteristic",
"names",
"does",
"the",
"product",
"``",
"cumin",
"''",
"have",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Count the number of different characteristic names the product 'cumin' has. | SELECT count(DISTINCT t3.characteristic_name) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame" | [
"SELECT",
"count",
"(",
"DISTINCT",
"t3.characteristic_name",
")",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"WHERE",
"t1.product_name",
"=",
"``",
"sesame",
"''"
] | [
"select",
"count",
"(",
"distinct",
"t3",
".",
"characteristic_name",
")",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"Count",
"the",
"number",
"of",
"different",
"characteristic",
"names",
"the",
"product",
"'cumin",
"'",
"has",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What are all the characteristic names of product "sesame"? | SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame" | [
"SELECT",
"t3.characteristic_name",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"WHERE",
"t1.product_name",
"=",
"``",
"sesame",
"''"
] | [
"select",
"t3",
".",
"characteristic_name",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"What",
"are",
"all",
"the",
"characteristic",
"names",
"of",
"product",
"``",
"sesame",
"''",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Return the characteristic names of the 'sesame' product. | SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame" | [
"SELECT",
"t3.characteristic_name",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"WHERE",
"t1.product_name",
"=",
"``",
"sesame",
"''"
] | [
"select",
"t3",
".",
"characteristic_name",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"Return",
"the",
"characteristic",
"names",
"of",
"the",
"'sesame",
"'",
"product",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | List all the characteristic names and data types of product "cumin". | SELECT t3.characteristic_name , t3.characteristic_data_type FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "cumin" | [
"SELECT",
"t3.characteristic_name",
",",
"t3.characteristic_data_type",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"WHERE",
"t1.product_name",
"=",
"``",
"cumin",
"''"
] | [
"select",
"t3",
".",
"characteristic_name",
",",
"t3",
".",
"characteristic_data_type",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"List",
"all",
"the",
"characteristic",
"names",
"and",
"data",
"types",
"of",
"product",
"``",
"cumin",
"''",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What are the names and data types of the characteristics of the 'cumin' product? | SELECT t3.characteristic_name , t3.characteristic_data_type FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "cumin" | [
"SELECT",
"t3.characteristic_name",
",",
"t3.characteristic_data_type",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"WHERE",
"t1.product_name",
"=",
"``",
"cumin",
"''"
] | [
"select",
"t3",
".",
"characteristic_name",
",",
"t3",
".",
"characteristic_data_type",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"What",
"are",
"the",
"names",
"and",
"data",
"types",
"of",
"the",
"characteristics",
"of",
"the",
"'cumin",
"'",
"product",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | List all characteristics of product named "sesame" with type code "Grade". | SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame" AND t3.characteristic_type_code = "Grade" | [
"SELECT",
"t3.characteristic_name",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"WHERE",
"t1.product_name",
"=",
"``",
"sesame",
"''",
"AND",
"t3.characteristic_type_code",
"=",
"``",
"Grade",
"''"
] | [
"select",
"t3",
".",
"characteristic_name",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"where",
"t1",
".",
"product_name",
"=",
"value",
"and",
"t3",
".",
"characteristic_type_code",
"=",
"value"
] | [
"List",
"all",
"characteristics",
"of",
"product",
"named",
"``",
"sesame",
"''",
"with",
"type",
"code",
"``",
"Grade",
"''",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What are the names of the characteristics of the product 'sesame' that have the characteristic type code 'Grade'? | SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame" AND t3.characteristic_type_code = "Grade" | [
"SELECT",
"t3.characteristic_name",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"WHERE",
"t1.product_name",
"=",
"``",
"sesame",
"''",
"AND",
"t3.characteristic_type_code",
"=",
"``",
"Grade",
"''"
] | [
"select",
"t3",
".",
"characteristic_name",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"where",
"t1",
".",
"product_name",
"=",
"value",
"and",
"t3",
".",
"characteristic_type_code",
"=",
"value"
] | [
"What",
"are",
"the",
"names",
"of",
"the",
"characteristics",
"of",
"the",
"product",
"'sesame",
"'",
"that",
"have",
"the",
"characteristic",
"type",
"code",
"'Grade",
"'",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | How many characteristics does the product named "laurel" have? | SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "laurel" | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"WHERE",
"t1.product_name",
"=",
"``",
"laurel",
"''"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"How",
"many",
"characteristics",
"does",
"the",
"product",
"named",
"``",
"laurel",
"''",
"have",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Count the number of characteristics of the product named 'laurel'. | SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "laurel" | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"WHERE",
"t1.product_name",
"=",
"``",
"laurel",
"''"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"Count",
"the",
"number",
"of",
"characteristics",
"of",
"the",
"product",
"named",
"'laurel",
"'",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Find the number of characteristics that the product "flax" has. | SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "flax" | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"WHERE",
"t1.product_name",
"=",
"``",
"flax",
"''"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"Find",
"the",
"number",
"of",
"characteristics",
"that",
"the",
"product",
"``",
"flax",
"''",
"has",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Count the number of characteristics of the 'flax' product. | SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "flax" | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"WHERE",
"t1.product_name",
"=",
"``",
"flax",
"''"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"Count",
"the",
"number",
"of",
"characteristics",
"of",
"the",
"'flax",
"'",
"product",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Find the name of the products that have the color description "red" and have the characteristic name "fast". | SELECT product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "red" AND t3.characteristic_name = "fast" | [
"SELECT",
"product_name",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"JOIN",
"ref_colors",
"AS",
"t4",
"ON",
"t1.color_code",
"=",
"t4.color_code",
"WHERE",
"t4.color_description",
"=",
"``",
"red",
"''",
"AND",
"t3.characteristic_name",
"=",
"``",
"fast",
"''"
] | [
"select",
"product_name",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"join",
"ref_colors",
"as",
"t4",
"on",
"t1",
".",
"color_code",
"=",
"t4",
".",
"color_code",
"where",
"t4",
".",
"color_description",
"=",
"value",
"and",
"t3",
".",
"characteristic_name",
"=",
"value"
] | [
"Find",
"the",
"name",
"of",
"the",
"products",
"that",
"have",
"the",
"color",
"description",
"``",
"red",
"''",
"and",
"have",
"the",
"characteristic",
"name",
"``",
"fast",
"''",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What are the names of the products that have a color description of 'red' and the 'fast' characteristic? | SELECT product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "red" AND t3.characteristic_name = "fast" | [
"SELECT",
"product_name",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"JOIN",
"ref_colors",
"AS",
"t4",
"ON",
"t1.color_code",
"=",
"t4.color_code",
"WHERE",
"t4.color_description",
"=",
"``",
"red",
"''",
"AND",
"t3.characteristic_name",
"=",
"``",
"fast",
"''"
] | [
"select",
"product_name",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"join",
"ref_colors",
"as",
"t4",
"on",
"t1",
".",
"color_code",
"=",
"t4",
".",
"color_code",
"where",
"t4",
".",
"color_description",
"=",
"value",
"and",
"t3",
".",
"characteristic_name",
"=",
"value"
] | [
"What",
"are",
"the",
"names",
"of",
"the",
"products",
"that",
"have",
"a",
"color",
"description",
"of",
"'red",
"'",
"and",
"the",
"'fast",
"'",
"characteristic",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | How many products have the characteristic named "hot"? | SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = "hot" | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"WHERE",
"t3.characteristic_name",
"=",
"``",
"hot",
"''"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"where",
"t3",
".",
"characteristic_name",
"=",
"value"
] | [
"How",
"many",
"products",
"have",
"the",
"characteristic",
"named",
"``",
"hot",
"''",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Count the number of products with the 'hot' charactersitic. | SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = "hot" | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"WHERE",
"t3.characteristic_name",
"=",
"``",
"hot",
"''"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"where",
"t3",
".",
"characteristic_name",
"=",
"value"
] | [
"Count",
"the",
"number",
"of",
"products",
"with",
"the",
"'hot",
"'",
"charactersitic",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | List the all the distinct names of the products with the characteristic name 'warm'. | SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = "warm" | [
"SELECT",
"DISTINCT",
"t1.product_name",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"WHERE",
"t3.characteristic_name",
"=",
"``",
"warm",
"''"
] | [
"select",
"distinct",
"t1",
".",
"product_name",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"where",
"t3",
".",
"characteristic_name",
"=",
"value"
] | [
"List",
"the",
"all",
"the",
"distinct",
"names",
"of",
"the",
"products",
"with",
"the",
"characteristic",
"name",
"'warm",
"'",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What are the different product names for products that have the 'warm' characteristic:? | SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = "warm" | [
"SELECT",
"DISTINCT",
"t1.product_name",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"WHERE",
"t3.characteristic_name",
"=",
"``",
"warm",
"''"
] | [
"select",
"distinct",
"t1",
".",
"product_name",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"where",
"t3",
".",
"characteristic_name",
"=",
"value"
] | [
"What",
"are",
"the",
"different",
"product",
"names",
"for",
"products",
"that",
"have",
"the",
"'warm",
"'",
"characteristic",
":",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Find the number of the products that have their color described as "red" and have a characteristic named "slow". | SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "red" AND t3.characteristic_name = "slow" | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"JOIN",
"ref_colors",
"AS",
"t4",
"ON",
"t1.color_code",
"=",
"t4.color_code",
"WHERE",
"t4.color_description",
"=",
"``",
"red",
"''",
"AND",
"t3.characteristic_name",
"=",
"``",
"slow",
"''"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"join",
"ref_colors",
"as",
"t4",
"on",
"t1",
".",
"color_code",
"=",
"t4",
".",
"color_code",
"where",
"t4",
".",
"color_description",
"=",
"value",
"and",
"t3",
".",
"characteristic_name",
"=",
"value"
] | [
"Find",
"the",
"number",
"of",
"the",
"products",
"that",
"have",
"their",
"color",
"described",
"as",
"``",
"red",
"''",
"and",
"have",
"a",
"characteristic",
"named",
"``",
"slow",
"''",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | How many products have the color description 'red' and the characteristic name 'slow'? | SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "red" AND t3.characteristic_name = "slow" | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"JOIN",
"ref_colors",
"AS",
"t4",
"ON",
"t1.color_code",
"=",
"t4.color_code",
"WHERE",
"t4.color_description",
"=",
"``",
"red",
"''",
"AND",
"t3.characteristic_name",
"=",
"``",
"slow",
"''"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"join",
"ref_colors",
"as",
"t4",
"on",
"t1",
".",
"color_code",
"=",
"t4",
".",
"color_code",
"where",
"t4",
".",
"color_description",
"=",
"value",
"and",
"t3",
".",
"characteristic_name",
"=",
"value"
] | [
"How",
"many",
"products",
"have",
"the",
"color",
"description",
"'red",
"'",
"and",
"the",
"characteristic",
"name",
"'slow",
"'",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Count the products that have the color description "white" or have the characteristic name "hot". | SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "white" OR t3.characteristic_name = "hot" | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"JOIN",
"ref_colors",
"AS",
"t4",
"ON",
"t1.color_code",
"=",
"t4.color_code",
"WHERE",
"t4.color_description",
"=",
"``",
"white",
"''",
"OR",
"t3.characteristic_name",
"=",
"``",
"hot",
"''"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"join",
"ref_colors",
"as",
"t4",
"on",
"t1",
".",
"color_code",
"=",
"t4",
".",
"color_code",
"where",
"t4",
".",
"color_description",
"=",
"value",
"or",
"t3",
".",
"characteristic_name",
"=",
"value"
] | [
"Count",
"the",
"products",
"that",
"have",
"the",
"color",
"description",
"``",
"white",
"''",
"or",
"have",
"the",
"characteristic",
"name",
"``",
"hot",
"''",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | How many products have their color described as 'white' or have a characteristic with the name 'hot'? | SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "white" OR t3.characteristic_name = "hot" | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"JOIN",
"ref_colors",
"AS",
"t4",
"ON",
"t1.color_code",
"=",
"t4.color_code",
"WHERE",
"t4.color_description",
"=",
"``",
"white",
"''",
"OR",
"t3.characteristic_name",
"=",
"``",
"hot",
"''"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"join",
"ref_colors",
"as",
"t4",
"on",
"t1",
".",
"color_code",
"=",
"t4",
".",
"color_code",
"where",
"t4",
".",
"color_description",
"=",
"value",
"or",
"t3",
".",
"characteristic_name",
"=",
"value"
] | [
"How",
"many",
"products",
"have",
"their",
"color",
"described",
"as",
"'white",
"'",
"or",
"have",
"a",
"characteristic",
"with",
"the",
"name",
"'hot",
"'",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What is the unit of measuerment of the product category code "Herbs"? | SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = "Herbs" | [
"SELECT",
"unit_of_measure",
"FROM",
"ref_product_categories",
"WHERE",
"product_category_code",
"=",
"``",
"Herbs",
"''"
] | [
"select",
"unit_of_measure",
"from",
"ref_product_categories",
"where",
"product_category_code",
"=",
"value"
] | [
"What",
"is",
"the",
"unit",
"of",
"measuerment",
"of",
"the",
"product",
"category",
"code",
"``",
"Herbs",
"''",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Return the unit of measure for 'Herb' products. | SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = "Herbs" | [
"SELECT",
"unit_of_measure",
"FROM",
"ref_product_categories",
"WHERE",
"product_category_code",
"=",
"``",
"Herbs",
"''"
] | [
"select",
"unit_of_measure",
"from",
"ref_product_categories",
"where",
"product_category_code",
"=",
"value"
] | [
"Return",
"the",
"unit",
"of",
"measure",
"for",
"'Herb",
"'",
"products",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Find the product category description of the product category with code "Spices". | SELECT product_category_description FROM ref_product_categories WHERE product_category_code = "Spices" | [
"SELECT",
"product_category_description",
"FROM",
"ref_product_categories",
"WHERE",
"product_category_code",
"=",
"``",
"Spices",
"''"
] | [
"select",
"product_category_description",
"from",
"ref_product_categories",
"where",
"product_category_code",
"=",
"value"
] | [
"Find",
"the",
"product",
"category",
"description",
"of",
"the",
"product",
"category",
"with",
"code",
"``",
"Spices",
"''",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What is the description of the product category with the code 'Spices'? | SELECT product_category_description FROM ref_product_categories WHERE product_category_code = "Spices" | [
"SELECT",
"product_category_description",
"FROM",
"ref_product_categories",
"WHERE",
"product_category_code",
"=",
"``",
"Spices",
"''"
] | [
"select",
"product_category_description",
"from",
"ref_product_categories",
"where",
"product_category_code",
"=",
"value"
] | [
"What",
"is",
"the",
"description",
"of",
"the",
"product",
"category",
"with",
"the",
"code",
"'Spices",
"'",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What is the product category description and unit of measurement of category "Herbs"? | SELECT product_category_description , unit_of_measure FROM ref_product_categories WHERE product_category_code = "Herbs" | [
"SELECT",
"product_category_description",
",",
"unit_of_measure",
"FROM",
"ref_product_categories",
"WHERE",
"product_category_code",
"=",
"``",
"Herbs",
"''"
] | [
"select",
"product_category_description",
",",
"unit_of_measure",
"from",
"ref_product_categories",
"where",
"product_category_code",
"=",
"value"
] | [
"What",
"is",
"the",
"product",
"category",
"description",
"and",
"unit",
"of",
"measurement",
"of",
"category",
"``",
"Herbs",
"''",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Return the description and unit of measurement for products in the 'Herbs' category. | SELECT product_category_description , unit_of_measure FROM ref_product_categories WHERE product_category_code = "Herbs" | [
"SELECT",
"product_category_description",
",",
"unit_of_measure",
"FROM",
"ref_product_categories",
"WHERE",
"product_category_code",
"=",
"``",
"Herbs",
"''"
] | [
"select",
"product_category_description",
",",
"unit_of_measure",
"from",
"ref_product_categories",
"where",
"product_category_code",
"=",
"value"
] | [
"Return",
"the",
"description",
"and",
"unit",
"of",
"measurement",
"for",
"products",
"in",
"the",
"'Herbs",
"'",
"category",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What is the unit of measurement of product named "cumin"? | SELECT t2.unit_of_measure FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = "cumin" | [
"SELECT",
"t2.unit_of_measure",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_product_categories",
"AS",
"t2",
"ON",
"t1.product_category_code",
"=",
"t2.product_category_code",
"WHERE",
"t1.product_name",
"=",
"``",
"cumin",
"''"
] | [
"select",
"t2",
".",
"unit_of_measure",
"from",
"products",
"as",
"t1",
"join",
"ref_product_categories",
"as",
"t2",
"on",
"t1",
".",
"product_category_code",
"=",
"t2",
".",
"product_category_code",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"What",
"is",
"the",
"unit",
"of",
"measurement",
"of",
"product",
"named",
"``",
"cumin",
"''",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Give the unit of measure for the product with the name 'cumin'. | SELECT t2.unit_of_measure FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = "cumin" | [
"SELECT",
"t2.unit_of_measure",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_product_categories",
"AS",
"t2",
"ON",
"t1.product_category_code",
"=",
"t2.product_category_code",
"WHERE",
"t1.product_name",
"=",
"``",
"cumin",
"''"
] | [
"select",
"t2",
".",
"unit_of_measure",
"from",
"products",
"as",
"t1",
"join",
"ref_product_categories",
"as",
"t2",
"on",
"t1",
".",
"product_category_code",
"=",
"t2",
".",
"product_category_code",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"Give",
"the",
"unit",
"of",
"measure",
"for",
"the",
"product",
"with",
"the",
"name",
"'cumin",
"'",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Find the unit of measurement and product category code of product named "chervil". | SELECT t2.unit_of_measure , t2.product_category_code FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = "chervil" | [
"SELECT",
"t2.unit_of_measure",
",",
"t2.product_category_code",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_product_categories",
"AS",
"t2",
"ON",
"t1.product_category_code",
"=",
"t2.product_category_code",
"WHERE",
"t1.product_name",
"=",
"``",
"chervil",
"''"
] | [
"select",
"t2",
".",
"unit_of_measure",
",",
"t2",
".",
"product_category_code",
"from",
"products",
"as",
"t1",
"join",
"ref_product_categories",
"as",
"t2",
"on",
"t1",
".",
"product_category_code",
"=",
"t2",
".",
"product_category_code",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"Find",
"the",
"unit",
"of",
"measurement",
"and",
"product",
"category",
"code",
"of",
"product",
"named",
"``",
"chervil",
"''",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What are the unit of measure and category code for the 'chervil' product? | SELECT t2.unit_of_measure , t2.product_category_code FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = "chervil" | [
"SELECT",
"t2.unit_of_measure",
",",
"t2.product_category_code",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_product_categories",
"AS",
"t2",
"ON",
"t1.product_category_code",
"=",
"t2.product_category_code",
"WHERE",
"t1.product_name",
"=",
"``",
"chervil",
"''"
] | [
"select",
"t2",
".",
"unit_of_measure",
",",
"t2",
".",
"product_category_code",
"from",
"products",
"as",
"t1",
"join",
"ref_product_categories",
"as",
"t2",
"on",
"t1",
".",
"product_category_code",
"=",
"t2",
".",
"product_category_code",
"where",
"t1",
".",
"product_name",
"=",
"value"
] | [
"What",
"are",
"the",
"unit",
"of",
"measure",
"and",
"category",
"code",
"for",
"the",
"'chervil",
"'",
"product",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Find the product names that are colored 'white' but do not have unit of measurement "Handful". | SELECT t1.product_name FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code JOIN ref_colors AS t3 ON t1.color_code = t3.color_code WHERE t3.color_description = "white" AND t2.unit_of_measure != "Handful" | [
"SELECT",
"t1.product_name",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_product_categories",
"AS",
"t2",
"ON",
"t1.product_category_code",
"=",
"t2.product_category_code",
"JOIN",
"ref_colors",
"AS",
"t3",
"ON",
"t1.color_code",
"=",
"t3.color_code",
"WHERE",
"t3.color_description",
"=",
"``",
"white",
"''",
"AND",
"t2.unit_of_measure",
"!",
"=",
"``",
"Handful",
"''"
] | [
"select",
"t1",
".",
"product_name",
"from",
"products",
"as",
"t1",
"join",
"ref_product_categories",
"as",
"t2",
"on",
"t1",
".",
"product_category_code",
"=",
"t2",
".",
"product_category_code",
"join",
"ref_colors",
"as",
"t3",
"on",
"t1",
".",
"color_code",
"=",
"t3",
".",
"color_code",
"where",
"t3",
".",
"color_description",
"=",
"value",
"and",
"t2",
".",
"unit_of_measure",
"!",
"=",
"value"
] | [
"Find",
"the",
"product",
"names",
"that",
"are",
"colored",
"'white",
"'",
"but",
"do",
"not",
"have",
"unit",
"of",
"measurement",
"``",
"Handful",
"''",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What are the names of products that are not 'white' in color and are not measured by the unit 'Handful'? | SELECT t1.product_name FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code JOIN ref_colors AS t3 ON t1.color_code = t3.color_code WHERE t3.color_description = "white" AND t2.unit_of_measure != "Handful" | [
"SELECT",
"t1.product_name",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_product_categories",
"AS",
"t2",
"ON",
"t1.product_category_code",
"=",
"t2.product_category_code",
"JOIN",
"ref_colors",
"AS",
"t3",
"ON",
"t1.color_code",
"=",
"t3.color_code",
"WHERE",
"t3.color_description",
"=",
"``",
"white",
"''",
"AND",
"t2.unit_of_measure",
"!",
"=",
"``",
"Handful",
"''"
] | [
"select",
"t1",
".",
"product_name",
"from",
"products",
"as",
"t1",
"join",
"ref_product_categories",
"as",
"t2",
"on",
"t1",
".",
"product_category_code",
"=",
"t2",
".",
"product_category_code",
"join",
"ref_colors",
"as",
"t3",
"on",
"t1",
".",
"color_code",
"=",
"t3",
".",
"color_code",
"where",
"t3",
".",
"color_description",
"=",
"value",
"and",
"t2",
".",
"unit_of_measure",
"!",
"=",
"value"
] | [
"What",
"are",
"the",
"names",
"of",
"products",
"that",
"are",
"not",
"'white",
"'",
"in",
"color",
"and",
"are",
"not",
"measured",
"by",
"the",
"unit",
"'Handful",
"'",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What is the description of the color for most products? | SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY count(*) DESC LIMIT 1 | [
"SELECT",
"t2.color_description",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_colors",
"AS",
"t2",
"ON",
"t1.color_code",
"=",
"t2.color_code",
"GROUP",
"BY",
"t2.color_description",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"DESC",
"LIMIT",
"1"
] | [
"select",
"t2",
".",
"color_description",
"from",
"products",
"as",
"t1",
"join",
"ref_colors",
"as",
"t2",
"on",
"t1",
".",
"color_code",
"=",
"t2",
".",
"color_code",
"group",
"by",
"t2",
".",
"color_description",
"order",
"by",
"count",
"(",
"*",
")",
"desc",
"limit",
"value"
] | [
"What",
"is",
"the",
"description",
"of",
"the",
"color",
"for",
"most",
"products",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Return the color description that is most common across all products. | SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY count(*) DESC LIMIT 1 | [
"SELECT",
"t2.color_description",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_colors",
"AS",
"t2",
"ON",
"t1.color_code",
"=",
"t2.color_code",
"GROUP",
"BY",
"t2.color_description",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"DESC",
"LIMIT",
"1"
] | [
"select",
"t2",
".",
"color_description",
"from",
"products",
"as",
"t1",
"join",
"ref_colors",
"as",
"t2",
"on",
"t1",
".",
"color_code",
"=",
"t2",
".",
"color_code",
"group",
"by",
"t2",
".",
"color_description",
"order",
"by",
"count",
"(",
"*",
")",
"desc",
"limit",
"value"
] | [
"Return",
"the",
"color",
"description",
"that",
"is",
"most",
"common",
"across",
"all",
"products",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What is the description of the color used by least products? | SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY count(*) ASC LIMIT 1 | [
"SELECT",
"t2.color_description",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_colors",
"AS",
"t2",
"ON",
"t1.color_code",
"=",
"t2.color_code",
"GROUP",
"BY",
"t2.color_description",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"ASC",
"LIMIT",
"1"
] | [
"select",
"t2",
".",
"color_description",
"from",
"products",
"as",
"t1",
"join",
"ref_colors",
"as",
"t2",
"on",
"t1",
".",
"color_code",
"=",
"t2",
".",
"color_code",
"group",
"by",
"t2",
".",
"color_description",
"order",
"by",
"count",
"(",
"*",
")",
"asc",
"limit",
"value"
] | [
"What",
"is",
"the",
"description",
"of",
"the",
"color",
"used",
"by",
"least",
"products",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Give the color description that is least common across products. | SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY count(*) ASC LIMIT 1 | [
"SELECT",
"t2.color_description",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"ref_colors",
"AS",
"t2",
"ON",
"t1.color_code",
"=",
"t2.color_code",
"GROUP",
"BY",
"t2.color_description",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"ASC",
"LIMIT",
"1"
] | [
"select",
"t2",
".",
"color_description",
"from",
"products",
"as",
"t1",
"join",
"ref_colors",
"as",
"t2",
"on",
"t1",
".",
"color_code",
"=",
"t2",
".",
"color_code",
"group",
"by",
"t2",
".",
"color_description",
"order",
"by",
"count",
"(",
"*",
")",
"asc",
"limit",
"value"
] | [
"Give",
"the",
"color",
"description",
"that",
"is",
"least",
"common",
"across",
"products",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What is the characteristic name used by most number of the products? | SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY count(*) DESC LIMIT 1 | [
"SELECT",
"t3.characteristic_name",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"GROUP",
"BY",
"t3.characteristic_name",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"DESC",
"LIMIT",
"1"
] | [
"select",
"t3",
".",
"characteristic_name",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"group",
"by",
"t3",
".",
"characteristic_name",
"order",
"by",
"count",
"(",
"*",
")",
"desc",
"limit",
"value"
] | [
"What",
"is",
"the",
"characteristic",
"name",
"used",
"by",
"most",
"number",
"of",
"the",
"products",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Return the name of the characteristic that is most common across all products. | SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY count(*) DESC LIMIT 1 | [
"SELECT",
"t3.characteristic_name",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"GROUP",
"BY",
"t3.characteristic_name",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"DESC",
"LIMIT",
"1"
] | [
"select",
"t3",
".",
"characteristic_name",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"group",
"by",
"t3",
".",
"characteristic_name",
"order",
"by",
"count",
"(",
"*",
")",
"desc",
"limit",
"value"
] | [
"Return",
"the",
"name",
"of",
"the",
"characteristic",
"that",
"is",
"most",
"common",
"across",
"all",
"products",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What are the names, details and data types of the characteristics which are never used by any product? | SELECT characteristic_name , other_characteristic_details , characteristic_data_type FROM CHARACTERISTICS EXCEPT SELECT t1.characteristic_name , t1.other_characteristic_details , t1.characteristic_data_type FROM CHARACTERISTICS AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id = t2.characteristic_id | [
"SELECT",
"characteristic_name",
",",
"other_characteristic_details",
",",
"characteristic_data_type",
"FROM",
"CHARACTERISTICS",
"EXCEPT",
"SELECT",
"t1.characteristic_name",
",",
"t1.other_characteristic_details",
",",
"t1.characteristic_data_type",
"FROM",
"CHARACTERISTICS",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.characteristic_id",
"=",
"t2.characteristic_id"
] | [
"select",
"characteristic_name",
",",
"other_characteristic_details",
",",
"characteristic_data_type",
"from",
"characteristics",
"except",
"select",
"t1",
".",
"characteristic_name",
",",
"t1",
".",
"other_characteristic_details",
",",
"t1",
".",
"characteristic_data_type",
"from",
"characteristics",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"characteristic_id",
"=",
"t2",
".",
"characteristic_id"
] | [
"What",
"are",
"the",
"names",
",",
"details",
"and",
"data",
"types",
"of",
"the",
"characteristics",
"which",
"are",
"never",
"used",
"by",
"any",
"product",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Give the names, details, and data types of characteristics that are not found in any product. | SELECT characteristic_name , other_characteristic_details , characteristic_data_type FROM CHARACTERISTICS EXCEPT SELECT t1.characteristic_name , t1.other_characteristic_details , t1.characteristic_data_type FROM CHARACTERISTICS AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id = t2.characteristic_id | [
"SELECT",
"characteristic_name",
",",
"other_characteristic_details",
",",
"characteristic_data_type",
"FROM",
"CHARACTERISTICS",
"EXCEPT",
"SELECT",
"t1.characteristic_name",
",",
"t1.other_characteristic_details",
",",
"t1.characteristic_data_type",
"FROM",
"CHARACTERISTICS",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.characteristic_id",
"=",
"t2.characteristic_id"
] | [
"select",
"characteristic_name",
",",
"other_characteristic_details",
",",
"characteristic_data_type",
"from",
"characteristics",
"except",
"select",
"t1",
".",
"characteristic_name",
",",
"t1",
".",
"other_characteristic_details",
",",
"t1",
".",
"characteristic_data_type",
"from",
"characteristics",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"characteristic_id",
"=",
"t2",
".",
"characteristic_id"
] | [
"Give",
"the",
"names",
",",
"details",
",",
"and",
"data",
"types",
"of",
"characteristics",
"that",
"are",
"not",
"found",
"in",
"any",
"product",
"."
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | What are characteristic names used at least twice across all products? | SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name HAVING count(*) >= 2 | [
"SELECT",
"t3.characteristic_name",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"GROUP",
"BY",
"t3.characteristic_name",
"HAVING",
"count",
"(",
"*",
")",
">",
"=",
"2"
] | [
"select",
"t3",
".",
"characteristic_name",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"group",
"by",
"t3",
".",
"characteristic_name",
"having",
"count",
"(",
"*",
")",
">",
"=",
"value"
] | [
"What",
"are",
"characteristic",
"names",
"used",
"at",
"least",
"twice",
"across",
"all",
"products",
"?"
] |
products_gen_characteristics | [
"CREATE TABLE `Ref_Characteristic_Types` (\n`characteristic_type_code` VARCHAR(15) PRIMARY KEY,\n`characteristic_type_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Colors` (\n`color_code` VARCHAR(15) PRIMARY KEY,\n`color_description` VARCHAR(80)\n);",
"CREATE TABLE `Ref_Product_Categories` (\n`product_category_code` VARCHAR(15) PRIMARY KEY,\n`product_category_description` VARCHAR(80),\n`unit_of_measure` VARCHAR(20)\n);",
"CREATE TABLE `Characteristics` (\n`characteristic_id` INTEGER PRIMARY KEY,\n`characteristic_type_code` VARCHAR(15) NOT NULL,\n`characteristic_data_type` VARCHAR(10),\n`characteristic_name` VARCHAR(80),\n`other_characteristic_details` VARCHAR(255),\nFOREIGN KEY (`characteristic_type_code` ) REFERENCES `Ref_Characteristic_Types`(`characteristic_type_code` )\n);",
"CREATE TABLE `Products` (\n`product_id` INTEGER PRIMARY KEY,\n`color_code` VARCHAR(15) NOT NULL,\n`product_category_code` VARCHAR(15) NOT NULL,\n`product_name` VARCHAR(80),\n`typical_buying_price` VARCHAR(20),\n`typical_selling_price` VARCHAR(20),\n`product_description` VARCHAR(255),\n`other_product_details` VARCHAR(255),\nFOREIGN KEY (`product_category_code` ) REFERENCES `Ref_Product_Categories`(`product_category_code` ),FOREIGN KEY (`color_code` ) REFERENCES `Ref_Colors`(`color_code` )\n);",
"CREATE TABLE `Product_Characteristics` (\n`product_id` INTEGER NOT NULL,\n`characteristic_id` INTEGER NOT NULL,\n`product_characteristic_value` VARCHAR(50),\nFOREIGN KEY (`characteristic_id` ) REFERENCES `Characteristics`(`characteristic_id` ),\nFOREIGN KEY (`product_id` ) REFERENCES `Products`(`product_id` )\n);"
] | Give the names of characteristics that are in two or more products? | SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name HAVING count(*) >= 2 | [
"SELECT",
"t3.characteristic_name",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"product_characteristics",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"CHARACTERISTICS",
"AS",
"t3",
"ON",
"t2.characteristic_id",
"=",
"t3.characteristic_id",
"GROUP",
"BY",
"t3.characteristic_name",
"HAVING",
"count",
"(",
"*",
")",
">",
"=",
"2"
] | [
"select",
"t3",
".",
"characteristic_name",
"from",
"products",
"as",
"t1",
"join",
"product_characteristics",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"characteristics",
"as",
"t3",
"on",
"t2",
".",
"characteristic_id",
"=",
"t3",
".",
"characteristic_id",
"group",
"by",
"t3",
".",
"characteristic_name",
"having",
"count",
"(",
"*",
")",
">",
"=",
"value"
] | [
"Give",
"the",
"names",
"of",
"characteristics",
"that",
"are",
"in",
"two",
"or",
"more",
"products",
"?"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.