Transactions and Security Implementations
Outcomes addressed in this activity:
Unit Outcomes:
· Use Data Control Language (DCL) statements that manage database user permissions.
· Utilize the Transaction Control Language (TCL) statements that manage changes made by Data Manipulation Language (DML) statements.
· Generate database views to help maintain data confidentiality.
Course Outcome:
IT234-4: Discover more advanced SQL such as security commands and logins.
Purpose
Data security is critical in an organization. In this unit, you will learn how to create roles, how to create users and assign them to roles, and how to grant and revoke privileges on database tables.
Assignment Instructions
Please watch the Unit 9 videos covering facets associated with database security and transaction control. Navigate to the Academic Tools area of this course and select Library then Required Readings to access your texts and videos.
You will need to change the authentication method used by Microsoft SQL Server in order to complete this assignment. Open the Microsoft SQL Server Management Studio (SSMS) application using the standard Windows authentication method as illustrated below.
Right-click on the SQL Server instance at the top of the tree in the Object Explorer window. Select the Properties item from the right-click menu.
The Server Properties window will appear. Click on the Security link at the left side of the window. Select the “SQL Server and Windows Authentication mode” option in the “Server authentication” list. Click on the OK button when finished.
You’ll receive a prompt indicating you’ll need to restart the SQL Server instance. Click on the OK button to close out the window.
Right-click on the SQL Server instance at the top of the tree in the Object Explorer window. Select the Restart item from the right-click menu.
You may receive a User Account Control prompt. Click on the YES button to continue.
You will then receive a restart prompt. Click on the YES button to proceed.
You’ll then see a restart progress window. It will close out once the restart is complete.
You can now proceed with work on the assignment problems below. Your assignment submittal needs to show both the generated SQL statements and confirmatory screenshots verifying task completion.
Problem 1: Create a view called EmployeeDirectory that displays the first name, last name, title, and phone extension of all employees in the company.
Problem 2: Create a stored procedure that increases an employee’s salary by a raise percentage. The skeleton of the stored procedure is provided below.
CREATE PROCEDURE GiveEmployeeRaise
@EmployeeID INT, @RaisePercentage DECIMAL
AS
<REPLACE WITH YOUR SQL CODE>
The equation for computing a new salary is as follows:
New Salary = Old Salary * (1 + Raise Percentage/100)
If an employee with EmployeeID = 9 gets a 5% raise, the stored procedure call would be as follows:
EXEC GiveEmployeeRaise @EmployeeID = 9, @RaisePercentage = 5;
Problem 3: Create and execute a transaction block that contains two DML statements. The first statement updates the title for all employees to “President.” The second statement inserts a new region record with a RegionID = 10 and a RegionDescription = “Antarctica.” Incorporate these statements within the SQL block specified below:
BEGIN TRANSACTION
<REPLACE WITH INSERT/UPDATE STATEMENTS>
SELECT * FROM Employees;
SELECT * FROM Region;
ROLLBACK TRANSACTION
SELECT * FROM Employees;
SELECT * FROM Region;
Execute the completed SQL block in a Microsoft SSMS query window.
Briefly explain what happened with the execution of this transaction. Provide screenshots of the data before and after the ROLLBACK TRANSACTION statement. Please note the query results will appear in 4 separate sections in the Results area of Microsoft SSMS following execution of the above SQL block.
Problem 4: You are asked to add three new products to an existing order with OrderID = 11061. The additional records need to be added to the OrderDetails table with the following information:
Record 1
OrderID = 11061
ProductID = 62
UnitPrice = 45
Quantity = 10
Discount = 0
Record 2
OrderID = 11061
ProductID = 70
UnitPrice = 14
Quantity = 25
Discount = 0
Record 3
OrderID = 11061
ProductID = 1000
UnitPrice = 100
Quantity = 5
Discount = 0
Incorporate the SQL insert statements for the new records into the transaction block specified below and execute in a Microsoft SSMS query window:
BEGIN TRANSACTION NewOrderDetails
BEGIN TRY
<REPLACE WITH INSERT STATEMENTS>
COMMIT TRANSACTION NewOrderDetails;
END TRY
BEGIN CATCH
ROLLBACK TRANSACTION NewOrderDetails
END CATCH
SELECT * FROM OrderDetails
WHERE OrderID = 11061;
Briefly explain what happened with the execution of this transaction. Do the new records get inserted into the OrderDetails table? If not, why?
Problem 5: Create four new roles in the Northwind database:
· SalesPerson
· SalesManager
· HRperson
· HRmanager
Problem 6: Use Data Control Language (DCL) statements that manage database user permissions.
· Grant select, insert, and update permissions for Sales-related tables (Orders & OrderDetails) to the SalesPerson role.
· Grant select and delete permissions for Sales-related tables to the SalesManager role.
· Grant select permissions for the EmployeeDirectory view to the SalesPerson and SalesManager roles.
· Grant select, insert, and update permissions for HR-related tables (Employees & EmployeeTerritories) to the HRperson role.
· Grant select and delete permissions for HR-related tables to the HRmanager role.
· Grant execute permission for the GiveEmployeeRaise stored procedure to the HRperson role
Problem 7: Create four new users named Jane, Joan, Joe, and James. Use the CREATE LOGIN and CREATE USER commands to accomplish the work. Each established Northwind database user account must be associated with an applicable SQL Server login account (e.g., CREATE USER Jane FOR LOGIN Jane). Please note, you must establish the SQL Server login accounts before the database-level usernames. Use the following password for each of the four SQL Server login accounts: P@$$w0rd
Problem 8: Grant the roles specified below to Jane, Joan, Joe, and James.
· Give Jane the role of SalesPerson.
· Give Joan the role of SalesManager
· Give Joe the role of HRperson.
· Give James the role of HRmanager
Use the ALTER ROLE command to accomplish the role granting work.
ALTER ROLE <role_name> ADD MEMBER <user_name>;
Problem 9: In Microsoft SSMS, right-click on the SQL Server instance at the top of the tree in the Object Explorer window. Select the Connect item from the right-click menu.
The login prompt will appear. Select “SQL Server Authentication” from the Authentication drop down box. Enter “Jane” and “P@$$w0rd” into the Login and Password fields, respectively. Click on the Connect button when finished.
You will now be connected to the SQL Server instance as “Jane.”
Expand the Databases item under “Jane.” Right-click on the Northwind database item and select the New Query item in the right-click menu.
Generate SQL statements in the query window to do the following:
· Update the order quantity to 50 for OrderID = 10249 and ProductID = 51.
· Delete the record in OrderDetails with OrderID = 10251 and ProductID = 65.
· Select all of the records from the Employees table
· Select all of the records from the EmployeeDirectory view established in Problem 1
Provide screenshots of the SQL statement outputs. Provide a brief explanation for any statement that failed to execute
Problem 10: Connect to the Northwind database as “Joan” using the steps specified in Problem 9. Generate SQL statements in the query window to do the following:
· Update the order quantity to 60 for OrderID = 10249 and ProductID = 51.
· Delete the record in OrderDetails with OrderID = 10251 and ProductID = 65.
· Select all of the records from the Employees table
· Select all of the records from the EmployeeDirectory view established in Problem 1
Provide screenshots of the SQL statement outputs. Provide a brief explanation for any statement that failed to execute
Problem 11: Connect to the Northwind database as “Joe” using the steps specified in Problem 9. Generate SQL statements in the query window to do the following:
· View all of the records contained in the Orders table.
· Give a 5% raise to the employee with EmployeeID = 9 using the GiveEmployeeRaise stored procedure
· Select all of the records from the Employees table
· Select all of the records from the EmployeeDirectory view
Provide screenshots of the SQL statement outputs. Provide a brief explanation for any statement that failed to execute
Problem 12: Connect to the Northwind database as “James” using the steps specified in Problem 9. Generate SQL statements in the query window to do the following:
· Give a 10% raise to the employee with EmployeeID = 8 using the GiveEmployeeRaise stored procedure established in Problem 2
· Update the title to “Gamemaster” for the employee with EmployeeID = 9
· Select all of the records from the Employees table
· Select all of the records from the EmployeeDirectory view
Provide screenshots of the SQL statement outputs. Provide a brief explanation for any statement that failed to execute
Assignment Requirements
Microsoft SQL Server Express and SQL Server Management Studio (SSMS) MUST be installed to complete this Assignment.
Compose your Assignment in a Word document and be sure to identify yourself, your class, and unit Assignment at the top of your paper. Embed the screenshots of your SQL statements and confirmatory output (e.g., table structure definitions) into the Word document.
Are you busy and do not have time to handle your assignment? Are you scared that your paper will not make the grade? Do you have responsibilities that may hinder you from turning in your assignment on time? Are you tired and can barely handle your assignment? Are your grades inconsistent?
Whichever your reason is, it is valid! You can get professional academic help from our service at affordable rates. We have a team of professional academic writers who can handle all your assignments.
Students barely have time to read. We got you! Have your literature essay or book review written without having the hassle of reading the book. You can get your literature paper custom-written for you by our literature specialists.
Do you struggle with finance? No need to torture yourself if finance is not your cup of tea. You can order your finance paper from our academic writing service and get 100% original work from competent finance experts.
Computer science is a tough subject. Fortunately, our computer science experts are up to the match. No need to stress and have sleepless nights. Our academic writers will tackle all your computer science assignments and deliver them on time. Let us handle all your python, java, ruby, JavaScript, php , C+ assignments!
While psychology may be an interesting subject, you may lack sufficient time to handle your assignments. Don’t despair; by using our academic writing service, you can be assured of perfect grades. Moreover, your grades will be consistent.
Engineering is quite a demanding subject. Students face a lot of pressure and barely have enough time to do what they love to do. Our academic writing service got you covered! Our engineering specialists follow the paper instructions and ensure timely delivery of the paper.
In the nursing course, you may have difficulties with literature reviews, annotated bibliographies, critical essays, and other assignments. Our nursing assignment writers will offer you professional nursing paper help at low prices.
Truth be told, sociology papers can be quite exhausting. Our academic writing service relieves you of fatigue, pressure, and stress. You can relax and have peace of mind as our academic writers handle your sociology assignment.
We take pride in having some of the best business writers in the industry. Our business writers have a lot of experience in the field. They are reliable, and you can be assured of a high-grade paper. They are able to handle business papers of any subject, length, deadline, and difficulty!
We boast of having some of the most experienced statistics experts in the industry. Our statistics experts have diverse skills, expertise, and knowledge to handle any kind of assignment. They have access to all kinds of software to get your assignment done.
Writing a law essay may prove to be an insurmountable obstacle, especially when you need to know the peculiarities of the legislative framework. Take advantage of our top-notch law specialists and get superb grades and 100% satisfaction.
We have highlighted some of the most popular subjects we handle above. Those are just a tip of the iceberg. We deal in all academic disciplines since our writers are as diverse. They have been drawn from across all disciplines, and orders are assigned to those writers believed to be the best in the field. In a nutshell, there is no task we cannot handle; all you need to do is place your order with us. As long as your instructions are clear, just trust we shall deliver irrespective of the discipline.
Our essay writers are graduates with bachelor's, masters, Ph.D., and doctorate degrees in various subjects. The minimum requirement to be an essay writer with our essay writing service is to have a college degree. All our academic writers have a minimum of two years of academic writing. We have a stringent recruitment process to ensure that we get only the most competent essay writers in the industry. We also ensure that the writers are handsomely compensated for their value. The majority of our writers are native English speakers. As such, the fluency of language and grammar is impeccable.
There is a very low likelihood that you won’t like the paper.
Not at all. All papers are written from scratch. There is no way your tutor or instructor will realize that you did not write the paper yourself. In fact, we recommend using our assignment help services for consistent results.
We check all papers for plagiarism before we submit them. We use powerful plagiarism checking software such as SafeAssign, LopesWrite, and Turnitin. We also upload the plagiarism report so that you can review it. We understand that plagiarism is academic suicide. We would not take the risk of submitting plagiarized work and jeopardize your academic journey. Furthermore, we do not sell or use prewritten papers, and each paper is written from scratch.
You determine when you get the paper by setting the deadline when placing the order. All papers are delivered within the deadline. We are well aware that we operate in a time-sensitive industry. As such, we have laid out strategies to ensure that the client receives the paper on time and they never miss the deadline. We understand that papers that are submitted late have some points deducted. We do not want you to miss any points due to late submission. We work on beating deadlines by huge margins in order to ensure that you have ample time to review the paper before you submit it.
We have a privacy and confidentiality policy that guides our work. We NEVER share any customer information with third parties. Noone will ever know that you used our assignment help services. It’s only between you and us. We are bound by our policies to protect the customer’s identity and information. All your information, such as your names, phone number, email, order information, and so on, are protected. We have robust security systems that ensure that your data is protected. Hacking our systems is close to impossible, and it has never happened.
You fill all the paper instructions in the order form. Make sure you include all the helpful materials so that our academic writers can deliver the perfect paper. It will also help to eliminate unnecessary revisions.
Proceed to pay for the paper so that it can be assigned to one of our expert academic writers. The paper subject is matched with the writer’s area of specialization.
You communicate with the writer and know about the progress of the paper. The client can ask the writer for drafts of the paper. The client can upload extra material and include additional instructions from the lecturer. Receive a paper.
The paper is sent to your email and uploaded to your personal account. You also get a plagiarism report attached to your paper.
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more