Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Copy and run the following code and then answer the questions that follow: CREATE TYPE address_t AS OBJECT ( street VARCHAR2(30), city VARCHAR2(20), state CHAR(2),

Copy and run the following code and then answer the questions that follow:

CREATE TYPE address_t AS OBJECT (

street VARCHAR2(30),

city VARCHAR2(20),

state CHAR(2),

zip CHAR(5) );

/

CREATE TYPE address_tab IS TABLE OF address_t;

/

CREATE TABLE customers (

custid number primary key,

address address_tab )

NESTED TABLE address STORE AS customer_addresses;

/

INSERT INTO customers VALUES (1,

address_tab(

address_t('62 Oak St.', 'Redwood Shores', 'CA', '94065'),

address_t('33 Union St.', 'Mill Valley', 'CA', '90952')

) );

/

INSERT INTO customers VALUES (2,

address_tab(

address_t('2 Queens Rd.', 'Poway', 'CA', '88065'),

address_t('129 Beach Rd.', 'Portola', 'CA', '91132'),

address_t('81 Federation St.', 'Plymouth', 'CA', '71532')

) );

/

INSERT INTO customers VALUES (3,

address_tab(

address_t('72 Gilmour Rd.', 'Placentia', 'CA', '44065')

) );

1.1 Write a query to display the street, city, state, and zip for the customer whose id is 1. That is, your query should display the following: (2.5 point)

STREET CITY STATE ZIP

------------------------------------------------------------

62 Oak St. Redwood Shores CA 94065

33 Union St. Mill Valley CA 90952

1.2 Write an update query to update the street of the first address of the customer whose id is 1 from street 62 Oak St. to 63 Oak St. (2.5 points)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mastering Apache Cassandra 3 X An Expert Guide To Improving Database Scalability And Availability Without Compromising Performance

Authors: Aaron Ploetz ,Tejaswi Malepati ,Nishant Neeraj

3rd Edition

1789131499, 978-1789131499

More Books

Students also viewed these Databases questions

Question

7. Explain how to recruit a more diverse workforce.

Answered: 1 week ago

Question

Explain the nature of human resource management.

Answered: 1 week ago

Question

Write a note on Quality circles.

Answered: 1 week ago