SOLUTIONS
Crystal Indigo!
Crystal Indigo!
Providing all solutions you need anytime
+27 76 626 8187
with all the code needed
, Question 1
1.1 Create a sequence for populating the Custeomer# column of the
CUSTOMERS table. When setting the start and the increment values, beer in
mind that data already exist in the table. Hence, you need to know the last
customer number stored in the database. The options should be set not to
cycle the values and not to cache any values. No minimum or maximum
values should be declared. (2 marks)
create sequence customers_customer#_seq
increment by 1
start with 10
nocache
nominvalue
nomaxvalue
nocycle;
1.2 Add a new customer row by using the sequence created in Question
1.1. the only data currently available for the customer is as follows: last name
= Shoulders, first_name = Frank, and zip = 23567. (3 marks)
INSERT INTO customers (customer#, lastname, firstname, zip) VALUES
(cust_seq.NEXTVAL, 'SHOULDERS', 'FRANK', '23567');
Question 2
2.1 create the user John with a password that expire with the role of
sales_person (3 marks)
CREATE USER John
IDENTIFIED BY CRYSTAL27
PASSWORD EXPIRE;
GRANT salesperson TO John;
2.2 As a salesperson, John has full responsibility for the CUSTOMERS
table of the JUSTLee Books and need to have object privileges to perform
any activity on the customers table. John needs to have the right to grand the
privileges to other users. (2 marks)
GRANT All
ON customers