Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

--declare a variable named @var (variable names must begin with @ in SQL Server) declare @var int --assignment statement, calculate expression & store result in

--declare a variable named @var (variable names must begin with @ in SQL Server)

declare @var int

--assignment statement, calculate expression & store result in variable

select @var = 100 40 * 2

--display what is stored in a variable for the DBA to see (in Message window)

--Click on Messages tab when you run this code to see the output

print 'Variable stores:'

print @var

--using the variable: Display all of the part information for those parts whose

-- quantity onhand is less than the value stored in @var

--FILL IN CODE HERE--

--store result of a query in a variable

--this code replaces the value stored in @var with a new value

select @var = partnum

from Part

where Description = 'Iron'

--display a message describing what is stored in @var

--along with the actual value stored in @var

--the code provided above shows an example of how to do this

--FILL IN CODE HERE

--Modify all orderlines that contain the part referred to by @var

--as follows: increase the NumOrdered by 1

--FILL IN CODE HERE--

--Get a list of all the customers who ordered the part referred to by @var

--FILL IN CODE HERE--

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

Intelligent Information And Database Systems 6th Asian Conference Aciids 2014 Bangkok Thailand April 7 9 2014 Proceedings Part I 9 2014 Proceedings Part 1 Lnai 8397

Authors: Ngoc-Thanh Nguyen ,Boonwat Attachoo ,Bogdan Trawinski ,Kulwadee Somboonviwat

2014th Edition

3319054759, 978-3319054759

More Books

Students also viewed these Databases questions