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

  A company makes use of a computerised flat file information

a company makes use of a computerised flat file information retrieval and storage system. the company is experiencing

  Consider the following hypothetical scenario

A hypothetical company has grown substantially using an acquisition strategy. As new companies were acquired, new systems that those companies were using were also acquired.

  Find bcnf decomposition of relation schema

Consider a relation schema r(A,B,C,D,E, F) and a set of functional dependencies {A BCD,BCDE,BD,DA}.  Determine whether or not (A,E, F) is in BCNF and justify your answer. If (A,E, F) is not in BCNF,find a BCNF decomposition of it.

  Write a 2 page research paper on the turing and von neumann

write a 2 page research paper on the turing and von neumann models. compare and contrast each and discuss which model

  What amount would company have to charge for cake

what would you expect to happen to the costs of cakes and what would be the overall margin on the order?

  Importance have button that takes you back to main page

What is the importance to have a button that takes you back to the main page on each web page? How does dead end or orphan pages affect the continuity of a website?

  How to change content in order for new list

To what kind of list would you change it? What would you require to change about content in order for new list type to be effective for purpose of list?

  Database modeling

After reading this week's article, "Modeling for the Future," expand on the subject of Database Modeling. There are several tools listed and reviewed in the article. Research these tools further, or identify other modeling tools

  Characteristics of database

Describe the database and describe the four characteristics of the database? Explain the Relational Database and generate a relational database for five employees.

  Find average number of books borrowed per member

Find the average number of books borrowed per member. Take into account that if a member does not borrow any books, then that member does not appear in the borrowed relation at all.

  Create table command, and modify it to create a new table

Start with this CREATE TABLE command, and modify it to create a new range_partitioned table named CH07EMPLOYEE_RANGE that contains the same column as the employee table.

  Review the data analysis and consider the coding activities

Review the data analysis and consider the coding activities you have engaged. Consider the kinds of data that would be generated through the data collection techniques anticipated for your qualitative research plan.

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