Database tables (Notion)
One of the major functionalities of Notion, is database tables, usually (and confusingly to me) just called databases (I use these two terms interchangeably). Thanks to this functionality, you can to a certain degree, create database-driven applications, including joins and filters - Quite exciting stuff!
Within Notion, there is also such a thing as a 'regular' 'static' table, like in e.g., LibreOffice Writer - Hence database table might not be such a bad name.
This is not just a database object
It seems that in Notion, no 'traditional application development object' exists just on its own. Everything seems to have been lumped together with something else into something hybrid, like a transition from a world of clear black-and-white concepts, to one of endlessly gray amorphous blobs. Database tables are no exception: No aspect of database tables seem to just exist as they are. Sometimes you may think that you see the real thing, but just when you think you got it by the tail, it turns out to be only an illusion.
One of the consequences of this seems to be, that I can't really relate concepts in Notion to concepts that I know already from elsewhere - I found it really hard to understand things in Notion. Naturally, a solution would be that I just let go of my pre-existing concepts of what databases or web applications look like, but does that really work?
But there's hope: once you know this, life may become bearable again. Or at least you may understand why in this article, everything seems to be murky - At least, that's why I wrote this introduction: Last time I looked up this article before writing this paragraph, I got annoyed that it doesn't discuss database concept within Notion just as they are, but only in relation to other stuff. Now I know. And it's ok.
Database tables live around pages
Probably the easiest introduction to Notion database tables, is that they live around pages. They come in two flavors:
- Inline database tables are incorporated into existing pages
- full-page database tables acts like subpages with only the database table. I prefer to call these stand-alone database tables.
One remarkable difference between these to databases, is their difference in header
Perhaps more important than the differences between these types of database tables is their similarity: Database tables live are associated with pages.
Example: Create a stand-alone database table
Let's do this slowly, so we understand everything that's happening:
Note:
- There are three objects rolled into one here: Database table, view and page
- There is hardly such a thing as a page. E.g., you cannot add other blocks
Example: Add an inline database
Example: Create a subpage with an inline database
Primary keys?
How about primary keys (pks)?
Notion doesn't use primary keys in the user interface - Not as a property, neither as an attribute of a property (or as an auto-increment field). I am quite sure that Notion uses primary keys internally:
- An example that hints at internal pks: You can link database tables, and identical rows do not get mixed up
- The function
id()
to retrieve a unique identifier for stuff (row?) - That's quite like a pk.
Default properties
In Notion parlance, fields or columns are called properties. As you can see in the examples above, a newly created database table contains the following properties:
Property Name | Property Type | Notes |
---|---|---|
Name | Title | Interesting: Notion has a specific property type called Title |
Tags | Multi-select | I really like these multi-select fields. That's much more work to code by yourself |
Notes:
- There is no default property Description - I though there was, but I can't find it back
- Database tables have a title, but that's not a property as intended here
- By clicking on the "+" at the top of the column right of Tags, you can define additional properties on the fly.
Views
Database tables are created in conjunction with a view: A way to view the data, a bit like table view plus form view in Microsoft Access at once. See Database views (Notion) for details.
Can I have the raw table definition, please?
Can I see the 'raw database table definition'? Like Table view in Microsoft Access, or the table definition in MySQL?
No, you can't.
There seem to be no obvious or intended way to just see the table definition without a view around it. But there are some ways to get close to this:
Workspace export
Table view
The table view or table database view seems to be the most basic no-frills view and hence the closest to a barebone table definition:
- The specialist who created a system for me in Notion, seemed to regard these views as the closest thing to the raw table definition, and so do I
- This is why I usually start with a table view, eventhough I probably well never use it - I do like to have it as backup, in case of complications
- When you create a new database without specifying a view, you get this view.
For more: Database views (Notion).
Peek view
With the creation of a database table and its view, an additional so-called peek view gets created. A bit like a custom Edit view on a WooCommerce product:
- It always gets created in the same way, regardless of the view that is specified at database creation
- But it's really a view and not just a raw table representation, because you can change its presentation.
- But the original peek view is preserved, so you can always get back to it - And that looks again a bit like a table definition representation.
For more: Peek view (Notion).
Can I see the properties of a database table?
Ehm, yes, you may see those:
View » Properties
This is probably the most reliable approach:
Peek view
Table view
Probably the least reliable approach, but easily available:
Can I at least see all database tables with their name?
You want to see the names of the database tables? It seems that Notion really doesn't want you to do that. Especially the names of database tables seem to be shrouded in ambiguity:
Sidebar object hierarchy
Hoover over the name of a view
Link to an existing database
URL encoded?
I think I read somewhere, that a database-ID is included in relevant URLs. Of course, that's not a title, but at least an identifier.
See also
- Header difference (Notion)
- Hoofdpagina#Notion
- Database views (Notion)
- Lookup-tabellen (Notion)
- Object browser (Notion)
Sources
- https://www.notion.so/Intro-to-databases-fd8cd2d212f74c50954c11086d85997e
- https://www.reddit.com/r/NotionSo/comments/ayvkcs/notioneers_level_up_your_tagging/
- https://www.youtube.com/watch?v=O8qdvSxDYNY - Notion: Creating a database
Name of the database table?