Data Structures   «Prev  Next»

Create Varray in Oracle - Exercise

Create Oracle VARRAY

Objective:Create a VARRAY.

Scoring

You will receive 10 points for this exercise. The exercise is auto-scored; when you have completed the exercise, click the Submit button to receive full credit.

Background | Overview

You have been asked to design a student table for a university. The student table will contain the student_name, student_no, student_address, and up to five college test scores. These could be the ACT or SAT scores for the student. Each test score will contain the test_name, the test_date, and the test_score. A student my have up to five test scores.

Instructions

Using the template below, create a student table with a VARRAY to hold the test scores.
CREATE TYPE 
table_goes_here
AS object 
( 
   test_name  VARCHAR2, 
   data1 data_type1
   data2 data_type2
); 

CREATE TYPE 
   table_arr 
AS 
   VARRAY(number) OF table; 
CREATE TABLE 
student 
( 
   student_no      NUMBER,
   // create 3 more 
   // column types for exercise
);