Public
Edited
Dec 7, 2023
Insert cell
Insert cell
pitchingFile = FileAttachment("Pitching.csv").csv({typed:true})
Insert cell
peopleFile = FileAttachment("People.csv").csv({typed:true})
Insert cell
HOFFile = FileAttachment("HallOfFame.csv").csv({typed:true})
Insert cell
db = DuckDBClient.of({
pitching: pitchingFile,
people: peopleFile,
HOF: HOFFile
})
Insert cell
db
SELECT DISTINCT nameFirst, namelast, pitching.playerID
FROM people INNER JOIN pitching
ON pitching.playerID = people.playerID
WHERE nameFirst = 'Bob'
ORDER BY W DESC
Insert cell
db
SELECT DISTINCT nameFirst, nameLast, max(pitching.W) as wins
FROM people INNER JOIN pitching
ON people.playerID = pitching.playerID
WHERE nameFirst = 'Bob'
GROUP BY nameFirst, nameLast
ORDER BY wins DESC

Insert cell
db
SELECT DISTINCT nameFirst, nameLast
FROM people INNER JOIN pitching
ON people.playerID = pitching.playerID
WHERE nameFirst = 'Bob'
INTERSECT
SELECT DISTINCT nameFirst, nameLast
FROM people INNER JOIN HOF
ON people.playerID = HOF.playerID
WHERE nameFirst = 'Bob' and inducted = 'Y'
Insert cell
db
SELECT DISTINCT people.playerID
FROM people INNER JOIN pitching
ON people.playerID = pitching.playerID
WHERE people.nameFirst = 'Bob' AND people.birthCity LIKE '%o%'
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