Question
How to write code to create a MAINTENANCE table and its required constraints. The table below provides details of the meaning of the additional attributes
How to write code to create a MAINTENANCE table and its required constraints. The table below 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. |
2. 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. 3. Insert one OWNER, one PROPERTY, and two MAINTENANCE entries into respective tables: a. You must make up your own data. The data added must be sensible eg. you must not use 'Test1' or 'Owner1' as owner names b. You must make use of the sequences when adding the owner and property. c. 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started