instruction
stringlengths
12
244
input
stringlengths
27
489
output
stringlengths
18
557
text
stringlengths
194
1.14k
What are the carriers of devices whose software platforms are not "Android"?
CREATE TABLE device (Carrier VARCHAR, Software_Platform VARCHAR)
SELECT Carrier FROM device WHERE Software_Platform <> 'Android'
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE device (Carrier VARCHAR, Software_Platform VARCHAR) Question: What are the carriers of devices whose software platforms are not "Android"? [/INST] SELECT Carrier FROM device WHERE Software_Platform <> 'Android' </s>
What are the names of shops in ascending order of open year?
CREATE TABLE shop (Shop_Name VARCHAR, Open_Year VARCHAR)
SELECT Shop_Name FROM shop ORDER BY Open_Year
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE shop (Shop_Name VARCHAR, Open_Year VARCHAR) Question: What are the names of shops in ascending order of open year? [/INST] SELECT Shop_Name FROM shop ORDER BY Open_Year </s>
What is the average quantity of stocks?
CREATE TABLE stock (Quantity INTEGER)
SELECT AVG(Quantity) FROM stock
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE stock (Quantity INTEGER) Question: What is the average quantity of stocks? [/INST] SELECT AVG(Quantity) FROM stock </s>
What are the names and location of the shops in ascending alphabetical order of name.
CREATE TABLE shop (Shop_Name VARCHAR, LOCATION VARCHAR)
SELECT Shop_Name, LOCATION FROM shop ORDER BY Shop_Name
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE shop (Shop_Name VARCHAR, LOCATION VARCHAR) Question: What are the names and location of the shops in ascending alphabetical order of name. [/INST] SELECT Shop_Name, LOCATION FROM shop ORDER BY Shop_Name </s>
How many different software platforms are there for devices?
CREATE TABLE device (Software_Platform VARCHAR)
SELECT COUNT(DISTINCT Software_Platform) FROM device
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE device (Software_Platform VARCHAR) Question: How many different software platforms are there for devices? [/INST] SELECT COUNT(DISTINCT Software_Platform) FROM device </s>
List the open date of open year of the shop named "Apple".
CREATE TABLE shop (Open_Date VARCHAR, Open_Year VARCHAR, Shop_Name VARCHAR)
SELECT Open_Date, Open_Year FROM shop WHERE Shop_Name = "Apple"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE shop (Open_Date VARCHAR, Open_Year VARCHAR, Shop_Name VARCHAR) Question: List the open date of open year of the shop named "Apple". [/INST] SELECT Open_Date, Open_Year FROM shop WHERE Shop_Name = "Apple" </s>
List the name of the shop with the latest open year.
CREATE TABLE shop (Shop_Name VARCHAR, Open_Year VARCHAR)
SELECT TOP 1 Shop_Name FROM shop ORDER BY Open_Year DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE shop (Shop_Name VARCHAR, Open_Year VARCHAR) Question: List the name of the shop with the latest open year. [/INST] SELECT TOP 1 Shop_Name FROM shop ORDER BY Open_Year DESC </s>
Show names of shops and the carriers of devices they have in stock.
CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR); CREATE TABLE stock (Device_ID VARCHAR, Shop_ID VARCHAR); CREATE TABLE device (Carrier VARCHAR, Device_ID VARCHAR)
SELECT T3.Shop_Name, T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR); CREATE TABLE stock (Device_ID VARCHAR, Shop_ID VARCHAR); CREATE TABLE device (Carrier VARCHAR, Device_ID VARCHAR) Question: Show names of shops and the carriers of devices they have in stock. [/INST] SELECT T3.Shop_Name, T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID </s>
Show names of shops that have more than one kind of device in stock.
CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR); CREATE TABLE stock (Shop_ID VARCHAR)
SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID HAVING COUNT(*) > 1
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR); CREATE TABLE stock (Shop_ID VARCHAR) Question: Show names of shops that have more than one kind of device in stock. [/INST] SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID HAVING COUNT(*) > 1 </s>
Show the name of the shop that has the most kind of devices in stock.
CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR); CREATE TABLE stock (Shop_ID VARCHAR)
SELECT TOP 1 T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR); CREATE TABLE stock (Shop_ID VARCHAR) Question: Show the name of the shop that has the most kind of devices in stock. [/INST] SELECT TOP 1 T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY COUNT(*) DESC </s>
Show the name of the shop that have the largest quantity of devices in stock.
CREATE TABLE stock (Shop_ID VARCHAR, quantity INTEGER); CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR)
SELECT TOP 1 T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE stock (Shop_ID VARCHAR, quantity INTEGER); CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR) Question: Show the name of the shop that have the largest quantity of devices in stock. [/INST] SELECT TOP 1 T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) DESC </s>
Please show different software platforms and the corresponding number of devices using each.
CREATE TABLE device (Software_Platform VARCHAR)
SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE device (Software_Platform VARCHAR) Question: Please show different software platforms and the corresponding number of devices using each. [/INST] SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform </s>
Please show the software platforms of devices in descending order of the count.
CREATE TABLE device (Software_Platform VARCHAR)
SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE device (Software_Platform VARCHAR) Question: Please show the software platforms of devices in descending order of the count. [/INST] SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC </s>
List the software platform shared by the greatest number of devices.
CREATE TABLE device (Software_Platform VARCHAR)
SELECT TOP 1 Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE device (Software_Platform VARCHAR) Question: List the software platform shared by the greatest number of devices. [/INST] SELECT TOP 1 Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC </s>
List the names of shops that have no devices in stock.
CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR); CREATE TABLE stock (Shop_Name VARCHAR, Shop_ID VARCHAR)
SELECT Shop_Name FROM shop WHERE NOT Shop_ID IN (SELECT Shop_ID FROM stock)
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE shop (Shop_Name VARCHAR, Shop_ID VARCHAR); CREATE TABLE stock (Shop_Name VARCHAR, Shop_ID VARCHAR) Question: List the names of shops that have no devices in stock. [/INST] SELECT Shop_Name FROM shop WHERE NOT Shop_ID IN (SELECT Shop_ID FROM stock) </s>
Show the locations shared by shops with open year later than 2012 and shops with open year before 2008.
CREATE TABLE shop (LOCATION VARCHAR, Open_Year INTEGER)
SELECT LOCATION FROM shop WHERE Open_Year > 2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year < 2008
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE shop (LOCATION VARCHAR, Open_Year INTEGER) Question: Show the locations shared by shops with open year later than 2012 and shops with open year before 2008. [/INST] SELECT LOCATION FROM shop WHERE Open_Year > 2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year < 2008 </s>
List the carriers of devices that have no devices in stock.
CREATE TABLE stock (Carrier VARCHAR, Device_ID VARCHAR); CREATE TABLE device (Carrier VARCHAR, Device_ID VARCHAR)
SELECT Carrier FROM device WHERE NOT Device_ID IN (SELECT Device_ID FROM stock)
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE stock (Carrier VARCHAR, Device_ID VARCHAR); CREATE TABLE device (Carrier VARCHAR, Device_ID VARCHAR) Question: List the carriers of devices that have no devices in stock. [/INST] SELECT Carrier FROM device WHERE NOT Device_ID IN (SELECT Device_ID FROM stock) </s>
Show the carriers of devices in stock at more than one shop.
CREATE TABLE stock (Device_ID VARCHAR); CREATE TABLE device (Carrier VARCHAR, Device_ID VARCHAR)
SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*) > 1
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE stock (Device_ID VARCHAR); CREATE TABLE device (Carrier VARCHAR, Device_ID VARCHAR) Question: Show the carriers of devices in stock at more than one shop. [/INST] SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*) > 1 </s>
How many bookings do we have?
CREATE TABLE BOOKINGS (Id VARCHAR)
SELECT COUNT(*) FROM BOOKINGS
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE BOOKINGS (Id VARCHAR) Question: How many bookings do we have? [/INST] SELECT COUNT(*) FROM BOOKINGS </s>
List the order dates of all the bookings.
CREATE TABLE BOOKINGS (Order_Date VARCHAR)
SELECT Order_Date FROM BOOKINGS
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE BOOKINGS (Order_Date VARCHAR) Question: List the order dates of all the bookings. [/INST] SELECT Order_Date FROM BOOKINGS </s>
Show all the planned delivery dates and actual delivery dates of bookings.
CREATE TABLE BOOKINGS (Planned_Delivery_Date VARCHAR, Actual_Delivery_Date VARCHAR)
SELECT Planned_Delivery_Date, Actual_Delivery_Date FROM BOOKINGS
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE BOOKINGS (Planned_Delivery_Date VARCHAR, Actual_Delivery_Date VARCHAR) Question: Show all the planned delivery dates and actual delivery dates of bookings. [/INST] SELECT Planned_Delivery_Date, Actual_Delivery_Date FROM BOOKINGS </s>
How many customers do we have?
CREATE TABLE CUSTOMERS (Id VARCHAR)
SELECT COUNT(*) FROM CUSTOMERS
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE CUSTOMERS (Id VARCHAR) Question: How many customers do we have? [/INST] SELECT COUNT(*) FROM CUSTOMERS </s>
What are the phone and email for customer Harold?
CREATE TABLE CUSTOMERS (Customer_Phone VARCHAR, Customer_Email_Address VARCHAR, Customer_Name VARCHAR)
SELECT Customer_Phone, Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name = "Harold"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE CUSTOMERS (Customer_Phone VARCHAR, Customer_Email_Address VARCHAR, Customer_Name VARCHAR) Question: What are the phone and email for customer Harold? [/INST] SELECT Customer_Phone, Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name = "Harold" </s>
Show all the Store_Name of drama workshop groups.
CREATE TABLE Drama_Workshop_Groups (Store_Name VARCHAR)
SELECT Store_Name FROM Drama_Workshop_Groups
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Drama_Workshop_Groups (Store_Name VARCHAR) Question: Show all the Store_Name of drama workshop groups. [/INST] SELECT Store_Name FROM Drama_Workshop_Groups </s>
Show the minimum, average, maximum order quantity of all invoices.
CREATE TABLE INVOICES (Order_Quantity INTEGER)
SELECT MIN(Order_Quantity), AVG(Order_Quantity), MAX(Order_Quantity) FROM INVOICES
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE INVOICES (Order_Quantity INTEGER) Question: Show the minimum, average, maximum order quantity of all invoices. [/INST] SELECT MIN(Order_Quantity), AVG(Order_Quantity), MAX(Order_Quantity) FROM INVOICES </s>
What are the distinct payment method codes in all the invoices?
CREATE TABLE INVOICES (payment_method_code VARCHAR)
SELECT DISTINCT payment_method_code FROM INVOICES
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE INVOICES (payment_method_code VARCHAR) Question: What are the distinct payment method codes in all the invoices? [/INST] SELECT DISTINCT payment_method_code FROM INVOICES </s>
What is the description of the marketing region China?
CREATE TABLE Marketing_Regions (Marketing_Region_Descriptrion VARCHAR, Marketing_Region_Name VARCHAR)
SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name = "China"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Marketing_Regions (Marketing_Region_Descriptrion VARCHAR, Marketing_Region_Name VARCHAR) Question: What is the description of the marketing region China? [/INST] SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name = "China" </s>
Show all the distinct product names with price higher than the average.
CREATE TABLE PRODUCTS (Product_Name VARCHAR, Product_Price INTEGER)
SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price > (SELECT AVG(Product_Price) FROM PRODUCTS)
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE PRODUCTS (Product_Name VARCHAR, Product_Price INTEGER) Question: Show all the distinct product names with price higher than the average. [/INST] SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price > (SELECT AVG(Product_Price) FROM PRODUCTS) </s>
What is the name of the most expensive product?
CREATE TABLE PRODUCTS (Product_Name VARCHAR, Product_Price VARCHAR)
SELECT TOP 1 Product_Name FROM PRODUCTS ORDER BY Product_Price DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE PRODUCTS (Product_Name VARCHAR, Product_Price VARCHAR) Question: What is the name of the most expensive product? [/INST] SELECT TOP 1 Product_Name FROM PRODUCTS ORDER BY Product_Price DESC </s>
What is the phone number of the performer Ashley?
CREATE TABLE PERFORMERS (Customer_Phone VARCHAR, Customer_Name VARCHAR)
SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name = "Ashley"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE PERFORMERS (Customer_Phone VARCHAR, Customer_Name VARCHAR) Question: What is the phone number of the performer Ashley? [/INST] SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name = "Ashley" </s>
Show all payment method codes and the number of orders for each code.
CREATE TABLE INVOICES (payment_method_code VARCHAR)
SELECT payment_method_code, COUNT(*) FROM INVOICES GROUP BY payment_method_code
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE INVOICES (payment_method_code VARCHAR) Question: Show all payment method codes and the number of orders for each code. [/INST] SELECT payment_method_code, COUNT(*) FROM INVOICES GROUP BY payment_method_code </s>
What is the payment method code used by the most orders?
CREATE TABLE INVOICES (payment_method_code VARCHAR)
SELECT TOP 1 payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE INVOICES (payment_method_code VARCHAR) Question: What is the payment method code used by the most orders? [/INST] SELECT TOP 1 payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY COUNT(*) DESC </s>
Which city is the address of the store named "FJA Filming" located in?
CREATE TABLE Addresses (City_Town VARCHAR, Address_ID VARCHAR); CREATE TABLE Stores (Address_ID VARCHAR, Store_Name VARCHAR)
SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Store_Name = "FJA Filming"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Addresses (City_Town VARCHAR, Address_ID VARCHAR); CREATE TABLE Stores (Address_ID VARCHAR, Store_Name VARCHAR) Question: Which city is the address of the store named "FJA Filming" located in? [/INST] SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Store_Name = "FJA Filming" </s>
What are the states or counties of the address of the stores with marketing region code "CA"?
CREATE TABLE Addresses (State_County VARCHAR, Address_ID VARCHAR); CREATE TABLE Stores (Address_ID VARCHAR, Marketing_Region_Code VARCHAR)
SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Marketing_Region_Code = "CA"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Addresses (State_County VARCHAR, Address_ID VARCHAR); CREATE TABLE Stores (Address_ID VARCHAR, Marketing_Region_Code VARCHAR) Question: What are the states or counties of the address of the stores with marketing region code "CA"? [/INST] SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Marketing_Region_Code = "CA" </s>
What is the name of the marketing region that the store Rob Dinning belongs to?
CREATE TABLE Marketing_Regions (Marketing_Region_Name VARCHAR, Marketing_Region_Code VARCHAR); CREATE TABLE Stores (Marketing_Region_Code VARCHAR, Store_Name VARCHAR)
SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = "Rob Dinning"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Marketing_Regions (Marketing_Region_Name VARCHAR, Marketing_Region_Code VARCHAR); CREATE TABLE Stores (Marketing_Region_Code VARCHAR, Store_Name VARCHAR) Question: What is the name of the marketing region that the store Rob Dinning belongs to? [/INST] SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = "Rob Dinning" </s>
What are the descriptions of the service types with product price above 100?
CREATE TABLE Services (Service_Type_Code VARCHAR, Product_Price INTEGER); CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR)
SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Services (Service_Type_Code VARCHAR, Product_Price INTEGER); CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR) Question: What are the descriptions of the service types with product price above 100? [/INST] SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 </s>
What is the description, code and the corresponding count of each service type?
CREATE TABLE Services (Service_Type_Code VARCHAR); CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR)
SELECT T1.Service_Type_Description, T2.Service_Type_Code, COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T2.Service_Type_Code
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Services (Service_Type_Code VARCHAR); CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR) Question: What is the description, code and the corresponding count of each service type? [/INST] SELECT T1.Service_Type_Description, T2.Service_Type_Code, COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T2.Service_Type_Code </s>
What is the description and code of the type of service that is performed the most often?
CREATE TABLE Services (Service_Type_Code VARCHAR); CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR)
SELECT TOP 1 T1.Service_Type_Description, T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Services (Service_Type_Code VARCHAR); CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR) Question: What is the description and code of the type of service that is performed the most often? [/INST] SELECT TOP 1 T1.Service_Type_Description, T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC </s>
What are the phones and emails of workshop groups in which services are performed?
CREATE TABLE Services (Workshop_Group_ID VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Phone VARCHAR, Store_Email_Address VARCHAR, Workshop_Group_ID VARCHAR)
SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Services (Workshop_Group_ID VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Phone VARCHAR, Store_Email_Address VARCHAR, Workshop_Group_ID VARCHAR) Question: What are the phones and emails of workshop groups in which services are performed? [/INST] SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID </s>
What are the names of workshop groups in which services with product name "film" are performed?
CREATE TABLE Services (Workshop_Group_ID VARCHAR, Product_Name VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Phone VARCHAR, Store_Email_Address VARCHAR, Workshop_Group_ID VARCHAR)
SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T2.Product_Name = "film"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Services (Workshop_Group_ID VARCHAR, Product_Name VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Phone VARCHAR, Store_Email_Address VARCHAR, Workshop_Group_ID VARCHAR) Question: What are the names of workshop groups in which services with product name "film" are performed? [/INST] SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T2.Product_Name = "film" </s>
What are the different product names? What is the average product price for each of them?
CREATE TABLE PRODUCTS (Product_Name VARCHAR, Product_Price INTEGER)
SELECT Product_Name, AVG(Product_Price) FROM PRODUCTS GROUP BY Product_Name
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE PRODUCTS (Product_Name VARCHAR, Product_Price INTEGER) Question: What are the different product names? What is the average product price for each of them? [/INST] SELECT Product_Name, AVG(Product_Price) FROM PRODUCTS GROUP BY Product_Name </s>
What are the product names with average product price smaller than 1000000?
CREATE TABLE PRODUCTS (Product_Name VARCHAR, Product_Price INTEGER)
SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING AVG(Product_Price) < 1000000
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE PRODUCTS (Product_Name VARCHAR, Product_Price INTEGER) Question: What are the product names with average product price smaller than 1000000? [/INST] SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING AVG(Product_Price) < 1000000 </s>
What are the total order quantities of photo products?
CREATE TABLE ORDER_ITEMS (Order_Quantity INTEGER, Product_ID VARCHAR); CREATE TABLE Products (Product_ID VARCHAR, Product_Name VARCHAR)
SELECT SUM(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_Name = "photo"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE ORDER_ITEMS (Order_Quantity INTEGER, Product_ID VARCHAR); CREATE TABLE Products (Product_ID VARCHAR, Product_Name VARCHAR) Question: What are the total order quantities of photo products? [/INST] SELECT SUM(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_Name = "photo" </s>
What are the order details of the products with price higher than 2000?
CREATE TABLE Products (Product_ID VARCHAR, Product_price INTEGER); CREATE TABLE ORDER_ITEMS (Other_Item_Details VARCHAR, Product_ID VARCHAR)
SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_price > 2000
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Products (Product_ID VARCHAR, Product_price INTEGER); CREATE TABLE ORDER_ITEMS (Other_Item_Details VARCHAR, Product_ID VARCHAR) Question: What are the order details of the products with price higher than 2000? [/INST] SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_price > 2000 </s>
What are the actual delivery dates of orders with quantity 1?
CREATE TABLE Customer_Orders (Actual_Delivery_Date VARCHAR, Order_ID VARCHAR); CREATE TABLE ORDER_ITEMS (Order_ID VARCHAR, Order_Quantity VARCHAR)
SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Customer_Orders (Actual_Delivery_Date VARCHAR, Order_ID VARCHAR); CREATE TABLE ORDER_ITEMS (Order_ID VARCHAR, Order_Quantity VARCHAR) Question: What are the actual delivery dates of orders with quantity 1? [/INST] SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1 </s>
What are the order dates of orders with price higher than 1000?
CREATE TABLE Products (Product_ID VARCHAR, Product_price INTEGER); CREATE TABLE ORDER_ITEMS (Order_ID VARCHAR, Product_ID VARCHAR); CREATE TABLE Customer_Orders (Order_Date VARCHAR, Order_ID VARCHAR)
SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_price > 1000
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Products (Product_ID VARCHAR, Product_price INTEGER); CREATE TABLE ORDER_ITEMS (Order_ID VARCHAR, Product_ID VARCHAR); CREATE TABLE Customer_Orders (Order_Date VARCHAR, Order_ID VARCHAR) Question: What are the order dates of orders with price higher than 1000? [/INST] SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_price > 1000 </s>
How many distinct currency codes are there for all drama workshop groups?
CREATE TABLE Drama_Workshop_Groups (Currency_Code VARCHAR)
SELECT COUNT(DISTINCT Currency_Code) FROM Drama_Workshop_Groups
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Drama_Workshop_Groups (Currency_Code VARCHAR) Question: How many distinct currency codes are there for all drama workshop groups? [/INST] SELECT COUNT(DISTINCT Currency_Code) FROM Drama_Workshop_Groups </s>
What are the names of the drama workshop groups with address in Feliciaberg city?
CREATE TABLE Addresses (Address_ID VARCHAR, City_Town VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Name VARCHAR, Address_ID VARCHAR)
SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = "Feliciaberg"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Addresses (Address_ID VARCHAR, City_Town VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Name VARCHAR, Address_ID VARCHAR) Question: What are the names of the drama workshop groups with address in Feliciaberg city? [/INST] SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = "Feliciaberg" </s>
What are the email addresses of the drama workshop groups with address in Alaska state?
CREATE TABLE Drama_Workshop_Groups (Store_Email_Address VARCHAR, Address_ID VARCHAR); CREATE TABLE Addresses (Address_ID VARCHAR, State_County VARCHAR)
SELECT T2.Store_Email_Address FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.State_County = "Alaska"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Drama_Workshop_Groups (Store_Email_Address VARCHAR, Address_ID VARCHAR); CREATE TABLE Addresses (Address_ID VARCHAR, State_County VARCHAR) Question: What are the email addresses of the drama workshop groups with address in Alaska state? [/INST] SELECT T2.Store_Email_Address FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.State_County = "Alaska" </s>
Show all cities along with the number of drama workshop groups in each city.
CREATE TABLE Addresses (City_Town VARCHAR, Address_ID VARCHAR); CREATE TABLE Drama_Workshop_Groups (Address_ID VARCHAR)
SELECT T1.City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Addresses (City_Town VARCHAR, Address_ID VARCHAR); CREATE TABLE Drama_Workshop_Groups (Address_ID VARCHAR) Question: Show all cities along with the number of drama workshop groups in each city. [/INST] SELECT T1.City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town </s>
What is the marketing region code that has the most drama workshop groups?
CREATE TABLE Drama_Workshop_Groups (Marketing_Region_Code VARCHAR)
SELECT TOP 1 Marketing_Region_Code FROM Drama_Workshop_Groups GROUP BY Marketing_Region_Code ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Drama_Workshop_Groups (Marketing_Region_Code VARCHAR) Question: What is the marketing region code that has the most drama workshop groups? [/INST] SELECT TOP 1 Marketing_Region_Code FROM Drama_Workshop_Groups GROUP BY Marketing_Region_Code ORDER BY COUNT(*) DESC </s>
Show all cities where at least one customer lives in but no performer lives in.
CREATE TABLE Customers (Address_ID VARCHAR); CREATE TABLE Addresses (City_Town VARCHAR, Address_ID VARCHAR); CREATE TABLE Performers (Address_ID VARCHAR)
SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = T2.Address_ID EXCEPT SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Customers (Address_ID VARCHAR); CREATE TABLE Addresses (City_Town VARCHAR, Address_ID VARCHAR); CREATE TABLE Performers (Address_ID VARCHAR) Question: Show all cities where at least one customer lives in but no performer lives in. [/INST] SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = T2.Address_ID EXCEPT SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID </s>
What is the most frequent status of bookings?
CREATE TABLE BOOKINGS (Status_Code VARCHAR)
SELECT TOP 1 Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE BOOKINGS (Status_Code VARCHAR) Question: What is the most frequent status of bookings? [/INST] SELECT TOP 1 Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY COUNT(*) DESC </s>
What are the names of the workshop groups that have bookings with status code "stop"?
CREATE TABLE Bookings (Workshop_Group_ID VARCHAR, Status_Code VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Name VARCHAR, Workshop_Group_ID VARCHAR)
SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Bookings (Workshop_Group_ID VARCHAR, Status_Code VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Name VARCHAR, Workshop_Group_ID VARCHAR) Question: What are the names of the workshop groups that have bookings with status code "stop"? [/INST] SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" </s>
Show the names of all the clients with no booking.
CREATE TABLE Clients (Customer_Name VARCHAR, Client_ID VARCHAR); CREATE TABLE Bookings (Customer_ID VARCHAR); CREATE TABLE Clients (Customer_Name VARCHAR)
SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Clients (Customer_Name VARCHAR, Client_ID VARCHAR); CREATE TABLE Bookings (Customer_ID VARCHAR); CREATE TABLE Clients (Customer_Name VARCHAR) Question: Show the names of all the clients with no booking. [/INST] SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID </s>
What is the average quantities ordered with payment method code "MasterCard" on invoices?
CREATE TABLE Invoices (Order_Quantity INTEGER, payment_method_code VARCHAR)
SELECT AVG(Order_Quantity) FROM Invoices WHERE payment_method_code = "MasterCard"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Invoices (Order_Quantity INTEGER, payment_method_code VARCHAR) Question: What is the average quantities ordered with payment method code "MasterCard" on invoices? [/INST] SELECT AVG(Order_Quantity) FROM Invoices WHERE payment_method_code = "MasterCard" </s>
What is the product ID of the most frequently ordered item on invoices?
CREATE TABLE INVOICES (Product_ID VARCHAR)
SELECT TOP 1 Product_ID FROM INVOICES GROUP BY Product_ID ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE INVOICES (Product_ID VARCHAR) Question: What is the product ID of the most frequently ordered item on invoices? [/INST] SELECT TOP 1 Product_ID FROM INVOICES GROUP BY Product_ID ORDER BY COUNT(*) DESC </s>
What is the description of the service type which offers both the photo product and the film product?
CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR); CREATE TABLE Services (Service_Type_Code VARCHAR, Product_Name VARCHAR)
SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'photo' INTERSECT SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'film'
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR); CREATE TABLE Services (Service_Type_Code VARCHAR, Product_Name VARCHAR) Question: What is the description of the service type which offers both the photo product and the film product? [/INST] SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'photo' INTERSECT SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'film' </s>
How many bands are there?
CREATE TABLE Band (Id VARCHAR)
SELECT COUNT(*) FROM Band
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Band (Id VARCHAR) Question: How many bands are there? [/INST] SELECT COUNT(*) FROM Band </s>
What are all the labels?
CREATE TABLE Albums (label VARCHAR)
SELECT DISTINCT label FROM Albums
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Albums (label VARCHAR) Question: What are all the labels? [/INST] SELECT DISTINCT label FROM Albums </s>
Find all the albums in 2012.
CREATE TABLE Albums (YEAR VARCHAR)
SELECT * FROM Albums WHERE YEAR = 2012
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Albums (YEAR VARCHAR) Question: Find all the albums in 2012. [/INST] SELECT * FROM Albums WHERE YEAR = 2012 </s>
Find all the stage positions of the musicians with first name "Solveig"
CREATE TABLE Band (id VARCHAR); CREATE TABLE Performance (stageposition VARCHAR, bandmate VARCHAR)
SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE Firstname = "Solveig"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Band (id VARCHAR); CREATE TABLE Performance (stageposition VARCHAR, bandmate VARCHAR) Question: Find all the stage positions of the musicians with first name "Solveig" [/INST] SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE Firstname = "Solveig" </s>
How many songs are there?
CREATE TABLE Songs (Id VARCHAR)
SELECT COUNT(*) FROM Songs
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Songs (Id VARCHAR) Question: How many songs are there? [/INST] SELECT COUNT(*) FROM Songs </s>
Find all the songs performed by artist with last name "Heilo"
CREATE TABLE Songs (Title VARCHAR, SongId VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Band (id VARCHAR, Lastname VARCHAR)
SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.Lastname = "Heilo"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Songs (Title VARCHAR, SongId VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Band (id VARCHAR, Lastname VARCHAR) Question: Find all the songs performed by artist with last name "Heilo" [/INST] SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.Lastname = "Heilo" </s>
Hom many musicians performed in the song "Flash"?
CREATE TABLE performance (bandmate VARCHAR, songid VARCHAR); CREATE TABLE songs (songid VARCHAR, Title VARCHAR); CREATE TABLE band (id VARCHAR)
SELECT COUNT(*) FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T3.Title = "Flash"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE performance (bandmate VARCHAR, songid VARCHAR); CREATE TABLE songs (songid VARCHAR, Title VARCHAR); CREATE TABLE band (id VARCHAR) Question: Hom many musicians performed in the song "Flash"? [/INST] SELECT COUNT(*) FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T3.Title = "Flash" </s>
Find all the songs produced by artists with first name "Marianne".
CREATE TABLE Songs (Title VARCHAR, SongId VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Band (id VARCHAR, firstname VARCHAR)
SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.firstname = "Marianne"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Songs (Title VARCHAR, SongId VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Band (id VARCHAR, firstname VARCHAR) Question: Find all the songs produced by artists with first name "Marianne". [/INST] SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.firstname = "Marianne" </s>
Who performed the song named "Badlands"? Show the first name and the last name.
CREATE TABLE Band (firstname VARCHAR, lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Songs (SongId VARCHAR, Title VARCHAR)
SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Band (firstname VARCHAR, lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Songs (SongId VARCHAR, Title VARCHAR) Question: Who performed the song named "Badlands"? Show the first name and the last name. [/INST] SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands" </s>
Who is performing in the back stage position for the song "Badlands"? Show the first name and the last name.
CREATE TABLE Band (firstname VARCHAR, lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR, StagePosition VARCHAR); CREATE TABLE Songs (SongId VARCHAR, Title VARCHAR)
SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands" AND T1.StagePosition = "back"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Band (firstname VARCHAR, lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR, StagePosition VARCHAR); CREATE TABLE Songs (SongId VARCHAR, Title VARCHAR) Question: Who is performing in the back stage position for the song "Badlands"? Show the first name and the last name. [/INST] SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands" AND T1.StagePosition = "back" </s>
How many unique labels are there for albums?
CREATE TABLE albums (label VARCHAR)
SELECT COUNT(DISTINCT label) FROM albums
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE albums (label VARCHAR) Question: How many unique labels are there for albums? [/INST] SELECT COUNT(DISTINCT label) FROM albums </s>
What is the label that has the most albums?
CREATE TABLE albums (label VARCHAR)
SELECT TOP 1 label FROM albums GROUP BY label ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE albums (label VARCHAR) Question: What is the label that has the most albums? [/INST] SELECT TOP 1 label FROM albums GROUP BY label ORDER BY COUNT(*) DESC </s>
What is the last name of the musician that have produced the most number of songs?
CREATE TABLE Songs (SongId VARCHAR); CREATE TABLE Band (lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR)
SELECT TOP 1 T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Songs (SongId VARCHAR); CREATE TABLE Band (lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR) Question: What is the last name of the musician that have produced the most number of songs? [/INST] SELECT TOP 1 T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY COUNT(*) DESC </s>
What is the last name of the musician that has been at the back position the most?
CREATE TABLE Band (lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR)
SELECT TOP 1 T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE stageposition = "back" GROUP BY lastname ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Band (lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR) Question: What is the last name of the musician that has been at the back position the most? [/INST] SELECT TOP 1 T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE stageposition = "back" GROUP BY lastname ORDER BY COUNT(*) DESC </s>
Find all the songs whose name contains the word "the".
CREATE TABLE songs (title VARCHAR)
SELECT title FROM songs WHERE title LIKE '% the %'
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE songs (title VARCHAR) Question: Find all the songs whose name contains the word "the". [/INST] SELECT title FROM songs WHERE title LIKE '% the %' </s>
What are all the instruments used?
CREATE TABLE Instruments (instrument VARCHAR)
SELECT DISTINCT instrument FROM Instruments
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Instruments (instrument VARCHAR) Question: What are all the instruments used? [/INST] SELECT DISTINCT instrument FROM Instruments </s>
What instrument did the musician with last name "Heilo" use in the song "Le Pop"?
CREATE TABLE Songs (SongId VARCHAR, songid VARCHAR, title VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Band (id VARCHAR, lastname VARCHAR); CREATE TABLE Instruments (instrument VARCHAR, songid VARCHAR, bandmateid VARCHAR)
SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = "Heilo" AND T3.title = "Le Pop"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Songs (SongId VARCHAR, songid VARCHAR, title VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Band (id VARCHAR, lastname VARCHAR); CREATE TABLE Instruments (instrument VARCHAR, songid VARCHAR, bandmateid VARCHAR) Question: What instrument did the musician with last name "Heilo" use in the song "Le Pop"? [/INST] SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = "Heilo" AND T3.title = "Le Pop" </s>
What is the most used instrument?
CREATE TABLE instruments (instrument VARCHAR)
SELECT TOP 1 instrument FROM instruments GROUP BY instrument ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE instruments (instrument VARCHAR) Question: What is the most used instrument? [/INST] SELECT TOP 1 instrument FROM instruments GROUP BY instrument ORDER BY COUNT(*) DESC </s>
How many songs have used the instrument "drums"?
CREATE TABLE instruments (instrument VARCHAR)
SELECT COUNT(*) FROM instruments WHERE instrument = "drums"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE instruments (instrument VARCHAR) Question: How many songs have used the instrument "drums"? [/INST] SELECT COUNT(*) FROM instruments WHERE instrument = "drums" </s>
What instruments does the the song "Le Pop" use?
CREATE TABLE instruments (songid VARCHAR); CREATE TABLE songs (songid VARCHAR)
SELECT instrument FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Le Pop"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE instruments (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) Question: What instruments does the the song "Le Pop" use? [/INST] SELECT instrument FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Le Pop" </s>
How many instruments does the song "Le Pop" use?
CREATE TABLE instruments (songid VARCHAR); CREATE TABLE songs (songid VARCHAR)
SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Le Pop"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE instruments (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) Question: How many instruments does the song "Le Pop" use? [/INST] SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Le Pop" </s>
How many instrument does the musician with last name "Heilo" use?
CREATE TABLE instruments (bandmateid VARCHAR); CREATE TABLE Band (id VARCHAR, lastname VARCHAR)
SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = "Heilo"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE instruments (bandmateid VARCHAR); CREATE TABLE Band (id VARCHAR, lastname VARCHAR) Question: How many instrument does the musician with last name "Heilo" use? [/INST] SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = "Heilo" </s>
Find all the instruments ever used by the musician with last name "Heilo"?
CREATE TABLE instruments (bandmateid VARCHAR); CREATE TABLE Band (id VARCHAR, lastname VARCHAR)
SELECT instrument FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = "Heilo"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE instruments (bandmateid VARCHAR); CREATE TABLE Band (id VARCHAR, lastname VARCHAR) Question: Find all the instruments ever used by the musician with last name "Heilo"? [/INST] SELECT instrument FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = "Heilo" </s>
Which song has the most vocals?
CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR)
SELECT TOP 1 title FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid GROUP BY T1.songid ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) Question: Which song has the most vocals? [/INST] SELECT TOP 1 title FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid GROUP BY T1.songid ORDER BY COUNT(*) DESC </s>
Which vocal type is the most frequently appearring type?
CREATE TABLE vocals (TYPE VARCHAR)
SELECT TOP 1 TYPE FROM vocals GROUP BY TYPE ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE vocals (TYPE VARCHAR) Question: Which vocal type is the most frequently appearring type? [/INST] SELECT TOP 1 TYPE FROM vocals GROUP BY TYPE ORDER BY COUNT(*) DESC </s>
Which vocal type has the band mate with last name "Heilo" played the most?
CREATE TABLE vocals (bandmate VARCHAR); CREATE TABLE band (id VARCHAR)
SELECT TOP 1 TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE lastname = "Heilo" GROUP BY TYPE ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE vocals (bandmate VARCHAR); CREATE TABLE band (id VARCHAR) Question: Which vocal type has the band mate with last name "Heilo" played the most? [/INST] SELECT TOP 1 TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE lastname = "Heilo" GROUP BY TYPE ORDER BY COUNT(*) DESC </s>
What are the vocal types used in song "Le Pop"?
CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR)
SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Le Pop"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) Question: What are the vocal types used in song "Le Pop"? [/INST] SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Le Pop" </s>
Find the number of vocal types used in song "Demon Kitty Rag"?
CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR)
SELECT COUNT(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Demon Kitty Rag"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) Question: Find the number of vocal types used in song "Demon Kitty Rag"? [/INST] SELECT COUNT(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Demon Kitty Rag" </s>
How many songs have a lead vocal?
CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR)
SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = "lead"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) Question: How many songs have a lead vocal? [/INST] SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = "lead" </s>
Which vocal type did the musician with first name "Solveig" played in the song with title "A Bar in Amsterdam"?
CREATE TABLE vocals (songid VARCHAR, bandmate VARCHAR); CREATE TABLE band (id VARCHAR, firstname VARCHAR); CREATE TABLE songs (songid VARCHAR, title VARCHAR)
SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.firstname = "Solveig" AND T2.title = "A Bar In Amsterdam"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE vocals (songid VARCHAR, bandmate VARCHAR); CREATE TABLE band (id VARCHAR, firstname VARCHAR); CREATE TABLE songs (songid VARCHAR, title VARCHAR) Question: Which vocal type did the musician with first name "Solveig" played in the song with title "A Bar in Amsterdam"? [/INST] SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.firstname = "Solveig" AND T2.title = "A Bar In Amsterdam" </s>
Find all the songs that do not have a lead vocal.
CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE vocals (songid VARCHAR)
SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = "lead"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE vocals (songid VARCHAR) Question: Find all the songs that do not have a lead vocal. [/INST] SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = "lead" </s>
Find all the vocal types.
CREATE TABLE vocals (TYPE VARCHAR)
SELECT DISTINCT TYPE FROM vocals
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE vocals (TYPE VARCHAR) Question: Find all the vocal types. [/INST] SELECT DISTINCT TYPE FROM vocals </s>
What are the albums produced in year 2010?
CREATE TABLE Albums (YEAR VARCHAR)
SELECT * FROM Albums WHERE YEAR = 2010
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Albums (YEAR VARCHAR) Question: What are the albums produced in year 2010? [/INST] SELECT * FROM Albums WHERE YEAR = 2010 </s>
Who performed the song named "Le Pop"?
CREATE TABLE Band (firstname VARCHAR, lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Songs (SongId VARCHAR, Title VARCHAR)
SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Le Pop"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Band (firstname VARCHAR, lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Songs (SongId VARCHAR, Title VARCHAR) Question: Who performed the song named "Le Pop"? [/INST] SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Le Pop" </s>
What instrument did the musician with last name "Heilo" use in the song "Badlands"?
CREATE TABLE Songs (SongId VARCHAR, songid VARCHAR, title VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Band (id VARCHAR, lastname VARCHAR); CREATE TABLE Instruments (instrument VARCHAR, songid VARCHAR, bandmateid VARCHAR)
SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = "Heilo" AND T3.title = "Badlands"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Songs (SongId VARCHAR, songid VARCHAR, title VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Band (id VARCHAR, lastname VARCHAR); CREATE TABLE Instruments (instrument VARCHAR, songid VARCHAR, bandmateid VARCHAR) Question: What instrument did the musician with last name "Heilo" use in the song "Badlands"? [/INST] SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = "Heilo" AND T3.title = "Badlands" </s>
How many instruments does the song "Badlands" use?
CREATE TABLE instruments (songid VARCHAR); CREATE TABLE songs (songid VARCHAR)
SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Badlands"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE instruments (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) Question: How many instruments does the song "Badlands" use? [/INST] SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Badlands" </s>
What are the vocal types used in song "Badlands"?
CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR)
SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Badlands"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) Question: What are the vocal types used in song "Badlands"? [/INST] SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Badlands" </s>
Find the number of vocal types used in song "Le Pop"
CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR)
SELECT COUNT(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Le Pop"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) Question: Find the number of vocal types used in song "Le Pop" [/INST] SELECT COUNT(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Le Pop" </s>
How many songs have a shared vocal?
CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR)
SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = "shared"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE vocals (songid VARCHAR); CREATE TABLE songs (songid VARCHAR) Question: How many songs have a shared vocal? [/INST] SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = "shared" </s>
Find all the songs that do not have a back vocal.
CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE vocals (songid VARCHAR)
SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = "back"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE vocals (songid VARCHAR) Question: Find all the songs that do not have a back vocal. [/INST] SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = "back" </s>
Which vocal type has the band mate with first name "Solveig" played the most?
CREATE TABLE vocals (bandmate VARCHAR); CREATE TABLE band (id VARCHAR)
SELECT TOP 1 TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = "Solveig" GROUP BY TYPE ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE vocals (bandmate VARCHAR); CREATE TABLE band (id VARCHAR) Question: Which vocal type has the band mate with first name "Solveig" played the most? [/INST] SELECT TOP 1 TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = "Solveig" GROUP BY TYPE ORDER BY COUNT(*) DESC </s>
Which vocal type did the musician with last name "Heilo" played in the song with title "Der Kapitan"?
CREATE TABLE band (id VARCHAR, lastname VARCHAR); CREATE TABLE vocals (songid VARCHAR, bandmate VARCHAR); CREATE TABLE songs (songid VARCHAR, title VARCHAR)
SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.lastname = "Heilo" AND T2.title = "Der Kapitan"
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE band (id VARCHAR, lastname VARCHAR); CREATE TABLE vocals (songid VARCHAR, bandmate VARCHAR); CREATE TABLE songs (songid VARCHAR, title VARCHAR) Question: Which vocal type did the musician with last name "Heilo" played in the song with title "Der Kapitan"? [/INST] SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.lastname = "Heilo" AND T2.title = "Der Kapitan" </s>