-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tables whose primary keys have zero attributes #113
Comments
Note that this is different from SQL's tables that don't have a primary key. SQL is not exactly relational and its tables can contain duplicate rows. SQL does not have the equivalent of a primary key with zero attributes as defined here. |
As @eywalker suggested, one way to think about this topic is to imaging that all tables have an additional attribute |
If the primary key is empty, the table can have only one row. It is accomplished by adding an invisible column, defined as
to the primary key. It cannot be fetched or inserted or updated and is not shown in previews. |
Corresponding issue created for datajoint-matlab |
Currently datajoint prohibits creating tables with no attributes in the primary key. We can relax this prohibition.
If the primary key has no attributes, it can only have one value. Therefore, the relation can only contain one tuple. So it's good for relations that contain a single fact about the universe rather than a collection of similar facts. The relational algebra using such relations remains identical to what it is now. In particular, joining two relations with no primary key produces another relation with no primary key and one tuple.
The text was updated successfully, but these errors were encountered: