Question: Write the SQL procedure or function with the question.... DO NOT GIVE OTHER LANGUAGES!!! DO NOT WATES MY QUESTION. 5. When client is returning the

Write the SQL procedure or function with the question.... DO NOT GIVE OTHER LANGUAGES!!! DO NOT WATES MY QUESTION.

5. When client is returning the car (can pass reservation ID or client ID): The reservation ID is given. If a reservation is for more than 10 days, a 10% discount is offered If the reservation in having Christmas day in between, a 20% discount is offered. Now calculate the cost and ask for the payment. If client is not paying, or car is broken by the client, the client is moved to black list table with the reason

there is my tables....

create table vehicle( V_ID char(20) primary key, v_model varchar2(50), v_make varchar2(50), per_day_cost number );

create table client( C_ID char(20) primary key, f_name varchar2(50), l_name varchar2(50), dob date, city varchar(50), gender char(10) );

create table ar_res ( res_id number primary key, s_date date, e_date date, c_id number, v_id number, t_cost number, add_by varchar2(50), add_date date );

create table reservations( res_id number primary key, s_date date, e_date date, c_id number, v_id number, t_cost number, constraint fk_c_id foreign key (C_ID) references CLIENT(C_ID), constraint fk_v_id foreign key(V_ID) references VEHICLE(V_ID) );

create table b_list ( c_id number primary key, f_name varchar2(50), l_name varchar2(50), dob date, city varchar2(50), gender char(10), reason varchar2(50), add_by varchar2(50), add_date date ); create table stats ( year number, c_id number, age number, gender char(10), tol_res number, tol_days_res number, tol_cost_res number );

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!