Write a script that creates a user-defined database role named OrderEntry in the MyGuitarShop database. Give INSERT and UPDATE permission to the new role for the Orders and OrderItems table. Give SELECT permission for all user tables. Write a script that (1) creates a login ID named "BillyHalliday" with the password "HelloBilly"; (2) sets the default database for the login to the MyGuitarShop database; (3) creates a user named "BHalliday" for the login; and (4) assigns the user to the OrderEntry role you created in exercise 1.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

USE MICROSOFT SQL SERVER

22
Murach's SQL Server 2016 for Developers: My Guitar Shop exercises (modified)
Chapter 17
How to manage database security
Exercises
1 Write a script that creates a user-defined database role named OrderEntry in the
MyGuitarShop database. Give INSERT and UPDATE permission to the new role for
the Orders and OrderItems table. Give SELECT permission for all user tables.
2 Write a script that (1) creates a login ID named "BillyHalliday" with the password
"HelloBilly"; (2) sets the default database for the login to the MyGuitarShop
database; (3) creates a user named "BHalliday" for the login; and (4) assigns the user
to the OrderEntry role you created in exercise 1.
3 Write a script that uses dynamic SQL and a cursor to loop through each row of the
Administrators table and (1) create a login ID for each row that consists of the
administrator's last and first name with no space between; (2) set a temporary
password of "dump" for each login; (3) set the default database for the login to the
MyGuitarShop database; (4) create a user for the login with the same name as the
login; and (4) assign the user to the OrderEntry role you created in exercise 1.
4 Using the Management Studio, create a login ID named "ASmithfield" with the
password "ASmi9999," and set the default database to the MyGuitarShop database.
Then, grant the login ID access to the MyGuitarShop database, create a user for the
login ID named "RBrautigan", and assign the user to the OrderEntry role you created
in exercise 1.
Note: If you get an error that says "The MUST CHANGE option is not supported",
you can deselect the "Enforce password policy" option for the login ID.
Save a screen print of the user list after adding this user. Name it ex17-04a.png.
(Any image format will be fine)
5
Write a script that removes the user-defined database role named OrderEntry. (Hint:
This script should begin by removing all users from this role.)
6
Write a script that (1) creates a schema named Admin, (2) transfers the table named
Addresses from the dbo schema to the Admin schema, (3) assigns the Admin schema
as the default schema for the user named RobertHalliday that you created in exercise
2, and (4) grants all standard privileges except for REFERENCES and ALTER to
Robert Halliday for the Admin schema.
Transcribed Image Text:22 Murach's SQL Server 2016 for Developers: My Guitar Shop exercises (modified) Chapter 17 How to manage database security Exercises 1 Write a script that creates a user-defined database role named OrderEntry in the MyGuitarShop database. Give INSERT and UPDATE permission to the new role for the Orders and OrderItems table. Give SELECT permission for all user tables. 2 Write a script that (1) creates a login ID named "BillyHalliday" with the password "HelloBilly"; (2) sets the default database for the login to the MyGuitarShop database; (3) creates a user named "BHalliday" for the login; and (4) assigns the user to the OrderEntry role you created in exercise 1. 3 Write a script that uses dynamic SQL and a cursor to loop through each row of the Administrators table and (1) create a login ID for each row that consists of the administrator's last and first name with no space between; (2) set a temporary password of "dump" for each login; (3) set the default database for the login to the MyGuitarShop database; (4) create a user for the login with the same name as the login; and (4) assign the user to the OrderEntry role you created in exercise 1. 4 Using the Management Studio, create a login ID named "ASmithfield" with the password "ASmi9999," and set the default database to the MyGuitarShop database. Then, grant the login ID access to the MyGuitarShop database, create a user for the login ID named "RBrautigan", and assign the user to the OrderEntry role you created in exercise 1. Note: If you get an error that says "The MUST CHANGE option is not supported", you can deselect the "Enforce password policy" option for the login ID. Save a screen print of the user list after adding this user. Name it ex17-04a.png. (Any image format will be fine) 5 Write a script that removes the user-defined database role named OrderEntry. (Hint: This script should begin by removing all users from this role.) 6 Write a script that (1) creates a schema named Admin, (2) transfers the table named Addresses from the dbo schema to the Admin schema, (3) assigns the Admin schema as the default schema for the user named RobertHalliday that you created in exercise 2, and (4) grants all standard privileges except for REFERENCES and ALTER to Robert Halliday for the Admin schema.
Administrators
Admin D
EmailAddress
Password
FirstName
LastName
Orderitems
Item D
Order D
7
Products
ProductID
CategoryID
Product Code
ProductName
Description
ListPrice
ProductID
ItemPrice
Categories
CategoryID
DiscountAmount
Quantity
DiscountPercent
Date Added
CategoryName
Q
Addresses
AddressID
CustomerlD
Linel
Line2
City
State
ZipCode
Phone
Disabled
Orders
8
OrderID
CustomerlD
OrderDate
ShipAmount
TaxAmount
ShipDate
ShipAddressID
Card Type
CardNumber
CardExpires
BillingAddressID
Customers
Customer D
EmailAddress
Password
FirstName
LastName
ShippingAddressID
BillingAddress D
Transcribed Image Text:Administrators Admin D EmailAddress Password FirstName LastName Orderitems Item D Order D 7 Products ProductID CategoryID Product Code ProductName Description ListPrice ProductID ItemPrice Categories CategoryID DiscountAmount Quantity DiscountPercent Date Added CategoryName Q Addresses AddressID CustomerlD Linel Line2 City State ZipCode Phone Disabled Orders 8 OrderID CustomerlD OrderDate ShipAmount TaxAmount ShipDate ShipAddressID Card Type CardNumber CardExpires BillingAddressID Customers Customer D EmailAddress Password FirstName LastName ShippingAddressID BillingAddress D
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Query Syntax
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education