Oracle SQL - Write SQL to create SALRANGE_TYPE type, based on a varray of two NUMBER(6,2) values

Requirements

Write SQL to create SALRANGE_TYPE type, based on a varray of two NUMBER(6,2) values

Use it to create an alternative SALGRADES2 table.

Demo

SQL>
SQL> create or replace type SALRANGE_TYPE
  2  as varray(2) of number(6,2);
  3  /-- ww  w.  j  a va 2  s.co m

Type created.

SQL> drop table salgrades2;
SQL> create table salgrades2
  2  ( grade      number(2)   constraint S2_PK
  3                           primary key
  4  , salrange   SALRANGE_TYPE  constraint S2_RANGE_NN
  5                           not null
  6  , bonus      NUMBER(6,2) constraint S2_BONUS_NN
  7                           not null
  8  ) ;
SQL>

Related Quiz