First: I really haven't got any idea how to google for this. If you got one, leave a comment.
If I want to store arbitrarily large tables in a database, how should I set up my database tables?
Requirements:
- A table has an arbitrary number of columns and rows (columns about 1-10k, rows about 0-10M)
- There are thousands of tables
- A table has a name
- The columns of a table have a name
- Column-Cell values can be either numbers or strings
- A column always has the same datatype
Data I want to store:
"Bob the Table"
| "Name" | "Size" | "Comment" |
---------------------------------
| "Homer" | 170 | "A guy" |
| "Lisa" | 120 | "A girl" |
| "Bart" | 130 | "A boy" |
You get the idea. Table could be much larger.
Data I want to query:
Most of the time I want to query a single table, that is, given a table's name, just display "the table" as depicted above.
How would you implement the RDBMS tables and how would you write queries to select the data for a single table?
Disclaimer: This isn't homework. This here is purely out of curiosity while working on another problem.