Public
Edited
Oct 2, 2023
Insert cell
Insert cell
battingFile = FileAttachment("Batting.csv").csv({typed:true})
Insert cell
peopleFile = FileAttachment("People.csv").csv({typed:true})
Insert cell
managersFile = FileAttachment("Managers.csv").csv({typed:true})
Insert cell
db = DuckDBClient.of({
batting:battingFile,
people:peopleFile,
managers:managersFile
})
Insert cell
db
SELECT DISTINCT playerID
FROM batting
WHERE 30 < (
SELECT count(yearID)
FROM managers
WHERE playerID = batting.playerID
)
Insert cell
db
SELECT playerID,count(yearID)
FROM batting
GROUP BY playerID
HAVING 20*count(yearID) < (
SELECT count(yearID)
FROM managers
WHERE playerID = batting.playerID
)
Insert cell
db
SELECT playerID,count(yearID)
FROM managers
WHERE playerID = 'alstowa01' OR playerID = 'andersp01'
GROUP BY playerID
Insert cell
db
SELECT DISTINCT playerID
FROM managers
WHERE NOT EXISTS (
SELECT playerID
FROM batting
WHERE playerID = managers.playerID
)
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