messages
listlengths
3
3
system
stringclasses
1 value
user
stringlengths
326
8.38k
assistant
stringlengths
18
577
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_name , access_count FROM documents ORDER BY document_name
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_name , access_count FROM documents ORDER BY access_count DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_name , access_count FROM documents ORDER BY access_count DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING count(*) > 4
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING count(*) > 4
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT sum(access_count) FROM documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT sum(access_count) FROM documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT avg(access_count) FROM documents
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT avg(access_count) FROM documents
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT t2.document_structure_description FROM documents AS t1 JOIN document_structures AS t2 ON t1.document_structure_code = t2.document_structure_code GROUP BY t1.document_structure_code ORDER BY count(*) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT t2.document_structure_description FROM documents AS t1 JOIN document_structures AS t2 ON t1.document_structure_code = t2.document_structure_code GROUP BY t1.document_structure_code ORDER BY count(*) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_type_code FROM documents WHERE document_name = "David CV"
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_type_code FROM documents WHERE document_name = "David CV"
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_name FROM documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 3 INTERSECT SELECT document_name FROM documents GROUP BY document_structure_code ORDER BY count(*) DESC LIMIT 3
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_name FROM documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 3 INTERSECT SELECT document_name FROM documents GROUP BY document_structure_code ORDER BY count(*) DESC LIMIT 3
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING sum(access_count) > 10000
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING sum(access_count) > 10000
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT t2.section_title FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code WHERE t1.document_name = "David CV"
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT t2.section_title FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code WHERE t1.document_name = "David CV"
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_name FROM documents WHERE document_code NOT IN (SELECT document_code FROM document_sections)
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_name FROM documents WHERE document_code NOT IN (SELECT document_code FROM document_sections)
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT user_name , password FROM users GROUP BY role_code ORDER BY count(*) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT user_name , password FROM users GROUP BY role_code ORDER BY count(*) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT avg(t1.access_count) FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code = t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code = t3.functional_area_code WHERE t3.functional_area_description = "Acknowledgement"
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT avg(t1.access_count) FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code = t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code = t3.functional_area_code WHERE t3.functional_area_description = "Acknowledgement"
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_name FROM documents EXCEPT SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code JOIN document_sections_images AS t3 ON t2.section_id = t3.section_id
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_name FROM documents EXCEPT SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code JOIN document_sections_images AS t3 ON t2.section_id = t3.section_id
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code GROUP BY t1.document_code ORDER BY count(*) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code GROUP BY t1.document_code ORDER BY count(*) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_name FROM documents WHERE document_name LIKE "%CV%"
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_name FROM documents WHERE document_name LIKE "%CV%"
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT count(*) FROM users WHERE user_login = 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT count(*) FROM users WHERE user_login = 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT role_description FROM ROLES WHERE role_code = (SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY count(*) DESC LIMIT 1)
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT role_description FROM ROLES WHERE role_code = (SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY count(*) DESC LIMIT 1)
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT avg(access_count) FROM documents GROUP BY document_structure_code ORDER BY count(*) ASC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT avg(access_count) FROM documents GROUP BY document_structure_code ORDER BY count(*) ASC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT image_name , image_url FROM images ORDER BY image_name
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT image_name , image_url FROM images ORDER BY image_name
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT count(*) , role_code FROM users GROUP BY role_code
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT count(*) , role_code FROM users GROUP BY role_code
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING count(*) > 2
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE `Roles` (\n`role_code` VARCHAR(15) PRIMARY KEY,\...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE `Roles` ( `role_code` VARCHAR(15) PRIMARY KEY, `role_description` VARCHAR(80) ) CREATE TABLE `Users` ( `user_id` INTEGER PRIMARY KEY, `role_code` VARCHAR(15) NOT NULL, `user_name` VARCHAR(40), `user_login` VARCHAR(40), `password` VARCHAR(40), FOREIGN KEY (`role_code` ) REFERENCES `Role...
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING count(*) > 2
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT count(*) FROM Companies
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT count(*) FROM Companies
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT name FROM Companies ORDER BY Market_Value_billion DESC
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT name FROM Companies ORDER BY Market_Value_billion DESC
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT name FROM Companies WHERE Headquarters != 'USA'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT name FROM Companies WHERE Headquarters != 'USA'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT name , Assets_billion FROM Companies ORDER BY name ASC
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT name , Assets_billion FROM Companies ORDER BY name ASC
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT avg(Profits_billion) FROM Companies
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT avg(Profits_billion) FROM Companies
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT max(Sales_billion) , min(Sales_billion) FROM Companies WHERE Industry != "Banking"
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT max(Sales_billion) , min(Sales_billion) FROM Companies WHERE Industry != "Banking"
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT count(DISTINCT Industry) FROM Companies
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT count(DISTINCT Industry) FROM Companies
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT name FROM buildings ORDER BY Height DESC
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT name FROM buildings ORDER BY Height DESC
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT T3.name , T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT T3.name , T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id HAVING COUNT(*) > 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id HAVING COUNT(*) > 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id ORDER BY COUNT(*) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id ORDER BY COUNT(*) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT name FROM buildings WHERE Status = "on-hold" ORDER BY Stories ASC
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT name FROM buildings WHERE Status = "on-hold" ORDER BY Stories ASC
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT Industry , COUNT(*) FROM Companies GROUP BY Industry
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT Industry , COUNT(*) FROM Companies GROUP BY Industry
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT name FROM buildings WHERE id NOT IN (SELECT building_id FROM Office_locations)
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT name FROM buildings WHERE id NOT IN (SELECT building_id FROM Office_locations)
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT Industry FROM Companies WHERE Headquarters = "USA" INTERSECT SELECT Industry FROM Companies WHERE Headquarters = "China"
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT Industry FROM Companies WHERE Headquarters = "USA" INTERSECT SELECT Industry FROM Companies WHERE Headquarters = "China"
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT count(*) FROM Companies WHERE Industry = "Banking" OR Industry = "Conglomerate"
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT count(*) FROM Companies WHERE Industry = "Banking" OR Industry = "Conglomerate"
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT Headquarters FROM Companies GROUP BY Headquarters HAVING COUNT(*) > 2
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"buildings\" (\n\"id\" int,\n\"name\" text,\n\"...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "buildings" ( "id" int, "name" text, "City" text, "Height" int, "Stories" int, "Status" text, PRIMARY KEY("id") ) CREATE TABLE "Companies" ( "id" int, "name" text, "Headquarters" text, "Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value_b...
SELECT Headquarters FROM Companies GROUP BY Headquarters HAVING COUNT(*) > 2
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Addresses (\nAddress_ID INTEGER NOT NULL ,\naddr...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Addresses ( Address_ID INTEGER NOT NULL , address_details VARCHAR(255), PRIMARY KEY (Address_ID), UNIQUE (Address_ID) ) CREATE TABLE Locations ( Location_ID INTEGER NOT NULL , Other_Details VARCHAR(255), PRIMARY KEY (Location_ID) ) CREATE TABLE Products ( Product_ID INTEGER NOT NULL, ...
SELECT count(*) FROM Products
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Addresses (\nAddress_ID INTEGER NOT NULL ,\naddr...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Addresses ( Address_ID INTEGER NOT NULL , address_details VARCHAR(255), PRIMARY KEY (Address_ID), UNIQUE (Address_ID) ) CREATE TABLE Locations ( Location_ID INTEGER NOT NULL , Other_Details VARCHAR(255), PRIMARY KEY (Location_ID) ) CREATE TABLE Products ( Product_ID INTEGER NOT NULL, ...
SELECT Product_Name FROM Products ORDER BY Product_Price ASC
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Addresses (\nAddress_ID INTEGER NOT NULL ,\naddr...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Addresses ( Address_ID INTEGER NOT NULL , address_details VARCHAR(255), PRIMARY KEY (Address_ID), UNIQUE (Address_ID) ) CREATE TABLE Locations ( Location_ID INTEGER NOT NULL , Other_Details VARCHAR(255), PRIMARY KEY (Location_ID) ) CREATE TABLE Products ( Product_ID INTEGER NOT NULL, ...
SELECT Product_Name , Product_Type_Code FROM Products
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Addresses (\nAddress_ID INTEGER NOT NULL ,\naddr...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Addresses ( Address_ID INTEGER NOT NULL , address_details VARCHAR(255), PRIMARY KEY (Address_ID), UNIQUE (Address_ID) ) CREATE TABLE Locations ( Location_ID INTEGER NOT NULL , Other_Details VARCHAR(255), PRIMARY KEY (Location_ID) ) CREATE TABLE Products ( Product_ID INTEGER NOT NULL, ...
SELECT Product_Price FROM Products WHERE Product_Name = "Dining" OR Product_Name = "Trading Policy"
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Addresses (\nAddress_ID INTEGER NOT NULL ,\naddr...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Addresses ( Address_ID INTEGER NOT NULL , address_details VARCHAR(255), PRIMARY KEY (Address_ID), UNIQUE (Address_ID) ) CREATE TABLE Locations ( Location_ID INTEGER NOT NULL , Other_Details VARCHAR(255), PRIMARY KEY (Location_ID) ) CREATE TABLE Products ( Product_ID INTEGER NOT NULL, ...
SELECT avg(Product_Price) FROM Products
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Addresses (\nAddress_ID INTEGER NOT NULL ,\naddr...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Addresses ( Address_ID INTEGER NOT NULL , address_details VARCHAR(255), PRIMARY KEY (Address_ID), UNIQUE (Address_ID) ) CREATE TABLE Locations ( Location_ID INTEGER NOT NULL , Other_Details VARCHAR(255), PRIMARY KEY (Location_ID) ) CREATE TABLE Products ( Product_ID INTEGER NOT NULL, ...
SELECT Product_Name FROM Products ORDER BY Product_Price DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Addresses (\nAddress_ID INTEGER NOT NULL ,\naddr...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Addresses ( Address_ID INTEGER NOT NULL , address_details VARCHAR(255), PRIMARY KEY (Address_ID), UNIQUE (Address_ID) ) CREATE TABLE Locations ( Location_ID INTEGER NOT NULL , Other_Details VARCHAR(255), PRIMARY KEY (Location_ID) ) CREATE TABLE Products ( Product_ID INTEGER NOT NULL, ...
SELECT Product_Type_Code , COUNT(*) FROM Products GROUP BY Product_Type_Code
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Addresses (\nAddress_ID INTEGER NOT NULL ,\naddr...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Addresses ( Address_ID INTEGER NOT NULL , address_details VARCHAR(255), PRIMARY KEY (Address_ID), UNIQUE (Address_ID) ) CREATE TABLE Locations ( Location_ID INTEGER NOT NULL , Other_Details VARCHAR(255), PRIMARY KEY (Location_ID) ) CREATE TABLE Products ( Product_ID INTEGER NOT NULL, ...
SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(*) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Addresses (\nAddress_ID INTEGER NOT NULL ,\naddr...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Addresses ( Address_ID INTEGER NOT NULL , address_details VARCHAR(255), PRIMARY KEY (Address_ID), UNIQUE (Address_ID) ) CREATE TABLE Locations ( Location_ID INTEGER NOT NULL , Other_Details VARCHAR(255), PRIMARY KEY (Location_ID) ) CREATE TABLE Products ( Product_ID INTEGER NOT NULL, ...
SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code HAVING COUNT(*) >= 2
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Addresses (\nAddress_ID INTEGER NOT NULL ,\naddr...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Addresses ( Address_ID INTEGER NOT NULL , address_details VARCHAR(255), PRIMARY KEY (Address_ID), UNIQUE (Address_ID) ) CREATE TABLE Locations ( Location_ID INTEGER NOT NULL , Other_Details VARCHAR(255), PRIMARY KEY (Location_ID) ) CREATE TABLE Products ( Product_ID INTEGER NOT NULL, ...
SELECT Product_Type_Code FROM Products WHERE Product_Price > 4500 INTERSECT SELECT Product_Type_Code FROM Products WHERE Product_Price < 3000
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Addresses (\nAddress_ID INTEGER NOT NULL ,\naddr...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Addresses ( Address_ID INTEGER NOT NULL , address_details VARCHAR(255), PRIMARY KEY (Address_ID), UNIQUE (Address_ID) ) CREATE TABLE Locations ( Location_ID INTEGER NOT NULL , Other_Details VARCHAR(255), PRIMARY KEY (Location_ID) ) CREATE TABLE Products ( Product_ID INTEGER NOT NULL, ...
SELECT T1.Product_Name , COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Addresses (\nAddress_ID INTEGER NOT NULL ,\naddr...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Addresses ( Address_ID INTEGER NOT NULL , address_details VARCHAR(255), PRIMARY KEY (Address_ID), UNIQUE (Address_ID) ) CREATE TABLE Locations ( Location_ID INTEGER NOT NULL , Other_Details VARCHAR(255), PRIMARY KEY (Location_ID) ) CREATE TABLE Products ( Product_ID INTEGER NOT NULL, ...
SELECT T1.Product_Name , COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name ORDER BY COUNT(*) DESC
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Addresses (\nAddress_ID INTEGER NOT NULL ,\naddr...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Addresses ( Address_ID INTEGER NOT NULL , address_details VARCHAR(255), PRIMARY KEY (Address_ID), UNIQUE (Address_ID) ) CREATE TABLE Locations ( Location_ID INTEGER NOT NULL , Other_Details VARCHAR(255), PRIMARY KEY (Location_ID) ) CREATE TABLE Products ( Product_ID INTEGER NOT NULL, ...
SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT(*) >= 2
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Addresses (\nAddress_ID INTEGER NOT NULL ,\naddr...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Addresses ( Address_ID INTEGER NOT NULL , address_details VARCHAR(255), PRIMARY KEY (Address_ID), UNIQUE (Address_ID) ) CREATE TABLE Locations ( Location_ID INTEGER NOT NULL , Other_Details VARCHAR(255), PRIMARY KEY (Location_ID) ) CREATE TABLE Products ( Product_ID INTEGER NOT NULL, ...
SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT(*) >= 2 ORDER BY T1.Product_Name
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Addresses (\nAddress_ID INTEGER NOT NULL ,\naddr...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Addresses ( Address_ID INTEGER NOT NULL , address_details VARCHAR(255), PRIMARY KEY (Address_ID), UNIQUE (Address_ID) ) CREATE TABLE Locations ( Location_ID INTEGER NOT NULL , Other_Details VARCHAR(255), PRIMARY KEY (Location_ID) ) CREATE TABLE Products ( Product_ID INTEGER NOT NULL, ...
SELECT Product_Name FROM Products WHERE Product_ID NOT IN (SELECT Product_ID FROM Products_in_Events)
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"festival_detail\" (\n\"Festival_ID\" int,\n\"F...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "festival_detail" ( "Festival_ID" int, "Festival_Name" text, "Chair_Name" text, "Location" text, "Year" int, "Num_of_Audience" int, PRIMARY KEY ("Festival_ID") ) CREATE TABLE artwork ( "Artwork_ID" int, "Type" text, "Name" text, PRIMARY KEY ("Artwork_ID") ) CREATE TABLE nomination ( "...
SELECT count(*) FROM artwork
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"festival_detail\" (\n\"Festival_ID\" int,\n\"F...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE "festival_detail" ( "Festival_ID" int, "Festival_Name" text, "Chair_Name" text, "Location" text, "Year" int, "Num_of_Audience" int, PRIMARY KEY ("Festival_ID") ) CREATE TABLE artwork ( "Artwork_ID" int, "Type" text, "Name" text, PRIMARY KEY ("Artwork_ID") ) CREATE TABLE nomination ( "...
SELECT Name FROM artwork ORDER BY Name ASC