Public
Edited
Sep 20, 2023
Fork of Sets
Insert cell
Insert cell
Insert cell
db
SELECT max(HR)
FROM batting
Insert cell
Insert cell
db
SELECT playerID,HR
FROM batting
WHERE HR = (
SELECT max(HR)
FROM batting
)
Insert cell
Insert cell
db
SELECT name,HR,yearID
FROM teams
WHERE HR = (
SELECT max(HR)
FROM teams
)
Insert cell
Insert cell
db
SELECT nameFirst,nameLast,yearID,HR
FROM batting INNER JOIN people
ON batting.playerID = people.playerID
WHERE teamID = (
SELECT teamID
FROM teams
WHERE name = 'Philadelphia Phillies'
)
Insert cell
Insert cell
db
SELECT nameFirst,nameLast,yearID,HR
FROM batting INNER JOIN people
ON batting.playerID = people.playerID
WHERE teamID IN (
SELECT teamID
FROM teams
WHERE name LIKE 'Philadelphia %'
)
Insert cell
Insert cell
db
SELECT DISTINCT playerID
FROM managers
WHERE playerID NOT IN (
SELECT playerID
FROM batting
)
Insert cell
Insert cell
db
SELECT DISTINCT playerID
FROM managers
WHERE playerID IN (
SELECT playerID
FROM batting
)
Insert cell
Insert cell
db
SELECT playerID
FROM batting
WHERE teamID = 'NYA' AND yearID = '2022' AND HR > ALL(
SELECT HR
FROM batting
WHERE teamid = 'PHI' AND yearID = '2022'
)
Insert cell
Insert cell
db
SELECT name,yearID,HR
FROM teams
WHERE yearID == 1950 AND HR < ALL(
SELECT HR
FROM teams
WHERE yearID = 2022
)
ORDER BY yearID
Insert cell
db
SELECT teamID,HR
FROM teams
WHERE yearID = 2022
ORDER BY HR
Insert cell
Insert cell
db = DuckDBClient.of({
batting:FileAttachment("Batting.csv"),
hall:FileAttachment("HallOfFame.csv"),
managers:FileAttachment("Managers.csv"),
people:FileAttachment("People.csv"),
teams:FileAttachment("Teams.csv")
})
Insert cell
db
SELECT *
FROM managers
LIMIT 10
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more