Page 23 - Open Soource Technologies 304.indd
P. 23
Open Source Technologies Sarabjit Kumar, Lovely Professional University
Notes Unit 2: Working with My SQL
CONTENTS
Objectives
Introduction
2.1 Privilege System in SQL
2.2 Working with User Privileges
2.2.1 Adding Users Through My SQL
2.2.2 Removing Privileges of My SQL
2.3 Summary
2.4 Keywords
2.5 Self Assessment Questions
2.6 Review Questions
2.7 Further Reading
Objectives
After studying this unit, you will be able to:
• Explain SQL privilege.
• Discuss working with user privileges.
Introduction
Table privileges are effective for a certain table. SQL also supports privileges for an entire
database, such as the privilege to create tables or views in a certain database.
Granting privileges on the database level is not supported by all SQL products. SQL supports
the following database privileges:
• SELECT. This privilege gives the user the right to access all tables of the specified database
with the SELECT statement.
• INSERT. This privilege gives the user the right to add rows to all tables of the specified
database with the INSERT statement.
• DELETE. This privilege gives the user the right to remove rows from all tables of the
specified database with the DELETE statement.
• UPDATE. This privilege gives the user the right to update values in all tables of the
specified database with the UPDATE statement.
• REFERENCES. This privilege gives the user the right to create foreign keys that point to
tables of the specified database.
18 LOVELY PROFESSIONAL UNIVERSITY