Published
Edited
Jun 17, 2022
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
// we've loaded the sqlite file and made it accessible as a database in this notebook
db = FileAttachment("sql-murder-mystery.db").sqlite()
Insert cell
Insert cell
db
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
db
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
db
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
db
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
transcripts = witnessInterviews.map(d => d.transcript)
Insert cell
Insert cell
Insert cell
Insert cell
db
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
db
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
db
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
db
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
db
INSERT INTO solution VALUES (1, 'Jeremy Bowers');
SELECT value FROM solution
Insert cell
Insert cell
Insert cell
db
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
db
select distinct d.id as license_id, p.id as person_id, p.name , p.ssn
from drivers_license d
join person p
on d.id = p.license_id
join facebook_event_checkin t
on t.person_id = p.id
where d.height >= 65 and
d.height <= 67 and
d.hair_color == 'red' and
d.car_make == 'Tesla'
Insert cell
Insert cell
db
INSERT INTO solution VALUES (1, 'Miranda Priestly');
SELECT value FROM solution
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// uncomment the line below to see a schema diagram of the database!
// diagram(db)
Insert cell
db
SELECT t.ssn,t.annual_income FROM income t
Insert cell
Insert cell
Insert cell
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