Example:Tables are relations
From CS2800 wiki
For example, we could think of a table of blood donors containing names, birth dates, and social security numbers as a relation on the set Name of names, the set Date of dates, and the set SSN of social security numbers. We would represent this table:
Name | Birthdate | Social |
---|---|---|
Alice | 01/01/2011 | 111-11-1111 |
Bob | 02/02/1922 | 222-22-2222 |
As the relation .
Thinking of tables as relations is central to the design of certain kinds of databases (so-called relational databases). Operations like "filter out the millenials", "hide the social security number", and "add a hair color column by looking up the name in a second table" are all functions whose domains and codomains are sets of relations.