RelationalDBDesign RelationalDBDesign 


Data Structures   «Prev  Next»

Create Varray in Oracle - Exercise

Create a 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 
xxxx 
AS object 
( 
   test_name  VARCHAR2, 
   xxxx
); 
CREATE TYPE 
   xxxx_arr 
AS 
   VARRAY(????) OF xxxx; 
CREATE TABLE 
student 
( 
   student_no      NUMBER,
   xxxx,
   xxxx,
   xxxx
);