instruction_seed stringlengths 305 1.28k | response_seed stringclasses 1
value | response stringlengths 7 2.05k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|---|
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE gas_station (station_id VARCHAR, LOCATION VARCHAR, manager_name VARCHAR, open_year VARCHAR)
Question: Show gas station id, location, and manager_name for all gas stations... | Here is the SQLite query to answer the question, formatted as requested:
```
SELECT station_id, LOCATION, manager_name FROM gas_station ORDER BY open_year;
``` | 1,200 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE gas_station (station_id VARCHAR, LOCATION VARCHAR, manager_name VARCHAR, open_year VARCHAR)\n\n Question: Show gas station id, loc... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE gas_station (open_year INTEGER)
Question: How many gas station are opened between 2000 and 2005?
Here is the SQLite query to answer to the question: How many gas station... | Your SQLite query is correct. Here it is formatted as requested:
```
SELECT COUNT(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005;
``` | 1,201 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE gas_station (open_year INTEGER)\n\n Question: How many gas station are opened between 2000 and 2005?\n\nHere is the SQLite query t... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE gas_station (LOCATION VARCHAR)
Question: Show all locations and the number of gas stations in each location ordered by the count.
Here is the SQLite query to answer to t... | Here is the SQLite query to show all locations and the number of gas stations in each location, ordered by the count:
```
SELECT LOCATION, COUNT(*) AS num_gas_stations
FROM gas_station
GROUP BY LOCATION
ORDER BY num_gas_stations;
``` | 1,202 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE gas_station (LOCATION VARCHAR)\n\n Question: Show all locations and the number of gas stations in each location ordered by the cou... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE company (headquarters VARCHAR, main_industry VARCHAR)
Question: Show all headquarters with both a company in banking industry and a company in Oil and gas.
Here is the S... | Here's the SQLite query that answers the question about showing all headquarters with both a company in the banking industry and a company in oil and gas:
```
SELECT headquarters
FROM company
WHERE main_industry = 'Banking'
INTERSECT
SELECT headquarters
FROM company
WHERE main_industry = 'Oil and gas';
``` | 1,203 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE company (headquarters VARCHAR, main_industry VARCHAR)\n\n Question: Show all headquarters with both a company in banking industry ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE company (headquarters VARCHAR, main_industry VARCHAR)
Question: Show all headquarters without a company in banking industry.
Here is the SQLite query to answer to the qu... | Your SQLite query is correct. It effectively retrieves all headquarters that do not have a company in the banking industry by using the `EXCEPT` clause. Here it is again wrapped in code formatting:
```
SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking'
```
This q... | 1,204 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE company (headquarters VARCHAR, main_industry VARCHAR)\n\n Question: Show all headquarters without a company in banking industry.\n... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE station_company (company_id VARCHAR); CREATE TABLE company (company VARCHAR, company_id VARCHAR)
Question: Show the company name with the number of gas station.
Here is ... | Your provided SQLite query is almost correct, but it needs a small adjustment to ensure that we are counting the number of gas stations properly for each company. You should group by the company name (or `T2.company`), rather than `T1.company_id`.
Here is the corrected SQLite query:
```
SELECT T2.company, COUNT(*) A... | 1,205 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE station_company (company_id VARCHAR); CREATE TABLE company (company VARCHAR, company_id VARCHAR)\n\n Question: Show the company na... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE station_company (company VARCHAR, main_industry VARCHAR, company_id VARCHAR); CREATE TABLE company (company VARCHAR, main_industry VARCHAR, company_id VARCHAR)
Question: ... | Your SQLite query to show the company name and main industry without a gas station looks correct. Here it is wrapped in code format as per your request:
```
SELECT company, main_industry FROM company WHERE NOT company_id IN (SELECT company_id FROM station_company);
```
This query selects the company name and main in... | 1,206 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE station_company (company VARCHAR, main_industry VARCHAR, company_id VARCHAR); CREATE TABLE company (company VARCHAR, main_industry VA... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE gas_station (manager_name VARCHAR, station_id VARCHAR); CREATE TABLE station_company (company_id VARCHAR, station_id VARCHAR); CREATE TABLE company (company_id VARCHAR, compan... | Here is the SQLite query to show the manager name for gas stations belonging to the ExxonMobil company:
```
SELECT T3.manager_name
FROM station_company AS T1
JOIN company AS T2 ON T1.company_id = T2.company_id
JOIN gas_station AS T3 ON T1.station_id = T3.station_id
WHERE T2.company = 'ExxonMobil';
``` | 1,207 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE gas_station (manager_name VARCHAR, station_id VARCHAR); CREATE TABLE station_company (company_id VARCHAR, station_id VARCHAR); CREATE... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE gas_station (location VARCHAR, station_id VARCHAR); CREATE TABLE company (company_id VARCHAR, market_value INTEGER); CREATE TABLE station_company (company_id VARCHAR, station_... | Your provided SQLite query is correctly structured to answer the question. Here it is wrapped as you requested:
```
SELECT T3.location
FROM station_company AS T1
JOIN company AS T2 ON T1.company_id = T2.company_id
JOIN gas_station AS T3 ON T1.station_id = T3.station_id
WHERE T2.market_value > 100;
``` | 1,208 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE gas_station (location VARCHAR, station_id VARCHAR); CREATE TABLE company (company_id VARCHAR, market_value INTEGER); CREATE TABLE sta... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE gas_station (manager_name VARCHAR, open_year INTEGER)
Question: Show the manager name with most number of gas stations opened after 2000.
Here is the SQLite query to ans... | Your query is almost correct. It effectively counts the number of gas stations opened after 2000 and selects the manager with the most stations. However, it's good to ensure clarity. Here's the properly formatted query:
```
SELECT manager_name
FROM gas_station
WHERE open_year > 2000
GROUP BY manager_name
ORDER BY ... | 1,209 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE gas_station (manager_name VARCHAR, open_year INTEGER)\n\n Question: Show the manager name with most number of gas stations opened ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE gas_station (LOCATION VARCHAR, open_year VARCHAR)
Question: order all gas station locations by the opening year.
Here is the SQLite query to answer to the question: orde... | Your SQL query is correct for ordering all gas station locations by the opening year. Here it is wrapped in triple backticks:
```
SELECT LOCATION FROM gas_station ORDER BY open_year;
``` | 1,210 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE gas_station (LOCATION VARCHAR, open_year VARCHAR)\n\n Question: order all gas station locations by the opening year.\n\nHere is th... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE company (rank VARCHAR, company VARCHAR, market_value VARCHAR, main_industry VARCHAR, sales_billion VARCHAR, profits_billion VARCHAR)
Question: find the rank, company name... | Here is the corrected SQLite query to find the rank, company names, and market values of the companies in the banking industry, ordered by their sales and profits in billion:
```sql
SELECT rank, company, market_value
FROM company
WHERE main_industry = 'Banking'
ORDER BY sales_billion ASC, profits_billion ASC;
```
... | 1,211 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE company (rank VARCHAR, company VARCHAR, market_value VARCHAR, main_industry VARCHAR, sales_billion VARCHAR, profits_billion VARCHAR)\... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE gas_station (location VARCHAR, Representative_Name VARCHAR, station_id VARCHAR); CREATE TABLE station_company (company_id VARCHAR, station_id VARCHAR); CREATE TABLE company (c... | The provided query attempts to retrieve the locations and representative names of gas stations owned by the companies with the top 3 asset amounts. However, the query is currently not structured correctly to filter by the top 3 companies based on asset amount before joining with the gas stations.
To properly achieve ... | 1,212 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE gas_station (location VARCHAR, Representative_Name VARCHAR, station_id VARCHAR); CREATE TABLE station_company (company_id VARCHAR, st... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE region (Id VARCHAR)
Question: How many regions do we have?
Here is the SQLite query to answer to the question: How many regions do we have?:
```
SELECT COUNT(*) FROM reg... | Here is the SQLite query to answer the question: How many regions do we have?:
```
SELECT COUNT(*) FROM region;
``` | 1,213 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE region (Id VARCHAR)\n\n Question: How many regions do we have?\n\nHere is the SQLite query to answer to the question: How many reg... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE region (region_name VARCHAR, Label VARCHAR)
Question: Show all distinct region names ordered by their labels.
Here is the SQLite query to answer to the question: Show al... | Your provided query is almost correct, but there is a slight mistake. You should include the `Label` in the `SELECT` statement if you want to order by it. Additionally, if you want distinct region names to be used for ordering, you should consider that the `Label` may belong to the same region. Here is the corrected ve... | 1,214 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE region (region_name VARCHAR, Label VARCHAR)\n\n Question: Show all distinct region names ordered by their labels.\n\nHere is the S... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE party (party_name VARCHAR)
Question: How many parties do we have?
Here is the SQLite query to answer to the question: How many parties do we have?:
```
SELECT COUNT(DIST... | Here is the SQLite query to answer the question: How many parties do we have?:
```sql
SELECT COUNT(DISTINCT party_name) FROM party;
``` | 1,215 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE party (party_name VARCHAR)\n\n Question: How many parties do we have?\n\nHere is the SQLite query to answer to the question: How m... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE party (minister VARCHAR, took_office VARCHAR, left_office VARCHAR)
Question: Show the ministers and the time they took and left office, listed by the time they left offic... | Your SQLite query to show the ministers and the time they took and left office, listed by the time they left office, is correct. Here it is wrapped in code format:
```
SELECT minister, took_office, left_office FROM party ORDER BY left_office;
``` | 1,216 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE party (minister VARCHAR, took_office VARCHAR, left_office VARCHAR)\n\n Question: Show the ministers and the time they took and lef... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE party (minister VARCHAR, took_office VARCHAR)
Question: Show the minister who took office after 1961 or before 1959.
Here is the SQLite query to answer to the question: ... | Here is the corrected SQLite query to show the minister who took office after 1961 or before 1959, in line with the given schema:
```sql
SELECT minister FROM party WHERE took_office > '1961' OR took_office < '1959'
``` | 1,217 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE party (minister VARCHAR, took_office VARCHAR)\n\n Question: Show the minister who took office after 1961 or before 1959.\n\nHere i... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE party (minister VARCHAR, party_name VARCHAR)
Question: Show all ministers who do not belong to Progress Party.
Here is the SQLite query to answer to the question: Show a... | Here is the SQLite query to show all ministers who do not belong to the Progress Party:
```
SELECT minister FROM party WHERE party_name <> 'Progress Party'
``` | 1,218 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE party (minister VARCHAR, party_name VARCHAR)\n\n Question: Show all ministers who do not belong to Progress Party.\n\nHere is the ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE party (minister VARCHAR, party_name VARCHAR, took_office VARCHAR)
Question: Show all ministers and parties they belong to in descending order of the time they took office... | Your SQLite query is almost correct, but it could be enhanced for clarity. Here is the properly formatted query:
```
SELECT minister, party_name
FROM party
ORDER BY took_office DESC;
```
This query retrieves the names of ministers along with their respective party names and orders the results by the time they took... | 1,219 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE party (minister VARCHAR, party_name VARCHAR, took_office VARCHAR)\n\n Question: Show all ministers and parties they belong to in d... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE party (minister VARCHAR, left_office VARCHAR)
Question: Return the minister who left office at the latest time.
Here is the SQLite query to answer to the question: Retur... | Here is the SQLite query to answer the question of returning the minister who left office at the latest time:
```
SELECT minister FROM party ORDER BY left_office DESC LIMIT 1
``` | 1,220 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE party (minister VARCHAR, left_office VARCHAR)\n\n Question: Return the minister who left office at the latest time.\n\nHere is the... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (member_name VARCHAR, party_id VARCHAR)
Question: List member names and their party names.
Here is the ... | Here is the SQLite query to list member names and their party names:
```
SELECT T1.member_name, T2.party_name
FROM Member AS T1
JOIN party AS T2 ON T1.party_id = T2.party_id;
``` | 1,221 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (member_name VARCHAR, party_id VARCHAR)\n\n Question: List membe... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (party_id VARCHAR)
Question: Show all party names and the number of members in each party.
Here is the ... | Your SQLite query is close, but you need to ensure that you also handle cases where a party has no members, as well as the correct grouping. Here's a revised version of the query:
```sql
SELECT T2.party_name, COUNT(T1.party_id) AS member_count
FROM party AS T2
LEFT JOIN Member AS T1 ON T1.party_id = T2.party_id
GRO... | 1,222 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (party_id VARCHAR)\n\n Question: Show all party names and the nu... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (party_id VARCHAR)
Question: What is the name of party with most number of members?
Here is the SQLite ... | Your provided SQLite query is correctly structured to find the name of the party with the most number of members. Below is the query wrapped as you requested:
```
SELECT T2.party_name
FROM Member AS T1
JOIN party AS T2 ON T1.party_id = T2.party_id
GROUP BY T1.party_id
ORDER BY COUNT(*) DESC
LIMIT 1;
```
This qu... | 1,223 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (party_id VARCHAR)\n\n Question: What is the name of party with ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE party (party_name VARCHAR, region_id VARCHAR)
Question: Show all party names and their region names.
Here i... | Your SQLite query looks correct for the given schema and question. It appropriately selects party names along with their corresponding region names by joining the `party` table with the `region` table on the `region_id`. Here’s the query wrapped as you requested:
```
SELECT T1.party_name, T2.region_name
FROM party AS... | 1,224 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE party (party_name VARCHAR, region_id VARCHAR)\n\n Question: Show all... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (party_name VARCHAR, party_id VARCHAR)
Question: Show names of parties that does not have any members.
... | The SQL query you provided is correct for showing the names of parties that do not have any members. Here it is wrapped in code formatting for clarity:
```
SELECT party_name FROM party WHERE NOT party_id IN (SELECT party_id FROM Member);
```
This query selects the `party_name` from the `party` table where the `party_... | 1,225 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (party_name VARCHAR, party_id VARCHAR)\n\n Question: Show names ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE member (member_name VARCHAR, party_id VARCHAR)
Question: Show the member names which are in both the party with id 3 and the party with id 1.
Here is the SQLite query to... | Here is the SQLite query to answer the question of showing member names which are in both the party with id 3 and the party with id 1:
```
SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1
``` | 1,226 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE member (member_name VARCHAR, party_id VARCHAR)\n\n Question: Show the member names which are in both the party with id 3 and the p... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE party (party_id VARCHAR, Party_name VARCHAR); CREATE TABLE Member (member_name VARCHAR, party_id VARCHAR)
Question: Show member names that are not in the Progress Party.
... | Your provided query is almost correct, but it will exclude members who belong to any other party and only show those from parties other than "Progress Party". To correctly show the member names that are not in the "Progress Party", you can use a LEFT JOIN or a NOT EXISTS clause to ensure members from the "Progress Part... | 1,227 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE party (party_id VARCHAR, Party_name VARCHAR); CREATE TABLE Member (member_name VARCHAR, party_id VARCHAR)\n\n Question: Show membe... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE party_events (Id VARCHAR)
Question: How many party events do we have?
Here is the SQLite query to answer to the question: How many party events do we have?:
```
SELECT C... | Here is the SQLite query to answer the question: How many party events do we have?:
```
SELECT COUNT(*) FROM party_events;
``` | 1,228 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE party_events (Id VARCHAR)\n\n Question: How many party events do we have?\n\nHere is the SQLite query to answer to the question: H... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE party_events (party_id VARCHAR)
Question: Show party names and the number of events for each party.
Here is th... | The SQLite query you provided is almost correct but it needs a minor adjustment in the `GROUP BY` clause to also include `T2.party_name` for proper aggregation. Here's the corrected version of the SQL query:
```
SELECT T2.party_name, COUNT(*) AS event_count
FROM party_events AS T1
JOIN party AS T2 ON T1.party_id = T... | 1,229 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE party_events (party_id VARCHAR)\n\n Question: Show party names and the ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE member (member_name VARCHAR); CREATE TABLE party_events (member_in_charge_id VARCHAR); CREATE TABLE member (member_name VARCHAR, member_id VARCHAR)
Question: Show all mem... | Here is the SQLite query to show all member names who are not in charge of any event:
```sql
SELECT member_name
FROM member
WHERE member_id NOT IN (SELECT member_in_charge_id FROM party_events);
``` | 1,230 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE member (member_name VARCHAR); CREATE TABLE party_events (member_in_charge_id VARCHAR); CREATE TABLE member (member_name VARCHAR, memb... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE party_events (party_id VARCHAR)
Question: What are the names of parties with at least 2 events?
Here is the SQ... | Here is the SQLite query to answer the question of what the names of parties with at least 2 events are:
```
SELECT T2.party_name
FROM party_events AS T1
JOIN party AS T2 ON T1.party_id = T2.party_id
GROUP BY T1.party_id
HAVING COUNT(*) >= 2;
``` | 1,231 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE party_events (party_id VARCHAR)\n\n Question: What are the names of par... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE party_events (member_in_charge_id VARCHAR); CREATE TABLE member (member_name VARCHAR, member_id VARCHAR)
Question: What is the name of member in charge of greatest number... | Your SQL query to find the name of the member in charge of the greatest number of events is correct. Here it is wrapped in the appropriate code formatting:
```
SELECT T1.member_name
FROM member AS T1
JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id
GROUP BY T2.member_in_charge_id
ORDER BY COUNT(*) ... | 1,232 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE party_events (member_in_charge_id VARCHAR); CREATE TABLE member (member_name VARCHAR, member_id VARCHAR)\n\n Question: What is the... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE party_events (event_name VARCHAR)
Question: find the event names that have more than 2 records.
Here is the SQLite query to answer to the question: find the event names ... | Your provided SQLite query is correct for finding event names that have more than 2 records. Here it is wrapped again for clarity:
```
SELECT event_name FROM party_events GROUP BY event_name HAVING COUNT(*) > 2
```
This query selects the `event_name` from the `party_events` table, groups the results by `event_name`,... | 1,233 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE party_events (event_name VARCHAR)\n\n Question: find the event names that have more than 2 records.\n\nHere is the SQLite query to... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE party_events (party_id VARCHAR, Event_Name VARCHAR); CREATE TABLE region (region_id VARCHAR, region_name VARCHAR); CREATE TABLE party (region_id VARCHAR, party_id VARCHAR)
... | It looks like there is a typo in the event name "Annaual Meeting". It should be "Annual Meeting". Here is the corrected SQLite query:
```
SELECT COUNT(*)
FROM region AS t1
JOIN party AS t2 ON t1.region_id = t2.region_id
JOIN party_events AS t3 ON t2.party_id = t3.party_id
WHERE t1.region_name = "United Kingdom"
... | 1,234 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE party_events (party_id VARCHAR, Event_Name VARCHAR); CREATE TABLE region (region_id VARCHAR, region_name VARCHAR); CREATE TABLE party... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE pilot (Id VARCHAR)
Question: How many pilots are there?
Here is the SQLite query to answer to the question: How many pilots are there?:
```
SELECT COUNT(*) FROM pilot
``... | Your SQLite query to count the number of pilots is correct. Here it is wrapped in code format:
```
SELECT COUNT(*) FROM pilot;
``` | 1,235 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE pilot (Id VARCHAR)\n\n Question: How many pilots are there?\n\nHere is the SQLite query to answer to the question: How many pilots... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE pilot (Pilot_name VARCHAR, Rank VARCHAR)
Question: List the names of pilots in ascending order of rank.
Here is the SQLite query to answer to the question: List the name... | Here's the SQLite query to list the names of pilots in ascending order of rank:
```
SELECT Pilot_name FROM pilot ORDER BY Rank ASC
``` | 1,236 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE pilot (Pilot_name VARCHAR, Rank VARCHAR)\n\n Question: List the names of pilots in ascending order of rank.\n\nHere is the SQLite ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE pilot (POSITION VARCHAR, Team VARCHAR)
Question: What are the positions and teams of pilots?
Here is the SQLite query to answer to the question: What are the positions a... | Here is the SQLite query to answer the question regarding the positions and teams of pilots:
```
SELECT POSITION, Team FROM pilot;
``` | 1,237 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE pilot (POSITION VARCHAR, Team VARCHAR)\n\n Question: What are the positions and teams of pilots?\n\nHere is the SQLite query to an... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE pilot (POSITION VARCHAR, Age INTEGER)
Question: List the distinct positions of pilots older than 30.
Here is the SQLite query to answer to the question: List the distinc... | Here is the SQLite query to answer the question: List the distinct positions of pilots older than 30:
```
SELECT DISTINCT POSITION FROM pilot WHERE Age > 30
``` | 1,238 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE pilot (POSITION VARCHAR, Age INTEGER)\n\n Question: List the distinct positions of pilots older than 30.\n\nHere is the SQLite que... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE pilot (Pilot_name VARCHAR, Team VARCHAR)
Question: Show the names of pilots from team "Bradley" or "Fordham".
Here is the SQLite query to answer to the question: Show th... | The SQLite query you provided is correctly formatted to retrieve the names of pilots from the teams "Bradley" or "Fordham". Here it is wrapped as per your request:
```
SELECT Pilot_name FROM pilot WHERE Team = "Bradley" OR Team = "Fordham";
``` | 1,239 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE pilot (Pilot_name VARCHAR, Team VARCHAR)\n\n Question: Show the names of pilots from team \"Bradley\" or \"Fordham\".\n\nHere is t... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE pilot (Join_Year VARCHAR, Rank VARCHAR)
Question: What is the joined year of the pilot of the highest rank?
Here is the SQLite query to answer to the question: What is t... | Your query is almost correct for retrieving the joined year of the pilot with the highest rank. However, the ordering should be based on the ranking, which typically would mean you want it sorted in descending order (if ranks are in a format where a higher value represents a higher rank). Here's the corrected query wit... | 1,240 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE pilot (Join_Year VARCHAR, Rank VARCHAR)\n\n Question: What is the joined year of the pilot of the highest rank?\n\nHere is the SQL... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE pilot (Nationality VARCHAR)
Question: What are the different nationalities of pilots? Show each nationality and the number of pilots of each nationality.
Here is the SQL... | Your SQLite query is correct for retrieving the different nationalities of pilots along with the count of pilots for each nationality. Here it is, wrapped in code formatting:
```
SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality;
``` | 1,241 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE pilot (Nationality VARCHAR)\n\n Question: What are the different nationalities of pilots? Show each nationality and the number of ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE pilot (Nationality VARCHAR)
Question: Show the most common nationality of pilots.
Here is the SQLite query to answer to the question: Show the most common nationality of... | Your SQLite query to show the most common nationality of pilots is correct. Here it is wrapped in code format:
```
SELECT Nationality FROM pilot GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1
```
This query groups the records by nationality, counts the occurrences of each nationality, orders them in descending ... | 1,242 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE pilot (Nationality VARCHAR)\n\n Question: Show the most common nationality of pilots.\n\nHere is the SQLite query to answer to the... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE pilot (POSITION VARCHAR, Join_Year INTEGER)
Question: Show the pilot positions that have both pilots joining after year 2005 and pilots joining before 2000.
Here is the ... | Your query is almost correct, but it uses the `INTERSECT` operator, which might not give the desired result in this context. Instead, we can group the positions and use a `HAVING` clause to ensure that each position has both conditions met: pilots joining before 2000 and pilots joining after 2005. Here’s the revised qu... | 1,243 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE pilot (POSITION VARCHAR, Join_Year INTEGER)\n\n Question: Show the pilot positions that have both pilots joining after year 2005 a... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_ID VARCHAR); CREATE TABLE aircraft (Model VARCHAR, Aircraft_ID VARCHAR)
... | Your SQLite query is correct. It properly joins the `pilot_record`, `aircraft`, and `pilot` tables to retrieve the names of pilots along with the models of aircraft they have flown. Here is your query wrapped in code format:
```
SELECT T3.Pilot_name, T2.Model
FROM pilot_record AS T1
JOIN aircraft AS T2 ON T1.Aircraf... | 1,244 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_ID VARCHAR); CREATE TABLE aircraf... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_ID VARCHAR, Rank VARCHAR); CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE TABLE aircraft (Fleet_Series VARCHAR, Air... | Here is the SQLite query to answer the question about showing the names of pilots and fleet series of the aircraft they have flown with in ascending order of the rank of the pilot:
```
SELECT T3.Pilot_name, T2.Fleet_Series
FROM pilot_record AS T1
JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID
JOIN pilot AS ... | 1,245 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_ID VARCHAR, Rank VARCHAR); CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_ID VARCHAR, Age INTEGER); CREATE TABLE aircraft (Fleet_Series VARCHAR, Aircraft_ID VARCHAR)
... | Here's the SQLite query that answers the question of showing the fleet series of the aircraft flown by pilots younger than 34:
```
SELECT T2.Fleet_Series
FROM pilot_record AS T1
JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID
JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID
WHERE T3.Age < 34;
``` | 1,246 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_ID VARCHAR, Age INTEGER); CREATE TABLE aircraft (Flee... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE pilot (Pilot_name VARCHAR, pilot_ID VARCHAR); CREATE TABLE pilot_record (pilot_ID VARCHAR)
Question: Show the names of pilots and the number of records they have.
Here i... | Here is the SQLite query to answer the question of showing the names of pilots and the number of records they have:
```
SELECT T2.Pilot_name, COUNT(*) AS record_count
FROM pilot_record AS T1
JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID
GROUP BY T2.Pilot_name;
``` | 1,247 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE pilot (Pilot_name VARCHAR, pilot_ID VARCHAR); CREATE TABLE pilot_record (pilot_ID VARCHAR)\n\n Question: Show the names of pilots ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE pilot (Pilot_name VARCHAR, pilot_ID VARCHAR); CREATE TABLE pilot_record (pilot_ID VARCHAR)
Question: Show names of pilots that have more than one record.
Here is the SQL... | Here is the SQLite query to answer the question of showing names of pilots that have more than one record:
```
SELECT T2.Pilot_name, COUNT(*)
FROM pilot_record AS T1
JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID
GROUP BY T2.Pilot_name
HAVING COUNT(*) > 1
``` | 1,248 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE pilot (Pilot_name VARCHAR, pilot_ID VARCHAR); CREATE TABLE pilot_record (pilot_ID VARCHAR)\n\n Question: Show names of pilots that... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE pilot_record (Pilot_name VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_ID VARCHAR)
Question: List the names of pilots that do not have any rec... | Here is the SQLite query to list the names of pilots that do not have any record:
```sql
SELECT Pilot_name FROM pilot WHERE Pilot_ID NOT IN (SELECT Pilot_ID FROM pilot_record);
``` | 1,249 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE pilot_record (Pilot_name VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_ID VARCHAR)\n\n Question: List ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Ref_Document_Status (document_status_code VARCHAR)
Question: What document status codes do we have?
Here is the SQLite query to answer to the question: What document sta... | Your SQLite query to retrieve the document status codes is correct. Here it is formatted as you requested:
```
SELECT document_status_code FROM Ref_Document_Status;
``` | 1,250 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Ref_Document_Status (document_status_code VARCHAR)\n\n Question: What document status codes do we have?\n\nHere is the SQLite quer... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Ref_Document_Status (document_status_description VARCHAR, document_status_code VARCHAR)
Question: What is the description of document status code 'working'?
Here is the ... | Here is the SQLite query to answer the question about the description of document status code 'working':
```
SELECT document_status_description FROM Ref_Document_Status WHERE document_status_code = 'working';
``` | 1,251 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Ref_Document_Status (document_status_description VARCHAR, document_status_code VARCHAR)\n\n Question: What is the description of d... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Ref_Document_Types (document_type_code VARCHAR)
Question: What document type codes do we have?
Here is the SQLite query to answer to the question: What document type cod... | Here is the SQLite query to answer the question "What document type codes do we have?":
```
SELECT document_type_code FROM Ref_Document_Types;
``` | 1,252 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Ref_Document_Types (document_type_code VARCHAR)\n\n Question: What document type codes do we have?\n\nHere is the SQLite query to ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Ref_Document_Types (document_type_description VARCHAR, document_type_code VARCHAR)
Question: What is the description of document type 'Paper'?
Here is the SQLite query t... | Here is the SQLite query to answer the question about the description of the document type 'Paper':
```
SELECT document_type_description FROM Ref_Document_Types WHERE document_type_code = 'Paper';
``` | 1,253 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Ref_Document_Types (document_type_description VARCHAR, document_type_code VARCHAR)\n\n Question: What is the description of docume... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Ref_Shipping_Agents (shipping_agent_name VARCHAR)
Question: What are the shipping agent names?
Here is the SQLite query to answer to the question: What are the shipping ... | Your SQLite query to retrieve the shipping agent names is correct. Here it is wrapped in the appropriate code format:
```
SELECT shipping_agent_name FROM Ref_Shipping_Agents;
``` | 1,254 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Ref_Shipping_Agents (shipping_agent_name VARCHAR)\n\n Question: What are the shipping agent names?\n\nHere is the SQLite query to ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Ref_Shipping_Agents (shipping_agent_code VARCHAR, shipping_agent_name VARCHAR)
Question: What is the shipping agent code of shipping agent UPS?
Here is the SQLite query ... | Here is the SQLite query to answer the question regarding the shipping agent code of shipping agent UPS:
```
SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = "UPS"
``` | 1,255 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Ref_Shipping_Agents (shipping_agent_code VARCHAR, shipping_agent_name VARCHAR)\n\n Question: What is the shipping agent code of sh... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE ROLES (role_code VARCHAR)
Question: What are all role codes?
Here is the SQLite query to answer to the question: What are all role codes?:
```
SELECT role_code FROM ROLE... | Here is the SQLite query to answer the question "What are all role codes?":
```
SELECT role_code FROM ROLES;
``` | 1,256 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE ROLES (role_code VARCHAR)\n\n Question: What are all role codes?\n\nHere is the SQLite query to answer to the question: What are a... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR)
Question: What is the description of role code ED?
Here is the SQLite query to answer to the question: What is the de... | Your SQLite query to retrieve the description of the role code "ED" is correct. Below is the code wrapped as you requested:
```
SELECT role_description FROM ROLES WHERE role_code = "ED";
``` | 1,257 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR)\n\n Question: What is the description of role code ED?\n\nHere is the SQLite q... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Employees (Id VARCHAR)
Question: How many employees do we have?
Here is the SQLite query to answer to the question: How many employees do we have?:
```
SELECT COUNT(*) F... | Here is the SQLite query to answer the question: How many employees do we have?:
```
SELECT COUNT(*) FROM Employees;
``` | 1,258 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Employees (Id VARCHAR)\n\n Question: How many employees do we have?\n\nHere is the SQLite query to answer to the question: How man... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR); CREATE TABLE Employees (role_code VARCHAR, employee_name VARCHAR)
Question: What is the role of the employee named Ko... | Here is the SQLite query to answer the question: What is the role of the employee named Koby?:
```
SELECT T1.role_description
FROM ROLES AS T1
JOIN Employees AS T2 ON T1.role_code = T2.role_code
WHERE T2.employee_name = "Koby";
``` | 1,259 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR); CREATE TABLE Employees (role_code VARCHAR, employee_name VARCHAR)\n\n Questio... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Documents (document_id VARCHAR, receipt_date VARCHAR)
Question: List all document ids and receipt dates of documents.
Here is the SQLite query to answer to the question:... | Here is the SQLite query to list all document ids and receipt dates of documents:
```
SELECT document_id, receipt_date FROM Documents
``` | 1,260 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Documents (document_id VARCHAR, receipt_date VARCHAR)\n\n Question: List all document ids and receipt dates of documents.\n\nHere ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR); CREATE TABLE Employees (role_code VARCHAR)
Question: How many employees does each role have? List role description, i... | Your SQL query is close, but it needs a little adjustment to correctly reflect the required output. Specifically, you need to ensure that you are correctly selecting fields and that the `COUNT(*)` is correctly grouped based on the join between `ROLES` and `Employees`. Here is a corrected version of your query:
```sql
... | 1,261 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR); CREATE TABLE Employees (role_code VARCHAR)\n\n Question: How many employees d... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE ROLES (Id VARCHAR); CREATE TABLE Employees (Id VARCHAR)
Question: List roles that have more than one employee. List the role description and number of employees.
Here is... | Your SQLite query needs a few adjustments based on the provided schema. The schema you provided does not include any columns for `role_description` or `role_code`. I am assuming there is a common identifier that connects the `ROLES` and `Employees` tables, though that is not defined in the schema you provided. Let’s ad... | 1,262 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE ROLES (Id VARCHAR); CREATE TABLE Employees (Id VARCHAR)\n\n Question: List roles that have more than one employee. List the role d... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Document_Status (Id VARCHAR)
Question: What is the document status description of the document with id 1?
Here is the SQLite que... | It looks like your schema and SQL query have some discrepancies. Based on the provided schema, there are no explicit columns for `document_status_code` or `document_status_description` in the `Documents` or `Ref_Document_Status` tables.
Assuming that you intended to check for the existence of a relationship between do... | 1,263 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Document_Status (Id VARCHAR)\n\n Question: What is the document status description of the... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Documents (document_status_code VARCHAR)
Question: How many documents have the status code done?
Here is the SQLite query to answer to the question: How many documents h... | Your SQLite query is correct for counting the number of documents with the status code "done". Here it is wrapped in code format as you requested:
```
SELECT COUNT(*) FROM Documents WHERE document_status_code = "done";
``` | 1,264 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Documents (document_status_code VARCHAR)\n\n Question: How many documents have the status code done?\n\nHere is the SQLite query t... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Documents (document_type_code VARCHAR, document_id VARCHAR)
Question: List the document type code for the document with the id 2.
Here is the SQLite query to answer to t... | Here is the SQLite query to list the document type code for the document with the id 2:
```sql
SELECT document_type_code FROM Documents WHERE document_id = '2';
```
Note that I have enclosed the document_id in quotes, assuming that it is a string type, as indicated by the schema definition. | 1,265 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Documents (document_type_code VARCHAR, document_id VARCHAR)\n\n Question: List the document type code for the document with the id... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Documents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR)
Question: List the document ids for any documents with the status code done and ... | Here is the SQLite query to answer the question you provided:
```
SELECT document_id FROM Documents WHERE document_status_code = 'done' AND document_type_code = 'paper';
``` | 1,266 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Documents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR)\n\n Question: List the document ids for ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Shipping_Agents (Id VARCHAR)
Question: What is the name of the shipping agent of the document with id 2?
Here is the SQLite quer... | The provided SQLite query contains errors related to column names and relationships that don't seem to exist in the schema you shared. Since there are only two tables (`Documents` and `Ref_Shipping_Agents`), and you did not specify any relationships or additional columns beyond the `Id` in both tables, I will assume so... | 1,267 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Shipping_Agents (Id VARCHAR)\n\n Question: What is the name of the shipping agent of the ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Shipping_Agents (Id VARCHAR)
Question: How many documents were shipped by USPS?
Here is the SQLite query to answer to the questi... | The provided query has some issues regarding the column names and relationships in the tables based on the given schema. Since the schema defines only `Id` columns for both tables without any mention of `shipping_agent_code` or `shipping_agent_name`, we need to revise the query accordingly. Assuming you meant to check ... | 1,268 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Shipping_Agents (Id VARCHAR)\n\n Question: How many documents were shipped by USPS?\n\nHe... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Shipping_Agents (Id VARCHAR)
Question: Which shipping agent shipped the most documents? List the shipping agent name and the numb... | It seems there are some discrepancies in the original query you provided based on the specified schema. The schema only includes the `Documents` table and the `Ref_Shipping_Agents` table but lacks details about how they relate to each other or what columns they contain (specifically for shipping agent names and documen... | 1,269 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Shipping_Agents (Id VARCHAR)\n\n Question: Which shipping agent shipped the most document... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Documents (receipt_date VARCHAR, document_id VARCHAR)
Question: What is the receipt date of the document with id 3?
Here is the SQLite query to answer to the question: W... | Your SQLite query has a minor issue. The `document_id` in the WHERE clause should be quoted as it's a string type according to the schema. Here’s the corrected query:
```
SELECT receipt_date FROM Documents WHERE document_id = '3'
``` | 1,270 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Documents (receipt_date VARCHAR, document_id VARCHAR)\n\n Question: What is the receipt date of the document with id 3?\n\nHere is... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Addresses (document_id VARCHAR); CREATE TABLE Documents_Mailed (document_id VARCHAR)
Question: What address was the document with id 4 mailed to?
Here is the SQLite quer... | It looks like there are some discrepancies in the query given your schema for the tables. The schema you provided defines `Addresses` with a `document_id` column and `Documents_Mailed` with a `document_id` column, but there is no clear definition of an `address_details` or an `address_id`.
For the query to find out t... | 1,271 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Addresses (document_id VARCHAR); CREATE TABLE Documents_Mailed (document_id VARCHAR)\n\n Question: What address was the document w... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Documents_Mailed (mailing_date VARCHAR, document_id VARCHAR)
Question: What is the mail date of the document with id 7?
Here is the SQLite query to answer to the questio... | Your SQLite query is almost correct, but since `document_id` is defined as a `VARCHAR`, you should include quotes around the value `7`. Here’s the corrected query:
```
SELECT mailing_date FROM Documents_Mailed WHERE document_id = '7'
``` | 1,272 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Documents_Mailed (mailing_date VARCHAR, document_id VARCHAR)\n\n Question: What is the mail date of the document with id 7?\n\nHer... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Ref_Shipping_Agents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_status_code VARCHAR,... | Your query needs a small adjustment to correctly reference the relevant fields from both tables. Since your `Ref_Shipping_Agents` table does not directly reference the documents and the `Documents` table must contain the same IDs, we'll use the `document_id` for the join condition.
Here's the corrected SQLite query to... | 1,273 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Ref_Shipping_Agents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Ref_Shipping_Agents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_status_code VARCHAR,... | Here is the corrected SQLite query based on the provided schema and requirements:
```sql
SELECT d.document_id
FROM Documents d
JOIN Ref_Shipping_Agents r ON d.document_id = r.document_id
WHERE d.document_status_code = 'done'
AND d.document_type_code = 'Paper'
AND r.document_status_code = 'USPS';
```
Note that... | 1,274 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Ref_Shipping_Agents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Document_Drafts (draft_details VARCHAR, document_id VARCHAR)
Question: What is draft detail of the document with id 7?
Here is the SQLite query to answer to the question... | Your SQLite query is almost correct, but the value for `document_id` should be a string since the schema specifies it as `VARCHAR`. It should include quotes around the `7`. Here's the corrected version:
```
SELECT draft_details FROM Document_Drafts WHERE document_id = '7'
``` | 1,275 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Document_Drafts (draft_details VARCHAR, document_id VARCHAR)\n\n Question: What is draft detail of the document with id 7?\n\nHere... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Draft_Copies (document_id VARCHAR)
Question: How many draft copies does the document with id 2 have?
Here is the SQLite query to answer to the question: How many draft c... | The SQL query you provided is almost correct, but since `document_id` is defined as a VARCHAR in the schema, you should compare it as a string. Here is the corrected query wrapped in the proper format:
```
SELECT COUNT(*) FROM Draft_Copies WHERE document_id = '2'
``` | 1,276 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Draft_Copies (document_id VARCHAR)\n\n Question: How many draft copies does the document with id 2 have?\n\nHere is the SQLite que... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Draft_Copies (document_id VARCHAR, copy_number VARCHAR)
Question: Which document has the most draft copies? List its document id and number of draft copies.
Here is the ... | Your provided SQLite query is correctly structured to find the document with the most draft copies along with the count of those copies. Here it is wrapped as requested:
```
SELECT document_id, COUNT(copy_number) AS number_of_draft_copies
FROM Draft_Copies
GROUP BY document_id
ORDER BY number_of_draft_copies DESC
... | 1,277 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Draft_Copies (document_id VARCHAR, copy_number VARCHAR)\n\n Question: Which document has the most draft copies? List its document ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Draft_Copies (document_id VARCHAR)
Question: Which documents have more than 1 draft copies? List document id and number of draft copies.
Here is the SQLite query to answ... | Your SQLite query is correct. Here it is wrapped in code format:
```
SELECT document_id, COUNT(*)
FROM Draft_Copies
GROUP BY document_id
HAVING COUNT(*) > 1;
```
This query groups the records in the `Draft_Copies` table by `document_id`, counts the number of draft copies for each document, and then filters the re... | 1,278 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Draft_Copies (document_id VARCHAR)\n\n Question: Which documents have more than 1 draft copies? List document id and number of dra... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Circulation_History (Id VARCHAR); CREATE TABLE Employees (Id VARCHAR)
Question: List all employees in the circulation history of the document with id 1. List the employee... | It seems there are some inconsistencies in the provided database schema and the query you've written. The `Employees` table does not have an `employee_name` or `employee_id` column indicated in the schema you provided, nor does the `Circulation_History` table mention any columns related to documents or employees.
Base... | 1,279 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Circulation_History (Id VARCHAR); CREATE TABLE Employees (Id VARCHAR)\n\n Question: List all employees in the circulation history ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Circulation_History (employee_name VARCHAR); CREATE TABLE Employees (employee_name VARCHAR)
Question: List the employees who have not showed up in any circulation history... | The provided query aims to list employees who haven't appeared in the `Circulation_History` table. However, note that the `Circulation_History` table only contains the `employee_name` column according to the schema you've given. Therefore, we should directly query for employees whose names do not appear in `Circulation... | 1,280 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Circulation_History (employee_name VARCHAR); CREATE TABLE Employees (employee_name VARCHAR)\n\n Question: List the employees who h... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Circulation_History (Id VARCHAR); CREATE TABLE Employees (Id VARCHAR)
Question: Which employee has showed up in most circulation history documents. List the employee's na... | It looks like there are some issues with your query regarding the schema provided. The `Employees` table should have a column for the employee name, and the `Circulation_History` table needs clarification on how it relates to the employees.
Assuming that the `Circulation_History` table might need to include columns f... | 1,281 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Circulation_History (Id VARCHAR); CREATE TABLE Employees (Id VARCHAR)\n\n Question: Which employee has showed up in most circulati... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Circulation_History (document_id VARCHAR, employee_id VARCHAR)
Question: For each document, list the number of employees who have showed up in the circulation history of ... | Your SQLite query is correct and addresses the question well. It effectively counts the number of distinct employees for each document based on the `Circulation_History` table. Here’s the query wrapped in the requested format:
```
SELECT document_id, COUNT(DISTINCT employee_id)
FROM Circulation_History
GROUP BY docu... | 1,282 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Circulation_History (document_id VARCHAR, employee_id VARCHAR)\n\n Question: For each document, list the number of employees who h... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE department (dname VARCHAR, mgr_start_date VARCHAR)
Question: List all department names ordered by their starting date.
Here is the SQLite query to answer to the question... | Your SQLite query is correctly formulated to list all department names ordered by their starting date. Here it is wrapped in the requested format:
```
SELECT dname FROM department ORDER BY mgr_start_date;
``` | 1,283 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE department (dname VARCHAR, mgr_start_date VARCHAR)\n\n Question: List all department names ordered by their starting date.\n\nHere... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE dependent (Dependent_name VARCHAR, relationship VARCHAR)
Question: find all dependent names who have a spouse relation with some employee.
Here is the SQLite query to an... | Here is the SQLite query to find all dependent names who have a spouse relation with some employee:
```sql
SELECT Dependent_name FROM dependent WHERE relationship = 'Spouse';
``` | 1,284 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE dependent (Dependent_name VARCHAR, relationship VARCHAR)\n\n Question: find all dependent names who have a spouse relation with so... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE dependent (sex VARCHAR)
Question: how many female dependents are there?
Here is the SQLite query to answer to the question: how many female dependents are there?:
```
SE... | Your SQLite query to count the number of female dependents is correct. Here it is wrapped in the appropriate code formatting:
```
SELECT COUNT(*) FROM dependent WHERE sex = 'F';
``` | 1,285 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE dependent (sex VARCHAR)\n\n Question: how many female dependents are there?\n\nHere is the SQLite query to answer to the question:... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE dept_locations (dnumber VARCHAR, dlocation VARCHAR); CREATE TABLE department (dname VARCHAR, dnumber VARCHAR)
Question: Find the names of departments that are located in ... | Here's the SQLite query wrapped as you requested:
```
SELECT t1.dname
FROM department AS t1
JOIN dept_locations AS t2 ON t1.dnumber = t2.dnumber
WHERE t2.dlocation = 'Houston';
``` | 1,286 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE dept_locations (dnumber VARCHAR, dlocation VARCHAR); CREATE TABLE department (dname VARCHAR, dnumber VARCHAR)\n\n Question: Find t... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE employee (fname VARCHAR, lname VARCHAR, salary INTEGER)
Question: Return the first names and last names of employees who earn more than 30000 in salary.
Here is the SQLi... | The SQLite query you provided is correct for retrieving the first names and last names of employees who earn more than 30000 in salary. Here it is wrapped in the code block as you requested:
```
SELECT fname, lname FROM employee WHERE salary > 30000;
``` | 1,287 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE employee (fname VARCHAR, lname VARCHAR, salary INTEGER)\n\n Question: Return the first names and last names of employees who earn ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE employee (sex VARCHAR, salary INTEGER)
Question: Find the number of employees of each gender whose salary is lower than 50000.
Here is the SQLite query to answer to the ... | Your SQLite query is correct for the requirement specified. Here it is wrapped as requested:
```
SELECT COUNT(*), sex FROM employee WHERE salary < 50000 GROUP BY sex;
```
This query counts the number of employees for each gender (sex) whose salary is below 50,000, grouping the results by gender. | 1,288 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE employee (sex VARCHAR, salary INTEGER)\n\n Question: Find the number of employees of each gender whose salary is lower than 50000.... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE employee (fname VARCHAR, lname VARCHAR, address VARCHAR, Bdate VARCHAR)
Question: list the first and last names, and the addresses of all employees in the ascending order... | Here is the SQLite query that lists the first and last names, and the addresses of all employees in ascending order of their birth date:
```sql
SELECT fname, lname, address FROM employee ORDER BY Bdate ASC;
``` | 1,289 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE employee (fname VARCHAR, lname VARCHAR, address VARCHAR, Bdate VARCHAR)\n\n Question: list the first and last names, and the addre... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE EVENTS (event_details VARCHAR, Service_ID VARCHAR); CREATE TABLE Services (Service_ID VARCHAR, Service_Type_Code VARCHAR)
Question: what are the event details of the serv... | Here is the SQLite query to answer the question regarding the event details of the services that have the type code 'Marriage':
```
SELECT T1.event_details
FROM EVENTS AS T1
JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID
WHERE T2.Service_Type_Code = 'Marriage'
``` | 1,290 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE EVENTS (event_details VARCHAR, Service_ID VARCHAR); CREATE TABLE Services (Service_ID VARCHAR, Service_Type_Code VARCHAR)\n\n Ques... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE EVENTS (event_id VARCHAR, event_details VARCHAR, Event_ID VARCHAR); CREATE TABLE Participants_in_Events (Event_ID VARCHAR)
Question: What are the ids and details of event... | Your query looks mostly correct, but there are some minor inconsistencies in the schema definitions, such as the use of `event_id` and `Event_ID`. Assuming you meant to use consistent naming (likely `event_id` or `Event_ID` consistently throughout), your query should work correctly if the schema is adjusted accordingly... | 1,291 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE EVENTS (event_id VARCHAR, event_details VARCHAR, Event_ID VARCHAR); CREATE TABLE Participants_in_Events (Event_ID VARCHAR)\n\n Que... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Participants (Participant_ID VARCHAR, Participant_Type_Code VARCHAR); CREATE TABLE Participants_in_Events (Participant_ID VARCHAR)
Question: How many events have each par... | Your SQLite query is mostly correct, but it is important to explicitly state how to handle cases where a participant has not attended any events. The `COUNT(*)` function will return 0 for participants who have no events to count only if we perform a LEFT JOIN instead of an INNER JOIN.
Here is the revised query to ens... | 1,292 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Participants (Participant_ID VARCHAR, Participant_Type_Code VARCHAR); CREATE TABLE Participants_in_Events (Participant_ID VARCHAR)\n\... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Participants (Participant_ID VARCHAR, Participant_Type_Code VARCHAR, Participant_Details VARCHAR)
Question: What are all the the participant ids, type code and details?
... | Here is the SQLite query to retrieve all the participant IDs, type codes, and details from the Participants table:
```sql
SELECT Participant_ID, Participant_Type_Code, Participant_Details FROM Participants;
``` | 1,293 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Participants (Participant_ID VARCHAR, Participant_Type_Code VARCHAR, Participant_Details VARCHAR)\n\n Question: What are all the t... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE participants (participant_type_code VARCHAR)
Question: How many participants belong to the type 'Organizer'?
Here is the SQLite query to answer to the question: How many... | Here is the SQLite query to answer the question regarding how many participants belong to the type 'Organizer':
```
SELECT COUNT(*) FROM participants WHERE participant_type_code = 'Organizer'
``` | 1,294 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE participants (participant_type_code VARCHAR)\n\n Question: How many participants belong to the type 'Organizer'?\n\nHere is the SQ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE services (service_type_code VARCHAR)
Question: List the type of the services in alphabetical order.
Here is the SQLite query to answer to the question: List the type of ... | Here is the SQLite query to list the type of the services in alphabetical order:
```
SELECT service_type_code FROM services ORDER BY service_type_code
``` | 1,295 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE services (service_type_code VARCHAR)\n\n Question: List the type of the services in alphabetical order.\n\nHere is the SQLite quer... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE EVENTS (service_id VARCHAR, event_details VARCHAR)
Question: List the service id and details for the events.
Here is the SQLite query to answer to the question: List the... | Your query is correctly written to list the service id and details for the events. Here it is wrapped in code format:
```
SELECT service_id, event_details FROM EVENTS;
``` | 1,296 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE EVENTS (service_id VARCHAR, event_details VARCHAR)\n\n Question: List the service id and details for the events.\n\nHere is the SQ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE participants (Participant_ID VARCHAR, participant_details VARCHAR); CREATE TABLE Participants_in_Events (Participant_ID VARCHAR)
Question: How many events had participant... | Here is the SQLite query to answer the question regarding how many events had participants whose details had the substring 'Dr.':
```
SELECT COUNT(DISTINCT T2.Participant_ID)
FROM participants AS T1
JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID
WHERE T1.participant_details LIKE '%Dr.%';
... | 1,297 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE participants (Participant_ID VARCHAR, participant_details VARCHAR); CREATE TABLE Participants_in_Events (Participant_ID VARCHAR)\n\n ... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE participants (participant_type_code VARCHAR)
Question: What is the most common participant type?
Here is the SQLite query to answer to the question: What is the most com... | Your SQLite query to find the most common participant type looks correct. Here's the query wrapped as you requested:
```
SELECT participant_type_code FROM participants GROUP BY participant_type_code ORDER BY COUNT(*) DESC LIMIT 1
```
This query groups the records by `participant_type_code`, counts the occurrences of... | 1,298 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE participants (participant_type_code VARCHAR)\n\n Question: What is the most common participant type?\n\nHere is the SQLite query t... | |
Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:
Schema: CREATE TABLE Participants_in_Events (Participant_ID VARCHAR, Event_ID VARCHAR); CREATE TABLE services (Service_Type_Code VARCHAR, service_id VARCHAR); CREATE TABLE EVENTS (service_id VARCH... | Here is the SQLite query to answer the question: Which service id and type has the least number of participants?:
```
SELECT T3.service_id, T4.Service_Type_Code
FROM participants AS T1
JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID
JOIN EVENTS AS T3 ON T2.Event_ID = T3.Event_ID
JOIN ser... | 1,299 | [
{
"from": "human",
"value": " Write SQLite query to answer the following question given the database schema. Please wrap your code answer using ```:\n Schema: CREATE TABLE Participants_in_Events (Participant_ID VARCHAR, Event_ID VARCHAR); CREATE TABLE services (Service_Type_Code VARCHAR, service_id VARCH... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.