simonw / datasette

An open source multi-tool for exploring and publishing data
https://datasette.io
Apache License 2.0
9.59k stars 691 forks source link

Improvements to help make Datasette a better tool for learning SQL #1613

Open simonw opened 2 years ago

simonw commented 2 years ago

Tracking issue for the general goal of making Datasette a better tool for learning SQL.

simonw commented 2 years ago

The existing flow where you can apply filters to a table and then click "View and edit SQL" to see the query is a good starting point.

Group by queries are both crucially important and difficult to assemble for beginners. Providing a way to see the query that was used by a facet (since facets are really just group-by-counts) would be very useful, which could come out of this:

simonw commented 2 years ago

Tool for setting up foreign key relationships. It could even verify the relationship before you apply it - checking that every value in the column does indeed correspond to a value in the other table.

Could also detect and suggest possible ones.

simonw commented 2 years ago

Joins are really hard. A mechanism for constructing them in the table view would help a lot:

simonw commented 2 years ago

Better contextual help on the SQL editor - like in Django SQL Dashboard which shows all available tables and columns.

Fancy inline autocomplete would be great too, but that's pretty hard for SQL based on past research.

simonw commented 2 years ago

A better interface for modifying the columns used in the SELECT clause would be useful too.