context
stringlengths 27
489
| answer
stringlengths 18
557
| question_th
stringlengths 8
226
| question_en
stringlengths 12
244
|
---|---|---|---|
CREATE TABLE organisation_Types (organisation_type VARCHAR, organisation_type_description VARCHAR); CREATE TABLE Grants (grant_id VARCHAR, organisation_id VARCHAR, grant_amount VARCHAR); CREATE TABLE Organisations (organisation_id VARCHAR, organisation_type VARCHAR); CREATE TABLE documents (sent_date VARCHAR, grant_id VARCHAR) | SELECT T1.sent_date FROM documents AS T1 JOIN Grants AS T2 ON T1.grant_id = T2.grant_id JOIN Organisations AS T3 ON T2.organisation_id = T3.organisation_id JOIN organisation_Types AS T4 ON T3.organisation_type = T4.organisation_type WHERE T2.grant_amount > 5000 AND T4.organisation_type_description = 'Research' | ค้นหาวันที่ส่งเอกสารที่มีจำนวนทุนมากกว่า 5,000 ที่ได้รับตามประเภทองค์กรที่อธิบายไว้ | Find out the send dates of the documents with the grant amount of more than 5000 were granted by organisation type described |
CREATE TABLE Documents (response_received_date VARCHAR, document_type_code VARCHAR, grant_id VARCHAR); CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR); CREATE TABLE Grants (grant_id VARCHAR, grant_amount VARCHAR) | SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Types AS T2 ON T1.document_type_code = T2.document_type_code JOIN Grants AS T3 ON T1.grant_id = T3.grant_id WHERE T2.document_description = 'Regular' OR T3.grant_amount > 100 | วันที่ได้รับคำตอบสำหรับเอกสารที่อธิบายว่า 'ปกติ' หรือได้รับมากกว่า 100 คือเมื่อใด | What are the response received dates for the documents described as 'Regular' or granted with more than 100? |
CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR, role_code VARCHAR); CREATE TABLE Project_Staff (project_details VARCHAR, project_id VARCHAR, role_code VARCHAR) | SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_Staff WHERE role_code = 'researcher') | ระบุรายละเอียดโครงการของโครงการที่ไม่มีการจ้างบุคลากรเป็นนักวิจัย | List the project details of the projects which did not hire any staff for a researcher role. |
CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR); CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Tasks (task_details VARCHAR, task_id VARCHAR, project_id VARCHAR) | SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'omnis' UNION SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.project_id HAVING COUNT(*) > 2 | รายละเอียดงาน รหัสงาน และรหัสโครงการสำหรับโครงการที่มีรายละเอียดเป็น 'omnis' หรือมีผลลัพธ์มากกว่า 2 รายการคืออะไร | What are the task details, task id and project id for the projects which are detailed as 'omnis' or have more than 2 outcomes? |
CREATE TABLE Project_Staff (date_from VARCHAR, date_to VARCHAR, role_code VARCHAR) | SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'researcher' | เจ้าหน้าที่บทบาทนักวิจัยทั้งหมดเริ่มทำงานเมื่อใด และจะหยุดทำงานเมื่อใด | When do all the researcher role staff start to work, and when do they stop working? |
CREATE TABLE Project_Staff (role_code VARCHAR) | SELECT COUNT(DISTINCT role_code) FROM Project_Staff | บทบาทของพนักงานมีกี่ประเภท? | How many kinds of roles are there for the staff? |
CREATE TABLE Grants (organisation_id VARCHAR, grant_amount INTEGER) | SELECT SUM(grant_amount), organisation_id FROM Grants GROUP BY organisation_id | แต่ละองค์กรได้รับทุนสนับสนุนทั้งหมดเป็นจำนวนเท่าใด? ระบุรหัสองค์กรด้วย | What is the total amount of grants given by each organisations? Also list the organisation id. |
CREATE TABLE Research_outcomes (outcome_code VARCHAR, outcome_description VARCHAR); CREATE TABLE Project_outcomes (project_id VARCHAR, outcome_code VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR) | SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id JOIN Research_outcomes AS T3 ON T2.outcome_code = T3.outcome_code WHERE T3.outcome_description LIKE '%Published%' | แสดงรายการรายละเอียดโครงการของโครงการพร้อมผลการวิจัยที่อธิบายด้วยสตริงย่อย 'เผยแพร่แล้ว' | List the project details of the projects with the research outcome described with the substring 'Published'. |
CREATE TABLE Project_Staff (project_id VARCHAR); CREATE TABLE Projects (project_id VARCHAR) | SELECT T1.project_id, COUNT(*) FROM Project_Staff AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) | แต่ละโครงการมีพนักงานกี่คน? แสดงรายการรหัสโครงการและหมายเลขตามลำดับจากน้อยไปหามาก | How many staff does each project has? List the project id and the number in an ascending order. |
CREATE TABLE Staff_Roles (role_description VARCHAR, role_code VARCHAR) | SELECT role_description FROM Staff_Roles WHERE role_code = 'researcher' | คำอธิบายบทบาทของนักวิจัยที่สมบูรณ์คืออะไร | What is the complete description of the researcher role. |
CREATE TABLE Project_Staff (date_from VARCHAR) | SELECT date_from FROM Project_Staff ORDER BY date_from LIMIT 1 | พนักงานคนแรกของโครงการเริ่มทำงานเมื่อใด | When did the first staff for the projects started working? |
CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR) | SELECT T1.project_details, T1.project_id FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) DESC LIMIT 1 | โครงการใดสร้างผลลัพธ์ได้มากที่สุด? แสดงรายการรายละเอียดโครงการและรหัสโครงการ | Which project made the most number of outcomes? List the project details and the project id. |
CREATE TABLE Project_outcomes (project_details VARCHAR, project_id VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR) | SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_outcomes) | โครงการไหนไม่มีผลงาน? แสดงรายการรายละเอียดโครงการ | Which projects have no outcome? List the project details. |
CREATE TABLE Organisations (organisation_id VARCHAR, organisation_type VARCHAR, organisation_details VARCHAR); CREATE TABLE Research_Staff (employer_organisation_id VARCHAR) | SELECT T1.organisation_id, T1.organisation_type, T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1 | องค์กรใดจ้างเจ้าหน้าที่วิจัยจำนวนมากที่สุด? ระบุรหัสองค์กร ประเภท และรายละเอียด | Which organisation hired the most number of research staff? List the organisation id, type and detail. |
CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Project_Staff (staff_id VARCHAR, role_code VARCHAR, project_id VARCHAR); CREATE TABLE Staff_Roles (role_description VARCHAR, role_code VARCHAR) | SELECT T1.role_description, T2.staff_id FROM Staff_Roles AS T1 JOIN Project_Staff AS T2 ON T1.role_code = T2.role_code JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.staff_id ORDER BY COUNT(*) DESC LIMIT 1 | แสดงคำอธิบายบทบาทและรหัสของเจ้าหน้าที่โครงการที่เกี่ยวข้องกับผลลัพธ์ของโครงการส่วนใหญ่หรือไม่ | Show the role description and the id of the project staff involved in most number of project outcomes? |
CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR) | SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%' | เอกสารประเภทใดที่อธิบายด้วยคำนำหน้า 'เริ่มต้น' | Which document type is described with the prefix 'Initial'? |
CREATE TABLE Grants (grant_start_date VARCHAR, grant_id VARCHAR); CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR); CREATE TABLE Documents (grant_id VARCHAR, document_type_code VARCHAR) | SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Regular' INTERSECT SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Initial Application' | สำหรับทุนที่มีทั้งเอกสารที่อธิบายว่า 'ปกติ' และเอกสารที่อธิบายว่า 'การสมัครเริ่มต้น' ให้ระบุวันที่เริ่มต้น | For grants with both documents described as 'Regular' and documents described as 'Initial Application', list its start date. |
CREATE TABLE Documents (grant_id VARCHAR) | SELECT grant_id, COUNT(*) FROM Documents GROUP BY grant_id ORDER BY COUNT(*) DESC LIMIT 1 | หนึ่งทุนสามารถมีเอกสารได้มากสุดกี่ฉบับ? ระบุรหัสและหมายเลขการให้สิทธิ์ | How many documents can one grant have at most? List the grant id and number. |
CREATE TABLE Organisations (organisation_type VARCHAR, organisation_details VARCHAR); CREATE TABLE organisation_Types (organisation_type_description VARCHAR, organisation_type VARCHAR) | SELECT T1.organisation_type_description FROM organisation_Types AS T1 JOIN Organisations AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_details = 'quo' | ค้นหาคำอธิบายประเภทองค์กรขององค์กรที่มีรายละเอียดเป็น 'ที่เป็นอยู่' | Find the organisation type description of the organisation detailed as 'quo'. |
CREATE TABLE organisation_Types (organisation_type VARCHAR, organisation_type_description VARCHAR); CREATE TABLE Organisations (organisation_type VARCHAR) | SELECT organisation_details FROM Organisations AS T1 JOIN organisation_Types AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_type_description = 'Sponsor' ORDER BY organisation_details | รายละเอียดทั้งหมดขององค์กรที่ได้รับการอธิบายว่าเป็น 'ผู้สนับสนุน' มีอะไรบ้าง เรียงลำดับผลลัพธ์จากน้อยไปหามาก | What are all the details of the organisations described as 'Sponsor'? Sort the result in an ascending order. |
CREATE TABLE Project_outcomes (outcome_code VARCHAR) | SELECT COUNT(*) FROM Project_outcomes WHERE outcome_code = 'Patent' | มีผลลัพธ์ด้านสิทธิบัตรจำนวนเท่าใดจากโครงการทั้งหมด? | How many Patent outcomes are generated from all the projects? |
CREATE TABLE Project_Staff (role_code VARCHAR, date_from VARCHAR) | SELECT COUNT(*) FROM Project_Staff WHERE role_code = 'leader' OR date_from < '1989-04-24 23:51:54' | มีเจ้าหน้าที่โครงการกี่คนที่ทำงานเป็นผู้นำหรือเริ่มทำงานก่อน '1989-04-24 23:51:54'? | How many project staff worked as leaders or started working before '1989-04-24 23:51:54'? |
CREATE TABLE Project_Staff (date_to VARCHAR) | SELECT date_to FROM Project_Staff ORDER BY date_to DESC LIMIT 1 | พนักงานออกจากโครงการวันสุดท้ายคือเมื่อใด | What is the last date of the staff leaving the projects? |
CREATE TABLE Project_outcomes (outcome_code VARCHAR, project_id VARCHAR); CREATE TABLE Research_outcomes (outcome_description VARCHAR, outcome_code VARCHAR); CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR) | SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code JOIN Projects AS T3 ON T2.project_id = T3.project_id WHERE T3.project_details = 'sint' | คำอธิบายผลลัพธ์ของโครงการที่มีรายละเอียด 'sint' คืออะไร? | What are the result description of the project whose detail is 'sint'? |
CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Projects (organisation_id VARCHAR, project_id VARCHAR) | SELECT T1.organisation_id, COUNT(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1 | ระบุรหัสองค์กรที่มีการนับผลลัพธ์สูงสุดและจำนวน | List the organisation id with the maximum outcome count, and the count. |
CREATE TABLE Projects (project_details VARCHAR, organisation_id VARCHAR) | SELECT project_details FROM Projects WHERE organisation_id IN (SELECT organisation_id FROM Projects GROUP BY organisation_id ORDER BY COUNT(*) DESC LIMIT 1) | แสดงรายการรายละเอียดโครงการของโครงการที่เปิดตัวโดยองค์กร | List the project details of the projects launched by the organisation |
CREATE TABLE Research_Staff (staff_details VARCHAR) | SELECT staff_details FROM Research_Staff ORDER BY staff_details | ระบุรายละเอียดของเจ้าหน้าที่วิจัย และเรียงลำดับจากน้อยไปหามาก | List the research staff details, and order in ascending order. |
CREATE TABLE Tasks (Id VARCHAR) | SELECT COUNT(*) FROM Tasks | มีงานทั้งหมดกี่งาน? | How many tasks are there in total? |
CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR); CREATE TABLE Tasks (project_id VARCHAR) | SELECT COUNT(*), T1.project_details FROM Projects AS T1 JOIN Tasks AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id | แต่ละโครงการมีงานกี่งาน? แสดงรายการจำนวนงานและรายละเอียดโครงการ | How many tasks does each project have? List the task count and the project detail. |
CREATE TABLE Project_Staff (role_code VARCHAR, date_from VARCHAR, date_to VARCHAR) | SELECT role_code FROM Project_Staff WHERE date_from > '2003-04-19 15:06:20' AND date_to < '2016-03-15 00:33:18' | บทบาทของพนักงานของพนักงานคืออะไร | What are the staff roles of the staff who |
CREATE TABLE Research_outcomes (outcome_description VARCHAR, outcome_code VARCHAR); CREATE TABLE Project_outcomes (outcome_code VARCHAR) | SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code | รายละเอียดของผลลัพธ์ของโครงการทั้งหมดมีอะไรบ้าง? | What are the descriptions of all the project outcomes? |
CREATE TABLE Project_Staff (role_code VARCHAR) | SELECT role_code FROM Project_Staff GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1 | บทบาทใดที่พบบ่อยที่สุดสำหรับพนักงาน? | Which role is most common for the staff? |
CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR) | SELECT COUNT(T2.friend) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Dan' | แดนมีเพื่อนกี่คน? | How many friends does Dan have? |
CREATE TABLE Person (gender VARCHAR) | SELECT COUNT(*) FROM Person WHERE gender = 'female' | เครือข่ายนี้มีผู้หญิงกี่คน? | How many females does this network has? |
CREATE TABLE Person (age INTEGER) | SELECT AVG(age) FROM Person | อายุเฉลี่ยของทุกคนคือเท่าไร? | What is the average age for all person? |
CREATE TABLE Person (city VARCHAR) | SELECT COUNT(DISTINCT city) FROM Person | พวกเขามาจากเมืองต่างๆ กี่เมือง? | How many different cities are they from? |
CREATE TABLE Person (job VARCHAR) | SELECT COUNT(DISTINCT job) FROM Person | พวกเขามีงานกี่ประเภท? | How many type of jobs do they have? |
CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE person (name VARCHAR, age INTEGER) | SELECT name FROM Person WHERE age = (SELECT MAX(age) FROM person) | ใครคือบุคคลที่อายุมากที่สุด? | Who is the oldest person? |
CREATE TABLE person (name VARCHAR, job VARCHAR, age INTEGER); CREATE TABLE Person (name VARCHAR, job VARCHAR, age INTEGER) | SELECT name FROM Person WHERE job = 'student' AND age = (SELECT MAX(age) FROM person WHERE job = 'student') | ใครอายุมากที่สุดที่ทำงานเป็นนักศึกษา? | Who is the oldest person whose job is student? |
CREATE TABLE Person (name VARCHAR, gender VARCHAR, age INTEGER); CREATE TABLE person (name VARCHAR, gender VARCHAR, age INTEGER) | SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT MIN(age) FROM person WHERE gender = 'male') | ใครคือผู้ชายที่อายุน้อยที่สุด? | Who is the youngest male? |
CREATE TABLE Person (age VARCHAR, job VARCHAR, name VARCHAR) | SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach' | หมอชื่อแซคอายุเท่าไหร่? | How old is the doctor named Zach? |
CREATE TABLE Person (name VARCHAR, age INTEGER) | SELECT name FROM Person WHERE age < 30 | ใครคือผู้ที่มีอายุต่ำกว่า 30 ปี? | Who is the person whose age is below 30? |
CREATE TABLE Person (age VARCHAR, job VARCHAR) | SELECT COUNT(*) FROM Person WHERE age > 30 AND job = 'engineer' | อายุ 30 ปีขึ้นไป และอาชีพวิศวกรมีกี่คน? | How many people whose age is greater 30 and job is engineer? |
CREATE TABLE Person (gender VARCHAR, age INTEGER) | SELECT AVG(age), gender FROM Person GROUP BY gender | อายุเฉลี่ยของแต่ละเพศคือเท่าไร? | What is the average age for each gender? |
CREATE TABLE Person (job VARCHAR, age INTEGER) | SELECT AVG(age), job FROM Person GROUP BY job | อายุเฉลี่ยสำหรับตำแหน่งงานที่แตกต่างกันคือเท่าใด | What is average age for different job title? |
CREATE TABLE Person (job VARCHAR, age INTEGER, gender VARCHAR) | SELECT AVG(age), job FROM Person WHERE gender = 'male' GROUP BY job | อายุเฉลี่ยของผู้ชายในตำแหน่งงานที่แตกต่างกันคือเท่าไร? | What is average age of male for different job title? |
CREATE TABLE Person (job VARCHAR, age INTEGER) | SELECT MIN(age), job FROM Person GROUP BY job | อายุขั้นต่ำสำหรับตำแหน่งงานที่แตกต่างกันคือเท่าไร? | What is minimum age for different job title? |
CREATE TABLE Person (gender VARCHAR, age INTEGER) | SELECT COUNT(*), gender FROM Person WHERE age < 40 GROUP BY gender | ค้นหาจำนวนผู้ที่มีอายุต่ำกว่า 40 ปี ในแต่ละเพศ | Find the number of people who is under 40 for each gender. |
CREATE TABLE Person (name VARCHAR, age INTEGER, job VARCHAR); CREATE TABLE person (name VARCHAR, age INTEGER, job VARCHAR) | SELECT name FROM Person WHERE age > (SELECT MIN(age) FROM person WHERE job = 'engineer') ORDER BY age | ค้นหารายชื่อผู้ที่มีอายุมากกว่าวิศวกรโดยเรียงตามอายุ | Find the name of people whose age is greater than any engineer sorted by their age. |
CREATE TABLE Person (age INTEGER, job VARCHAR); CREATE TABLE person (age INTEGER, job VARCHAR) | SELECT COUNT(*) FROM Person WHERE age > (SELECT MAX(age) FROM person WHERE job = 'engineer') | ค้นหาจำนวนผู้ที่มีอายุมากกว่าวิศวกรทุกคน | Find the number of people whose age is greater than all engineers. |
CREATE TABLE Person (name VARCHAR, job VARCHAR) | SELECT name, job FROM Person ORDER BY name | ระบุชื่อ ตำแหน่งงานของทุกคนตามลำดับชื่อ | list the name, job title of all people ordered by their names. |
CREATE TABLE Person (name VARCHAR, age VARCHAR) | SELECT name FROM Person ORDER BY age DESC | ค้นหาชื่อของบุคคลทั้งหมดโดยเรียงลำดับตามอายุจากมากไปน้อย | Find the names of all person sorted in the descending order using age. |
CREATE TABLE Person (name VARCHAR, gender VARCHAR, age VARCHAR) | SELECT name FROM Person WHERE gender = 'male' ORDER BY age | ค้นหาชื่อและอายุของผู้ชายทุกคนตามลำดับอายุ | Find the name and age of all males in order of their age. |
CREATE TABLE Person (name VARCHAR, age VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR) | SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' | ค้นหาชื่อและอายุของบุคคลที่เป็นเพื่อนของทั้งแดนและอลิซ | Find the name and age of the person who is a friend of both Dan and Alice. |
CREATE TABLE Person (name VARCHAR, age VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR) | SELECT DISTINCT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice' | ค้นหาชื่อและอายุของบุคคลที่เป็นเพื่อนของแดนหรืออลิซ | Find the name and age of the person who is a friend of Dan or Alice. |
CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR) | SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30) | หาชื่อคนที่มีเพื่อนอายุเกิน 40 แต่ไม่เกิน 30 ปี? | Find the name of the person who has friends with age above 40 and under age 30? |
CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR) | SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) EXCEPT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30) | หาชื่อคนที่มีเพื่อนอายุเกิน 40 ปีแต่ไม่ต่ำกว่า 30 ปี ? | Find the name of the person who has friends with age above 40 but not under age 30? |
CREATE TABLE Person (name VARCHAR, job VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE person (name VARCHAR) | SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.job = 'student' | ค้นหาชื่อบุคคลที่ไม่มีเพื่อนนักศึกษา | Find the name of the person who has no student friends. |
CREATE TABLE PersonFriend (name VARCHAR) | SELECT name FROM PersonFriend GROUP BY name HAVING COUNT(*) = 1 | ค้นหาคนที่มีเพื่อนเพียงคนเดียว | Find the person who has exactly one friend. |
CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR) | SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob' | เพื่อนของบ๊อบคือใคร? | Who are the friends of Bob? |
CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR) | SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob' | ค้นหาชื่อบุคคลที่เป็นเพื่อนกับบ๊อบ | Find the name of persons who are friends with Bob. |
CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR, gender VARCHAR) | SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female' | ค้นหาชื่อผู้หญิงที่เป็นเพื่อนกับแซค | Find the names of females who are friends with Zach |
CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR, gender VARCHAR) | SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female' | ค้นหาเพื่อนผู้หญิงของอลิซ | Find the female friends of Alice. |
CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR, job VARCHAR, gender VARCHAR) | SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor' | ตามหาเพื่อนผู้ชายของอลิซที่ทำงานเป็นหมอ? | Find the male friend of Alice whose job is a doctor? |
CREATE TABLE Person (name VARCHAR, city VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR) | SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city' | ใครมีเพื่อนที่มาจากนิวยอร์กซิตี้บ้าง? | Who has a friend that is from new york city? |
CREATE TABLE person (age INTEGER); CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR) | SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT AVG(age) FROM person) | ใครมีเพื่อนที่อายุน้อยกว่าอายุเฉลี่ยบ้าง? | Who has friends that are younger than the average age? |
CREATE TABLE person (age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (age INTEGER, name VARCHAR) | SELECT DISTINCT T2.name, T2.friend, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM person) | ใครมีเพื่อนที่อายุมากกว่าอายุเฉลี่ยบ้าง? พิมพ์เพื่อนและอายุของพวกเขาด้วย | Who has friends that are older than the average age? Print their friends and their ages as well |
CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR, YEAR INTEGER) | SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT MAX(YEAR) FROM PersonFriend WHERE name = 'Zach') | ใครคือเพื่อนของ Zach ที่มีความสัมพันธ์ยาวนานที่สุด? | Who is the friend of Zach with longest year relationship? |
CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR, year VARCHAR); CREATE TABLE PersonFriend (YEAR INTEGER, name VARCHAR); CREATE TABLE Person (age VARCHAR, name VARCHAR) | SELECT T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2.year = (SELECT MAX(YEAR) FROM PersonFriend WHERE name = 'Zach') | เพื่อนของ Zach ที่มีความสัมพันธ์ยาวนานที่สุดอายุเท่าไหร่? | What is the age of the friend of Zach with longest year relationship? |
CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR, YEAR INTEGER) | SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT MIN(YEAR) FROM PersonFriend WHERE friend = 'Alice') | ค้นหาชื่อบุคคลที่เป็นเพื่อนกับอลิซในช่วงปีที่สั้นที่สุด | Find the name of persons who are friends with Alice for the shortest years. |
CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR, year VARCHAR); CREATE TABLE Person (name VARCHAR, age VARCHAR, job VARCHAR); CREATE TABLE PersonFriend (YEAR INTEGER, friend VARCHAR) | SELECT T1.name, T1.age, T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT MAX(YEAR) FROM PersonFriend WHERE friend = 'Alice') | ค้นหาชื่อ อายุ และตำแหน่งงานของบุคคลที่เป็นเพื่อนกับอลิซมานานที่สุด | Find the name, age, and job title of persons who are friends with Alice for the longest years. |
CREATE TABLE PersonFriend (name VARCHAR); CREATE TABLE person (name VARCHAR) | SELECT name FROM person EXCEPT SELECT name FROM PersonFriend | ใครคือคนไม่มีเพื่อน? | Who is the person that has no friend? |
CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (age INTEGER, name VARCHAR) | SELECT T2.name, AVG(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend GROUP BY T2.name ORDER BY AVG(T1.age) DESC LIMIT 1 | บุคคลใดที่เพื่อนมีอายุเฉลี่ยมากที่สุด? | Which person whose friends have the oldest average age? |
CREATE TABLE person (name VARCHAR, friend VARCHAR, city VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR, city VARCHAR) | SELECT COUNT(DISTINCT name) FROM PersonFriend WHERE NOT friend IN (SELECT name FROM person WHERE city = 'Austin') | จำนวนคนที่ไม่มีเพื่อนอาศัยอยู่ในเมืองออสตินทั้งหมดเป็นเท่าใด | What is the total number of people who has no friend living in the city of Austin. |
CREATE TABLE PersonFriend (name VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR) | SELECT DISTINCT T4.name FROM PersonFriend AS T1 JOIN Person AS T2 ON T1.name = T2.name JOIN PersonFriend AS T3 ON T1.friend = T3.name JOIN PersonFriend AS T4 ON T3.friend = T4.name WHERE T2.name = 'Alice' AND T4.name <> 'Alice' | ค้นหาเพื่อนของเพื่อนของอลิซ | Find Alice's friends of friends. |
CREATE TABLE member (Id VARCHAR) | SELECT COUNT(*) FROM member | มีสมาชิกกี่คน? | How many members are there? |
CREATE TABLE member (Name VARCHAR) | SELECT Name FROM member ORDER BY Name | รายชื่อสมาชิกตามลำดับตัวอักษรจากน้อยไปหามาก | List the names of members in ascending alphabetical order. |
CREATE TABLE member (Name VARCHAR, Country VARCHAR) | SELECT Name, Country FROM member | สมาชิกมีชื่อและประเทศอะไรบ้าง? | What are the names and countries of members? |
CREATE TABLE member (Name VARCHAR, Country VARCHAR) | SELECT Name FROM member WHERE Country = "United States" OR Country = "Canada" | แสดงชื่อสมาชิกที่มีประเทศคือ "สหรัฐอเมริกา" หรือ "แคนาดา" | Show the names of members whose country is "United States" or "Canada". |
CREATE TABLE member (Country VARCHAR) | SELECT Country, COUNT(*) FROM member GROUP BY Country | แสดงประเทศต่างๆ และจำนวนสมาชิกจากแต่ละประเทศ | Show the different countries and the number of members from each. |
CREATE TABLE member (Country VARCHAR) | SELECT Country FROM member GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1 | แสดงประเทศที่พบมากที่สุดจากสมาชิก | Show the most common country across members. |
CREATE TABLE member (Country VARCHAR) | SELECT Country FROM member GROUP BY Country HAVING COUNT(*) > 2 | ประเทศใดมีสมาชิกมากกว่าสองคน? | Which countries have more than two members? |
CREATE TABLE college (Leader_Name VARCHAR, College_Location VARCHAR) | SELECT Leader_Name, College_Location FROM college | แสดงชื่อผู้นำและที่ตั้งของวิทยาลัย | Show the leader names and locations of colleges. |
CREATE TABLE member (Name VARCHAR, College_ID VARCHAR); CREATE TABLE college (Name VARCHAR, College_ID VARCHAR) | SELECT T2.Name, T1.Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID | แสดงชื่อสมาชิกและชื่อวิทยาลัยที่พวกเขาไป | Show the names of members and names of colleges they go to. |
CREATE TABLE member (Name VARCHAR, College_ID VARCHAR); CREATE TABLE college (College_Location VARCHAR, College_ID VARCHAR) | SELECT T2.Name, T1.College_Location FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID ORDER BY T2.Name | แสดงชื่อสมาชิกและที่ตั้งของวิทยาลัยที่พวกเขาไปโดยเรียงตามตัวอักษรจากชื่อสมาชิก | Show the names of members and the locations of colleges they go to in ascending alphabetical order of member names. |
CREATE TABLE college (Leader_Name VARCHAR, College_ID VARCHAR); CREATE TABLE member (College_ID VARCHAR, Country VARCHAR) | SELECT DISTINCT T1.Leader_Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID WHERE T2.Country = "Canada" | แสดงชื่อผู้นำที่ชัดเจนของวิทยาลัยที่เกี่ยวข้องกับสมาชิกจากประเทศ "แคนาดา" | Show the distinct leader names of colleges associated with members from country "Canada". |
CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE round (Decoration_Theme VARCHAR, Member_ID VARCHAR) | SELECT T1.Name, T2.Decoration_Theme FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID | แสดงชื่อสมาชิกและธีมการตกแต่งที่พวกเขามี | Show the names of members and the decoration themes they have. |
CREATE TABLE round (Member_ID VARCHAR, Rank_in_Round INTEGER); CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR) | SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID WHERE T2.Rank_in_Round > 3 | แสดงรายชื่อสมาชิกที่มีอันดับในรอบสูงกว่า 3 | Show the names of members that have a rank in round higher than 3. |
CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE round (Member_ID VARCHAR) | SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID ORDER BY Rank_in_Round | แสดงรายชื่อสมาชิกตามลำดับจากน้อยไปหามากในรอบ | Show the names of members in ascending order of their rank in rounds. |
CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE round (Name VARCHAR, Member_ID VARCHAR) | SELECT Name FROM member WHERE NOT Member_ID IN (SELECT Member_ID FROM round) | รายชื่อสมาชิกที่ไม่ได้เข้าร่วมในรอบใด | List the names of members who did not participate in any round. |
CREATE TABLE documents (document_name VARCHAR, access_count VARCHAR) | SELECT document_name, access_count FROM documents ORDER BY document_name | ค้นหาชื่อและจำนวนการเข้าถึงเอกสารทั้งหมด ตามลำดับตัวอักษรของชื่อเอกสาร | Find the name and access counts of all documents, in alphabetic order of the document name. |
CREATE TABLE documents (document_name VARCHAR, access_count VARCHAR) | SELECT document_name, access_count FROM documents ORDER BY access_count DESC LIMIT 1 | ค้นหาชื่อเอกสารที่มีการเข้าใช้มากที่สุด และจำนวนครั้งที่เข้าใช้? | Find the name of the document that has been accessed the greatest number of times, as well as the count of how many times it has been accessed? |
CREATE TABLE documents (document_type_code VARCHAR) | SELECT document_type_code FROM documents GROUP BY document_type_code HAVING COUNT(*) > 4 | ค้นหาประเภทเอกสารที่มีเอกสารมากกว่า 4 รายการ | Find the types of documents with more than 4 documents. |
CREATE TABLE documents (access_count INTEGER, document_type_code VARCHAR) | SELECT SUM(access_count) FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1 | ค้นหาจำนวนการเข้าถึงเอกสารทั้งหมดในประเภทเอกสารที่ได้รับความนิยมสูงสุด | Find the total access count of all documents in the most popular document type. |
CREATE TABLE documents (access_count INTEGER) | SELECT AVG(access_count) FROM documents | จำนวนการเข้าถึงเอกสารโดยเฉลี่ยคือเท่าใด | What is the average access count of documents? |
CREATE TABLE document_structures (document_structure_description VARCHAR, document_structure_code VARCHAR); CREATE TABLE documents (document_structure_code VARCHAR) | 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 | โครงสร้างของเอกสารที่มีจำนวนการเข้าถึงน้อยที่สุดคืออะไร? | What is the structure of the document with the least number of accesses? |
CREATE TABLE documents (document_type_code VARCHAR, document_name VARCHAR) | SELECT document_type_code FROM documents WHERE document_name = "David CV" | เอกสารชื่อ "David CV" เป็นเอกสารประเภทใด | What is the type of the document named "David CV"? |
CREATE TABLE documents (document_name VARCHAR, document_type_code VARCHAR, document_structure_code VARCHAR) | 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 | ค้นหารายการเอกสารที่มีทั้งประเภทยอดนิยมสามประเภทและมีโครงสร้างยอดนิยมสามอันดับสูงสุด | Find the list of documents that are both in the most three popular type and have the most three popular structure. |
CREATE TABLE documents (document_type_code VARCHAR, access_count INTEGER) | SELECT document_type_code FROM documents GROUP BY document_type_code HAVING SUM(access_count) > 10000 | เอกสารประเภทใดที่มีจำนวนการเข้าถึงรวมมากกว่า 10,000 หมายเลข | What document types do have more than 10000 total access number. |
CREATE TABLE documents (document_code VARCHAR, document_name VARCHAR); CREATE TABLE document_sections (section_title VARCHAR, document_code VARCHAR) | 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" | ชื่อหัวข้อทั้งหมดของเอกสารชื่อ "David CV" คืออะไร | What are all the section titles of the document named "David CV"? |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.