Question

All of the data for your project has been inserted with the exception of the shippingMethods table. Your task is to create a new stored procedure called Insert_ShippingMethod_Data and write the necessary code to insert the shipping method data into your tables. Once you create the stored procedure, you must execute the stored procedure in order to populate the shippingMethods table. The data to be inserted into your table is below. Check task 5 for the data types of each attribute to make sure you use the correct format when inserting the data.

MS SQL server

vRate 0.5 0.5 30 1 1 shipID 101 102 103 104 201 202 203 204 301 302 303 304 company Fedex Fedex Fedex Fedex UPS UPS UPS UPS U

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Stored Procedure :

CREATE PROCEDURE Insert_ShippingMethod_Data
-- Add the parameters for the stored procedure here
@shipID int,
@company varchar(50),
@method varchar(50),
@fRate int,
@vRate real,
@baseWeight int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

-- Insert statements for procedure here
INSERT INTO shippingMethods
(shipID,company,method,fRate,vRate,baseWeight)
VALUES
(@shipID,@company,@method,@fRate,@vRate,@baseWeight)
END
GO

--------------------------------------------------------------------------------------------------------------------------------------------

Record insertion by using stored procedure :

EXECUTE [dbo].[Insert_ShippingMethod_Data]
@shipID = 101, @company = 'Fedex', @method = 'Standard Ground', @fRate = 10, @vRate= 0.5,@baseWeight= 20
GO

EXECUTE [dbo].[Insert_ShippingMethod_Data]
@shipID = 102, @company = 'Fedex',@method = 'Standard Air',@fRate = 20,@vRate= 0.5, @baseWeight= 10
GO

EXECUTE [dbo].[Insert_ShippingMethod_Data]
@shipID = 103, @company = 'Fedex',@method = 'Express Air',@fRate = 30,@vRate= 1, @baseWeight= 10
Go

EXECUTE [dbo].[Insert_ShippingMethod_Data]
@shipID = 104, @company = 'Fedex',@method = 'Next Day Air',@fRate = 40,@vRate= 1, @baseWeight= 10
Go

EXECUTE [dbo].[Insert_ShippingMethod_Data]
@shipID = 201, @company = 'UPS',@method = 'Standard Ground',@fRate = 15,@vRate= 0.5, @baseWeight= 15
Go

EXECUTE [dbo].[Insert_ShippingMethod_Data]
@shipID = 202, @company = 'UPS',@method = 'Standard Air',@fRate = 25,@vRate= 0.5, @baseWeight= 15
Go

EXECUTE [dbo].[Insert_ShippingMethod_Data]
@shipID = 203, @company = 'UPS',@method = 'Express Air',@fRate = 35,@vRate= 0.5, @baseWeight= 15
Go

EXECUTE [dbo].[Insert_ShippingMethod_Data]
@shipID = 204, @company = 'UPS',@method = 'Next Day Air',@fRate = 45,@vRate= 0.5, @baseWeight= 15
Go

EXECUTE [dbo].[Insert_ShippingMethod_Data]
@shipID = 301, @company = 'USPS',@method = 'Standard Ground',@fRate = 5,@vRate= 0.5, @baseWeight= 20
Go

EXECUTE [dbo].[Insert_ShippingMethod_Data]
@shipID = 302, @company = 'USPS',@method = 'Standard Air',@fRate = 15,@vRate= 0.5, @baseWeight= 10
Go

EXECUTE [dbo].[Insert_ShippingMethod_Data]
@shipID = 303, @company = 'USPS',@method = 'Express Air',@fRate = 30,@vRate= 1, @baseWeight= 10
Go

EXECUTE [dbo].[Insert_ShippingMethod_Data]
@shipID = 304, @company = 'USPS',@method = 'Next Day Air',@fRate = 40,@vRate= 1, @baseWeight= 10
Go

-----------------------------------------------------------------------------------------------------------------------------------------------

Veiw all Records in database table stored procedure :

create Procedure Select_From_ShippingMethods
As
Begin

select * from shippingMethods;

End
Go

--------------------------------------------------------------------------------------------------------------------------------------

Exeucte above stored procedure as :

Execute
Select_From_ShippingMethods
Go

------------------------------------------------------------------------------------------------------------------------------------------

