THE SQL:1999 STANDARD OrderID OrderDate Customer Name Address

THE SQL:1999 STANDARD OrderID OrderDate Customer Name Address Phone Street City State Postcode Figure 1-3: Complex Types in Otherwise Relational Tables GIF types cannot be compared (or otherwise operated on) without using the SQL CAST operator. CAST indicates that the programmer is aware that two distinct types are being compared. Using the JPEG type s get_ background_coloris likely to get incorrect results against a GIFcolumn. Complex types contain multiple data values, also called attributes. Including these data types in the SQL standard was inspired by the popularity of object-oriented databases in the early and mid-1990s. An example of a complex type is a person type that consists of a name, an address, and a phone number. Although these data types violate the first normal form of the relational data model and can be easily represented as a discrete table in a properly normalized database, these types have a few unique features. A diagram representing the data structures involved is shown in Figure 1-3. The person type could be used in multiple tables while maintaining its personness that is, the same attributes and functions are usable against the person type even when the person column is used in three unrelated tables. In addition to allowing complex types, SQL:1999 defined types that could be references to complex types. For example, a person type could contain a reference (similar to a pointer) to an address type in a different table, as shown in the following code. CREATE TYPE PERSON ( pers_first_name VARCHAR(30), pers_last_name VARCHAR(30), other fields omitted pers_base_currency REF(ADDRESS) SCOPE ADDR_TAB) ) CREATE TYPE ADDRESS ( addr_street VARCHAR(20), addr_city VARCHAR(30), addr_state_province VARCHAR(10), addr_postal_code VARCHAR(10) ) CREATE TABLE ADDR_TAB ( addr_oid BIGINT, addr_address ADDRESS )

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost JSP Web Hosting services

Bookmark the permalink.

Comments are closed.