Public
Edited
Sep 22, 2023
Fork of Sets
1 fork
Insert cell
Insert cell
db
SELECT playerID, yearID
FROM batting
WHERE playerID = 'ruthba01'
INTERSECT
SELECT playerID, yearID
FROM batting
WHERE teamID = 'NYA'
Insert cell
db
SELECT m.playerID,nameFirst,nameLast
FROM managers m INNER JOIN people p
ON m.playerID = p.playerID
INTERSECT
SELECT b.playerID,nameFirst,nameLast
FROM batting b INNER JOIN people p
ON b.playerID = p.playerID
Insert cell
db
SELECT m.playerID,nameFirst,nameLast
FROM managers m INNER JOIN people p
ON m.playerID = p.playerID
WHERE teamID = 'NYA'
INTERSECT
SELECT b.playerID,nameFirst,nameLast
FROM batting b INNER JOIN people p
ON b.playerID = p.playerID
WHERE teamID = 'NYA'
Insert cell
db
SELECT playerID
FROM batting
Insert cell
db
SELECT playerID, teamID, yearID, HR
FROM batting
WHERE teamID = 'NYA'
Insert cell
db
SELECT h.playerID,nameFirst,nameLast
FROM hall h INNER JOIN people p
ON h.playerID = p.playerID
WHERE inducted = 'Y'
INTERSECT
SELECT b.playerID,max(nameFirst),max(nameLast)
FROM batting b INNER JOIN people p
ON b.playerID = p.playerID
WHERE teamID = 'PHI'
GROUP BY b.playerID
HAVING count(yearID) >= 10
Insert cell
db
SELECT playerID
FROM managers
EXCEPT
SELECT playerID
FROM batting
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