Add a comment
Know the answer?
Add Answer to:
All of the data for your project has been inserted with the exception of the shippingMethods...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • create a new stored procedure called Insert_ShippingMethod_Data and write the necessary code to insert the shipping...

    create a new stored procedure called Insert_ShippingMethod_Data and write the necessary code to insert the shipping method data into your tables shippingMethods shipID company method 101 102 103 104 201 202 203 204 301 302 303 304 fRate vRate baseWeight Fedex Fedex Fedex Fedex UPS UPS UPS UPS USPS USPS USPS USPS 0.5 0.5 Standard Ground 10 Standard Air Express Air Next Day Air Standard Ground15 Standard Air Express Air Next Day Air Standard Ground 5 Standard Air Express Air...

  • Can you look and see where I could improve on this ERD and ensure that the...

    Can you look and see where I could improve on this ERD and ensure that the ERD is correct? For this task, you are to normalize the ERD that has been developed to remove any partial dependencies or transitive dependencies that may exist. Two things about customers to consider when modifying your ERD are that customers may have more than one shipping address and multiple credit cards they can use to pay for their order. Also, there are several shipping...

  • Use Exhibit 2.1 and estimate FEDEX 2016 Total Sale via the top down approach & the...

    Use Exhibit 2.1 and estimate FEDEX 2016 Total Sale via the top down approach & the following assumptions: I. Only 2 companies in this industry: FEDEX & UPS ii. The industry 2016 projected annual growth rate is assumed to the geometric average of 2015, 2014, 2013 and 2012 industry annual growth rate. iii. FEDEX plan to have 0.5% higher market share in 2016 compare to 2015 market share (i.e UPS will have lower market share in 2016) EXHIBIT 2.1 Revenues...

  • Case Study: this is the only information I was given to answer the 3 questions below....

    Case Study: this is the only information I was given to answer the 3 questions below. Thank you for your help! I always leave a review. Since its inception, Amazon has relied on third-party shippers, such as UPS and FedEx. In 2013, Amazon experienced a wave of last-minute orders and bad weather left UPS and other shippers unable to deliver Amazon’s packages. Amazon issued apologies and $20 gift cards to customers, but its reputation suffered from the unhappy customers who...

  • The table below provides shipping rates for packages using UPS next day air or ground service...

    The table below provides shipping rates for packages using UPS next day air or ground service options. The rates vary according to both the weight of the package and the distance of the shipment (larger numbered zones are farther away). Note that the zone number also indicates the number of days required to deliver a package using ground service. For example, it would take three days and cost $7.40 to send a 10-pound package to zone 3 using ground service....

  • Considering the following E-R diagram, your task is to create a script file for defining relations and populating data,...

    Considering the following E-R diagram, your task is to create a script file for defining relations and populating data, you can use any text editor (notepad/notepad+) to write SQL statements and save it with the file extension.sql (i.e., Test3Tsay.sql). Name the file as Test3XXX.sql (where XXX is your last name). Upload it to here. endedDate phone startedDate name address name location no salary no Employees Projects assignDate P WorksOn Scientists Technicians research hEduDegree N certifications Equipments cost no Task 1...

  • The lab for this week addresses taking a logical database design (data model) and transforming it...

    The lab for this week addresses taking a logical database design (data model) and transforming it into a physical model (tables, constraints, and relationships). As part of the lab, you will need to download the zip file titled CIS336Lab3Files from Doc Sharing. This zip file contains the ERD, Data Dictionary, and test data for the tables you create as you complete this exercise. Your job will be to use the ERD Diagram found below as a guide to define the...

  • Microsoft Project Assignment Description A system development project has been defined to contain the following list of...

    Microsoft Project Assignment Description A system development project has been defined to contain the following list of activities along with their estimated times for completion. The project will start on 5/1/2019. Project Data Provided: Activity ID Activity Name Days Predecessors Optimistic(O) Realistic(R) Pessimistic(P) 1 Gather Requirement 1 2 3 2 Analyze processes 1 2 6 1 3 Define DFDs 0.5 1 1.5 2 4 Design Processes 2 7 12 2 5 Design database 4 7 22 3 6 Design UI...

  • please answer it quikly this quizz has time frame Topic Task 11: Regression and Correlation Data...

    please answer it quikly this quizz has time frame Topic Task 11: Regression and Correlation Data Sheet This data and record sheet is required for you to complete the online Topic Task. Please print this sheet BEFORE you attempt to open the Topic Task 11. You will need this information in front of you when doing the task. You will also need a pencil/pen and your calculator Do not clear the data from your calculator between questions, as you will...

  • Step 1: Design and create the tables You must create additional tables to hold Project and...

    Step 1: Design and create the tables You must create additional tables to hold Project and Activity Data. A project represents the construction of a facility with a limited scope of work and financial funding. A Project can be composed of many activities which indicate the different phases in the construction cycle. Example Project Name: Bobba Fett’s Bounty Chase Ride An activity represents the work that must be done to complete the project. Example Activity Name: For Example activity name...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT