IT452 Unit 7 Programmable Objects

Availability: In stock

Regular Price: $20.00

Special Price: $15.00

OR

IT452 Unit: 7 Programmable Objects

Double click on above image to view full picture

Zoom Out
Zoom In

More Views

Quick Overview

IT452 Unit 7 Programmable Objects

1. Create a variable for the region column, birthdate column and empid column.

2. Create and use a variable to pull the category name for categoryID 8. Write a separate query to return the output.

3. Write an IF ELSE element that checks for the current month and prints ‘This Month is November’ if it is November or prints ‘This Month is not November’ if the month is not November.
Prints This Month is November if you enter 11

4. Write a WHILE Loop that returns ProductName, CategoryID and UnitPrice and compares the CategoryID to 4. As long as it is less than 4 it should print the product name, categoryid and unitprice.
12 rows for Category 1
12 rows for Category 2
13 rows for Category 3

5. Write a script that performs the following tasks:
a. Define a variable to hold the maximum database ID value.
b. Set that variable equal to the maximum database ID value.  To determine the maximum database ID value, use the database_id column of the sys.databases table in the master database.
c. Use PRINT to print the value of the variable. Result: [Note:  PRINT writes to the Messages tab of the query window.]
[Note:  Your result may vary.]

6. Create a cursor that updates only to and from the ProductName column of the Production.Products table and print that column out. Returns all of the productnames upon successful execution

7. Create a table variable called work table with the following structure. Insert the row of data listed and execute the batch.
Worktable
PK int Primary Key
Col1 int Not Null
Insert 1 row with the following data:
1, 101
Execute the batch
Returns 1 row

8. Create a global temporary table called GlobalTempWork with the following structure
GlobalTempWork
Test nvarchar primary key,
Col1 int
Insert 1 row with the following data
10
Execute the batch to return the 1 row

Regular Price: $20.00

Special Price: $15.00

Details

IT452 Unit 7 Programmable Objects

1. Create a variable for the region column, birthdate column and empid column.

2. Create and use a variable to pull the category name for categoryID 8. Write a separate query to return the output.

3. Write an IF ELSE element that checks for the current month and prints ‘This Month is November’ if it is November or prints ‘This Month is not November’ if the month is not November.
Prints This Month is November if you enter 11

4. Write a WHILE Loop that returns ProductName, CategoryID and UnitPrice and compares the CategoryID to 4. As long as it is less than 4 it should print the product name, categoryid and unitprice.
12 rows for Category 1
12 rows for Category 2
13 rows for Category 3

5. Write a script that performs the following tasks:
a. Define a variable to hold the maximum database ID value.
b. Set that variable equal to the maximum database ID value.  To determine the maximum database ID value, use the database_id column of the sys.databases table in the master database.
c. Use PRINT to print the value of the variable. Result: [Note:  PRINT writes to the Messages tab of the query window.]
[Note:  Your result may vary.]

6. Create a cursor that updates only to and from the ProductName column of the Production.Products table and print that column out. Returns all of the productnames upon successful execution

7. Create a table variable called work table with the following structure. Insert the row of data listed and execute the batch.
Worktable
PK int Primary Key
Col1 int Not Null
Insert 1 row with the following data:
1, 101
Execute the batch
Returns 1 row

8. Create a global temporary table called GlobalTempWork with the following structure
GlobalTempWork
Test nvarchar primary key,
Col1 int
Insert 1 row with the following data
10
Execute the batch to return the 1 row

Product Tags

Use spaces to separate tags. Use single quotes (') for phrases.