Reference no: EM13762470
Transactions& Locking
1. A. 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.
B. Why is it necessary to put the statements in 1A as a transaction?
C. What does it mean to commit a transaction?
2. A. Write a script 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. Place these two SQL statements in a transaction.
If these statements execute successfully, commit the changes. Otherwise, roll back the changes.
B. Explain why it is necessary to put statements involving foreign key updates such as in 2A into a transaction?
3. There are four types of concurrency problems. Explain Dirty Read and Lost Update with examples.
4. What are two ways you can prevent a deadlock in a database?
Security
5. Write a script that
A. Creates a user-defined database role named OrderEntry in the MyGuitarShop database
B. Give INSERT and UPDATE permission to the new role for Orders and OrderItems table.
C. Give SELECT permission for all user tables.
6. Write a script that
A. Creates a server login ID named "RobertHalliday" with the password "HelloBob"
B. Sets the default database for the login to the MyGuitarShop database
C. Creates a database user named "RobertHalliday" for the server login
D. Assigns the user to the OrderEntry role you created in exercise#5
7. Write a script that uses a cursor to loop through each row of the Administrators table and prints a login ID for each row in that consists of the administrator's first and last name with no space in between and a random number at the end of the login. You have to look up the function RAND and figure out how to use it.
8. Write a script that removes the user-defined database role named OrderEntry. (Hint: This script should begin by removing all users from this role.
9. In your own words, explain the following. Use specific examples if necessary.
A. Server Role
B. Database Role
Explain the many faces and facets of intelligence
: Explain The Many Faces and Facets of Intelligence. ctive, searching minds such as those of Katz, Gardner, and Goleman provide role models for the ways.
|
B2b e-marketplaces
: Volkswagen operates its own proprietary B2B e-marketplaces in which its suppliers participate. What are the disadvantages to Volkswagen of not using a generic B2B e-marketplace with even more suppliers?
|
Financial statements related to cash-cash equivalents
: Write a 700- to 1,050-word paper analyzing the disclosures contained within the notes to the financial statements related to cash and cash equivalents, receivables, and inventories. Include a list identifying the components of the organization's c..
|
Evaluating a health information system
: Did you purchase something off the shelf or have it developed in-house?
|
Creates a user-defined database role named orderentry
: Write a script that includes these statements coded as a transaction, What does it mean to commit a transaction
|
Single bank in a multibank system
: Suppose that the reserve ratio is .25, and that a bank has actual reserves of $15,000, loans of $40,000, and demand deposits of $50,000.
|
Systems development
: If you view systems development as a question-and-answer session, another question you could ask is, "Why do organizations develop IT systems?"
|
Applications of epidemiology
: Examine epidemiology as it relates to population, environment, transmission, and prevention.
|
Computers using some ai techniques
: Tablets Take Their Place in the PC Market on page 187 in the text and answer the questions below. APA formatting guidelines require a title page, abstract page, and reference page in addition to the body of the paper
|