instruction
stringlengths 12
244
| input
stringlengths 27
489
| output
stringlengths 18
557
| text
stringlengths 194
1.14k
|
---|---|---|---|
Find the name of services that have been used for more than 2 times in first notification of loss. | CREATE TABLE services (service_name VARCHAR, service_id VARCHAR); CREATE TABLE first_notification_of_loss (service_id VARCHAR) | SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 ON t1.service_id = t2.service_id GROUP BY t1.service_id HAVING COUNT(*) > 2 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE services (service_name VARCHAR, service_id VARCHAR); CREATE TABLE first_notification_of_loss (service_id VARCHAR) Question: Find the name of services that have been used for more than 2 times in first notification of loss. [/INST] SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 ON t1.service_id = t2.service_id GROUP BY t1.service_id HAVING COUNT(*) > 2 </s> |
What is the effective date of the claim that has the largest amount of total settlement? | CREATE TABLE settlements (claim_id VARCHAR, settlement_amount INTEGER); CREATE TABLE claims (Effective_Date VARCHAR, claim_id VARCHAR) | SELECT TOP 1 t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY SUM(t2.settlement_amount) DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE settlements (claim_id VARCHAR, settlement_amount INTEGER); CREATE TABLE claims (Effective_Date VARCHAR, claim_id VARCHAR) Question: What is the effective date of the claim that has the largest amount of total settlement? [/INST] SELECT TOP 1 t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY SUM(t2.settlement_amount) DESC </s> |
How many policies are listed for the customer named "Dayana Robel"? | CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE customers_policies (customer_id VARCHAR) | SELECT COUNT(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = "Dayana Robel" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE customers_policies (customer_id VARCHAR) Question: How many policies are listed for the customer named "Dayana Robel"? [/INST] SELECT COUNT(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = "Dayana Robel" </s> |
What is the name of the customer who has the most policies listed? | CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customers_policies (customer_id VARCHAR) | SELECT TOP 1 t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY COUNT(*) DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customers_policies (customer_id VARCHAR) Question: What is the name of the customer who has the most policies listed? [/INST] SELECT TOP 1 t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY COUNT(*) DESC </s> |
What are all the policy types of the customer named "Dayana Robel"? | CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE available_policies (policy_type_code VARCHAR, policy_id VARCHAR); CREATE TABLE customers_policies (customer_id VARCHAR, policy_id VARCHAR) | SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = "Dayana Robel" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE available_policies (policy_type_code VARCHAR, policy_id VARCHAR); CREATE TABLE customers_policies (customer_id VARCHAR, policy_id VARCHAR) Question: What are all the policy types of the customer named "Dayana Robel"? [/INST] SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = "Dayana Robel" </s> |
What are all the policy types of the customer that has the most policies listed? | CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE available_policies (policy_type_code VARCHAR, policy_id VARCHAR); CREATE TABLE customers_policies (customer_id VARCHAR, policy_id VARCHAR) | SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = (SELECT TOP 1 t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY COUNT(*) DESC) | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE available_policies (policy_type_code VARCHAR, policy_id VARCHAR); CREATE TABLE customers_policies (customer_id VARCHAR, policy_id VARCHAR) Question: What are all the policy types of the customer that has the most policies listed? [/INST] SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = (SELECT TOP 1 t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY COUNT(*) DESC) </s> |
List all the services in the alphabetical order. | CREATE TABLE services (service_name VARCHAR) | SELECT service_name FROM services ORDER BY service_name | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE services (service_name VARCHAR) Question: List all the services in the alphabetical order. [/INST] SELECT service_name FROM services ORDER BY service_name </s> |
How many services are there? | CREATE TABLE services (Id VARCHAR) | SELECT COUNT(*) FROM services | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE services (Id VARCHAR) Question: How many services are there? [/INST] SELECT COUNT(*) FROM services </s> |
Find the names of users who do not have a first notification of loss record. | CREATE TABLE first_notification_of_loss (customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR) | SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE first_notification_of_loss (customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR) Question: Find the names of users who do not have a first notification of loss record. [/INST] SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id </s> |
Find the names of customers who have used either the service "Close a policy" or the service "Upgrade a policy". | CREATE TABLE first_notification_of_loss (customer_id VARCHAR, service_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE services (service_id VARCHAR, service_name VARCHAR) | SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "Close a policy" OR t3.service_name = "Upgrade a policy" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE first_notification_of_loss (customer_id VARCHAR, service_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE services (service_id VARCHAR, service_name VARCHAR) Question: Find the names of customers who have used either the service "Close a policy" or the service "Upgrade a policy". [/INST] SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "Close a policy" OR t3.service_name = "Upgrade a policy" </s> |
Find the names of customers who have used both the service "Close a policy" and the service "New policy application". | CREATE TABLE first_notification_of_loss (customer_id VARCHAR, service_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE services (service_id VARCHAR, service_name VARCHAR) | SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "Close a policy" INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "New policy application" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE first_notification_of_loss (customer_id VARCHAR, service_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE services (service_id VARCHAR, service_name VARCHAR) Question: Find the names of customers who have used both the service "Close a policy" and the service "New policy application". [/INST] SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "Close a policy" INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "New policy application" </s> |
Find the IDs of customers whose name contains "Diana". | CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR) | SELECT customer_id FROM customers WHERE customer_name LIKE "%Diana%" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR) Question: Find the IDs of customers whose name contains "Diana". [/INST] SELECT customer_id FROM customers WHERE customer_name LIKE "%Diana%" </s> |
What are the maximum and minimum settlement amount on record? | CREATE TABLE settlements (settlement_amount INTEGER) | SELECT MAX(settlement_amount), MIN(settlement_amount) FROM settlements | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE settlements (settlement_amount INTEGER) Question: What are the maximum and minimum settlement amount on record? [/INST] SELECT MAX(settlement_amount), MIN(settlement_amount) FROM settlements </s> |
List all the customers in increasing order of IDs. | CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR) | SELECT customer_id, customer_name FROM customers ORDER BY customer_id | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR) Question: List all the customers in increasing order of IDs. [/INST] SELECT customer_id, customer_name FROM customers ORDER BY customer_id </s> |
Retrieve the open and close dates of all the policies associated with the customer whose name contains "Diana" | CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE customers_policies (date_opened VARCHAR, date_closed VARCHAR, customer_id VARCHAR) | SELECT t2.date_opened, t2.date_closed FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name LIKE "%Diana%" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE customers_policies (date_opened VARCHAR, date_closed VARCHAR, customer_id VARCHAR) Question: Retrieve the open and close dates of all the policies associated with the customer whose name contains "Diana" [/INST] SELECT t2.date_opened, t2.date_closed FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name LIKE "%Diana%" </s> |
How many kinds of enzymes are there? | CREATE TABLE enzyme (Id VARCHAR) | SELECT COUNT(*) FROM enzyme | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE enzyme (Id VARCHAR) Question: How many kinds of enzymes are there? [/INST] SELECT COUNT(*) FROM enzyme </s> |
List the name of enzymes in descending lexicographical order. | CREATE TABLE enzyme (name VARCHAR) | SELECT name FROM enzyme ORDER BY name DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE enzyme (name VARCHAR) Question: List the name of enzymes in descending lexicographical order. [/INST] SELECT name FROM enzyme ORDER BY name DESC </s> |
List the names and the locations that the enzymes can make an effect. | CREATE TABLE enzyme (name VARCHAR, LOCATION VARCHAR) | SELECT name, LOCATION FROM enzyme | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE enzyme (name VARCHAR, LOCATION VARCHAR) Question: List the names and the locations that the enzymes can make an effect. [/INST] SELECT name, LOCATION FROM enzyme </s> |
What is the maximum Online Mendelian Inheritance in Man (OMIM) value of the enzymes? | CREATE TABLE enzyme (OMIM INTEGER) | SELECT MAX(OMIM) FROM enzyme | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE enzyme (OMIM INTEGER) Question: What is the maximum Online Mendelian Inheritance in Man (OMIM) value of the enzymes? [/INST] SELECT MAX(OMIM) FROM enzyme </s> |
What is the product, chromosome and porphyria related to the enzymes which take effect at the location 'Cytosol'? | CREATE TABLE enzyme (product VARCHAR, chromosome VARCHAR, porphyria VARCHAR, LOCATION VARCHAR) | SELECT product, chromosome, porphyria FROM enzyme WHERE LOCATION = 'Cytosol' | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE enzyme (product VARCHAR, chromosome VARCHAR, porphyria VARCHAR, LOCATION VARCHAR) Question: What is the product, chromosome and porphyria related to the enzymes which take effect at the location 'Cytosol'? [/INST] SELECT product, chromosome, porphyria FROM enzyme WHERE LOCATION = 'Cytosol' </s> |
What are the names of enzymes who does not produce 'Heme'? | CREATE TABLE enzyme (name VARCHAR, product VARCHAR) | SELECT name FROM enzyme WHERE product <> 'Heme' | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE enzyme (name VARCHAR, product VARCHAR) Question: What are the names of enzymes who does not produce 'Heme'? [/INST] SELECT name FROM enzyme WHERE product <> 'Heme' </s> |
What are the names and trade names of the medicines which has 'Yes' value in the FDA record? | CREATE TABLE medicine (name VARCHAR, trade_name VARCHAR, FDA_approved VARCHAR) | SELECT name, trade_name FROM medicine WHERE FDA_approved = 'Yes' | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE medicine (name VARCHAR, trade_name VARCHAR, FDA_approved VARCHAR) Question: What are the names and trade names of the medicines which has 'Yes' value in the FDA record? [/INST] SELECT name, trade_name FROM medicine WHERE FDA_approved = 'Yes' </s> |
What are the names of enzymes in the medicine named 'Amisulpride' that can serve as an 'inhibitor'? | CREATE TABLE medicine (id VARCHAR, name VARCHAR); CREATE TABLE medicine_enzyme_interaction (enzyme_id VARCHAR, medicine_id VARCHAR, interaction_type VARCHAR); CREATE TABLE enzyme (name VARCHAR, id VARCHAR) | SELECT T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id JOIN medicine AS T3 ON T2.medicine_id = T3.id WHERE T3.name = 'Amisulpride' AND T2.interaction_type = 'inhibitor' | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE medicine (id VARCHAR, name VARCHAR); CREATE TABLE medicine_enzyme_interaction (enzyme_id VARCHAR, medicine_id VARCHAR, interaction_type VARCHAR); CREATE TABLE enzyme (name VARCHAR, id VARCHAR) Question: What are the names of enzymes in the medicine named 'Amisulpride' that can serve as an 'inhibitor'? [/INST] SELECT T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id JOIN medicine AS T3 ON T2.medicine_id = T3.id WHERE T3.name = 'Amisulpride' AND T2.interaction_type = 'inhibitor' </s> |
What are the ids and names of the medicine that can interact with two or more enzymes? | CREATE TABLE medicine_enzyme_interaction (medicine_id VARCHAR); CREATE TABLE medicine (id VARCHAR, Name VARCHAR) | SELECT T1.id, T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE medicine_enzyme_interaction (medicine_id VARCHAR); CREATE TABLE medicine (id VARCHAR, Name VARCHAR) Question: What are the ids and names of the medicine that can interact with two or more enzymes? [/INST] SELECT T1.id, T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2 </s> |
What are the ids, names and FDA approval status of medicines in descending order of the number of enzymes that it can interact with. | CREATE TABLE medicine_enzyme_interaction (medicine_id VARCHAR); CREATE TABLE medicine (id VARCHAR, Name VARCHAR, FDA_approved VARCHAR) | SELECT T1.id, T1.Name, T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE medicine_enzyme_interaction (medicine_id VARCHAR); CREATE TABLE medicine (id VARCHAR, Name VARCHAR, FDA_approved VARCHAR) Question: What are the ids, names and FDA approval status of medicines in descending order of the number of enzymes that it can interact with. [/INST] SELECT T1.id, T1.Name, T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC </s> |
What is the id and name of the enzyme with most number of medicines that can interact as 'activator'? | CREATE TABLE medicine_enzyme_interaction (enzyme_id VARCHAR, interaction_type VARCHAR); CREATE TABLE enzyme (id VARCHAR, name VARCHAR) | SELECT TOP 1 T1.id, T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id WHERE T2.interaction_type = 'activitor' GROUP BY T1.id ORDER BY COUNT(*) DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE medicine_enzyme_interaction (enzyme_id VARCHAR, interaction_type VARCHAR); CREATE TABLE enzyme (id VARCHAR, name VARCHAR) Question: What is the id and name of the enzyme with most number of medicines that can interact as 'activator'? [/INST] SELECT TOP 1 T1.id, T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id WHERE T2.interaction_type = 'activitor' GROUP BY T1.id ORDER BY COUNT(*) DESC </s> |
What is the interaction type of the enzyme named 'ALA synthase' and the medicine named 'Aripiprazole'? | CREATE TABLE enzyme (id VARCHAR, name VARCHAR); CREATE TABLE medicine (id VARCHAR, name VARCHAR); CREATE TABLE medicine_enzyme_interaction (interaction_type VARCHAR, medicine_id VARCHAR, enzyme_id VARCHAR) | SELECT T1.interaction_type FROM medicine_enzyme_interaction AS T1 JOIN medicine AS T2 ON T1.medicine_id = T2.id JOIN enzyme AS T3 ON T1.enzyme_id = T3.id WHERE T3.name = 'ALA synthase' AND T2.name = 'Aripiprazole' | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE enzyme (id VARCHAR, name VARCHAR); CREATE TABLE medicine (id VARCHAR, name VARCHAR); CREATE TABLE medicine_enzyme_interaction (interaction_type VARCHAR, medicine_id VARCHAR, enzyme_id VARCHAR) Question: What is the interaction type of the enzyme named 'ALA synthase' and the medicine named 'Aripiprazole'? [/INST] SELECT T1.interaction_type FROM medicine_enzyme_interaction AS T1 JOIN medicine AS T2 ON T1.medicine_id = T2.id JOIN enzyme AS T3 ON T1.enzyme_id = T3.id WHERE T3.name = 'ALA synthase' AND T2.name = 'Aripiprazole' </s> |
What is the most common interaction type between enzymes and medicine? And how many are there? | CREATE TABLE medicine_enzyme_interaction (interaction_type VARCHAR) | SELECT TOP 1 interaction_type, COUNT(*) FROM medicine_enzyme_interaction GROUP BY interaction_type ORDER BY COUNT(*) DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE medicine_enzyme_interaction (interaction_type VARCHAR) Question: What is the most common interaction type between enzymes and medicine? And how many are there? [/INST] SELECT TOP 1 interaction_type, COUNT(*) FROM medicine_enzyme_interaction GROUP BY interaction_type ORDER BY COUNT(*) DESC </s> |
How many medicines have the FDA approval status 'No' ? | CREATE TABLE medicine (FDA_approved VARCHAR) | SELECT COUNT(*) FROM medicine WHERE FDA_approved = 'No' | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE medicine (FDA_approved VARCHAR) Question: How many medicines have the FDA approval status 'No' ? [/INST] SELECT COUNT(*) FROM medicine WHERE FDA_approved = 'No' </s> |
How many enzymes do not have any interactions? | CREATE TABLE medicine_enzyme_interaction (id VARCHAR, enzyme_id VARCHAR); CREATE TABLE enzyme (id VARCHAR, enzyme_id VARCHAR) | SELECT COUNT(*) FROM enzyme WHERE NOT id IN (SELECT enzyme_id FROM medicine_enzyme_interaction) | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE medicine_enzyme_interaction (id VARCHAR, enzyme_id VARCHAR); CREATE TABLE enzyme (id VARCHAR, enzyme_id VARCHAR) Question: How many enzymes do not have any interactions? [/INST] SELECT COUNT(*) FROM enzyme WHERE NOT id IN (SELECT enzyme_id FROM medicine_enzyme_interaction) </s> |
What is the id and trade name of the medicines can interact with at least 3 enzymes? | CREATE TABLE medicine (id VARCHAR, trade_name VARCHAR); CREATE TABLE medicine_enzyme_interaction (medicine_id VARCHAR) | SELECT T1.id, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 3 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE medicine (id VARCHAR, trade_name VARCHAR); CREATE TABLE medicine_enzyme_interaction (medicine_id VARCHAR) Question: What is the id and trade name of the medicines can interact with at least 3 enzymes? [/INST] SELECT T1.id, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 3 </s> |
What are the distinct name, location and products of the enzymes which has any 'inhibitor' interaction? | CREATE TABLE enzyme (name VARCHAR, location VARCHAR, product VARCHAR, id VARCHAR); CREATE TABLE medicine_enzyme_interaction (enzyme_id VARCHAR, interaction_type VARCHAR) | SELECT DISTINCT T1.name, T1.location, T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor' | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE enzyme (name VARCHAR, location VARCHAR, product VARCHAR, id VARCHAR); CREATE TABLE medicine_enzyme_interaction (enzyme_id VARCHAR, interaction_type VARCHAR) Question: What are the distinct name, location and products of the enzymes which has any 'inhibitor' interaction? [/INST] SELECT DISTINCT T1.name, T1.location, T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor' </s> |
List the medicine name and trade name which can both interact as 'inhibitor' and 'activitor' with enzymes. | CREATE TABLE medicine (name VARCHAR, trade_name VARCHAR, id VARCHAR); CREATE TABLE medicine_enzyme_interaction (medicine_id VARCHAR) | SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'inhibitor' INTERSECT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'activitor' | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE medicine (name VARCHAR, trade_name VARCHAR, id VARCHAR); CREATE TABLE medicine_enzyme_interaction (medicine_id VARCHAR) Question: List the medicine name and trade name which can both interact as 'inhibitor' and 'activitor' with enzymes. [/INST] SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'inhibitor' INTERSECT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'activitor' </s> |
Show the medicine names and trade names that cannot interact with the enzyme with product 'Heme'. | CREATE TABLE medicine (name VARCHAR, trade_name VARCHAR); CREATE TABLE medicine_enzyme_interaction (medicine_id VARCHAR, enzyme_id VARCHAR); CREATE TABLE medicine (name VARCHAR, trade_name VARCHAR, id VARCHAR); CREATE TABLE enzyme (id VARCHAR, product VARCHAR) | SELECT name, trade_name FROM medicine EXCEPT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id JOIN enzyme AS T3 ON T3.id = T2.enzyme_id WHERE T3.product = 'Protoporphyrinogen IX' | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE medicine (name VARCHAR, trade_name VARCHAR); CREATE TABLE medicine_enzyme_interaction (medicine_id VARCHAR, enzyme_id VARCHAR); CREATE TABLE medicine (name VARCHAR, trade_name VARCHAR, id VARCHAR); CREATE TABLE enzyme (id VARCHAR, product VARCHAR) Question: Show the medicine names and trade names that cannot interact with the enzyme with product 'Heme'. [/INST] SELECT name, trade_name FROM medicine EXCEPT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id JOIN enzyme AS T3 ON T3.id = T2.enzyme_id WHERE T3.product = 'Protoporphyrinogen IX' </s> |
How many distinct FDA approval statuses are there for the medicines? | CREATE TABLE medicine (FDA_approved VARCHAR) | SELECT COUNT(DISTINCT FDA_approved) FROM medicine | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE medicine (FDA_approved VARCHAR) Question: How many distinct FDA approval statuses are there for the medicines? [/INST] SELECT COUNT(DISTINCT FDA_approved) FROM medicine </s> |
Which enzyme names have the substring "ALA"? | CREATE TABLE enzyme (name VARCHAR) | SELECT name FROM enzyme WHERE name LIKE "%ALA%" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE enzyme (name VARCHAR) Question: Which enzyme names have the substring "ALA"? [/INST] SELECT name FROM enzyme WHERE name LIKE "%ALA%" </s> |
find the number of medicines offered by each trade. | CREATE TABLE medicine (trade_name VARCHAR) | SELECT trade_name, COUNT(*) FROM medicine GROUP BY trade_name | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE medicine (trade_name VARCHAR) Question: find the number of medicines offered by each trade. [/INST] SELECT trade_name, COUNT(*) FROM medicine GROUP BY trade_name </s> |
List all schools and their nicknames in the order of founded year. | CREATE TABLE university (school VARCHAR, nickname VARCHAR, founded VARCHAR) | SELECT school, nickname FROM university ORDER BY founded | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE university (school VARCHAR, nickname VARCHAR, founded VARCHAR) Question: List all schools and their nicknames in the order of founded year. [/INST] SELECT school, nickname FROM university ORDER BY founded </s> |
List all public schools and their locations. | CREATE TABLE university (school VARCHAR, LOCATION VARCHAR, affiliation VARCHAR) | SELECT school, LOCATION FROM university WHERE affiliation = 'Public' | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE university (school VARCHAR, LOCATION VARCHAR, affiliation VARCHAR) Question: List all public schools and their locations. [/INST] SELECT school, LOCATION FROM university WHERE affiliation = 'Public' </s> |
When was the school with the largest enrollment founded? | CREATE TABLE university (founded VARCHAR, enrollment VARCHAR) | SELECT TOP 1 founded FROM university ORDER BY enrollment DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE university (founded VARCHAR, enrollment VARCHAR) Question: When was the school with the largest enrollment founded? [/INST] SELECT TOP 1 founded FROM university ORDER BY enrollment DESC </s> |
Find the founded year of the newest non public school. | CREATE TABLE university (founded VARCHAR, affiliation VARCHAR) | SELECT TOP 1 founded FROM university WHERE affiliation <> 'Public' ORDER BY founded DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE university (founded VARCHAR, affiliation VARCHAR) Question: Find the founded year of the newest non public school. [/INST] SELECT TOP 1 founded FROM university WHERE affiliation <> 'Public' ORDER BY founded DESC </s> |
How many schools are in the basketball match? | CREATE TABLE basketball_match (school_id VARCHAR) | SELECT COUNT(DISTINCT school_id) FROM basketball_match | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE basketball_match (school_id VARCHAR) Question: How many schools are in the basketball match? [/INST] SELECT COUNT(DISTINCT school_id) FROM basketball_match </s> |
What is the highest acc percent score in the competition? | CREATE TABLE basketball_match (acc_percent VARCHAR) | SELECT TOP 1 acc_percent FROM basketball_match ORDER BY acc_percent DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE basketball_match (acc_percent VARCHAR) Question: What is the highest acc percent score in the competition? [/INST] SELECT TOP 1 acc_percent FROM basketball_match ORDER BY acc_percent DESC </s> |
What is the primary conference of the school that has the lowest acc percent score in the competition? | CREATE TABLE basketball_match (school_id VARCHAR, acc_percent VARCHAR); CREATE TABLE university (Primary_conference VARCHAR, school_id VARCHAR) | SELECT TOP 1 t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t2.acc_percent | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE basketball_match (school_id VARCHAR, acc_percent VARCHAR); CREATE TABLE university (Primary_conference VARCHAR, school_id VARCHAR) Question: What is the primary conference of the school that has the lowest acc percent score in the competition? [/INST] SELECT TOP 1 t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t2.acc_percent </s> |
What is the team name and acc regular season score of the school that was founded for the longest time? | CREATE TABLE university (school_id VARCHAR, founded VARCHAR); CREATE TABLE basketball_match (team_name VARCHAR, ACC_Regular_Season VARCHAR, school_id VARCHAR) | SELECT TOP 1 t2.team_name, t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t1.founded | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE university (school_id VARCHAR, founded VARCHAR); CREATE TABLE basketball_match (team_name VARCHAR, ACC_Regular_Season VARCHAR, school_id VARCHAR) Question: What is the team name and acc regular season score of the school that was founded for the longest time? [/INST] SELECT TOP 1 t2.team_name, t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t1.founded </s> |
Find the location and all games score of the school that has Clemson as its team name. | CREATE TABLE basketball_match (All_Games VARCHAR, school_id VARCHAR); CREATE TABLE university (location VARCHAR, school_id VARCHAR) | SELECT t2.All_Games, t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE team_name = 'Clemson' | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE basketball_match (All_Games VARCHAR, school_id VARCHAR); CREATE TABLE university (location VARCHAR, school_id VARCHAR) Question: Find the location and all games score of the school that has Clemson as its team name. [/INST] SELECT t2.All_Games, t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE team_name = 'Clemson' </s> |
What are the average enrollment size of the universities that are founded before 1850? | CREATE TABLE university (enrollment INTEGER, founded INTEGER) | SELECT AVG(enrollment) FROM university WHERE founded < 1850 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE university (enrollment INTEGER, founded INTEGER) Question: What are the average enrollment size of the universities that are founded before 1850? [/INST] SELECT AVG(enrollment) FROM university WHERE founded < 1850 </s> |
Show the enrollment and primary_conference of the oldest college. | CREATE TABLE university (enrollment VARCHAR, primary_conference VARCHAR, founded VARCHAR) | SELECT TOP 1 enrollment, primary_conference FROM university ORDER BY founded | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE university (enrollment VARCHAR, primary_conference VARCHAR, founded VARCHAR) Question: Show the enrollment and primary_conference of the oldest college. [/INST] SELECT TOP 1 enrollment, primary_conference FROM university ORDER BY founded </s> |
What is the total and minimum enrollment of all schools? | CREATE TABLE university (enrollment INTEGER) | SELECT SUM(enrollment), MIN(enrollment) FROM university | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE university (enrollment INTEGER) Question: What is the total and minimum enrollment of all schools? [/INST] SELECT SUM(enrollment), MIN(enrollment) FROM university </s> |
Find the total student enrollment for different affiliation type schools. | CREATE TABLE university (affiliation VARCHAR, enrollment INTEGER) | SELECT SUM(enrollment), affiliation FROM university GROUP BY affiliation | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE university (affiliation VARCHAR, enrollment INTEGER) Question: Find the total student enrollment for different affiliation type schools. [/INST] SELECT SUM(enrollment), affiliation FROM university GROUP BY affiliation </s> |
How many schools do not participate in the basketball match? | CREATE TABLE university (school_id VARCHAR); CREATE TABLE basketball_match (school_id VARCHAR) | SELECT COUNT(*) FROM university WHERE NOT school_id IN (SELECT school_id FROM basketball_match) | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE university (school_id VARCHAR); CREATE TABLE basketball_match (school_id VARCHAR) Question: How many schools do not participate in the basketball match? [/INST] SELECT COUNT(*) FROM university WHERE NOT school_id IN (SELECT school_id FROM basketball_match) </s> |
Find the schools that were either founded after 1850 or public. | CREATE TABLE university (school VARCHAR, founded VARCHAR, affiliation VARCHAR) | SELECT school FROM university WHERE founded > 1850 OR affiliation = 'Public' | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE university (school VARCHAR, founded VARCHAR, affiliation VARCHAR) Question: Find the schools that were either founded after 1850 or public. [/INST] SELECT school FROM university WHERE founded > 1850 OR affiliation = 'Public' </s> |
Find how many different affiliation types there are. | CREATE TABLE university (affiliation VARCHAR) | SELECT COUNT(DISTINCT affiliation) FROM university | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE university (affiliation VARCHAR) Question: Find how many different affiliation types there are. [/INST] SELECT COUNT(DISTINCT affiliation) FROM university </s> |
Find how many school locations have the word 'NY'. | CREATE TABLE university (LOCATION VARCHAR) | SELECT COUNT(*) FROM university WHERE LOCATION LIKE "%NY%" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE university (LOCATION VARCHAR) Question: Find how many school locations have the word 'NY'. [/INST] SELECT COUNT(*) FROM university WHERE LOCATION LIKE "%NY%" </s> |
Find the team names of the universities whose enrollments are smaller than the average enrollment size. | CREATE TABLE university (school_id VARCHAR); CREATE TABLE basketball_match (team_name VARCHAR, school_id VARCHAR); CREATE TABLE university (enrollment INTEGER) | SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE enrollment < (SELECT AVG(enrollment) FROM university) | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE university (school_id VARCHAR); CREATE TABLE basketball_match (team_name VARCHAR, school_id VARCHAR); CREATE TABLE university (enrollment INTEGER) Question: Find the team names of the universities whose enrollments are smaller than the average enrollment size. [/INST] SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE enrollment < (SELECT AVG(enrollment) FROM university) </s> |
Find the number of universities that have over a 20000 enrollment size for each affiliation type. | CREATE TABLE university (affiliation VARCHAR, enrollment INTEGER) | SELECT COUNT(*), affiliation FROM university WHERE enrollment > 20000 GROUP BY affiliation | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE university (affiliation VARCHAR, enrollment INTEGER) Question: Find the number of universities that have over a 20000 enrollment size for each affiliation type. [/INST] SELECT COUNT(*), affiliation FROM university WHERE enrollment > 20000 GROUP BY affiliation </s> |
Find the total number of students enrolled in the colleges that were founded after the year of 1850 for each affiliation type. | CREATE TABLE university (affiliation VARCHAR, Enrollment INTEGER, founded INTEGER) | SELECT SUM(Enrollment), affiliation FROM university WHERE founded > 1850 GROUP BY affiliation | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE university (affiliation VARCHAR, Enrollment INTEGER, founded INTEGER) Question: Find the total number of students enrolled in the colleges that were founded after the year of 1850 for each affiliation type. [/INST] SELECT SUM(Enrollment), affiliation FROM university WHERE founded > 1850 GROUP BY affiliation </s> |
What is the maximum enrollment across all schools? | CREATE TABLE university (Enrollment INTEGER) | SELECT MAX(Enrollment) FROM university | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE university (Enrollment INTEGER) Question: What is the maximum enrollment across all schools? [/INST] SELECT MAX(Enrollment) FROM university </s> |
List all information regarding the basketball match. | CREATE TABLE basketball_match (Id VARCHAR) | SELECT * FROM basketball_match | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE basketball_match (Id VARCHAR) Question: List all information regarding the basketball match. [/INST] SELECT * FROM basketball_match </s> |
List names of all teams in the basketball competition, ordered by all home scores in descending order. | CREATE TABLE basketball_match (team_name VARCHAR, All_Home VARCHAR) | SELECT team_name FROM basketball_match ORDER BY All_Home DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE basketball_match (team_name VARCHAR, All_Home VARCHAR) Question: List names of all teams in the basketball competition, ordered by all home scores in descending order. [/INST] SELECT team_name FROM basketball_match ORDER BY All_Home DESC </s> |
the names of models that launched between 2002 and 2004. | CREATE TABLE chip_model (Model_name VARCHAR, Launch_year INTEGER) | SELECT Model_name FROM chip_model WHERE Launch_year BETWEEN 2002 AND 2004 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE chip_model (Model_name VARCHAR, Launch_year INTEGER) Question: the names of models that launched between 2002 and 2004. [/INST] SELECT Model_name FROM chip_model WHERE Launch_year BETWEEN 2002 AND 2004 </s> |
Which model has the least amount of RAM? List the model name and the amount of RAM. | CREATE TABLE chip_model (Model_name VARCHAR, RAM_MiB VARCHAR) | SELECT TOP 1 Model_name, RAM_MiB FROM chip_model ORDER BY RAM_MiB | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE chip_model (Model_name VARCHAR, RAM_MiB VARCHAR) Question: Which model has the least amount of RAM? List the model name and the amount of RAM. [/INST] SELECT TOP 1 Model_name, RAM_MiB FROM chip_model ORDER BY RAM_MiB </s> |
What are the chip model and screen mode of the phone with hardware model name "LG-P760"? | CREATE TABLE phone (chip_model VARCHAR, screen_mode VARCHAR, Hardware_Model_name VARCHAR) | SELECT chip_model, screen_mode FROM phone WHERE Hardware_Model_name = "LG-P760" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE phone (chip_model VARCHAR, screen_mode VARCHAR, Hardware_Model_name VARCHAR) Question: What are the chip model and screen mode of the phone with hardware model name "LG-P760"? [/INST] SELECT chip_model, screen_mode FROM phone WHERE Hardware_Model_name = "LG-P760" </s> |
How many phone hardware models are produced by the company named "Nokia Corporation"? | CREATE TABLE phone (Company_name VARCHAR) | SELECT COUNT(*) FROM phone WHERE Company_name = "Nokia Corporation" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE phone (Company_name VARCHAR) Question: How many phone hardware models are produced by the company named "Nokia Corporation"? [/INST] SELECT COUNT(*) FROM phone WHERE Company_name = "Nokia Corporation" </s> |
What is maximum and minimum RAM size of phone produced by company named "Nokia Corporation"? | CREATE TABLE phone (chip_model VARCHAR, Company_name VARCHAR); CREATE TABLE chip_model (RAM_MiB INTEGER, Model_name VARCHAR) | SELECT MAX(T1.RAM_MiB), MIN(T1.RAM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = "Nokia Corporation" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE phone (chip_model VARCHAR, Company_name VARCHAR); CREATE TABLE chip_model (RAM_MiB INTEGER, Model_name VARCHAR) Question: What is maximum and minimum RAM size of phone produced by company named "Nokia Corporation"? [/INST] SELECT MAX(T1.RAM_MiB), MIN(T1.RAM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = "Nokia Corporation" </s> |
What is the average ROM size of phones produced by the company named "Nokia Corporation"? | CREATE TABLE phone (chip_model VARCHAR, Company_name VARCHAR); CREATE TABLE chip_model (ROM_MiB INTEGER, Model_name VARCHAR) | SELECT AVG(T1.ROM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = "Nokia Corporation" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE phone (chip_model VARCHAR, Company_name VARCHAR); CREATE TABLE chip_model (ROM_MiB INTEGER, Model_name VARCHAR) Question: What is the average ROM size of phones produced by the company named "Nokia Corporation"? [/INST] SELECT AVG(T1.ROM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = "Nokia Corporation" </s> |
List the hardware model name and company name for all the phones that were launched in year 2002 or have RAM size greater than 32. | CREATE TABLE chip_model (Model_name VARCHAR, Launch_year VARCHAR, RAM_MiB VARCHAR); CREATE TABLE phone (Hardware_Model_name VARCHAR, Company_name VARCHAR, chip_model VARCHAR) | SELECT T2.Hardware_Model_name, T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 OR T1.RAM_MiB > 32 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE chip_model (Model_name VARCHAR, Launch_year VARCHAR, RAM_MiB VARCHAR); CREATE TABLE phone (Hardware_Model_name VARCHAR, Company_name VARCHAR, chip_model VARCHAR) Question: List the hardware model name and company name for all the phones that were launched in year 2002 or have RAM size greater than 32. [/INST] SELECT T2.Hardware_Model_name, T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 OR T1.RAM_MiB > 32 </s> |
Find all phones that have word 'Full' in their accreditation types. List the Hardware Model name and Company name. | CREATE TABLE phone (Hardware_Model_name VARCHAR, Company_name VARCHAR, Accreditation_type VARCHAR) | SELECT Hardware_Model_name, Company_name FROM phone WHERE Accreditation_type LIKE 'Full' | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE phone (Hardware_Model_name VARCHAR, Company_name VARCHAR, Accreditation_type VARCHAR) Question: Find all phones that have word 'Full' in their accreditation types. List the Hardware Model name and Company name. [/INST] SELECT Hardware_Model_name, Company_name FROM phone WHERE Accreditation_type LIKE 'Full' </s> |
Find the Char cells, Pixels and Hardware colours for the screen of the phone whose hardware model name is "LG-P760". | CREATE TABLE phone (screen_mode VARCHAR, Hardware_Model_name VARCHAR); CREATE TABLE screen_mode (Char_cells VARCHAR, Pixels VARCHAR, Hardware_colours VARCHAR, Graphics_mode VARCHAR) | SELECT T1.Char_cells, T1.Pixels, T1.Hardware_colours FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.Hardware_Model_name = "LG-P760" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE phone (screen_mode VARCHAR, Hardware_Model_name VARCHAR); CREATE TABLE screen_mode (Char_cells VARCHAR, Pixels VARCHAR, Hardware_colours VARCHAR, Graphics_mode VARCHAR) Question: Find the Char cells, Pixels and Hardware colours for the screen of the phone whose hardware model name is "LG-P760". [/INST] SELECT T1.Char_cells, T1.Pixels, T1.Hardware_colours FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.Hardware_Model_name = "LG-P760" </s> |
List the hardware model name and company name for the phone whose screen mode type is "Graphics." | CREATE TABLE phone (Hardware_Model_name VARCHAR, Company_name VARCHAR, screen_mode VARCHAR); CREATE TABLE screen_mode (Graphics_mode VARCHAR, Type VARCHAR) | SELECT T2.Hardware_Model_name, T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = "Graphics" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE phone (Hardware_Model_name VARCHAR, Company_name VARCHAR, screen_mode VARCHAR); CREATE TABLE screen_mode (Graphics_mode VARCHAR, Type VARCHAR) Question: List the hardware model name and company name for the phone whose screen mode type is "Graphics." [/INST] SELECT T2.Hardware_Model_name, T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = "Graphics" </s> |
Find the name of the company that has the least number of phone models. List the company name and the number of phone model produced by that company. | CREATE TABLE phone (Company_name VARCHAR) | SELECT TOP 1 Company_name, COUNT(*) FROM phone GROUP BY Company_name ORDER BY COUNT(*) | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE phone (Company_name VARCHAR) Question: Find the name of the company that has the least number of phone models. List the company name and the number of phone model produced by that company. [/INST] SELECT TOP 1 Company_name, COUNT(*) FROM phone GROUP BY Company_name ORDER BY COUNT(*) </s> |
List the name of the company that produced more than one phone model. | CREATE TABLE phone (Company_name VARCHAR) | SELECT Company_name FROM phone GROUP BY Company_name HAVING COUNT(*) > 1 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE phone (Company_name VARCHAR) Question: List the name of the company that produced more than one phone model. [/INST] SELECT Company_name FROM phone GROUP BY Company_name HAVING COUNT(*) > 1 </s> |
List the maximum, minimum and average number of used kb in screen mode. | CREATE TABLE screen_mode (used_kb INTEGER) | SELECT MAX(used_kb), MIN(used_kb), AVG(used_kb) FROM screen_mode | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE screen_mode (used_kb INTEGER) Question: List the maximum, minimum and average number of used kb in screen mode. [/INST] SELECT MAX(used_kb), MIN(used_kb), AVG(used_kb) FROM screen_mode </s> |
List the name of the phone model launched in year 2002 and with the highest RAM size. | CREATE TABLE chip_model (Model_name VARCHAR, Launch_year VARCHAR, RAM_MiB VARCHAR); CREATE TABLE phone (Hardware_Model_name VARCHAR, chip_model VARCHAR) | SELECT TOP 1 T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 ORDER BY T1.RAM_MiB DESC | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE chip_model (Model_name VARCHAR, Launch_year VARCHAR, RAM_MiB VARCHAR); CREATE TABLE phone (Hardware_Model_name VARCHAR, chip_model VARCHAR) Question: List the name of the phone model launched in year 2002 and with the highest RAM size. [/INST] SELECT TOP 1 T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 ORDER BY T1.RAM_MiB DESC </s> |
What are the wifi and screen mode type of the hardware model named "LG-P760"? | CREATE TABLE phone (chip_model VARCHAR, screen_mode VARCHAR, Hardware_Model_name VARCHAR); CREATE TABLE chip_model (WiFi VARCHAR, Model_name VARCHAR); CREATE TABLE screen_mode (Type VARCHAR, Graphics_mode VARCHAR) | SELECT T1.WiFi, T3.Type FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T2.Hardware_Model_name = "LG-P760" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE phone (chip_model VARCHAR, screen_mode VARCHAR, Hardware_Model_name VARCHAR); CREATE TABLE chip_model (WiFi VARCHAR, Model_name VARCHAR); CREATE TABLE screen_mode (Type VARCHAR, Graphics_mode VARCHAR) Question: What are the wifi and screen mode type of the hardware model named "LG-P760"? [/INST] SELECT T1.WiFi, T3.Type FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T2.Hardware_Model_name = "LG-P760" </s> |
List the hardware model name for the phones that have screen mode type "Text" or RAM size greater than 32. | CREATE TABLE chip_model (Model_name VARCHAR, RAM_MiB VARCHAR); CREATE TABLE phone (Hardware_Model_name VARCHAR, chip_model VARCHAR, screen_mode VARCHAR); CREATE TABLE screen_mode (Graphics_mode VARCHAR, Type VARCHAR) | SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T3.Type = "Text" OR T1.RAM_MiB > 32 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE chip_model (Model_name VARCHAR, RAM_MiB VARCHAR); CREATE TABLE phone (Hardware_Model_name VARCHAR, chip_model VARCHAR, screen_mode VARCHAR); CREATE TABLE screen_mode (Graphics_mode VARCHAR, Type VARCHAR) Question: List the hardware model name for the phones that have screen mode type "Text" or RAM size greater than 32. [/INST] SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T3.Type = "Text" OR T1.RAM_MiB > 32 </s> |
List the hardware model name for the phones that were produced by "Nokia Corporation" or whose screen mode type is "Graphics." | CREATE TABLE phone (Hardware_Model_name VARCHAR, screen_mode VARCHAR); CREATE TABLE screen_mode (Graphics_mode VARCHAR, Type VARCHAR) | SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = "Graphics" OR t2.Company_name = "Nokia Corporation" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE phone (Hardware_Model_name VARCHAR, screen_mode VARCHAR); CREATE TABLE screen_mode (Graphics_mode VARCHAR, Type VARCHAR) Question: List the hardware model name for the phones that were produced by "Nokia Corporation" or whose screen mode type is "Graphics." [/INST] SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = "Graphics" OR t2.Company_name = "Nokia Corporation" </s> |
List the hardware model name for the phons that were produced by "Nokia Corporation" but whose screen mode type is not Text. | CREATE TABLE phone (Hardware_Model_name VARCHAR, screen_mode VARCHAR); CREATE TABLE screen_mode (Graphics_mode VARCHAR, Type VARCHAR) | SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE t2.Company_name = "Nokia Corporation" AND T1.Type <> "Text" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE phone (Hardware_Model_name VARCHAR, screen_mode VARCHAR); CREATE TABLE screen_mode (Graphics_mode VARCHAR, Type VARCHAR) Question: List the hardware model name for the phons that were produced by "Nokia Corporation" but whose screen mode type is not Text. [/INST] SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE t2.Company_name = "Nokia Corporation" AND T1.Type <> "Text" </s> |
List the phone hardware model and company name for the phones whose screen usage in kb is between 10 and 15. | CREATE TABLE phone (Hardware_Model_name VARCHAR, Company_name VARCHAR, screen_mode VARCHAR); CREATE TABLE screen_mode (Graphics_mode VARCHAR, used_kb INTEGER) | SELECT DISTINCT T2.Hardware_Model_name, T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.used_kb BETWEEN 10 AND 15 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE phone (Hardware_Model_name VARCHAR, Company_name VARCHAR, screen_mode VARCHAR); CREATE TABLE screen_mode (Graphics_mode VARCHAR, used_kb INTEGER) Question: List the phone hardware model and company name for the phones whose screen usage in kb is between 10 and 15. [/INST] SELECT DISTINCT T2.Hardware_Model_name, T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.used_kb BETWEEN 10 AND 15 </s> |
Find the number of phones for each accreditation type. | CREATE TABLE phone (Accreditation_type VARCHAR) | SELECT Accreditation_type, COUNT(*) FROM phone GROUP BY Accreditation_type | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE phone (Accreditation_type VARCHAR) Question: Find the number of phones for each accreditation type. [/INST] SELECT Accreditation_type, COUNT(*) FROM phone GROUP BY Accreditation_type </s> |
Find the accreditation level that more than 3 phones use. | CREATE TABLE phone (Accreditation_level VARCHAR) | SELECT Accreditation_level FROM phone GROUP BY Accreditation_level HAVING COUNT(*) > 3 | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE phone (Accreditation_level VARCHAR) Question: Find the accreditation level that more than 3 phones use. [/INST] SELECT Accreditation_level FROM phone GROUP BY Accreditation_level HAVING COUNT(*) > 3 </s> |
Find the details for all chip models. | CREATE TABLE chip_model (Id VARCHAR) | SELECT * FROM chip_model | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE chip_model (Id VARCHAR) Question: Find the details for all chip models. [/INST] SELECT * FROM chip_model </s> |
How many models do not have the wifi function? | CREATE TABLE chip_model (wifi VARCHAR) | SELECT COUNT(*) FROM chip_model WHERE wifi = 'No' | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE chip_model (wifi VARCHAR) Question: How many models do not have the wifi function? [/INST] SELECT COUNT(*) FROM chip_model WHERE wifi = 'No' </s> |
List all the model names sorted by their launch year. | CREATE TABLE chip_model (model_name VARCHAR, launch_year VARCHAR) | SELECT model_name FROM chip_model ORDER BY launch_year | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE chip_model (model_name VARCHAR, launch_year VARCHAR) Question: List all the model names sorted by their launch year. [/INST] SELECT model_name FROM chip_model ORDER BY launch_year </s> |
Find the average ram mib size of the chip models that are never used by any phone. | CREATE TABLE chip_model (RAM_MiB INTEGER, model_name VARCHAR, chip_model VARCHAR); CREATE TABLE phone (RAM_MiB INTEGER, model_name VARCHAR, chip_model VARCHAR) | SELECT AVG(RAM_MiB) FROM chip_model WHERE NOT model_name IN (SELECT chip_model FROM phone) | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE chip_model (RAM_MiB INTEGER, model_name VARCHAR, chip_model VARCHAR); CREATE TABLE phone (RAM_MiB INTEGER, model_name VARCHAR, chip_model VARCHAR) Question: Find the average ram mib size of the chip models that are never used by any phone. [/INST] SELECT AVG(RAM_MiB) FROM chip_model WHERE NOT model_name IN (SELECT chip_model FROM phone) </s> |
Find the names of the chip models that are not used by any phone with full accreditation type. | CREATE TABLE chip_model (model_name VARCHAR, chip_model VARCHAR, Accreditation_type VARCHAR); CREATE TABLE phone (model_name VARCHAR, chip_model VARCHAR, Accreditation_type VARCHAR) | SELECT model_name FROM chip_model EXCEPT SELECT chip_model FROM phone WHERE Accreditation_type = 'Full' | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE chip_model (model_name VARCHAR, chip_model VARCHAR, Accreditation_type VARCHAR); CREATE TABLE phone (model_name VARCHAR, chip_model VARCHAR, Accreditation_type VARCHAR) Question: Find the names of the chip models that are not used by any phone with full accreditation type. [/INST] SELECT model_name FROM chip_model EXCEPT SELECT chip_model FROM phone WHERE Accreditation_type = 'Full' </s> |
Find the pixels of the screen modes that are used by both phones with full accreditation types and phones with Provisional accreditation types. | CREATE TABLE phone (screen_mode VARCHAR, Accreditation_type VARCHAR); CREATE TABLE screen_mode (pixels VARCHAR, Graphics_mode VARCHAR) | SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode = t2.screen_mode WHERE t2.Accreditation_type = 'Provisional' INTERSECT SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode = t2.screen_mode WHERE t2.Accreditation_type = 'Full' | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE phone (screen_mode VARCHAR, Accreditation_type VARCHAR); CREATE TABLE screen_mode (pixels VARCHAR, Graphics_mode VARCHAR) Question: Find the pixels of the screen modes that are used by both phones with full accreditation types and phones with Provisional accreditation types. [/INST] SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode = t2.screen_mode WHERE t2.Accreditation_type = 'Provisional' INTERSECT SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode = t2.screen_mode WHERE t2.Accreditation_type = 'Full' </s> |
How many countries are there in total? | CREATE TABLE country (Id VARCHAR) | SELECT COUNT(*) FROM country | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE country (Id VARCHAR) Question: How many countries are there in total? [/INST] SELECT COUNT(*) FROM country </s> |
Show the country name and capital of all countries. | CREATE TABLE country (Country_name VARCHAR, Capital VARCHAR) | SELECT Country_name, Capital FROM country | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE country (Country_name VARCHAR, Capital VARCHAR) Question: Show the country name and capital of all countries. [/INST] SELECT Country_name, Capital FROM country </s> |
Show all official native languages that contain the word "English". | CREATE TABLE country (Official_native_language VARCHAR) | SELECT Official_native_language FROM country WHERE Official_native_language LIKE "%English%" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE country (Official_native_language VARCHAR) Question: Show all official native languages that contain the word "English". [/INST] SELECT Official_native_language FROM country WHERE Official_native_language LIKE "%English%" </s> |
Show all distinct positions of matches. | CREATE TABLE match_season (POSITION VARCHAR) | SELECT DISTINCT POSITION FROM match_season | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE match_season (POSITION VARCHAR) Question: Show all distinct positions of matches. [/INST] SELECT DISTINCT POSITION FROM match_season </s> |
Show the players from college UCLA. | CREATE TABLE match_season (Player VARCHAR, College VARCHAR) | SELECT Player FROM match_season WHERE College = "UCLA" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE match_season (Player VARCHAR, College VARCHAR) Question: Show the players from college UCLA. [/INST] SELECT Player FROM match_season WHERE College = "UCLA" </s> |
Show the distinct position of players from college UCLA or Duke. | CREATE TABLE match_season (POSITION VARCHAR, College VARCHAR) | SELECT DISTINCT POSITION FROM match_season WHERE College = "UCLA" OR College = "Duke" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE match_season (POSITION VARCHAR, College VARCHAR) Question: Show the distinct position of players from college UCLA or Duke. [/INST] SELECT DISTINCT POSITION FROM match_season WHERE College = "UCLA" OR College = "Duke" </s> |
Show the draft pick numbers and draft classes of players whose positions are defenders. | CREATE TABLE match_season (Draft_Pick_Number VARCHAR, Draft_Class VARCHAR, POSITION VARCHAR) | SELECT Draft_Pick_Number, Draft_Class FROM match_season WHERE POSITION = "Defender" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE match_season (Draft_Pick_Number VARCHAR, Draft_Class VARCHAR, POSITION VARCHAR) Question: Show the draft pick numbers and draft classes of players whose positions are defenders. [/INST] SELECT Draft_Pick_Number, Draft_Class FROM match_season WHERE POSITION = "Defender" </s> |
How many distinct teams are involved in match seasons? | CREATE TABLE match_season (Team VARCHAR) | SELECT COUNT(DISTINCT Team) FROM match_season | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE match_season (Team VARCHAR) Question: How many distinct teams are involved in match seasons? [/INST] SELECT COUNT(DISTINCT Team) FROM match_season </s> |
Show the players and the years played. | CREATE TABLE player (Player VARCHAR, Years_Played VARCHAR) | SELECT Player, Years_Played FROM player | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE player (Player VARCHAR, Years_Played VARCHAR) Question: Show the players and the years played. [/INST] SELECT Player, Years_Played FROM player </s> |
Show all team names. | CREATE TABLE Team (Name VARCHAR) | SELECT Name FROM Team | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Team (Name VARCHAR) Question: Show all team names. [/INST] SELECT Name FROM Team </s> |
Show the season, the player, and the name of the country that player belongs to. | CREATE TABLE match_season (Season VARCHAR, Player VARCHAR, Country VARCHAR); CREATE TABLE country (Country_name VARCHAR, Country_id VARCHAR) | SELECT T2.Season, T2.Player, T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE match_season (Season VARCHAR, Player VARCHAR, Country VARCHAR); CREATE TABLE country (Country_name VARCHAR, Country_id VARCHAR) Question: Show the season, the player, and the name of the country that player belongs to. [/INST] SELECT T2.Season, T2.Player, T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country </s> |
Which players are from Indonesia? | CREATE TABLE country (Country_id VARCHAR, Country_name VARCHAR); CREATE TABLE match_season (Player VARCHAR, Country VARCHAR) | SELECT T2.Player FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Country_name = "Indonesia" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE country (Country_id VARCHAR, Country_name VARCHAR); CREATE TABLE match_season (Player VARCHAR, Country VARCHAR) Question: Which players are from Indonesia? [/INST] SELECT T2.Player FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Country_name = "Indonesia" </s> |
What are the distinct positions of the players from a country whose capital is Dublin? | CREATE TABLE country (Country_id VARCHAR, Capital VARCHAR); CREATE TABLE match_season (Position VARCHAR, Country VARCHAR) | SELECT DISTINCT T2.Position FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Capital = "Dublin" | <s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE country (Country_id VARCHAR, Capital VARCHAR); CREATE TABLE match_season (Position VARCHAR, Country VARCHAR) Question: What are the distinct positions of the players from a country whose capital is Dublin? [/INST] SELECT DISTINCT T2.Position FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Capital = "Dublin" </s> |