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

  List all the foreign key constraints among these relations

Give an example of a (plausible) constraint involving one or more of these relations that is not a primary key or foreign key constraint.

  Write a join query that for every order placed on september

Write a join query that for every order placed on September 5, 1998, (use '05-SEP-1998') will list the order number and order date along with the customer number, last name, and first name of the customer who placed the order

  Draw an er diagram for database scenario

Draw an ER diagram for database scenario. Design a set of 3NF tables for your database scenario.

  Project taskstask 1 analytic objectiveindividual groups are

project taskstask 1 analytic objectiveindividual groups are expected to come up with an analytic objective for which

  I describe the application that you would like to design

i. describe the application that you would like to design. this should include the purpose of the application and an

  Compute canonical cover for set of functional dependencies

Compute a canonical cover for the above set of functional dependencies (show each step of your derivation with an explanation).

  Data analysis and definition

What is the business implications that can be drawn from the process of building and comparing these models, and has this practice helped resolve the business issue? Why or why not?

  Information-sucurity and ethical concerns with the system

A disscussion of the information used in the system. A disscussion of any information-sucurity and ethical concerns with the system. MPR system

  Intro to programming

For this assignment, you will create a class to describe the product that is being ordered. You will then modify your code to create an instance of this class and utilize it in the ordering process.

  Types of relationships in a design model of a database

There are many kinds of relationships in a design model of a database. Why is it important to classify each of these types in an ERD Model?

  Advantages of a database management approach

Discuss the advantages of a database management approach to the file processing approach? Give examples to illustrate your answer. Outline the benefits and limitations of the relational database model for business applications today

  Construct an entity-relationship model for the database

Construct an entity-relationship (ER) model for the database. Make sure you include in your model details of entities, relationships, attributes, keys and limits in participation.

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