6

This is more of a theoritical question but I need help ASAP. Here it is:

With the appropriate use of SQL queries, grant as system administrators the required access privileges to a database user named STD01, so he can create a view of a table named CUSTOMER, which belongs to another database user STD00.

Can anyone help me with this?

I know that I have to grant him with the system privilege of CREATE (ANY) VIEW and also give him all the object privileges (SELECT, INSERT, UPDATE & DELETE) on the CUSTOMER table, but I have no idea how can I do that by using SQL...

András Váczi
31.8k13 gold badges103 silver badges152 bronze badges
asked Feb 1, 2012 at 17:34
2
  • 2
    Is this some kind of homework? Commented Feb 1, 2012 at 18:19
  • Its a kind of a possible question for an exam I'm having tomorrow, can you help? Commented Feb 1, 2012 at 18:42

1 Answer 1

10

To grant privilege to create a view:

GRANT CREATE VIEW TO STD01;

To grant the DML privileges:

GRANT SELECT,UPDATE,INSERT,DELETE ON STD00.CUSTOMER TO STD01;

But that's not all of the object privileges. If you did:

GRANT ALL ON STD00.CUSTOMER TO STD01;

you would also give other privileges such as ALTER, INDEX, FLASHBACK, etc.

answered Feb 2, 2012 at 0:01
3
  • If I grant him only the SELECT privilege, would it still work? Commented Feb 2, 2012 at 0:03
  • 2
    If you just grant select and create view then, yes, it will allow you to create a view on the customer table. Commented Feb 2, 2012 at 0:11
  • I've just tested this and worked fine, so thats why Im asking. But I guess I'll better write the whole command tomorrow as you did above. You just never know with professors.. Thanks for the help!:) Commented Feb 2, 2012 at 0:17

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.