Search code examples
databaseoracle-databasesqlplustablespace

How can I organize tables in SQL*Plus?


I am practicing SQL, and suddenly I have so many tables. What is a good way to organize them? Is there a way to put them into different directories?

Or is the only option to create a tablespace as explained here?


Solution

  • It depends what you mean by organise - tablespaces are really focused on organising storage.

    For organising tables, grouping them into different SCHEMAS may be more useful. This is more like the concept of a 'namespace' - i.e. schema1.people is not the same as schema2.people.

    It often pays off to separate Operational and Configuration data into different schemas.

    If you are talking about organising tables within a schema - and in a real world application, having hundreds of tables in one schema is not unknown - then all you can really do is come up with good naming conventions.

    Some places group tables with prefixes at the start of the table name. Personally, I think this leads to duplication - EMP_ADDRESSES and CUST_ADDRESSES rather than a properly linked Addresses.