id
int64 0
1.53k
| query
stringlengths 23
215
| sql
stringlengths 29
1.45k
| difficulty
stringclasses 3
values |
|---|---|---|---|
378
|
What are the foiled cards that are incredibly powerful when paired with non foiled cards? List the IDs.
|
SELECT id FROM cards WHERE cardKingdomId IS NOT NULL AND cardKingdomFoilId IS NOT NULL
|
simple
|
401
|
What percentage of legendary frame effect cards that are only available in online game variations?
|
SELECT SUM(CASE WHEN isOnlineOnly = 1 THEN 1.0 ELSE 0 END) / COUNT(id) * 100 FROM cards WHERE frameEffects = 'legendary'
|
moderate
|
147
|
How many female clients' accounts are in the region of South Bohemia?
|
SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.gender = 'F' AND T2.A3 = 'south Bohemia'
|
simple
|
429
|
What is the language and expansion type of set number 206?
|
SELECT T2.language, T1.type FROM sets AS T1 INNER JOIN set_translations AS T2 ON T1.code = T2.setCode WHERE T2.id = 206
|
simple
|
336
|
in molecules with triple bonds, how many of them are not carcinogenic?
|
SELECT COUNT(DISTINCT T1.molecule_id) FROM molecule AS T1 INNER JOIN bond AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.bond_type = '#' AND T1.label = '-'
|
simple
|
1,255
|
For the patients with an abnormal Ig M level, what is the most common disease they are diagnosed with?
|
SELECT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.IGM NOT BETWEEN 40 AND 400 GROUP BY T1.Diagnosis ORDER BY COUNT(T1.Diagnosis) DESC LIMIT 1
|
moderate
|
688
|
Identify the number of posts that have been viewed over 35000 times but have received no comments from other users.
|
SELECT COUNT(Id) FROM posts WHERE ViewCount > 35000 AND CommentCount = 0
|
simple
|
151
|
Please list the name of the districts with accounts that made withdrawal transactions.
|
SELECT DISTINCT T1.A2 FROM district AS T1 INNER JOIN account AS T2 ON T1.district_id = T2.district_id INNER JOIN trans AS T3 ON T2.account_id = T3.account_id WHERE T3.type = 'VYDAJ'
|
moderate
|
1,445
|
Find the full name of members whose t-shirt size is extra large.
|
SELECT first_name, last_name FROM member WHERE t_shirt_size = 'X-Large'
|
simple
|
1,404
|
Identify the type of expenses and their total value approved for 'October Meeting' event.
|
SELECT T1.type, SUM(T3.cost) FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event INNER JOIN expense AS T3 ON T2.budget_id = T3.link_to_budget WHERE T1.event_name = 'October Meeting'
|
moderate
|
647
|
Provide the badge names received in 2011 for the user whose location is in the North Pole.
|
SELECT T2.Name FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE STRFTIME('%Y', T2.Date) = '2011' AND T1.Location = 'North Pole'
|
simple
|
148
|
Please list the accounts whose district is Tabor that are eligible for loans.
|
SELECT T2.account_id FROM district AS T1 INNER JOIN account AS T2 ON T1.district_id = T2.district_id INNER JOIN disp AS T3 ON T2.account_id = T3.account_id WHERE T3.type = 'OWNER' AND T1.A2 = 'Tabor'
|
moderate
|
1,351
|
What was Brent Thomason's major?
|
SELECT T2.major_name FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.first_name = 'Brent' AND T1.last_name = 'Thomason'
|
simple
|
1,182
|
For the patient who first came to the hospital on 1991/6/13 who was diagnosed with SJS, what is the total number of his/her Laboratory tests in 1995?
|
SELECT COUNT(*) FROM Laboratory WHERE ID = ( SELECT ID FROM Patient WHERE `First Date` = '1991-06-13' AND Diagnosis = 'SJS' ) AND STRFTIME('%Y', Date) = '1995'
|
moderate
|
248
|
What are the atoms of the triple bond with the molecule "TR041"?
|
SELECT T2.atom_id, T2.atom_id2 FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id INNER JOIN bond AS T3 ON T2.bond_id = T3.bond_id WHERE T3.bond_type = '#' AND T3.molecule_id = 'TR041'
|
simple
|
690
|
Identify the latest badge awarded to the user with the display name Emmett.
|
SELECT T1.Name FROM badges AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T2.DisplayName = 'Emmett' ORDER BY T1.Date DESC LIMIT 1
|
simple
|
312
|
What is the carcinogenic label for bond TR001_2_4?
|
SELECT DISTINCT T2.label FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id INNER JOIN bond AS T3 ON T2.molecule_id = T3.molecule_id WHERE T3.bond_id = 'TR001_2_4'
|
simple
|
368
|
What is the percentage of borderless cards?
|
SELECT CAST(SUM(CASE WHEN borderColor = 'borderless' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(id) FROM cards
|
simple
|
555
|
What is the average score of the posts owned by the user csgillespie?
|
SELECT AVG(T1.Score) FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T2.DisplayName = 'csgillespie'
|
simple
|
458
|
How many artists have designed a card with a black border color and is available in both "arena" and "mtgo" printing type?
|
SELECT COUNT(CASE WHEN availability LIKE '%arena,mtgo%' AND borderColor = 'black' THEN 1 ELSE NULL END) FROM cards
|
simple
|
370
|
How many borderless cards are illustrated in Russian?
|
SELECT COUNT(T1.id) FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T1.uuid = T2.uuid WHERE T1.borderColor = 'borderless' AND T2.language = 'Russian'
|
simple
|
686
|
Identify the total number of posts with views above average.
|
SELECT Id FROM posts WHERE ViewCount > ( SELECT AVG(ViewCount) FROM posts )
|
simple
|
344
|
List all the mythic rarity print cards banned in gladiator format.
|
SELECT DISTINCT T1.id FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T2.format = 'gladiator' AND T2.status = 'Banned' AND T1.rarity = 'mythic'
|
moderate
|
1,478
|
Which segment had the least consumption?
|
SELECT T1.Segment FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID GROUP BY T1.Segment ORDER BY SUM(T2.Consumption) ASC LIMIT 1
|
simple
|
551
|
How many badges has the user csgillespie obtained?
|
SELECT COUNT(T1.Id) FROM badges AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T2.DisplayName = 'csgillespie'
|
simple
|
636
|
How many negative comments did Neil McGuigan get in his posts?
|
SELECT COUNT(T3.Id) FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId INNER JOIN comments AS T3 ON T2.Id = T3.PostId WHERE T1.DisplayName = 'Neil McGuigan' AND T3.Score < 60
|
simple
|
1,423
|
How many income are received with an amount of 50?
|
SELECT COUNT(income_id) FROM income WHERE amount = 50
|
simple
|
1,093
|
What is the average overall rating of the players born before the year 1986?
|
SELECT SUM(t2.overall_rating) / COUNT(t1.id) FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE SUBSTR(t1.birthday, 1, 4) < '1986'
|
moderate
|
878
|
Who was the driver that got the best lap time in the race No. 348? Give his full name.
|
SELECT T2.forename, T2.surname FROM lapTimes AS T1 INNER JOIN drivers AS T2 ON T2.driverId = T1.driverId WHERE T1.raceId = 348 ORDER BY T1.time ASC LIMIT 1
|
simple
|
889
|
When was the last f1 season whereby Brands Hatch hosted the British Grand Prix?
|
SELECT T2.date FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T1.name = 'Brands Hatch' AND T2.name = 'British Grand Prix' ORDER BY T2.year DESC LIMIT 1
|
simple
|
816
|
Provide the names of superheroes with attribute value between 75 to 80.
|
SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id WHERE T2.attribute_value BETWEEN 75 AND 80
|
simple
|
1,313
|
How many students in the Student_Club are from the College of Engineering?
|
SELECT COUNT(T1.member_id) FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T2.college = 'College of Engineering'
|
simple
|
1,141
|
Does the KSV Cercle Brugge team have a slow, balanced or fast speed class?
|
SELECT DISTINCT t1.buildUpPlaySpeedClass FROM Team_Attributes AS t1 INNER JOIN Team AS t2 ON t1.team_api_id = t2.team_api_id WHERE t2.team_long_name = 'KSV Cercle Brugge'
|
moderate
|
543
|
For the post that got the most number of answers owned by csgillespie, how many answers did it get?
|
SELECT MAX(T1.AnswerCount) FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T2.DisplayName = 'csgillespie'
|
simple
|
1,095
|
How much is the average build up play speed of the Heart of Midlothian team?
|
SELECT CAST(SUM(t2.buildUpPlaySpeed) AS REAL) / COUNT(t2.id) FROM Team AS t1 INNER JOIN Team_Attributes AS t2 ON t1.team_api_id = t2.team_api_id WHERE t1.team_long_name = 'Heart of Midlothian'
|
moderate
|
588
|
Give the total number of comments posted by user ID 13.
|
SELECT COUNT(Id) FROM comments WHERE UserId = 13
|
simple
|
717
|
Please list all the superpowers of 3-D Man.
|
SELECT T3.power_name FROM superhero AS T1 INNER JOIN hero_power AS T2 ON T1.id = T2.hero_id INNER JOIN superpower AS T3 ON T2.power_id = T3.id WHERE T1.superhero_name = '3-D Man'
|
simple
|
1,053
|
List the football teams that has a chance creation passing class of Risky. Inidcate its short name only.
|
SELECT DISTINCT t1.team_short_name FROM Team AS t1 INNER JOIN Team_attributes AS t2 ON t1.team_api_id = t2.team_api_id WHERE t2.chanceCreationPassingClass = 'Risky'
|
moderate
|
691
|
Identify the number of adult users who have cast over 5000 upvotes.
|
SELECT COUNT(Id) FROM users WHERE Age BETWEEN 19 AND 65 AND UpVotes > 5000
|
simple
|
3
|
What is the unabbreviated mailing street address of the school with the highest FRPM count for K-12 students?
|
SELECT T2.MailStreet FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode ORDER BY T1.`FRPM Count (K-12)` DESC LIMIT 1
|
simple
|
1,401
|
Indicate the cost of posters for 'September Speaker' event.
|
SELECT T3.cost FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event INNER JOIN expense AS T3 ON T2.budget_id = T3.link_to_budget WHERE T1.event_name = 'September Speaker' AND T3.expense_description = 'Posters'
|
moderate
|
1,005
|
What was the longest time a driver had ever spent at a pit stop?
|
SELECT duration FROM pitStops ORDER BY duration DESC LIMIT 1
|
simple
|
524
|
List the artists who illustrated cards with black borders which are available only in arena.
|
SELECT DISTINCT artist FROM cards WHERE availability = 'arena' AND BorderColor = 'black'
|
simple
|
366
|
What is the rule of playing card "Benalish Knight"?
|
SELECT T2.format FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T1.name = 'Benalish Knight'
|
simple
|
5
|
How many schools with an average score in Math greater than 400 in the SAT test are exclusively virtual?
|
SELECT COUNT(DISTINCT T2.School) FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T2.Virtual = 'F' AND T1.AvgScrMath > 400
|
simple
|
1,492
|
What percentage of KAM customers pay in euros?
|
SELECT CAST(SUM(Currency = 'EUR') AS FLOAT) * 100 / COUNT(CustomerID) FROM customers WHERE Segment = 'KAM'
|
simple
|
1,009
|
Please list the time each driver spent at the pit stop during the 2011 Australian Grand Prix.
|
SELECT T1.duration FROM pitStops AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T2.year = 2011 AND T2.name = 'Australian Grand Prix'
|
simple
|
1,186
|
Lists all patients by ID who were diagnosed with Behcet's and had their exams between 01/01/197 and 12/31/1997.
|
SELECT ID FROM Examination WHERE `Examination Date` BETWEEN '1997-01-01' AND '1997-12-31' AND Diagnosis = 'Behcet'
|
moderate
|
742
|
How many vampire superheroes are there?
|
SELECT COUNT(T1.superhero_name) FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id WHERE T2.race = 'Vampire'
|
simple
|
41
|
List the names of virtual schools that are among the top 5 in their respective counties based on average reading scores.
|
SELECT School FROM (SELECT T2.School,T1.AvgScrRead, RANK() OVER (PARTITION BY T2.County ORDER BY T1.AvgScrRead DESC) AS rnk FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T2.Virtual = 'F' ) ranked_schools WHERE rnk <= 5
|
simple
|
31
|
What is the eligible free rate of the 10th and 11th schools with the highest enrolment for students in grades 1 through 12?
|
SELECT CAST(`Free Meal Count (K-12)` AS REAL) / `Enrollment (K-12)` FROM frpm ORDER BY `Enrollment (K-12)` DESC LIMIT 9, 2
|
moderate
|
270
|
Among the molecules with element Calcium, are they mostly carcinogenic or non carcinogenic?
|
SELECT T2.label FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.element = 'ca' GROUP BY T2.label ORDER BY COUNT(T2.label) DESC LIMIT 1
|
moderate
|
145
|
Who are the account holder identification numbers whose who have transactions on the credit card with the amount is less than the average, in 1998?
|
SELECT T1.account_id FROM trans AS T1 INNER JOIN account AS T2 ON T1.account_id = T2.account_id WHERE STRFTIME('%Y', T1.date) = '1998' AND T1.operation = 'VYBER KARTOU' AND T1.amount < (SELECT AVG(amount) FROM trans WHERE STRFTIME('%Y', date) = '1998')
|
moderate
|
888
|
In which country was the first European Grand Prix hosted? Name the circuit and location.
|
SELECT T1.country, T1.location FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T2.name = 'European Grand Prix' ORDER BY T2.year ASC LIMIT 1
|
simple
|
729
|
What is the average height of the superheroes from Marvel Comics?
|
SELECT AVG(T1.height_cm) FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Marvel Comics'
|
simple
|
1,112
|
What was the chance creation crossing class for "Hull City" on 2010/2/22?
|
SELECT t2.chanceCreationCrossingClass FROM Team AS t1 INNER JOIN Team_Attributes AS t2 ON t1.team_api_id = t2.team_api_id WHERE t1.team_long_name = 'Hull City' AND SUBSTR(t2.`date`, 1, 10) = '2010-02-22'
|
moderate
|
1,092
|
Give the name of the league had the most matches in the 2008/2009 season?
|
SELECT t1.name FROM League AS t1 JOIN Match AS t2 ON t1.id = t2.league_id WHERE t2.season = '2008/2009' GROUP BY t1.name HAVING COUNT(t2.id) = (SELECT MAX(match_count) FROM (SELECT COUNT(t2.id) AS match_count FROM Match AS t2 WHERE t2.season = '2008/2009' GROUP BY t2.league_id))
|
simple
|
1,398
|
Name the event with the highest amount spent on advertisement.
|
SELECT T2.event_name FROM budget AS T1 INNER JOIN event AS T2 ON T1.link_to_event = T2.event_id WHERE T1.category = 'Advertisement' ORDER BY T1.spent DESC LIMIT 1
|
moderate
|
984
|
What is the website of the constructor who tallied the most total wins.
|
SELECT T1.url FROM constructors AS T1 INNER JOIN constructorStandings AS T2 on T1.constructorId = T2.constructorId ORDER BY T2.wins DESC LIMIT 1
|
simple
|
741
|
What is the name of the superhero that has the most powers?
|
SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN hero_power AS T2 ON T1.id = T2.hero_id GROUP BY T1.superhero_name ORDER BY COUNT(T2.hero_id) DESC LIMIT 1
|
simple
|
1,081
|
Which country is the Belgium Jupiler League from?
|
SELECT t1.name FROM Country AS t1 INNER JOIN League AS t2 ON t1.id = t2.country_id WHERE t2.name = 'Belgium Jupiler League'
|
simple
|
424
|
What proportion of cards do not have a text box with a normal layout?
|
SELECT CAST(SUM(CASE WHEN isTextless = 1 AND layout = 'normal' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM cards
|
simple
|
359
|
What is the type of the card "Ancestor's Chosen" as originally printed?
|
SELECT originalType FROM cards WHERE name = 'Ancestor''s Chosen' AND originalType IS NOT NULL
|
simple
|
493
|
For the set "Commander 2014 Oversized" , give its parent code.
|
SELECT parentCode FROM sets WHERE name = 'Commander 2014 Oversized'
|
simple
|
364
|
What is the status of card "Cloudchaser Eagle"?
|
SELECT DISTINCT T2.status FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T1.name = 'Cloudchaser Eagle'
|
simple
|
1,044
|
List the football players with a birthyear of 1970 and a birthmonth of October.
|
SELECT player_name FROM Player WHERE SUBSTR(birthday, 1, 7) = '1970-10'
|
simple
|
746
|
Calculate the average attribute value of all superheroes.
|
SELECT AVG(attribute_value) FROM hero_attribute
|
simple
|
473
|
Is the set of cards with Adarkar Valkyrie only available outside the United States?
|
SELECT IIF(isForeignOnly = 1, 'YES', 'NO') FROM cards AS T1 INNER JOIN sets AS T2 ON T2.code = T1.setCode WHERE T1.name = 'Adarkar Valkyrie'
|
moderate
|
1,064
|
List out of players whose preferred foot is left.
|
SELECT DISTINCT t1.id, t1.player_name FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t2.preferred_foot = 'left'
|
simple
|
971
|
Please state the reference name of the oldest German driver.
|
SELECT driverRef FROM drivers WHERE nationality = 'German' ORDER BY JULIANDAY(dob) ASC LIMIT 1
|
simple
|
1,259
|
Please list the diseases of the patients born after 1985-1-1 and have a normal Rhuematoid Factor.
|
SELECT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE (T2.RA = '-' OR T2.RA = '+-') AND T1.Birthday > '1985-01-01'
|
moderate
|
593
|
How many users from New York have a teacher and supporter badge?
|
SELECT COUNT(DISTINCT T1.Id) FROM badges AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T1.Name IN ('Supporter', 'Teacher') AND T2.Location = 'New York'
|
simple
|
252
|
What are the atoms that can bond with the atom that has the element lead?
|
SELECT T2.atom_id, T2.atom_id2 FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id WHERE T1.element = 'pb'
|
simple
|
1,433
|
Which countries have zip codes with post office boxes?
|
SELECT DISTINCT county FROM zip_code WHERE type = 'PO Box' AND county IS NOT NULL
|
simple
|
761
|
Among the male superheroes, list the super hero names of superheroes with weight greater than the 79% average weight of all superheroes.
|
SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN gender AS T2 ON T1.gender_id = T2.id WHERE T2.gender = 'Male' AND T1.weight_kg * 100 > ( SELECT AVG(weight_kg) FROM superhero ) * 79
|
moderate
|
1,070
|
Which country is the league Italy Serie A from?
|
SELECT t1.name FROM Country AS t1 INNER JOIN League AS t2 ON t1.id = t2.country_id WHERE t2.name = 'Italy Serie A'
|
simple
|
784
|
Provide the full names of vampire heroes.
|
SELECT T1.full_name FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id WHERE T2.race = 'Vampire'
|
simple
|
69
|
Please provide the National Center for Educational Statistics school district identification number for all schools with a School Ownership Code that are part of the State Special Schools.
|
SELECT NCESDist FROM schools WHERE SOC = 31
|
simple
|
1,050
|
What is the preferred foot when attacking of the youngest football player?
|
SELECT t2.preferred_foot FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id ORDER BY t1.birthday DESC LIMIT 1
|
simple
|
926
|
What's the fastest lap time ever in a race for Lewis Hamilton?
|
SELECT T2.fastestLapTime FROM drivers AS T1 INNER JOIN results AS T2 ON T2.driverId = T1.driverId WHERE T1.forename = 'Lewis' AND T1.surname = 'Hamilton' AND T2.fastestLapTime IS NOT NULL ORDER BY T2.fastestLapTime ASC LIMIT 1
|
simple
|
233
|
Please list top two bonds that happened with the molecule TR006 in alphabetical order.
|
SELECT DISTINCT T2.bond_id FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id WHERE T1.molecule_id = 'TR006' ORDER BY T2.bond_id LIMIT 2
|
simple
|
1,246
|
For the patients with an abnormal activated partial prothrom bin time, how many of them does not have thrombosis?
|
SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T3.ID = T2.ID WHERE T3.Thrombosis = 0 AND T2.APTT > 45
|
moderate
|
830
|
Identify the weakest attribute of the Black Panther.
|
SELECT T3.attribute_name FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id INNER JOIN attribute AS T3 ON T2.attribute_id = T3.id WHERE T1.superhero_name = 'Black Panther' ORDER BY T2.attribute_value ASC LIMIT 1
|
moderate
|
595
|
Which user have only one post history per post and having at least 1000 views?
|
SELECT T2.UserId FROM users AS T1 INNER JOIN postHistory AS T2 ON T1.Id = T2.UserId INNER JOIN posts AS T3 ON T2.PostId = T3.Id WHERE T3.ViewCount >= 1000 GROUP BY T2.UserId HAVING COUNT(DISTINCT T2.PostHistoryTypeId) = 1
|
moderate
|
675
|
How many users whose reputations are higher than 2000 and the number of views is higher than 1000?
|
SELECT COUNT(id) FROM users WHERE Reputation > 2000 AND Views > 1000
|
simple
|
920
|
Please list all the years that Silverstone Circuit was used in a Formula_1 race.
|
SELECT DISTINCT T2.year FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T1.name = 'Silverstone Circuit'
|
simple
|
1,103
|
What was the overall rating for Aaron Mooy on 2016/2/4?
|
SELECT t2.overall_rating FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE SUBSTR(t2.`date`, 1, 10) = '2016-02-04' AND t1.player_name = 'Aaron Mooy'
|
moderate
|
1,383
|
State the name of students from Georgetown, South Carolina.
|
SELECT T1.first_name, T1.last_name FROM member AS T1 INNER JOIN zip_code AS T2 ON T1.zip = T2.zip_code WHERE T2.city = 'Georgetown' AND T2.state = 'South Carolina'
|
simple
|
959
|
What is the fastest lap number of the champion in 2009?
|
SELECT T1.fastestLap FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T2.year = 2009 AND T1.time LIKE '_:%:__.___'
|
simple
|
860
|
For the driver who had the Q2 time as 0:01:40 in the qualifying race No. 355, what is his nationality?
|
SELECT DISTINCT T2.nationality FROM qualifying AS T1 INNER JOIN drivers AS T2 ON T2.driverId = T1.driverId WHERE T1.raceId = 355 AND T1.q2 LIKE '1:40%'
|
simple
|
627
|
How many users were adult?
|
SELECT COUNT(id) FROM users WHERE Age BETWEEN 19 AND 65
|
simple
|
1,384
|
How many income generated by Grant Gilmour?
|
SELECT T2.amount FROM member AS T1 INNER JOIN income AS T2 ON T1.member_id = T2.link_to_member WHERE T1.first_name = 'Grant' AND T1.last_name = 'Gilmour'
|
simple
|
978
|
How many times the circuits were held in Austria? Please give their location and coordinates.
|
SELECT DISTINCT location, lat, lng FROM circuits WHERE country = 'Austria'
|
simple
|
1,432
|
Among the members with t-shirt size of medium, what is the percentage of the amount 50 received by the Student_Club?
|
SELECT CAST(SUM(CASE WHEN T2.amount = 50 THEN 1.0 ELSE 0 END) AS REAL) * 100 / COUNT(T2.income_id) FROM member AS T1 INNER JOIN income AS T2 ON T1.member_id = T2.link_to_member WHERE T1.position = 'Member' AND T1.t_shirt_size = 'Medium'
|
moderate
|
1,047
|
What is the football player Francois Affolter header's finishing rate on 18/09/2014?
|
SELECT t2.heading_accuracy FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.player_name = 'Francois Affolter' AND SUBSTR(t2.`date`, 1, 10) = '2014-09-18'
|
moderate
|
311
|
How many molecules without sulphur element is not having double bond?
|
SELECT COUNT(DISTINCT T1.molecule_id) FROM atom AS T1 INNER JOIN bond AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.element <> 's' AND T2.bond_type <> '='
|
simple
|
681
|
Please list the users' display names whose posts had over 20000 views in 2011.
|
SELECT T1.DisplayName FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId WHERE STRFTIME('%Y', T2.CreaionDate) = '2011' AND T2.ViewCount > 20000
|
simple
|
408
|
How many unknown power cards contain info about the triggered ability
|
SELECT T2.text FROM cards AS T1 INNER JOIN rulings AS T2 ON T1.uuid = T2.uuid WHERE (T1.power IS NULL OR T1.power = '*') AND T2.text LIKE '%triggered ability%'
|
moderate
|
2
|
Please list the zip code of all the charter schools in Fresno County Office of Education.
|
SELECT T2.Zip FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T1.`District Name` = 'Fresno County Office of Education' AND T1.`Charter School (Y/N)` = 1
|
simple
|
6
|
Among the schools with the SAT test takers of over 500, please list the schools that are magnet schools or offer a magnet program.
|
SELECT T2.School FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T2.Magnet = 1 AND T1.NumTstTakr > 500
|
simple
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.