| Lesson 3 | Abstract data types |
| Objective | Create an abstract data type. |
One of the shortcomings of the Oracle7 database was the limited number of intrinsic data types.
A column in an Oracle7 table could be CHAR, VARCHAR, INT, or NUMBER data types, but there was no way to extend the data typing.
Another limitation of Oracle7 was that all entities had to be modeled at their smallest level. For example, to select all of the address information from a table, we have to specify all of the columns in the group.
To illustrate, consider a customer table:
A column in an Oracle7 table could be CHAR, VARCHAR, INT, or NUMBER data types, but there was no way to extend the data typing.
Another limitation of Oracle7 was that all entities had to be modeled at their smallest level. For example, to select all of the address information from a table, we have to specify all of the columns in the group.
To illustrate, consider a customer table:
The option to group values is an advantage, because the many individual columns in an SQL query no longer have to be listed.
Embedded data constructs and SQL joins
Creating Abstract Data Types (ADTs) also allows us to embed new constructs such as object ID (OIDs) and VARRAYs in table columns.
Embedded constructs have a huge impact on Oracle performance, since expensive JOINS can be avoided.
The next lesson shows how to imbed an OID in a table.
ADT - Exercise
Before you continue, click the Exercise link below to try creating an ADT.
ADT - Exercise
ADT - Exercise