Database Objects
A database objects in a relational database is a data structure used to either save or reference data. The most basic object that people interact with is the table. Other objects are indexes, stored procedures, sequences, views and many other.
When a database objects is created, a new object type can’t be created because all the various object types created are restricted by the very nature, or program, of the relational database model being used, such as Oracle, SQL Server or Access. What is being created is instances of the objects, such as a new table, an index on that table or a view on the same table.
2 small but important distinctions are needed:
- An object type is the base concept or idea of an object; for instance, the concept of a table or index.
- An object instance is an instance of an object type. For instance, a table called CUSTOMER_MASTER is an instance of the object type TABLE.
Most of the main database engines offer the same set of major database objects types:
- Tables
- Indexes
- Sequences
- Views
- Synonyms
Although there are subtle variations in the behavior and the syntax used for the creation of these main database objects types, they are almost identical in their concept and what they mean. A table in Oracle behaves almost exactly as a table in SQL Server. This makes work much simpler for the database administrator. It is analogous to moving from one car to another made by a various manufacturer; the switches for turning the headlights on may be in variant locations, but the overall layout is broadly same.
When creating an object instance, it is a good idea to follow an easy to understand naming convention. This is especially important for database designers whose products will be used by different people. It is also helpful to make work as simple as possible for in-house database administrators by decreasing the no. of queries made to the creator later. A simple guideline is to add suffixes. Here are two instance:
- Suffix all the master tables using _MASTER, e.g., CUSTOMER_MASTER, ACCOUNTS_MASTER and LOANS_MASTER).
- Suffix all transactional tables using the suffix _TRANS, e.g., DAILY_TRANS, LOANS_TRANS and INTERBANK_TRANS.