Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the film database you have, answer the following queries in your schema then write them down in this paper. Question one: a) Select the

Using the film database you have, answer the following queries in your schema then write them down in this paper.

Question one:

a) Select the total rental_rate for films grouped by their categories. Order the result from largest to smallest.

b) Select all actors who acted together with JOE in any film. Use inner query.

c) Create a view, which has category names and number of films each category has.

Question two:

a) Convert the following for-cursor into: open, fetch, close one:

DECLARE

Cursor c1 is select table_name from user_tables;

BEGIN

FOR tables IN c1 LOOP

DBMS_OUT.PUT_LINE(tables.table_name);

END LOOP;

END;

b) Create a trigger so that when user tries to update category table, new value won't take effect and old data will remain in the database.

c) Create a function to return if a particular film has more than 10 actors in it or not.

image text in transcribed

Film PF" actor_id PF filmid Film Actor SMALLINT SMALLINT Language language id SMALLINT name CHAR (20) Psilmid title description release_year Flanguage_id original language_id rental duration * rental_rate length replacement_cost rating special features last_update SMALLINT VARCHAR2 (255) VARCHAR2 (255) SMALLINT SMALLINT SMALLINT SMALLINT NUMBER (42) SMALLINT NUMBER (5.2) VARCHAR2(0) VARCHAR2(255) TIMESTAMP Film Category PF imid SMALLINT PF category.id SMALLINT Pactor_id first name last name IF nationality Actor SMALLINT VARCHAR2 (45) VARCHAR2 (45) CHAR (2) Category P. category_id SMALLINT name VARCHAR2 (25 ndo parent cat SMALLINT Country P country_id SMALLINT U short code CHAR (2) narne VARCHAR2 (25) INC 1334

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

Step: 3

blur-text-image

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

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions