problem
stringlengths 121
422
| db_id
stringclasses 69
values | solution
stringlengths 23
804
|
---|---|---|
Write SQL query to solve given problem: How many female users reshared their tweets?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT COUNT(T1.UserID) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Female' AND T1.IsReshare = 'TRUE' |
Write SQL query to solve given problem: Which country's tweets collected the most likes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT T.Country FROM ( SELECT T2.Country, SUM(T1.Likes) AS num FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID GROUP BY T2.Country ) T ORDER BY T.num DESC LIMIT 1 |
Write SQL query to solve given problem: Tweet with ID tw-682723090279841798 was posted from which country?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT T2.Country FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.TweetID = 'tw-682723090279841798' |
Write SQL query to solve given problem: List down all the tweet text posted from Australia.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT T1.text FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.Country = 'Australia' |
Write SQL query to solve given problem: Write down the tweet text posted from Rawang, Selangor, Malaysia.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT T1.text FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.City = 'Rawang' AND T2.State = 'Selangor' AND T2.Country = 'Malaysia' |
Write SQL query to solve given problem: Tweets that were posted from Brazil are in what languague?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT DISTINCT T1.Lang FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.Country = 'Brazil' |
Write SQL query to solve given problem: State the country where the most positive sentiment tweets were posted.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT T.Country FROM ( SELECT T2.Country, SUM(T1.Sentiment) AS num FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.Sentiment > 0 GROUP BY T2.Country ) T ORDER BY T.num DESC LIMIT 1 |
Write SQL query to solve given problem: Calculate the total likes collected by tweets in `ru` posted by male users.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT SUM(T1.Likes) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Lang = 'ru' AND T2.Gender = 'Male' |
Write SQL query to solve given problem: Calculate the average number of male users who posted tweets in a week.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT COUNT(DISTINCT T1.TweetID) / COUNT(DISTINCT T1.UserID) / 7 AS avg FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Male' AND T1.Day BETWEEN 1 AND 31 |
Write SQL query to solve given problem: How many tweets have a klout of over 50?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT COUNT(DISTINCT TweetID) FROM twitter WHERE Klout > 50 |
Write SQL query to solve given problem: Please list the texts of all the tweets that are not in English.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT text FROM twitter WHERE Lang != 'en' |
Write SQL query to solve given problem: Please give the user ID of the user who has posted the most tweets.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT UserID FROM twitter GROUP BY UserID ORDER BY COUNT(DISTINCT TweetID) DESC LIMIT 1 |
Write SQL query to solve given problem: Among all the tweets posted on Mondays, how many of them are reshared?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT COUNT(DISTINCT TweetID) FROM twitter WHERE Weekday = 'Monday' AND IsReshare = 'TRUE' |
Write SQL query to solve given problem: Please list the texts of the top 3 tweets with the most number of unique users seeing the tweet.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT text FROM twitter ORDER BY Reach DESC LIMIT 3 |
Write SQL query to solve given problem: How many reshared tweets have over 100 likes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT COUNT(DISTINCT TweetID) FROM twitter WHERE IsReshare = 'TRUE' AND Likes > 100 |
Write SQL query to solve given problem: What is the total number of tweets sent by male users on Mondays?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT COUNT(DISTINCT T1.TweetID) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Male' AND T1.Weekday = 'Monday' |
Write SQL query to solve given problem: What is the gender of the user who has posted the tweet that got the most likes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID ORDER BY T1.Likes DESC LIMIT 1 |
Write SQL query to solve given problem: Please list the texts of all the tweets in French posted by male users.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT T1.text FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Male' AND T1.Lang = 'fr' |
Write SQL query to solve given problem: How many tweets in French were posted from Australia?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT COUNT(DISTINCT T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.Lang = 'fr' AND T2.Country = 'Australia' |
Write SQL query to solve given problem: Among all the tweets with a positive sentiment, how many of them were posted by male users in Australia?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID INNER JOIN user AS T3 ON T3.UserID = T1.UserID WHERE T2.Country = 'Australia' AND T3.Gender = 'Male' AND T1.Sentiment > 0 |
Write SQL query to solve given problem: How many more tweets with a positive sentiment than the tweets with a neutral sentiment were posted by male users?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT SUM(CASE WHEN T1.Sentiment > 0 THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.Sentiment = 0 THEN 1 ELSE 0 END) AS diff FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Male' |
Write SQL query to solve given problem: From which city was the tweet with the most number of retweets posted?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT T2.City FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID ORDER BY T1.RetweetCount DESC LIMIT 1 |
Write SQL query to solve given problem: From which city were more tweets posted, Bangkok or Chiang Mai?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT SUM(CASE WHEN T2.City = 'Bangkok' THEN 1 ELSE 0 END) AS bNum , SUM(CASE WHEN T2.City = 'Chiang Mai' THEN 1 ELSE 0 END) AS cNum FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.City IN ('Bangkok', 'Chiang Mai') |
Write SQL query to solve given problem: Among the tweets posted from Santa Fe state in Argentina, how many of them were posted on 31st?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.Day = 31 AND T2.State = 'Santa' AND T2.Country = 'Argentina' |
Write SQL query to solve given problem: Please list the top 3 cities with the most number of tweets posted in Canada.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT T.City FROM ( SELECT T2.City, COUNT(T1.TweetID) AS num FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.Country = 'Canada' GROUP BY T2.City ) T ORDER BY T.num DESC LIMIT 3 |
Write SQL query to solve given problem: Please list all the cities from where tweets with neutral sentiments were posted.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT DISTINCT T2.City FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE Sentiment = 0 |
Write SQL query to solve given problem: Among all the tweets sent by male users in Argentina, what is the text of the one with the most number of likes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT T2.text FROM user AS T1 INNER JOIN twitter AS T2 ON T1.UserID = T2.UserID INNER JOIN location AS T3 ON T2.LocationID = T3.LocationID WHERE T3.Country = 'Argentina' AND T1.Gender = 'Male' ORDER BY T2.Likes DESC LIMIT 1 |
Write SQL query to solve given problem: What is the average number of likes for a tweet posted by a male user on Mondays?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT SUM(T1.Likes) / COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Male' AND T1.Weekday = 'Monday' |
Write SQL query to solve given problem: Tweets posted from which city has a higher number of average likes, Bangkok or Chiang Mai?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | social_media | SELECT SUM(CASE WHEN T2.City = 'Bangkok' THEN Likes ELSE NULL END) / COUNT(CASE WHEN T2.City = 'Bangkok' THEN 1 ELSE 0 END) AS bNum , SUM(CASE WHEN City = 'Chiang Mai' THEN Likes ELSE NULL END) / COUNT(CASE WHEN City = 'Chiang Mai' THEN TweetID ELSE NULL END) AS cNum FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.City IN ('Bangkok', 'Chiang Mai') |
Write SQL query to solve given problem: Which course is more difficult, Intro to BlockChain or Computer Network?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT name FROM course WHERE name = 'Intro to BlockChain' OR name = 'Computer Network' ORDER BY diff DESC LIMIT 1 |
Write SQL query to solve given problem: Please list the names of the courses that are less important than Machine Learning Theory.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT name FROM course WHERE credit < ( SELECT credit FROM course WHERE name = 'Machine Learning Theory' ) |
Write SQL query to solve given problem: How many professors are more popular than Zhou Zhihua?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(prof_id) FROM prof WHERE popularity > ( SELECT popularity FROM prof WHERE first_name = 'Zhihua' AND last_name = 'Zhou' ) |
Write SQL query to solve given problem: What is the phone number of Kerry Pryor?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT phone_number FROM student WHERE l_name = 'Pryor' AND f_name = 'Kerry' |
Write SQL query to solve given problem: Which professor advised Faina Mallinar to become a research assistant? Please give his or her full name.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T1.first_name, T1.last_name FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Faina' AND T3.l_name = 'Mallinar' |
Write SQL query to solve given problem: How many research assistants does Sauveur Skyme have?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.first_name = 'Sauveur' AND T2.last_name = 'Skyme' |
Write SQL query to solve given problem: Please list the full names of all the students who are research assistants with the highest research capability.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN RA AS T2 ON T1.student_id = T2.student_id WHERE T2.capability = 5 |
Write SQL query to solve given problem: How many research assistants of Ogdon Zywicki have an average salary?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(T1.prof_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.first_name = 'Ogdon' AND T1.salary = 'med' AND T2.last_name = 'Zywicki' |
Write SQL query to solve given problem: Please list the full names of all the students who took the course Machine Learning Theory.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Machine Learning Theory' |
Write SQL query to solve given problem: Among the students who got a B in the course Machine Learning Theory, how many of them have a gpa of over 3?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(student_id) FROM registration WHERE grade = 'B' AND student_id IN ( SELECT student_id FROM student WHERE gpa > 3 AND course_id IN ( SELECT course_id FROM course WHERE name = 'Machine Learning Theory' ) ) |
Write SQL query to solve given problem: Please list the names of the courses taken by Laughton Antonio.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T3.name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T1.f_name = 'Laughton' AND T1.l_name = 'Antonio' |
Write SQL query to solve given problem: Which student failed the course Intro to Database 2? Please give his or her full name.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T2.grade IS NULL AND T3.name = 'Intro to Database 2' |
Write SQL query to solve given problem: Which student is more satisfied with the course Machine Learning Theory, Willie Rechert or Laughton Antonio?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE (T1.f_name = 'Laughton' OR T1.f_name = 'Willie') AND (T1.l_name = 'Antonio' OR T1.l_name = 'Rechert') AND T3.name = 'Machine Learning Theory' ORDER BY T2.sat DESC LIMIT 1 |
Write SQL query to solve given problem: Among the professors who have more than 3 research assistants, how many of them are male?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(*) FROM ( SELECT T2.prof_id FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.gender = 'Male' GROUP BY T1.prof_id HAVING COUNT(T1.student_id) > 3 ) |
Write SQL query to solve given problem: Among the students who took the course Machine Learning Theory, how many of them are undergraduates?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(T1.student_id) FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Machine Learning Theory' AND T1.type = 'UG' |
Write SQL query to solve given problem: Which professor advised Willie Rechert to work as a research assistant? Please give his or her full name.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T1.first_name, T1.last_name FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Willie' AND T3.l_name = 'Rechert' |
Write SQL query to solve given problem: What is the average gpa of Ogdon Zywicki's research assistants?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT SUM(T3.gpa) / COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T1.student_id = T3.student_id WHERE T2.first_name = 'Ogdon' AND T2.last_name = 'Zywicki' |
Write SQL query to solve given problem: What is the average satisfying degree of the course Machine Learning Theory?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT CAST(SUM(T1.sat) AS REAL) / COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.name = 'Machine Learning Theory' |
Write SQL query to solve given problem: Give the number of research postgraduate students.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(student_id) FROM student WHERE type = 'RPG' |
Write SQL query to solve given problem: Which student has the highest gpa? Give the full name.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT f_name, l_name FROM student WHERE gpa = ( SELECT MAX(gpa) FROM student ) |
Write SQL query to solve given problem: For the 3-credit course with the easiest difficulty, how many students get an "A" in that course?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.grade = 'A' AND T2.credit = '3' AND T2.diff = 1 |
Write SQL query to solve given problem: How many students took the hardest course?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.diff = 5 |
Write SQL query to solve given problem: Which professor is Oliy Spratling working with? Give the full name.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T1.first_name, T1.last_name FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Oliy' AND T3.l_name = 'Spratling' |
Write SQL query to solve given problem: For the professor who is working with Harrietta Lydford, how is his popularity?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T1.popularity FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Harrietta' AND T3.l_name = 'Lydford' |
Write SQL query to solve given problem: How many research assistants does the female professor with the lowest teaching ability have?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.teachingability = '1' AND T2.gender = 'Female' |
Write SQL query to solve given problem: For the professors who advise more than 2 students, which professor has a higher teaching ability? Give the full name.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, T2.teachingability FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id GROUP BY T1.prof_id HAVING COUNT(student_id) > 2 ) T ORDER BY T.teachingability DESC LIMIT 1 |
Write SQL query to solve given problem: Give the grade score for Rik Unsworth in "Computer Network".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT CASE grade WHEN 'A' THEN 4 WHEN 'B' THEN 3 WHEN 'C' THEN 2 ELSE 1 END AS result FROM registration WHERE student_id IN ( SELECT student_id FROM student WHERE f_name = 'Rik' AND l_name = 'Unsworth' AND course_id IN ( SELECT course_id FROM course WHERE name = 'Computer Network' ) ) |
Write SQL query to solve given problem: How many courses does Alvera McQuillin take?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(T1.course_id) FROM registration AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T2.f_name = 'Alvera' AND T2.l_name = 'McQuillin' |
Write SQL query to solve given problem: State the name of research postgraduate student among Professor Zhihua Zhou's research assistants.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T3.f_name, T3.l_name FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T1.first_name = 'Zhihua' AND T3.type = 'RPG' AND T1.last_name = 'Zhou' |
Write SQL query to solve given problem: Provide the number of students enrolled in the "Statistical Learning" course.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(T2.student_id) FROM course AS T1 INNER JOIN registration AS T2 ON T1.course_id = T2.course_id WHERE T1.name = 'Statistical learning' |
Write SQL query to solve given problem: Who were the students who failed the course "Applied Deep Learning"? Give the full name.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Applied Deep Learning ' AND T2.grade IS NULL |
Write SQL query to solve given problem: Give the phone number of the only student who obtained "A" in the course "Intro to BlockChain".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T1.phone_number FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Intro to BlockChain' AND T2.grade = 'A' |
Write SQL query to solve given problem: What is the percentage of Professor Ogdon Zywicki's research assistants are taught postgraduate students?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT CAST(SUM(CASE WHEN T3.type = 'TPG' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T1.student_id = T3.student_id WHERE T2.first_name = 'Ogdon' AND T2.last_name = 'Zywicki' |
Write SQL query to solve given problem: What is the percentage of students who get a "B" in the course "Computer Network"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT CAST(SUM(CASE WHEN T1.grade = 'B' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.name = 'Computer Network' |
Write SQL query to solve given problem: How many courses have the highest difficulty?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(course_id) FROM course WHERE diff = 5 |
Write SQL query to solve given problem: What is the full name of the professor who graduated from an Ivy League School?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT first_name, last_name FROM prof WHERE graduate_from IN ( 'Brown University', 'Columbia University', 'Cornell University', 'Dartmouth College', 'Harvard University', 'Princeton University', 'University of Pennsylvania', 'Yale University' ) |
Write SQL query to solve given problem: Among the most important courses, what is the name of the most difficult course?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT name FROM course WHERE credit = ( SELECT MAX(credit) FROM course ) AND diff = ( SELECT MAX(diff) FROM course ) |
Write SQL query to solve given problem: How many students have the highest intelligence among those taking a bachelor's degree?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(student_id) FROM student WHERE type = 'UG' AND intelligence = ( SELECT MAX(intelligence) FROM student ) |
Write SQL query to solve given problem: Among the most popular professors, how many are females?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(prof_id) FROM prof WHERE gender = 'Female' AND popularity = ( SELECT MAX(popularity) FROM prof ) |
Write SQL query to solve given problem: How many research postgraduate students are there?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(student_id) FROM student WHERE type = 'RPG' |
Write SQL query to solve given problem: How many students got an A in Applied Deep Learning?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(T2.student_id) FROM course AS T1 INNER JOIN registration AS T2 ON T1.course_id = T2.course_id WHERE T2.grade = 'A' AND T1.name = 'Applied Deep Learning ' |
Write SQL query to solve given problem: What are the GPAs of the unpaid Research Assistants?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T2.gpa FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'free' |
Write SQL query to solve given problem: Among the easiest courses, what is the name of the course where most students got an A?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T2.name FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.grade = 'A' AND T2.diff = 1 GROUP BY T2.name ORDER BY COUNT(T1.student_id) DESC LIMIT 1 |
Write SQL query to solve given problem: How many courses does the student with the highest GPA this semester take?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(course_id) FROM registration WHERE student_id IN ( SELECT student_id FROM student WHERE gpa = ( SELECT MAX(gpa) FROM student ) ) |
Write SQL query to solve given problem: How many students does Ogdon Zywicki advise?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.first_name = 'Ogdon' AND T2.last_name = 'Zywicki' |
Write SQL query to solve given problem: What is the name of the course with the highest satisfaction from students?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT DISTINCT T2.name FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.sat = 5 |
Write SQL query to solve given problem: What are the names of the courses that the students with the lowest intelligence are least satisfied with?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T3.name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T2.sat = 1 AND T1.intelligence = 1 |
Write SQL query to solve given problem: Which of the two courses, "Advanced Operating System" or "Intro to BlockChain', did most of the students receive an A in?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T2.name FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.grade = 'A' AND T2.name IN ('Advanced Operating System', 'Intro to BlockChain') GROUP BY T2.name ORDER BY COUNT(T1.student_id) DESC LIMIT 1 |
Write SQL query to solve given problem: What is the popularity of the professor who advises the highest number of students with the highest research ability?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T2.popularity FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id GROUP BY T1.prof_id, T1.capability ORDER BY COUNT(T1.student_id) DESC, T1.capability DESC LIMIT 1 |
Write SQL query to solve given problem: What is the average number of students who registered for the courses with a difficulty of 4?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT CAST(COUNT(T1.student_id) AS REAL) / COUNT(DISTINCT T2.course_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.diff = 4 |
Write SQL query to solve given problem: How many students, who have a GPA between 3 to 4, failed a course?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(T2.student_id) FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id WHERE T2.grade IS NULL AND T1.gpa BETWEEN 3 AND 4 |
Write SQL query to solve given problem: How many students taking a bachelor's degree received an A in all of the courses that they took?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(T2.student_id) FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id WHERE T2.grade = 'A' AND T1.type = 'UG' |
Write SQL query to solve given problem: What is the average GPA of the students with the highest research capability and high salary? List the full names of the students.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT AVG(T2.gpa), T2.f_name, T2.l_name FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'high' AND T1.capability = 5 GROUP BY T2.student_id |
Write SQL query to solve given problem: List the professors' IDs and students' IDs with the lowest research ability.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT prof_id, student_id FROM RA WHERE capability = ( SELECT MIN(capability) FROM RA ) |
Write SQL query to solve given problem: Name the professor who got graduation from the University of Boston.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT first_name, last_name FROM prof WHERE graduate_from = 'University of Boston' |
Write SQL query to solve given problem: List the courses' IDs and students' IDs who failed to pass the course.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT course_id, student_id FROM registration WHERE grade IS NULL OR grade = '' |
Write SQL query to solve given problem: What is the male and female ratio among the professors?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT CAST(SUM(CASE WHEN gender = 'Male' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN gender = 'Female' THEN 1 ELSE 0 END) FROM prof |
Write SQL query to solve given problem: Describe the names and credits of the least difficult courses.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT name, credit FROM course WHERE diff = ( SELECT MIN(diff) FROM course ) |
Write SQL query to solve given problem: Describe the students' full names and GPAs under the supervision of the most popular professor.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T3.f_name, T3.l_name, T3.gpa FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id ORDER BY T1.popularity DESC LIMIT 1 |
Write SQL query to solve given problem: Provide the full names and emails of unpaid research assistants.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T2.f_name, T2.l_name, T2.email FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'free' |
Write SQL query to solve given problem: List the research assistants' full names, capabilities and GPAs who were under the supervision of Merwyn Conkay.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T3.f_name, T3.l_name, T2.capability, T3.gpa FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T1.first_name = 'Merwyn' AND T1.last_name = 'Conkay' |
Write SQL query to solve given problem: Describe the students' full names and grades in Intro to BlockChain course.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T1.f_name, T1.l_name, T2.grade FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Intro to BlockChain' |
Write SQL query to solve given problem: Among students registered for the most difficult course, list the students' full names who got grade A.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T2.grade = 'A' ORDER BY T3.diff DESC LIMIT 1 |
Write SQL query to solve given problem: Describe the full names and graduated universities of the professors who advised Olia Rabier.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T1.first_name, T1.last_name, T1.graduate_from FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Olia' AND T3.l_name = 'Rabier' |
Write SQL query to solve given problem: Name the students of the Advanced Database Systems course with the highest satisfaction.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Advanced Database Systems' ORDER BY T2.sat DESC LIMIT 1 |
Write SQL query to solve given problem: Calculate the GPA of the semester for Laughton Antonio.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT CAST(SUM(T3.credit * CASE T1.grade WHEN 'A' THEN 4 WHEN 'B' THEN 3 WHEN 'C' THEN 2 WHEN 'D' THEN 1 ELSE 1 END) AS REAL) / COUNT(T3.credit) FROM registration AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T2.f_name = 'Laughton' AND T2.l_name = 'Antonio' |
Write SQL query to solve given problem: Provide the registered courses' names by undergraduate students with GPA of 3.7 and above.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT DISTINCT T1.f_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T1.type = 'UG' AND T1.gpa > 3.7 |
Write SQL query to solve given problem: Describe the names and capability of the students who were advised by professors from the University of Washington.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T3.f_name, T3.l_name, T2.capability FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T1.graduate_from = 'University of Washington' |
Write SQL query to solve given problem: Describe the full names, emails and intelligence of the students with the highest capability and salary.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT f_name, l_name, email, intelligence FROM student WHERE student_id IN ( SELECT student_id FROM RA WHERE salary = 'high' AND capability = ( SELECT MAX(capability) FROM RA ) ) |
Write SQL query to solve given problem: Mention the names and credits of course registered by the students who were under the supervision of female professor with the highest teaching ability.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT T5.name, T5.credit FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T1.student_id = T3.student_id INNER JOIN registration AS T4 ON T3.student_id = T4.student_id INNER JOIN course AS T5 ON T4.course_id = T5.course_id WHERE T2.gender = 'Female' ORDER BY T2.teachingability DESC LIMIT 1 |
Write SQL query to solve given problem: How many of the professors are female?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cs_semester | SELECT COUNT(prof_id) FROM prof WHERE gender = 'Female' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.