Create table with user defined type as column
SQL>
SQL> create type employee_type as object (
2 employee_id number,
3 first_name varchar2(30),
4 last_name varchar2(30)
5 );
6 /
Type created.
SQL>
SQL> create type employee_list_type as varray(50) of employee_type
2 /
Type created.
SQL>
SQL>
SQL> create table departments (
2 department_id number,
3 department_name varchar2(30),
4 manager employee_type,
5 employees employee_list_type )
6 /
Table created.
SQL>
SQL>
SQL>
SQL> drop table departments;
Table dropped.
SQL> drop type employee_list_type;
Type dropped.
SQL> drop type employee_type;
Type dropped.
SQL>
Related examples in the same category