Grant the user Kwame the privilege to display (i.e. SELECT) all data for any boo
ID: 3819603 • Letter: G
Question
Grant the user Kwame the privilege to display (i.e. SELECT) all data for any book in the BOOK table and the privilege to UPDATE the BK_LIST_PRICE only for any book In the BOOK table. Grant the user Kwame the privilege to display (i.e. SELECT) all data for any book In the BOOK table where the PBID = 217; and the privilege to UPDATE the BK_LIST_PRICE only for any book in the BOOK table where the PBID = 217. Create a view Author_2K13 that includes the Name and Date-of-Birth only for each Author born after January 1, 2013. Create a view PUBLISHER_Z2328A_S that includes the PBID, PB_NAME, PB_STREET, PB_ZIPCODE & PB_PHONE for each Publisher whose PB_ZIPCODE is 23284 or 23285. Create a view PUBUSHER_BK_Z2328A_S that includes the BKID, BK_TITLE, BK_LIST_PRICE, PB_ID, PB_NAME for those Books whose List Price is less than $250.00 and the corresponding PB_ZIPCODE is 23284 or 23285. Write a SQL query against the view Author_2K13 that includes the Name and Date-of-Birth only for each Author born after June 30, 2014. Grant the user Abena the privilege to display (i.e. SELECT) the PBID, PB_NAME, PB_STREET, PB_ZIPCODE & PB_PHONE for each Publisher whose PB_ZIPCODE is 23284 or 23285 only. Also grant her the privileges to INSERT and DELETE records for each Publisher whose PB_ZIPCODE is 23284 or 23285 only. Write a SQL query that will list the BK_TITLE, BK_LIST_PRICE, PB_NAME for those Books whose BK_LIST_PRICE is less than $250.00 and the corresponding PB_ZIPCODE is 23284 or 23285. Grant the user Abena the privilege to display (i.e. SELECT) the BK_TITLE, BK_LIST_PRICE, PB_NAME for those Books whose BK_LIST_PRICE e is less than $250.00 and corresponding PB_ZIPCODE is 23284 or 23285.Explanation / Answer
1.
GRANT SELECT (BKID,BK_TITLE,BK_LIST_PRICE,PBID),
UPDATE (BK_LIST_PRICE)
ON BOOK
TO Kwame;
2.
create view BOOK_V as
select BKID,BK_TITLE,BK_LIST_PRICE,PBID
from BOOK
where PBID = 217;
GRANT SELECT (BKID,BK_TITLE,BK_LIST_PRICE,PBID),
UPDATE (BK_LIST_PRICE)
ON BOOK_V
TO Kwame;
3.
create view Author_2K13 as
select AU_NAME,AU_DOB
from AUTHOR
where AU_DOB > '01/01/2013';
4.
create view PUBLISHER_Z23284_5 as
select PBID,PB_NAME,PB_STREET,PB_ZIPCODE,PB_PHONE
from PUBLISHER
where PB_ZIPCODE in (23284,23285);
5.
create view PUBLISHER_BK_Z23284_5 as
select b.BKID,b.BK_TITLE,b.BK_LIST_PRICE,b.PBID,p.PB_NAME
from BOOK b
JOIN PUBLISHER p
on b.PBID=p.PBID
where b.BK_LIST_PRICE < 250.00
and p.PB_ZIPCODE in (23284,23285);
6.
select AU_NAME,AU_DOB
from Author_2K13
where AU_DOB > '30/06/2014'
7.
create view PUBLISHER_V as
select PBID,PB_NAME,PB_STREET,PB_ZIPCODE,PB_PHONE
from PUBLISHER
where PB_ZIPCODE in (23284,23285);
GRANT SELECT (PBID,PB_NAME,PB_STREET,PB_ZIPCODE,PB_PHONE),
INSERT (PBID,PB_NAME,PB_STREET,PB_ZIPCODE,PB_PHONE),
DELETE (PBID,PB_NAME,PB_STREET,PB_ZIPCODE,PB_PHONE)
ON PUBLISHER_V
TO Abena;
8.
select b.BK_TITLE,b.BK_LIST_PRICE,p.PB_NAME
from BOOK b
JOIN PUBLISHER p
on b.PBID=p.PBID
where b.BK_LIST_PRICE < 250.00
and p.PB_ZIPCODE in (23284,23285);
create view PUBLISHER_VV as
select b.BK_TITLE,b.BK_LIST_PRICE,p.PB_NAME
from BOOK b
JOIN PUBLISHER p
on b.PBID=p.PBID
where b.BK_LIST_PRICE < 250.00
and p.PB_ZIPCODE in (23284,23285);
GRANT SELECT (BK_TITLE,BK_LIST_PRICE,PB_NAME)
ON PUBLISHER_VV
TO Abena;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.