Rows that contain unnamed row types
Suppose you create the table that the following figure
shows. The student table defines the s_address column
as an unnamed row type.
Figure 1. Create the student table.
CREATE TABLE student
(
s_name VARCHAR(30),
s_address ROW(street VARCHAR (20), city VARCHAR(20),
state CHAR(2), zip VARCHAR(9)),
grade_point_avg DECIMAL(3,2)
);
The following statement shows you how to add a row to
the student table. To insert into the unnamed row-type column s_address,
use the ROW constructor but do not cast the row-type value.
INSERT INTO student
VALUES ('Keene, Terry',
ROW('53 Terra Villa', 'Wheeling', 'IL', '45052'),
3.75);