Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Oracle SQL Problem Tables: CREATE TABLE VEHICLE_19 (V_ID CHAR(5) PRIMARY KEY , V_MODEL VARCHAR2(15), V_MAKE CHAR(4), COST_PER_DAY NUMBER(7,2)); INSERT INTO VEHICLE_19 VALUES ('V1001', 'Tata Sierra',

Oracle SQL Problem

image text in transcribed

Tables:

CREATE TABLE VEHICLE_19 (V_ID CHAR(5) PRIMARY KEY , V_MODEL VARCHAR2(15), V_MAKE CHAR(4), COST_PER_DAY NUMBER(7,2));

INSERT INTO VEHICLE_19 VALUES ('V1001', 'Tata Sierra', '2011',37.50); INSERT INTO VEHICLE_19 VALUES ('V1002', 'Honda CRV', '2016',47.50); INSERT INTO VEHICLE_19 VALUES ('V1003', 'Mercedez Benz', '2011',117.50); INSERT INTO VEHICLE_19 VALUES ('V1004', 'Ford Focus', '2011',87.50); INSERT INTO VEHICLE_19 VALUES ('V1005', 'Dodge Dakota', '2013',87.00);

Create table CLIENT_19 (C_ID CHAR(10) PRIMARY KEY, F_NAME VARCHAR2(25), L_NAME VARCHAR2(25), DOB DATE, CITY VARCHAR2(15), GENDER CHAR(1) CHECK (GENDER IN (NULL, 'M','F')));

INSERT INTO CLIENT_19 VALUES ('C00000001','Mike','Thomas',to_date('1998-12-20','yyyy-mm-dd'), 'Kamloops','M'); INSERT INTO CLIENT_19 VALUES ('C00000002','Andrew','Thessen',to_date('1988-08-20','yyyy-mm-dd'), 'Williams Lake','M');

create table RESERVATION_19 (R_ID NUMBER PRIMARY KEY, START_DATE DATE, END_DATE DATE, C_ID CHAR(10) REFERENCES CLIENT_19(C_ID), V_ID CHAR(5) REFERENCES VEHICLE_19(V_ID) , TOTAL_COST NUMBER(9,2));

INSERT INTO RESERVATION_19 VALUES (1, TO_DATE('12-01-2019','DD-MM-YY'), TO_DATE('15-01-2019','DD-MM-YY'), 'C00000001', 'V1003',352.50); INSERT INTO RESERVATION_19 VALUES (2, TO_DATE('2-01-2019','DD-MM-YY'), TO_DATE('6-01-2019','DD-MM-YY'), 'C00000002', 'V1001',150.00); INSERT INTO RESERVATION_19 VALUES (3, TO_DATE('10-10-2018','DD-MM-YY'), TO_DATE('12-10-2018','DD-MM-YY'), 'C00000001', 'V1004',150.00);

Question:

Black list (Stored Procedure)

Create a store procedure to add clients to the Black list. The input parameters are C_ID and a string of characters for the reason. Insert all client information, the reason , and the USER NAME (STU.) and date/time. The procedure should also delete the client from the clients table

Thanks

CLIENT C ID F NAME L NAME DOB CITY GENDER VEHICLE RESERVATION V ID V MODEL V MAKE COST PER DAY R ID START DATE END DATE C ID V ID TOTAL COST ARCHIVED RESERVATION R ID START DATE END DATE C ID V ID TOTAL COST ADDED BY ADDED DATE STATS YEAR C ID AGE GENDER TOT RESERVATIONS TOT DAYS OF RESERVATIONS TOT COST OF RESERVATIONS BLACK_LIST C ID F NAME L NAME DOB CITY GENDER REASON ADDED BY ADDED DATE CLIENT C ID F NAME L NAME DOB CITY GENDER VEHICLE RESERVATION V ID V MODEL V MAKE COST PER DAY R ID START DATE END DATE C ID V ID TOTAL COST ARCHIVED RESERVATION R ID START DATE END DATE C ID V ID TOTAL COST ADDED BY ADDED DATE STATS YEAR C ID AGE GENDER TOT RESERVATIONS TOT DAYS OF RESERVATIONS TOT COST OF RESERVATIONS BLACK_LIST C ID F NAME L NAME DOB CITY GENDER REASON ADDED BY ADDED DATE

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

Implementing Ai And Machine Learning For Business Optimization

Authors: Robert K Wiley

1st Edition

B0CPQJW72N, 979-8870675855

More Books

Students also viewed these Databases questions

Question

c. What groups were least represented? Why do you think this is so?

Answered: 1 week ago