Creates a user-defined database role named orderentry

Assignment Help Database Management System
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

Reference no: EM13762470

Questions Cloud

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

Reviews

Write a Review

Database Management System Questions & Answers

  Sketch hash table to result from using hash function

Sketch hash table of length 11 which results from using hash function h(i) = (2i + 5) mod 11, to hash the keys 12, 44, 13, 88, 23, 94, 11, and 39,

  Explaining valid host addresses of wan links

Start with LAN on RTA and proceed clockwise. Determine the number that how many total valid host addresses will be wasted on WAN links?

  Use case diagram for the functional requirements

Analyse the Case Study documents and produce an initial high level functional requirements specification. Document these requirements with.

  Develop basic tools to expedite use of oracles dictionary

Write a script that provides all of the information in, and duplicates the formatting of, Oracle's SQL*Plus describe command. Additionally, the output should add the comments on the rows. Input: owner and table name. Output: columns for Name, Null..

  1 what is meant by data independence explain your answer2

1. what is meant by data independence? explain your answer.2. identify two benefits of separating application software

  Electronic spreadsheets in data modeling

Explain in detail with supporting illustrations the six stages of the problem solving process and explain when the choice for using electronic spreadsheets is the preferred tool of choice.

  Mark the words as index entries behavior and favorable

Mark the following words in the document as index entries: behavior (four instances), favorable (five instances), and impression (eight instances).

  Assume that a student table in a university database has an

assume that a student table in a university database has an index on studentid the primary key. and additional indexes

  The current database section found through the office button

In the Current Database section found through the Office Button, add Add Messages-Operator's Version as the application title. Make the start-up form Unread Messages open automatically when the application starts.

  Create an erd to show the resultant tables

Create an ERD to show the resultant tables at the 3NF level with all the needed attributes, Primary/Foreign keys etc - Create the RDM with appropriate attributes, primary and foreign keys.

  Create stored procedure to updates members balance

Create a stored procedure that updates the members' balance in the membership table by correctly recording the current or outstanding balance for each customer.

  Draw context diagram that represent supply ordering system

Draw a context diagram that represents a Supply Ordering System (SOS).

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