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

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

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