Write a script that includes two sql statements code

Assignment Help Database Management System
Reference no: EM131061999

Lab Assignment

Excercise

1. Write a script that includes two SQL statements coded as a transaction to delete the row with a customer ID of 8 from the Customers table. To do this, you must first delete all addresses for that customer from the Addresses table.

If these statements execute successfully, commit the changes. Otherwise, roll back the changes.

2. Write a script that includes these statements coded as a transaction:

INSERT Orders

VALUES (3, GETDATE(), '10.00', '0.00', NULL, 4,

'American Express', '378282246310005', '04/2013', 4);

SET @OrderID = @@IDENTITY;

INSERT OrderItems

VALUES (@OrderID, 6, '415.00', '161.85', 1);

INSERT OrderItems

VALUES (@OrderID, 1, '699.00', '209.70', 1);

Here, the @@IDENTITY variable is used to get the order ID value that's automatically generated when the first INSERT statement inserts an order.

If these statements execute successfully, commit the changes. Otherwise, roll back the changes.

Attachment:- CreateMyGuitarShop.rar

Reference no: EM131061999

Questions Cloud

Determine the components of the corresponding reaction at b : Prob. 8.46 The machine part ABC is supported by a frictionless hinge at B and a 10° wedge at C. Knowing that the coefficient of static friction is 0.20 at both surfaces of the wedge, determine (a) the force P required to move the wedge to the left..
Faced with rising costs-particularly employment costs : View the clip below, in which one person believes they are partners and the other believes it is an employer / employee  relationship. Agents may bind the principal in a number of ways. When you are reviewing the video, consider whether the intent..
Percentage of households : Fifty million of 94 million households watched the last episode of a popular television show. What percentage of households were not watching the show? Approximately ? % of households were not watching the last episode of the show.
Determine the smallest force p that should be applied : Knowing that the coefficient of static friction is 0.30 at all surfaces of contact, determine the smallest force P that should be applied as shown to one of the wedges.
Write a script that includes two sql statements code : Write a script that includes two SQL statements coded as a transaction to delete the row with a customer ID of 8 from the Customers table. To do this, you must first delete all addresses for that customer from the Addresses table.
Coefficient between the number of automatic weapons : The data below show the number of registered automatic weapons, in thousands, and the murder rate, in murders per 100,000, for eight randomly selected states. a. Determine the correlation coefficient between the number of automatic weapons and the ..
Which motion occurs and what that motion is : which motion occurs, and what that motion is
Discuss the process and outcomes of the job portal project : Write a professional reflection essay in which you discuss the process and outcomes of this project, as well as how your coursework culminated in the capstone project.
Research proposal on self driving car : Prepare a Research proposal on given Topic. My topic is self driving car. What method wills you use to analyse your readings? How will you interpret the analysis to make your conclusions

Reviews

Write a Review

Database Management System Questions & Answers

  Create the database using three tables

Create the database using three tables: one for student information, one for advisor information, and one for department information.

  Explain how data mining be used to imporve customer service.

Please explain how a databses management system (DBMS) and data mining can help a motor vehicle maintenance center improve its services, and what tables would be needed in such a database

  How much total materials handling cost would be allocated

how much of the total materials handling cost would be allocated to the prefab barns and how much of the total materials handling cost would be allocated to the modular homes?

  Draw an entity relationship diagram

1. Draw an entity relationship diagram (ERD) for the following situation: A company has a number of employees. Each employee is identified by an Employee_Id. The company wants to store Employee_Name, Employee_Address, and Employee_BirthDate in the da..

  Describe the steps that are needed to pick a proper dbms

A database is a very important system in many organizations. Describe the steps that are needed to pick a proper DBMS

  The focus is to write sql queries that combine data

This is the final installment of the project! The focus is to write SQL queries that combine data from both Mondial and GapMinder (GM). For most queries you will need both Mondial and GM data, so you may need to use your bridge table(s).

  Problem 1 produce a scatterplot of rent vs size square

problem 1. produce a scatterplot of rent vs. size square meters of the apartment for the rental data in

  Code for event handler for the onclick event

Write the code for the event handler for the OnClick event of btnReset. Write the code for event handler for the OnClick event of btnCheck so that the number of occurrences of the selected vowel are counted and displayed.

  Explain meaning of expression acid transaction

What is lock granularity? Explain the use of BEGIN, COMMIT, and ROLLBACK TRANSACTION statements. Explain the meaning of expression ACID transaction.

  What is the primary key for each entity

Are there any multivalued attributes shown? If so, discuss how it/they should be handled in the implementation of the relational database.

  Write a program to calculate the tax of an employee

Write a program to calculate the tax of an employee whose employee number is input from the keyboard. Display an appropriate error message if the data does not exist in the Emp table.

  Under which conditions would each type of loop be more

there are 3 kinds of loops-for loop while loop and do while loop. under which circumstances would each kind of loop be

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd