Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

My Part of ERD: Requirement: My procedure: CREATE PROCEDURE ADD_EXTRAS @EXTRA_ID CHAR(10), @EXTRA_CODE CHAR(3), @DESCRIPTION VARCHAR(30), @COST DECIMAL(5,2), @UNIT CHAR(8), @QTY INT, @EXTRA_TOTAL DECIMAL(5,2), @CONTRACT_NUM

My Part of ERD:

image text in transcribed

Requirement:

image text in transcribed

My procedure:

CREATE PROCEDURE ADD_EXTRAS

@EXTRA_ID CHAR(10),

@EXTRA_CODE CHAR(3),

@DESCRIPTION VARCHAR(30),

@COST DECIMAL(5,2),

@UNIT CHAR(8),

@QTY INT,

@EXTRA_TOTAL DECIMAL(5,2),

@CONTRACT_NUM CHAR(10)

AS

INSERT INTO EXTRA(EXTRA_ID,EXTRA_CODE,DESCRIPTION,COST,UNIT,QTY,EXTRA_TOTAL,CONTRACT_NUM)

VALUES(

@EXTRA_ID,

@EXTRA_CODE,

@DESCRIPTION,

@COST,

@UNIT,

@QTY,

@EXTRA_TOTAL,

@CONTRACT_NUM);

INSERT INTO ExtrasLog(CustomerID,CustomerFirstName,CustomerLastName,CustomerCity,CustomerState,Contract_NUM,VehicleMake,VehicleModel,VehicleOutDate,TotalCostOfExtras)

VALUES(

(SELECT LICENSE_NUM FROM CONTRACT WHERE @CONTRACT_NUM = CONTRACT.CONTRACT_NUM),

(SELECT F_NAME FROM CUSTOMER),

(SELECT L_NAME FROM CUSTOMER),

(SELECT CITY FROM CUSTOMER),

(SELECT STATE FROM CUSTOMER),

@CONTRACT_NUM,

(SELECT MAKE FROM VEHICLES),

(SELECT model FROM VEHICLES),

(SELECT OUT_DAY FROM CONTRACT),

@EXTRA_TOTAL);

The values part in ExtraLog is not right and I can not find what is wrong at this point. Can anyone help me?

Customer FName City Insurance els Rental Vehicles Type ConditioniD ExtralD Servicel Servicesource ConfracfNum

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_2

Step: 3

blur-text-image_3

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

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions

Question

2. How price elasticity of demand affects total revenue.

Answered: 1 week ago

Question

Identify and apply the elements of supervision.

Answered: 1 week ago