Create sequences which used to provide primary key values


Problem

I. Provides details of the meaning of the "additional" attributes in the MAINTENANCE table. You must pick RESTRICT/NO ACTION on the delete rule for all FK constraints.

Attribute name

Meaning

maint_id

Maintenance ID (unique for each maintenance record)

maint_datetime

Maintenance date and time

maint_des

Maintenance description

maint_cost

Maintenance cost

maint_assigned

Maintenance assignment to a vendor (Y - yes, N - no). Yes means that the maintenance is carried out by a vendor. No means that the maintenance is carried out by the owner.

II. Create two sequences which could be used to provide primary key values for the OWNER and PROPERTY tables (one for each PK). Both sequences should start at 1 and increment by 1. Immediately prior to the create sequence commands, place appropriate DROP SEQUENCE commands so they will cause the sequences to be dropped before being created if they exist.

III. Insert one OWNER, one PROPERTY, and two MAINTENANCE entries into respective tables:

i. You must make up your own data. The data added must be sensible eg. you must not use 'Test1' or 'Owner1' as owner names

ii. You must make use of the sequences when adding the owner and property.

iii. At this stage, prior to our study of transactions, you should include one commit after all inserts to make the changes correctly recorded in the database. We will re examine such processes after studying transactions

If you have problems with these tasks simply rerun proprental_schema_start.sql which will cause all tables to be dropped and OWNER and PROPERTY tables to be recreated, then correct the issues in your scrip.

Request for Solution File

Ask an Expert for Answer!!
Computer Networking: Create sequences which used to provide primary key values
Reference No:- TGS03226653

Expected delivery within 24 Hours