db_name
stringclasses 146
values | prompt
stringlengths 310
4.81k
|
|---|---|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# How many citations does luke zettlemoyer have per year
#
### SQL:
#
# SELECT DISTINCT COUNT ( t4.citedpaperid ) , t3.year FROM paper AS t3 JOIN cite AS t4 ON t3.paperid = t4.citedpaperid JOIN writes AS t2 ON t2.paperid = t3.paperid JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname = "luke zettlemoyer" GROUP BY t3.year;
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# authors working on ImageNet
#
### SQL:
#
# SELECT DISTINCT t2.paperid FROM paperdataset AS t3 JOIN dataset AS t1 ON t3.datasetid = t1.datasetid JOIN paper AS t4 ON t4.paperid = t3.paperid JOIN writes AS t2 ON t2.paperid = t4.paperid WHERE t1.datasetname = "ImageNet" GROUP BY t2.paperid;
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# What articles have been published since 2006 about the effects of juicing for cancer patients ?
#
### SQL:
#
# SELECT DISTINCT paperid , title FROM paper WHERE title LIKE "the effects of juicing for cancer patients" AND YEAR > 2006;
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# Eric C. Kerrigan 's Liquid Automatica paper
#
### SQL:
#
# SELECT DISTINCT t2.paperid FROM paperkeyphrase AS t5 JOIN keyphrase AS t3 ON t5.keyphraseid = t3.keyphraseid JOIN writes AS t4 ON t4.paperid = t5.paperid JOIN paper AS t2 ON t4.paperid = t2.paperid JOIN author AS t1 ON t4.authorid = t1.authorid JOIN venue AS t6 ON t6.venueid = t2.venueid WHERE t1.authorname = "Eric C. Kerrigan" AND t3.keyphrasename = "Liquid" AND t6.venuename = "Automatica";
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# Where did sergey levine publish his last paper ?
#
### SQL:
#
# SELECT DISTINCT t3.venueid , t3.year FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid JOIN paper AS t3 ON t2.paperid = t3.paperid WHERE t1.authorname = "sergey levine" GROUP BY t3.venueid , t3.year ORDER BY t3.year DESC;
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# keyphrases used by dan klein in his emnlp papers
#
### SQL:
#
# SELECT DISTINCT t2.keyphraseid FROM paper AS t3 JOIN paperkeyphrase AS t2 ON t3.paperid = t2.paperid JOIN venue AS t4 ON t4.venueid = t3.venueid JOIN writes AS t5 ON t5.paperid = t3.paperid JOIN author AS t1 ON t5.authorid = t1.authorid WHERE t1.authorname = "dan klein" AND t4.venuename = "emnlp";
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# Who are the prominent researchers in Neutralizing Antibody in 2012 ?
#
### SQL:
#
# SELECT DISTINCT COUNT ( t4.paperid ) , t3.authorid FROM paperkeyphrase AS t1 JOIN keyphrase AS t2 ON t1.keyphraseid = t2.keyphraseid JOIN paper AS t4 ON t4.paperid = t1.paperid JOIN writes AS t3 ON t3.paperid = t4.paperid WHERE t2.keyphrasename = "Neutralizing Antibody" AND t4.year = 2012 GROUP BY t3.authorid ORDER BY COUNT ( t4.paperid ) DESC;
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# the papers at eccv in 2014 using ImageNet dataset
#
### SQL:
#
# SELECT DISTINCT t3.paperid FROM paperdataset AS t2 JOIN dataset AS t1 ON t2.datasetid = t1.datasetid JOIN paper AS t3 ON t3.paperid = t2.paperid JOIN venue AS t4 ON t4.venueid = t3.venueid WHERE t1.datasetname = "ImageNet" AND t3.year = 2014 AND t4.venuename = "eccv";
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# which papers in eccv 2014 use ImageNet ?
#
### SQL:
#
# SELECT DISTINCT t3.paperid FROM paperdataset AS t2 JOIN dataset AS t1 ON t2.datasetid = t1.datasetid JOIN paper AS t3 ON t3.paperid = t2.paperid JOIN venue AS t4 ON t4.venueid = t3.venueid WHERE t1.datasetname = "ImageNet" AND t3.year = 2014 AND t4.venuename = "eccv";
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# eccv 2014 papers using ImageNet
#
### SQL:
#
# SELECT DISTINCT t3.paperid FROM paperdataset AS t2 JOIN dataset AS t1 ON t2.datasetid = t1.datasetid JOIN paper AS t3 ON t3.paperid = t2.paperid JOIN venue AS t4 ON t4.venueid = t3.venueid WHERE t1.datasetname = "ImageNet" AND t3.year = 2014 AND t4.venuename = "eccv";
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# Euclidean Distance papers citing NIPS papers
#
### SQL:
#
# SELECT DISTINCT t5.citingpaperid FROM paperkeyphrase AS t2 JOIN keyphrase AS t1 ON t2.keyphraseid = t1.keyphraseid JOIN cite AS t5 ON t2.paperid = t5.citingpaperid JOIN paper AS t3 ON t3.paperid = t5.citedpaperid JOIN venue AS t4 ON t4.venueid = t3.venueid WHERE t1.keyphrasename = "Euclidean Distance" AND t4.venuename = "NIPS";
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# top authors working on ImageNet ?
#
### SQL:
#
# SELECT DISTINCT COUNT ( t4.paperid ) , t3.paperid FROM paperdataset AS t2 JOIN dataset AS t1 ON t2.datasetid = t1.datasetid JOIN paper AS t4 ON t4.paperid = t2.paperid JOIN writes AS t3 ON t3.paperid = t4.paperid WHERE t1.datasetname = "ImageNet" GROUP BY t3.paperid ORDER BY COUNT ( t4.paperid ) DESC;
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# how many ACL 2012 papers have more than 7 citations ?
#
### SQL:
#
# SELECT DISTINCT ( t1.paperid ) , COUNT ( t3.citingpaperid ) FROM paper AS t1 JOIN cite AS t3 ON t1.paperid = t3.citedpaperid JOIN venue AS t2 ON t2.venueid = t1.venueid WHERE t1.year = 2012 AND t2.venuename = "ACL" GROUP BY t1.paperid HAVING COUNT ( t3.citingpaperid ) > 7;
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# What was the topic of best paper in 2012 EMNLP-CoNLL ?
#
### SQL:
#
# SELECT DISTINCT COUNT ( DISTINCT t4.citingpaperid ) , t1.keyphraseid , t2.paperid FROM paper AS t2 JOIN cite AS t4 ON t2.paperid = t4.citedpaperid JOIN paperkeyphrase AS t1 ON t2.paperid = t1.paperid JOIN venue AS t3 ON t3.venueid = t2.venueid WHERE t2.year = 2012 AND t3.venuename = "EMNLP-CoNLL" GROUP BY t2.paperid , t1.keyphraseid ORDER BY COUNT ( DISTINCT t4.citingpaperid ) DESC;
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# How many papers has Noah Smith co-authored since 2009 ?
#
### SQL:
#
# SELECT DISTINCT COUNT ( DISTINCT t2.paperid ) FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid JOIN paper AS t3 ON t2.paperid = t3.paperid WHERE t1.authorname != "Noah Smith" AND t3.year > 2009 AND t2.paperid IN ( SELECT t2.paperid FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname LIKE "Noah Smith" );
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# Number of ACL papers with more than 2 citations
#
### SQL:
#
# SELECT DISTINCT COUNT ( t3.citingpaperid ) FROM paper AS t1 JOIN cite AS t3 ON t1.paperid = t3.citedpaperid JOIN venue AS t2 ON t2.venueid = t1.venueid WHERE t2.venuename = "ACL" GROUP BY t3.citingpaperid HAVING COUNT ( DISTINCT t3.citedpaperid ) > 2;
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# What is the name of Eric C. Kerrigan 's Liquid Automatica paper ?
#
### SQL:
#
# SELECT DISTINCT t2.title FROM paperkeyphrase AS t5 JOIN keyphrase AS t3 ON t5.keyphraseid = t3.keyphraseid JOIN writes AS t4 ON t4.paperid = t5.paperid JOIN paper AS t2 ON t4.paperid = t2.paperid JOIN author AS t1 ON t4.authorid = t1.authorid JOIN venue AS t6 ON t6.venueid = t2.venueid WHERE t1.authorname LIKE "Eric C. Kerrigan" AND t3.keyphrasename = "Liquid" AND t6.venuename = "Automatica";
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# How many papers used ImageNet datasets in cvpr ?
#
### SQL:
#
# SELECT DISTINCT COUNT ( t3.paperid ) FROM paperdataset AS t2 JOIN dataset AS t1 ON t2.datasetid = t1.datasetid JOIN paper AS t3 ON t3.paperid = t2.paperid JOIN venue AS t4 ON t4.venueid = t3.venueid WHERE t1.datasetname = "ImageNet" AND t4.venuename = "cvpr";
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# What venues are for Neuroscience ?
#
### SQL:
#
# SELECT DISTINCT venueid FROM venue WHERE venuename = "Neuroscience";
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# When was the last time Mary Crainie published a paper ?
#
### SQL:
#
# SELECT DISTINCT MAX ( t3.year ) FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid JOIN paper AS t3 ON t2.paperid = t3.paperid WHERE t1.authorname = "Mary Crainie";
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# I want the co-authors of papers on Machine Translation Output with Philipp Koehn
#
### SQL:
#
# SELECT DISTINCT t1.authorid FROM paperkeyphrase AS t6 JOIN keyphrase AS t3 ON t6.keyphraseid = t3.keyphraseid JOIN writes AS t4 ON t4.paperid = t6.paperid JOIN writes AS t5 ON t5.paperid = t4.paperid JOIN author AS t1 ON t5.authorid = t1.authorid JOIN author AS t2 ON t4.authorid = t2.authorid WHERE t2.authorname = "Philipp Koehn" AND t3.keyphrasename = "Machine Translation Output";
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# How many papers does Samuel Madden publish outside of PVLDB area ?
#
### SQL:
#
# SELECT DISTINCT COUNT ( DISTINCT t3.paperid ) FROM venue AS t4 JOIN paper AS t3 ON t4.venueid = t3.venueid JOIN writes AS t2 ON t2.paperid = t3.paperid JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname = "Samuel Madden" AND t4.venuename != "PVLDB";
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# which journal did Donald E Knuth publish his last paper ?
#
### SQL:
#
# SELECT DISTINCT t3.journalid , t3.year FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid JOIN paper AS t3 ON t2.paperid = t3.paperid WHERE t1.authorname = "Donald E Knuth" GROUP BY t3.journalid , t3.year ORDER BY t3.year DESC;
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# What is the venue of Fracture of acrylic bone cement ?
#
### SQL:
#
# SELECT DISTINCT venueid FROM paper WHERE title = "Fracture of acrylic bone cement";
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# How many authors published at sigcse in 2010 ?
#
### SQL:
#
# SELECT DISTINCT COUNT ( t2.paperid ) FROM venue AS t3 JOIN paper AS t2 ON t3.venueid = t2.venueid JOIN writes AS t1 ON t1.paperid = t2.paperid WHERE t2.year = 2010 AND t3.venuename = "sigcse";
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# What is the year of publication of " A Switching Architecture For ISDN " ?
#
### SQL:
#
# SELECT DISTINCT title , YEAR FROM paper WHERE title = "A Switching Architecture For ISDN";
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# what keywords are used by papers at uist
#
### SQL:
#
# SELECT DISTINCT t1.keyphraseid FROM paperkeyphrase AS t2 JOIN keyphrase AS t1 ON t2.keyphraseid = t1.keyphraseid JOIN paper AS t3 ON t3.paperid = t2.paperid JOIN venue AS t4 ON t4.venueid = t3.venueid WHERE t4.venuename = "uist";
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# Give me the papers written by Su-In Lee before 2012 .
#
### SQL:
#
# SELECT DISTINCT t3.paperid FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid JOIN paper AS t3 ON t2.paperid = t3.paperid WHERE t1.authorname = "Su-In Lee" AND t3.year < 2012;
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# papers in semantic parsing for each year
#
### SQL:
#
# SELECT DISTINCT COUNT ( t3.paperid ) , t3.year FROM paperkeyphrase AS t2 JOIN keyphrase AS t1 ON t2.keyphraseid = t1.keyphraseid JOIN paper AS t3 ON t3.paperid = t2.paperid WHERE t1.keyphrasename = "semantic parsing" GROUP BY t3.year ORDER BY t3.year DESC;
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# papers with at least 5 citations
#
### SQL:
#
# SELECT DISTINCT t2.citingpaperid FROM paper AS t1 JOIN cite AS t2 ON t1.paperid = t2.citedpaperid GROUP BY t2.citingpaperid HAVING COUNT ( DISTINCT t2.citedpaperid ) >= 5;
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# papers cited by at least 5 papers
#
### SQL:
#
# SELECT DISTINCT t2.citingpaperid FROM paper AS t1 JOIN cite AS t2 ON t1.paperid = t2.citedpaperid GROUP BY t2.citingpaperid HAVING COUNT ( DISTINCT t2.citedpaperid ) >= 5;
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# What is the most cited paper at sigcomm ?
#
### SQL:
#
# SELECT DISTINCT t3.citedpaperid , COUNT ( t3.citingpaperid ) FROM paper AS t1 JOIN cite AS t3 ON t1.paperid = t3.citedpaperid JOIN venue AS t2 ON t2.venueid = t1.venueid WHERE t2.venuename = "sigcomm" GROUP BY t3.citedpaperid ORDER BY COUNT ( t3.citingpaperid ) DESC;
#
### End.
|
scholar
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# venue ( venueId, venueName )
# author ( authorId, authorName )
# dataset ( datasetId, datasetName )
# journal ( journalId, journalName )
# keyphrase ( keyphraseId, keyphraseName )
# paper ( paperId, title, venueId, year, numCiting, numCitedBy, journalId )
# cite ( citingPaperId, citedPaperId )
# paperDataset ( paperId, datasetId )
# paperKeyphrase ( paperId, keyphraseId )
# writes ( paperId, authorId )
#
# paper.venueId can be joined with venue.venueId
# paper.journalId can be joined with journal.journalId
# cite.citingPaperId can be joined with paper.paperId
# cite.citedPaperId can be joined with paper.paperId
# paperKeyphrase.keyphraseId can be joined with keyphrase.keyphraseId
# paperKeyphrase.paperId can be joined with paper.paperId
# writes.authorId can be joined with author.authorId
# writes.paperId can be joined with paper.paperId
#
### Question:
#
# What is the name of Ranjit Jhala 's Liquid Haskell paper ?
#
### SQL:
#
# SELECT DISTINCT t3.title FROM paperkeyphrase AS t2 JOIN keyphrase AS t5 ON t2.keyphraseid = t5.keyphraseid JOIN writes AS t4 ON t4.paperid = t2.paperid JOIN paper AS t3 ON t4.paperid = t3.paperid JOIN author AS t1 ON t4.authorid = t1.authorid WHERE t1.authorname LIKE "Ranjit Jhala" AND t5.keyphrasename = "Liquid Haskell";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# List all the businesses with more than 4.5 stars
#
### SQL:
#
# SELECT name FROM business WHERE rating > 4.5;
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# List all businesses with rating 3.5
#
### SQL:
#
# SELECT name FROM business WHERE rating = 3.5;
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# List all user ids with name Michelle
#
### SQL:
#
# SELECT user_id FROM USER WHERE name = "Michelle";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all states in which there is a Whataburger
#
### SQL:
#
# SELECT state FROM business WHERE name = "Whataburger";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all cities in which there is a restaurant called " MGM Grand Buffet "
#
### SQL:
#
# SELECT t1.city FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.name = "MGM Grand Buffet" AND t2.category_name = "category_category_name0";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find the cities of businesses rated below 1.5
#
### SQL:
#
# SELECT city FROM business WHERE rating < 1.5;
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all cities which has a " Taj Mahal " .
#
### SQL:
#
# SELECT city FROM business WHERE name = "Taj Mahal";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# List all the reviews which rated a business less than 1
#
### SQL:
#
# SELECT text FROM review WHERE rating < 1;
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# List all the restaurant rated more than 3.5
#
### SQL:
#
# SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.rating > 3.5 AND t2.category_name = "restaurant";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# find all cities which has a " Taj Mahal " restaurant
#
### SQL:
#
# SELECT t1.city FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.name = "Taj Mahal" AND t2.category_name = "restaurant";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# list all the reviews by Niloofar
#
### SQL:
#
# SELECT t1.text FROM USER AS t2 JOIN review AS t1 ON t2.user_id = t1.user_id WHERE t2.name = "Niloofar";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# list all the businesses which have a review by Niloofar
#
### SQL:
#
# SELECT t1.name FROM review AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN USER AS t3 ON t3.user_id = t2.user_id WHERE t3.name = "Niloofar";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# list all the businesses which Niloofar rated 5
#
### SQL:
#
# SELECT t1.name FROM review AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN USER AS t3 ON t3.user_id = t2.user_id WHERE t2.rating = 5 AND t3.name = "Niloofar";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# List all the reviews by Michelle for Italian restaurant
#
### SQL:
#
# SELECT t4.text FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN category AS t3 ON t3.business_id = t1.business_id JOIN review AS t4 ON t4.business_id = t1.business_id JOIN USER AS t5 ON t5.user_id = t4.user_id WHERE t2.category_name = "Italian" AND t3.category_name = "category_category_name1" AND t5.name = "Michelle";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# find the number of reviews written for " Cafe Zinho " restaurant in Texas
#
### SQL:
#
# SELECT COUNT ( DISTINCT t3.text ) FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN review AS t3 ON t3.business_id = t1.business_id WHERE t1.name = "Cafe Zinho" AND t1.state = "Texas" AND t2.category_name = "restaurant";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# List all 5 star Italian restaurant
#
### SQL:
#
# SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN category AS t3 ON t3.business_id = t1.business_id WHERE t1.rating = 5 AND t2.category_name = "Italian" AND t3.category_name = "restaurant";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# List all the neighbourhoods with Italian restaurant in Madison
#
### SQL:
#
# SELECT t1.neighbourhood_name FROM category AS t3 JOIN business AS t2 ON t3.business_id = t2.business_id JOIN category AS t4 ON t4.business_id = t2.business_id JOIN neighbourhood AS t1 ON t1.business_id = t2.business_id WHERE t2.city = "Madison" AND t3.category_name = "Italian" AND t4.category_name = "restaurant";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# List all the neighbourhoods with Italian restaurant rated less than 2.5 in Madison
#
### SQL:
#
# SELECT t1.neighbourhood_name FROM category AS t3 JOIN business AS t2 ON t3.business_id = t2.business_id JOIN category AS t4 ON t4.business_id = t2.business_id JOIN neighbourhood AS t1 ON t1.business_id = t2.business_id WHERE t2.city = "Madison" AND t2.rating < 2.5 AND t3.category_name = "Italian" AND t4.category_name = "restaurant";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# find all the restaurant in Pennsylvania
#
### SQL:
#
# SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.state = "Pennsylvania" AND t2.category_name = "restaurant";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# List all businesses that are restaurant in Pennsylvania .
#
### SQL:
#
# SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.state = "Pennsylvania" AND t2.category_name = "restaurant";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all the reviews for all Pet Groomers with more than 100 reviews
#
### SQL:
#
# SELECT t3.text FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN review AS t3 ON t3.business_id = t1.business_id WHERE t1.review_count > 100 AND t2.category_name = "Pet Groomers";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# What are all the breweries in " Los Angeles " ?
#
### SQL:
#
# SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.city = "Los Angeles" AND t2.category_name = "breweries";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all breweries in Los Angeles
#
### SQL:
#
# SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.city = "Los Angeles" AND t2.category_name = "breweries";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all breweries in " Los Angeles "
#
### SQL:
#
# SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.city = "Los Angeles" AND t2.category_name = "breweries";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all users who reviewed restaurant " Mesa Grill "
#
### SQL:
#
# SELECT t4.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN review AS t3 ON t3.business_id = t1.business_id JOIN USER AS t4 ON t4.user_id = t3.user_id WHERE t1.name = "Mesa Grill" AND t2.category_name = "restaurant";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# List the addresses of all Walmart in " Los Angeles "
#
### SQL:
#
# SELECT full_address FROM business WHERE city = "Los Angeles" AND name = "Walmart";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all restaurant reviewed by Patrick in " Dallas "
#
### SQL:
#
# SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN review AS t3 ON t3.business_id = t1.business_id JOIN USER AS t4 ON t4.user_id = t3.user_id WHERE t1.city = "Dallas" AND t2.category_name = "restaurant" AND t4.name = "Patrick";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Which restaurant in Dallas were reviewed by user Patrick ?
#
### SQL:
#
# SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN review AS t3 ON t3.business_id = t1.business_id JOIN USER AS t4 ON t4.user_id = t3.user_id WHERE t1.city = "Dallas" AND t2.category_name = "restaurant" AND t4.name = "Patrick";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all Bars reviewed by Patrick
#
### SQL:
#
# SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN review AS t3 ON t3.business_id = t1.business_id JOIN USER AS t4 ON t4.user_id = t3.user_id WHERE t2.category_name = "Bars" AND t4.name = "Patrick";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all Bars reviewed by Patrick with at least 3 stars
#
### SQL:
#
# SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN review AS t3 ON t3.business_id = t1.business_id JOIN USER AS t4 ON t4.user_id = t3.user_id WHERE t1.rating >= 3 AND t2.category_name = "Bars" AND t4.name = "Patrick";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all users who have written tips for " Barrio Cafe " in 2015
#
### SQL:
#
# SELECT t3.name FROM tip AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN USER AS t3 ON t3.user_id = t2.user_id WHERE t1.name = "Barrio Cafe" AND t2.year = 2015;
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all businesses in Texas with a rating below 2
#
### SQL:
#
# SELECT name FROM business WHERE rating < 2 AND state = "Texas";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all restaurant Seafood in Los Angeles
#
### SQL:
#
# SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN category AS t3 ON t3.business_id = t1.business_id WHERE t1.city = "Los Angeles" AND t2.category_name = "Seafood" AND t3.category_name = "restaurant";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# List all the Seafood restaurant in " Los Angeles "
#
### SQL:
#
# SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN category AS t3 ON t3.business_id = t1.business_id WHERE t1.city = "Los Angeles" AND t2.category_name = "Seafood" AND t3.category_name = "restaurant";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all restaurant that serve Seafood in " Los Angeles "
#
### SQL:
#
# SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN category AS t3 ON t3.business_id = t1.business_id WHERE t1.city = "Los Angeles" AND t2.category_name = "Seafood" AND t3.category_name = "restaurant";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all reviews by Patrick with a rating above 4
#
### SQL:
#
# SELECT t1.text FROM USER AS t2 JOIN review AS t1 ON t2.user_id = t1.user_id WHERE t1.rating > 4 AND t2.name = "Patrick";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all Apple Store in " Los Angeles "
#
### SQL:
#
# SELECT business_id FROM business WHERE city = "Los Angeles" AND name = "Apple Store";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all Dallas restaurant with a rating above 4.5
#
### SQL:
#
# SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.city = "Dallas" AND t1.rating > 4.5 AND t2.category_name = "restaurant";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# What neighbourhood is restaurant " Flat Top Grill " in ?
#
### SQL:
#
# SELECT t1.neighbourhood_name FROM category AS t3 JOIN business AS t2 ON t3.business_id = t2.business_id JOIN neighbourhood AS t1 ON t1.business_id = t2.business_id WHERE t2.name = "Flat Top Grill" AND t3.category_name = "category_category_name0";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all tips about " Vintner Grill " that received more than 9 likes
#
### SQL:
#
# SELECT t2.text FROM tip AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.name = "Vintner Grill" AND t2.likes > 9;
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all reviews about " Kabob Palace " in year 2014
#
### SQL:
#
# SELECT t2.text FROM review AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.name = "Kabob Palace" AND t2.year = 2014;
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all users who have written tips about businesses in Dallas
#
### SQL:
#
# SELECT t3.name FROM tip AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN USER AS t3 ON t3.user_id = t2.user_id WHERE t1.city = "Dallas";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all cities in Texas in which there is a restaurant called " MGM Grand Buffet "
#
### SQL:
#
# SELECT t1.city FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.name = "MGM Grand Buffet" AND t1.state = "Texas" AND t2.category_name = "restaurant";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find the users who have given tips on Pet Groomers
#
### SQL:
#
# SELECT t4.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN tip AS t3 ON t3.business_id = t1.business_id JOIN USER AS t4 ON t4.user_id = t3.user_id WHERE t2.category_name = "Pet Groomers";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all tips for " Cafe Zinho " in Texas .
#
### SQL:
#
# SELECT t2.text FROM tip AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.name = "Cafe Zinho" AND t1.state = "Texas";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# List all users who reviewed businesses that are restaurant .
#
### SQL:
#
# SELECT t4.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN review AS t3 ON t3.business_id = t1.business_id JOIN USER AS t4 ON t4.user_id = t3.user_id WHERE t2.category_name = "restaurant";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# List all tips for " Cafe Zinho " in Pennsylvania in 2010 .
#
### SQL:
#
# SELECT t2.text FROM tip AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.name = "Cafe Zinho" AND t1.state = "Pennsylvania" AND t2.year = 2010;
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# List all users who reviewed businesses that are restaurant in 2010 .
#
### SQL:
#
# SELECT t4.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN review AS t3 ON t3.business_id = t1.business_id JOIN USER AS t4 ON t4.user_id = t3.user_id WHERE t2.category_name = "restaurant" AND t3.year = 2010;
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all the tips from a user who has written a review in 2012
#
### SQL:
#
# SELECT t2.text FROM USER AS t3 JOIN review AS t1 ON t3.user_id = t1.user_id JOIN tip AS t2 ON t3.user_id = t2.user_id WHERE t1.year = 2012;
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# Find all reviews for businesses rated 2.5
#
### SQL:
#
# SELECT t2.text FROM review AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.rating = 2.5;
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# find the number of escape games in Madison
#
### SQL:
#
# SELECT COUNT ( DISTINCT t1.name ) FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.city = "Madison" AND t2.category_name = "escape games";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# What is the number of escape games in Madison
#
### SQL:
#
# SELECT COUNT ( DISTINCT t1.name ) FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.city = "Madison" AND t2.category_name = "escape games";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# How many escape games exist in Madison
#
### SQL:
#
# SELECT COUNT ( DISTINCT t1.name ) FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.city = "Madison" AND t2.category_name = "escape games";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# What is the number of escape games in " Madison " ?
#
### SQL:
#
# SELECT COUNT ( DISTINCT t1.name ) FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.city = "Madison" AND t2.category_name = "escape games";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# How many escape games are there in Madison ?
#
### SQL:
#
# SELECT COUNT ( DISTINCT t1.name ) FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.city = "Madison" AND t2.category_name = "escape games";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# find the number of restaurant rated more than 3.5
#
### SQL:
#
# SELECT COUNT ( DISTINCT t1.name ) FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.rating > 3.5 AND t2.category_name = "restaurant";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# find the total checkins in Moroccan restaurant in " Los Angeles "
#
### SQL:
#
# SELECT SUM ( t4.count ) FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN category AS t3 ON t3.business_id = t1.business_id JOIN checkin AS t4 ON t4.business_id = t1.business_id WHERE t1.city = "Los Angeles" AND t2.category_name = "restaurant" AND t3.category_name = "Moroccan";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# find the total checkins in Moroccan restaurant in " Los Angeles " on Friday
#
### SQL:
#
# SELECT SUM ( t4.count ) FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN category AS t3 ON t3.business_id = t1.business_id JOIN checkin AS t4 ON t4.business_id = t1.business_id WHERE t1.city = "Los Angeles" AND t2.category_name = "Moroccan" AND t3.category_name = "restaurant" AND t4.day = "Friday";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# find the total checkins in Moroccan restaurant in " Los Angeles " per day
#
### SQL:
#
# SELECT t4.day , SUM ( t4.count ) FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN category AS t3 ON t3.business_id = t1.business_id JOIN checkin AS t4 ON t4.business_id = t1.business_id WHERE t1.city = "Los Angeles" AND t2.category_name = "Moroccan" AND t3.category_name = "restaurant" GROUP BY t4.day;
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# find the total checkins in Italian Delis in each state on Sunday
#
### SQL:
#
# SELECT t1.state , SUM ( t4.count ) FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN category AS t3 ON t3.business_id = t1.business_id JOIN checkin AS t4 ON t4.business_id = t1.business_id WHERE t2.category_name = "Italian" AND t3.category_name = "Delis" AND t4.day = "Sunday" GROUP BY t1.state;
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# How many reviews has Niloofar written in 2015
#
### SQL:
#
# SELECT COUNT ( DISTINCT t1.text ) FROM USER AS t2 JOIN review AS t1 ON t2.user_id = t1.user_id WHERE t1.year = 2015 AND t2.name = "Niloofar";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# what is the average rating given in Michelle reviews
#
### SQL:
#
# SELECT AVG ( t1.rating ) FROM USER AS t2 JOIN review AS t1 ON t2.user_id = t1.user_id WHERE t2.name = "Michelle";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# What is the number of checkins for " Cafe Zinho " on Friday
#
### SQL:
#
# SELECT t2.count FROM checkin AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.name = "Cafe Zinho" AND t2.day = "Friday";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# how many users reviewed " Sushi Too " in Pittsburgh
#
### SQL:
#
# SELECT COUNT ( DISTINCT t3.name ) FROM review AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN USER AS t3 ON t3.user_id = t2.user_id WHERE t1.city = "Pittsburgh" AND t1.name = "Sushi Too";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# What is the number of restaurant in Pittsburgh rated 4.5
#
### SQL:
#
# SELECT COUNT ( DISTINCT t1.name ) FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.city = "Pittsburgh" AND t1.rating = 4.5 AND t2.category_name = "restaurant";
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# How many tips have been written in 2015
#
### SQL:
#
# SELECT COUNT ( DISTINCT text ) FROM tip WHERE YEAR = 2015;
#
### End.
|
yelp
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state )
# category ( id, business_id, category_name )
# user ( uid, user_id, name )
# checkin ( cid, business_id, count, day )
# neighbourhood ( id, business_id, neighbourhood_name )
# review ( rid, business_id, user_id, rating, text, year, month )
# tip ( tip_id, business_id, text, user_id, likes, year, month )
#
# category.business_id can be joined with business.business_id
# checkin.business_id can be joined with business.business_id
# neighbourhood.business_id can be joined with business.business_id
# review.user_id can be joined with user.user_id
# review.business_id can be joined with business.business_id
# tip.user_id can be joined with user.user_id
# tip.business_id can be joined with business.business_id
#
### Question:
#
# What is the total likes on tips from Niloofar
#
### SQL:
#
# SELECT SUM ( t1.likes ) FROM USER AS t2 JOIN tip AS t1 ON t2.user_id = t1.user_id WHERE t2.name = "Niloofar";
#
### End.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.