1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Pepsi [2]
3 years ago
8

Write a script that creates and calls a stored procedure named test. This procedure should use a transaction that includes the s

tatements necessary to combine two customers. These statements should do the following: Select a row from the Customers table for the customer with a customer_id value of 6. This statement should lock the row so other transactions can’t read or modify it until the transaction commits, and it should fail immediately if the row is locked from another session. Update the Orders table so any orders for the selected customer are assigned to the customer with a customer_id value of 3. Update the Addresses table so any addresses for the selected customer are assigned to the customer with a customer_id value of 3. Delete the selected customer from the Customers table. If these statements execute successfully, commit the changes. Otherwise, rollback the changes.
Computers and Technology
1 answer:
natita [175]3 years ago
8 0

Answer:

Check the explanation

Explanation:

use `my_guitar_shop`;

#delete the procedure test if it exists.

DROP PROCEDURE IF EXISTS test;

DELIMITER //

CREATE PROCEDURE test ()

BEGIN

   #declare variable sqlerr to store if there is an sql exception

  declare sqlerr tinyint default false;

   #declare variable handler to flag when duplicate value is inserted

  declare continue handler for 1062 set sqlerr = TRUE;

   #start transaction

   start transaction;

  delete from order_items where order_id in

      (select order_id from orders where customer_id=6);

  delete from orders where customer_id=6;

  delete from addresses where customer_id=6;

  delete from customers where customer_id=6;

 

   if sqlerr=FALSE then

      commit;

        select 'Transaction Committed' as msg;

  else

       rollback;

       select 'Transaction rollbacked' as msg;

   end if;

end //

delimiter ;

call test();

You might be interested in
Which of these are correctly formatted Python tuples? CHECK ALL THAT APPY.
grin007 [14]
I think C is correct I looked into some Python and that would seam like the most logical answer
4 0
3 years ago
Read 2 more answers
What is software piracy
Tju [1.3M]
Software piracy is the illegal copying, distribution, or use of software.
8 0
3 years ago
Read 2 more answers
In word, the ____ presents the most accurate view of how your document will look when printed, displaying the entire page on scr
makkiz [27]
<span>When using Microsoft Word, the "Print Preview" presents the most accurate view of how the document will look when it is printed. When using "Print Preview" the entire page is displayed on screen, making it easier to see what adjustments should be made to the page layout, such as spacing or text size.</span>
7 0
3 years ago
What two benefits are a result of configuring a wireless mesh network? Check all that apply.
Andrei [34K]

Answer:

1)PERFORMANCE

2)RANGE

Explanation:

A mesh network can be regarded as local network topology whereby infrastructure nodes connect dynamically and directly, with other different nodes ,cooperate with one another so that data can be efficiently route from/to clients. It could be a Wireless mesh network or wired one.

Wireless mesh network, utilize

only one node which is physically wired to a network connection such as DSL internet modem. Then the one wired node will now be responsible for sharing of its internet connection in wireless firm with all other nodes arround the vicinity. Then the nodes will now share the connection in wireless firm to nodes which are closest to them, and with this wireless connection wide range of area can be convered which is one advantage of wireless mesh network, other one is performance, wireless has greater performance than wired one.

Some of the benefits derived from configuring a wireless mesh network is

1)PERFORMANCE

2)RANGE

7 0
2 years ago
Ximena noticed that Sofia had created a network bridge on her new laptop between the unsecured wireless network and the organiza
ratelena [41]

Answer:

A bridge could permit access to the secure wired network from the unsecured wireless network

Explanation:

A bridge is connecting device in networking that connects two different network devices. This device is suitable to connect a secure network with an unsecured network.

8 0
3 years ago
Other questions:
  • Lucy has to move data from column A to column N in a worksheet. Which keys should she select to move data in the same worksheet?
    7·2 answers
  • You just read a restaurant review on the internet of the newest restaurant in town. The writer of the article said the food was
    15·1 answer
  • Where to set up wireless network xbox one?
    5·1 answer
  • What is after Windows 8.1
    11·2 answers
  • When records are in ____ order, they are arranged one after another on the basis of the value in a particular field.?
    9·1 answer
  • If the base-10 system stops with the<br> number 9, then why isn't it called<br> base-9?
    15·1 answer
  • Describe at least two other companies that are direct or indirect competitors to your company. Explain how you will differentiat
    15·1 answer
  • Worth 30 pts
    9·2 answers
  • PLEASE HELP WILL GIVE BRAINLIEST!!!’
    15·1 answer
  • Python Programming
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!