100 likes | 290 Views
Spatial Data Type Definitions in ORDB Abstract Data Types (ADT). Defining Spatial Data Types in SQL3. SQL3 User defined data type -Overview CREATE TYPE statements Defines a new data types Attributes and methods are defined Separate statements for interface and implementation
E N D
Spatial Data Type Definitions in ORDB Abstract Data Types (ADT)
Defining Spatial Data Types in SQL3 • SQL3 User defined data type -Overview • CREATE TYPE statements • Defines a new data types • Attributes and methods are defined • Separate statements for interface and implementation • Additional effort is needed at physical data model level
Semantics • For point data type an important operation is Distance • Length operation is not a semantically correct operation on a Point • In relational databases the set of data types is fixed • In object-relational and object-oriented databases, this limitation has been relaxed • And there is built in support for user-defined data types.
ADT definition in SQL3/SQL99 • Colons before u and v signify them as local variables. • Remember, ADT is like classes in object oriented technology. It can have attributes & member functions (eg. to modify values etc.) • To instantiate, create a table:
Row Type definition in SQL3/SQL99 • CREATE ROW TYPE Point ( x NUMBER, y NUMBER, ); Colons before u and v signify them as local variables
Write an Object Relational Scheme for Logical Model • 3 Relations • Country(Name, Cont, Pop, GDP, Life-Exp, Shape) • City(Name, Country, Pop,Capital, Shape) • River(Name, Origin, Length, Shape)
River Representation Oracle syntax