SlideShare a Scribd company logo
1 of 3
Download to read offline
SQL – Ch 15 – SQL SECURITY

                                          15. SQL SECURITY
1   What are the security requirements of a database?
    In any multiuser environment, data security is very important Some of the security requirements of an
    organization are:
    1. The data in any given table should be accessible to certain users only.
    2. Only authorized users should be allowed to update data in a particular table; others should only
        be allowed to retrieve data.
    3. For some tables, access should be restricted on a column-by-column basis.
    4. Some users should be denied interactive SQL access to a table but should be allowed to use
        applications programs that update the table.

2   With reference to SQL security, define the following concepts: users, database objects, and privileges.
    Users are a main component in the database. Every time the DBMS retrieves, inserts, deletes, or
    updates data, it does so on behalf of some user. The DBMS permits or prohibits the action
    depending on which user is making the request.

    Database objects are the items to which SQL security protection can be applied. Security is applied
    to tables, views, forms, application programs, and entire databases. Most users will have permission
    to use certain database objects but will be prohibited from using others.

    Privileges are the actions that a user is permitted to carry out for a given database object. A user
    may have permission to SELECT and INSERT rows in a certain table, for example, but may be denied
    permission to DELETE or UPDATE rows of the table. A different user may have a different set of
    privileges.

3   How is the security scheme established for a database?
    The SQL GRANT statement is used to specify which users have which privileges on which database
    objects. For example, the following GRANT statement lets Sam retrieve and insert data in the
    OFFICES table.

    Let Sam retrieve and insert data in the OFFICES table.
    GRANT SELECT, INSERT
    ON OFFICES
    TO SAM

    Here SAM is the user-id, the object is the OFFICES table, and the privileges are SELECT and INSERT.

    Take away the privileges granted earlier to Sam Clark.
    REVOKE SELECT, INSERT
    ON OFFICES
    FROM SAM

    Grant all privileges to SAM
    GRANT ALL PRIVILEGES
    ON SALESREPS
    TO SAM

4   What are the various security objects?
    SQL security protections apply to specific objects contained in a database. These are tables, views,
    domains, stored procedure.

    Privileges:
    The set of actions that a user can carry out against a database object are called the privileges for the
    object. The four basic privileges for tables and views are:

    1. The SELECT privilege allows you to retrieve data from a table or view. With this privilege, you
Prof. Mukesh N. Tekwani [9869 488 356]                                                                Page 1
SQL - Ch 13 – SQL VIEWS

              can specify the table or view in the FROM clause of a SELECT statement or sub-query.

         2. The INSERT privilege allows you to insert new rows into a table or view. With this privilege, you
            can specify the table or view in the INTO clause of an INSERT statement.

         3. The DELETE privilege allows you to delete rows of data from a table or view. With this privilege,
            you can specify the table or view in the FROM clause of a DELETE statement.

         4.   The UPDATE privilege allows you to modify rows of data in a table or view. With this privilege,
              you can specify the table or view as the target table in an UPDATE statement. The UPDATE
              privilege can be restricted to specific columns of the table or view, allowing updates to these
              columns but disallowing updates to any other columns.

5        Views and SQL Security
         Views also play a key role in SQL security. THE DBA can define a view and give a user permission
         to access the view but not its source tables. This way we can restrict the user's access to only
         selected columns and rows.

         For example, suppose we wanted to enforce this security rule in the sample database:
         Accounts receivable personnel should be able to retrieve employee numbers, names, and office
         numbers from the SALESREPS table, but data about sales and quotas should not be available to
         them. We can implement this security rule by defining a view as follows:

         CREATE VIEW REPINFO AS
         SELECT EMPL_NUM, NAME, REP_OFFICE
         FROM SALESREPS

6        Queries on Security:
a)       Sam must be able to retrieve and insert data in the OFFICES table.
         GRANT SELECT, INSERT
         ON OFFICES
         TO SAM

b)       Give all users SELECT access to the OFFICES table.
         GRANT SELECT
         ON OFFICES
         TO PUBLIC

c)       Let order processing users change company names and salesperson assignments.
         GRANT UPDATE (COMPANY, CUST_REP)
         ON CUSTOMERS
         TO OPUSER

d)       The following query shows how a privilege can be passed by one user to another user.
         GRANT SELECT
         ON SALESREPS
         TO JIM

e)       Revoke the SALESREP table insert and update privileges.
         REVOKE INSERT, UPDATE
         ON SALESREPS
         FROM OPUSER

    f)   Take away UPDATE & DELETE privileges for users ARUSER and OPUSER on the OFFICES table.
         REVOKE UPDATE, DELETE
         ON OFFICES
         FROM ARUSER, OPUSER


Page 2                                                                           mukeshtekwani@hotmail.com
SQL – Ch 15 – SQL SECURITY

 g)   Take away all privileges on the OFFICES from to all users.
      REVOKE ALL PRIVILEGES
      ON OFFICES
      FROM PUBLIC

 h)   User SAM wants to grant update and select privileges on the software table to another user GROFF and
      he wants to let him grant these permissions to other users.
      GRANT SELECT, UPDATE
      ON SOFTWARE
      TO GROFF
      WITH GRANT OPTION




Prof. Mukesh N. Tekwani [9869 488 356]                                                            Page 3

More Related Content

What's hot

Native tables in NonStop SQL/MX
Native tables in NonStop SQL/MXNative tables in NonStop SQL/MX
Native tables in NonStop SQL/MXFrans Jongma
 
07 Using Oracle-Supported Package in Application Development
07 Using Oracle-Supported Package in Application Development07 Using Oracle-Supported Package in Application Development
07 Using Oracle-Supported Package in Application Developmentrehaniltifat
 
Database administration commands
Database administration commands Database administration commands
Database administration commands Varsha Ajith
 
MySql 5.7 Backup Script
MySql 5.7 Backup ScriptMySql 5.7 Backup Script
MySql 5.7 Backup ScriptHızlan ERPAK
 
Concepts of NonStop SQL/MX: Part 2 - Introduction to catalogs and other objects
Concepts of NonStop SQL/MX: Part 2 - Introduction to catalogs and other objectsConcepts of NonStop SQL/MX: Part 2 - Introduction to catalogs and other objects
Concepts of NonStop SQL/MX: Part 2 - Introduction to catalogs and other objectsFrans Jongma
 
Concepts of NonStop SQL/MX: Part 4 - Storage.
Concepts of NonStop SQL/MX: Part 4 - Storage.Concepts of NonStop SQL/MX: Part 4 - Storage.
Concepts of NonStop SQL/MX: Part 4 - Storage.Frans Jongma
 
Concepts of NonStop SQL/MX: Part 5 - Stored Procedures
Concepts of NonStop SQL/MX: Part 5 - Stored ProceduresConcepts of NonStop SQL/MX: Part 5 - Stored Procedures
Concepts of NonStop SQL/MX: Part 5 - Stored ProceduresFrans Jongma
 
Concepts of NonStop SQL/MX: Part 3 - Introduction to Metadata
Concepts of NonStop SQL/MX: Part 3 - Introduction to MetadataConcepts of NonStop SQL/MX: Part 3 - Introduction to Metadata
Concepts of NonStop SQL/MX: Part 3 - Introduction to MetadataFrans Jongma
 

What's hot (16)

A Tour To SQL
A Tour To SQLA Tour To SQL
A Tour To SQL
 
SQL2SPARQL
SQL2SPARQLSQL2SPARQL
SQL2SPARQL
 
Native tables in NonStop SQL/MX
Native tables in NonStop SQL/MXNative tables in NonStop SQL/MX
Native tables in NonStop SQL/MX
 
07 Using Oracle-Supported Package in Application Development
07 Using Oracle-Supported Package in Application Development07 Using Oracle-Supported Package in Application Development
07 Using Oracle-Supported Package in Application Development
 
Database administration commands
Database administration commands Database administration commands
Database administration commands
 
MySql 5.7 Backup Script
MySql 5.7 Backup ScriptMySql 5.7 Backup Script
MySql 5.7 Backup Script
 
21
2121
21
 
Oracle11g notes
Oracle11g notesOracle11g notes
Oracle11g notes
 
Power point oracle db 12c
Power point oracle db 12cPower point oracle db 12c
Power point oracle db 12c
 
Concepts of NonStop SQL/MX: Part 2 - Introduction to catalogs and other objects
Concepts of NonStop SQL/MX: Part 2 - Introduction to catalogs and other objectsConcepts of NonStop SQL/MX: Part 2 - Introduction to catalogs and other objects
Concepts of NonStop SQL/MX: Part 2 - Introduction to catalogs and other objects
 
Oracle backup
Oracle backupOracle backup
Oracle backup
 
Concepts of NonStop SQL/MX: Part 4 - Storage.
Concepts of NonStop SQL/MX: Part 4 - Storage.Concepts of NonStop SQL/MX: Part 4 - Storage.
Concepts of NonStop SQL/MX: Part 4 - Storage.
 
IR SQLite Session #3
IR SQLite Session #3IR SQLite Session #3
IR SQLite Session #3
 
Concepts of NonStop SQL/MX: Part 5 - Stored Procedures
Concepts of NonStop SQL/MX: Part 5 - Stored ProceduresConcepts of NonStop SQL/MX: Part 5 - Stored Procedures
Concepts of NonStop SQL/MX: Part 5 - Stored Procedures
 
MFC Whitepaper
MFC WhitepaperMFC Whitepaper
MFC Whitepaper
 
Concepts of NonStop SQL/MX: Part 3 - Introduction to Metadata
Concepts of NonStop SQL/MX: Part 3 - Introduction to MetadataConcepts of NonStop SQL/MX: Part 3 - Introduction to Metadata
Concepts of NonStop SQL/MX: Part 3 - Introduction to Metadata
 

Viewers also liked (7)

Sql ch 1
Sql ch 1Sql ch 1
Sql ch 1
 
C sharp chap5
C sharp chap5C sharp chap5
C sharp chap5
 
Ajax chap 5
Ajax chap 5Ajax chap 5
Ajax chap 5
 
Ajax chap 3
Ajax chap 3Ajax chap 3
Ajax chap 3
 
Perl Chapter 1
Perl Chapter 1Perl Chapter 1
Perl Chapter 1
 
OSI Model
OSI ModelOSI Model
OSI Model
 
C sharp chap6
C sharp chap6C sharp chap6
C sharp chap6
 

Similar to Sql ch 15 - sql security

Security in Relational model
Security in Relational modelSecurity in Relational model
Security in Relational modelSlideshare
 
Database Security Methods, DAC, MAC,View
Database Security Methods, DAC, MAC,ViewDatabase Security Methods, DAC, MAC,View
Database Security Methods, DAC, MAC,ViewDr-Dipali Meher
 
Chapter 6 Database Security and Authorization (4).pdf
Chapter 6 Database Security and Authorization (4).pdfChapter 6 Database Security and Authorization (4).pdf
Chapter 6 Database Security and Authorization (4).pdfabrehamcheru14
 
Database Management System Security.pptx
Database Management System  Security.pptxDatabase Management System  Security.pptx
Database Management System Security.pptxRoshni814224
 
Oracle Data Redaction
Oracle Data RedactionOracle Data Redaction
Oracle Data RedactionAlex Zaballa
 
Access Control Facilities in Oracle Database 11g r2
Access Control Facilities in Oracle Database 11g r2Access Control Facilities in Oracle Database 11g r2
Access Control Facilities in Oracle Database 11g r2Amin Saqi
 
UNIT-1-Security.ppt
UNIT-1-Security.pptUNIT-1-Security.ppt
UNIT-1-Security.pptDharaDarji5
 
Data Redaction - OTN TOUR LA 2015
Data Redaction - OTN TOUR LA 2015 Data Redaction - OTN TOUR LA 2015
Data Redaction - OTN TOUR LA 2015 Alex Zaballa
 
Row-level security and Dynamic Data Masking
Row-level security and Dynamic Data MaskingRow-level security and Dynamic Data Masking
Row-level security and Dynamic Data MaskingSolidQ
 
UNIT 3- DATABASE INTEGRITY AND SECURITY CONCEPTS (1).pdf
UNIT 3- DATABASE INTEGRITY AND SECURITY CONCEPTS (1).pdfUNIT 3- DATABASE INTEGRITY AND SECURITY CONCEPTS (1).pdf
UNIT 3- DATABASE INTEGRITY AND SECURITY CONCEPTS (1).pdfKavitaShinde26
 
DB2UDB_the_Basics Day 3
DB2UDB_the_Basics Day 3DB2UDB_the_Basics Day 3
DB2UDB_the_Basics Day 3Pranav Prakash
 
OTech magazine article - Principle of Least Privilege
OTech magazine article - Principle of Least PrivilegeOTech magazine article - Principle of Least Privilege
OTech magazine article - Principle of Least PrivilegeBiju Thomas
 

Similar to Sql ch 15 - sql security (20)

Security in Relational model
Security in Relational modelSecurity in Relational model
Security in Relational model
 
Database Security Methods, DAC, MAC,View
Database Security Methods, DAC, MAC,ViewDatabase Security Methods, DAC, MAC,View
Database Security Methods, DAC, MAC,View
 
Trigger in DBMS
Trigger in DBMSTrigger in DBMS
Trigger in DBMS
 
Chapter 6 Database Security and Authorization (4).pdf
Chapter 6 Database Security and Authorization (4).pdfChapter 6 Database Security and Authorization (4).pdf
Chapter 6 Database Security and Authorization (4).pdf
 
8034.ppt
8034.ppt8034.ppt
8034.ppt
 
Database Management System Security.pptx
Database Management System  Security.pptxDatabase Management System  Security.pptx
Database Management System Security.pptx
 
Les13
Les13Les13
Les13
 
Oracle Data Redaction
Oracle Data RedactionOracle Data Redaction
Oracle Data Redaction
 
Access Control Facilities in Oracle Database 11g r2
Access Control Facilities in Oracle Database 11g r2Access Control Facilities in Oracle Database 11g r2
Access Control Facilities in Oracle Database 11g r2
 
Les01
Les01Les01
Les01
 
Les14
Les14Les14
Les14
 
UNIT-1-Security.ppt
UNIT-1-Security.pptUNIT-1-Security.ppt
UNIT-1-Security.ppt
 
Data Redaction - OTN TOUR LA 2015
Data Redaction - OTN TOUR LA 2015 Data Redaction - OTN TOUR LA 2015
Data Redaction - OTN TOUR LA 2015
 
Chapter23
Chapter23Chapter23
Chapter23
 
Row-level security and Dynamic Data Masking
Row-level security and Dynamic Data MaskingRow-level security and Dynamic Data Masking
Row-level security and Dynamic Data Masking
 
UNIT 3- DATABASE INTEGRITY AND SECURITY CONCEPTS (1).pdf
UNIT 3- DATABASE INTEGRITY AND SECURITY CONCEPTS (1).pdfUNIT 3- DATABASE INTEGRITY AND SECURITY CONCEPTS (1).pdf
UNIT 3- DATABASE INTEGRITY AND SECURITY CONCEPTS (1).pdf
 
Oracle sql material
Oracle sql materialOracle sql material
Oracle sql material
 
DB2UDB_the_Basics Day 3
DB2UDB_the_Basics Day 3DB2UDB_the_Basics Day 3
DB2UDB_the_Basics Day 3
 
OTech magazine article - Principle of Least Privilege
OTech magazine article - Principle of Least PrivilegeOTech magazine article - Principle of Least Privilege
OTech magazine article - Principle of Least Privilege
 
Database modeling and security
Database modeling and securityDatabase modeling and security
Database modeling and security
 

More from Mukesh Tekwani

Computer Science Made Easy - Youtube Channel
Computer Science Made Easy - Youtube ChannelComputer Science Made Easy - Youtube Channel
Computer Science Made Easy - Youtube ChannelMukesh Tekwani
 
The Elphinstonian 1988-College Building Centenary Number (2).pdf
The Elphinstonian 1988-College Building Centenary Number (2).pdfThe Elphinstonian 1988-College Building Centenary Number (2).pdf
The Elphinstonian 1988-College Building Centenary Number (2).pdfMukesh Tekwani
 
ISCE-Class 12-Question Bank - Electrostatics - Physics
ISCE-Class 12-Question Bank - Electrostatics  -  PhysicsISCE-Class 12-Question Bank - Electrostatics  -  Physics
ISCE-Class 12-Question Bank - Electrostatics - PhysicsMukesh Tekwani
 
Hexadecimal to binary conversion
Hexadecimal to binary conversion Hexadecimal to binary conversion
Hexadecimal to binary conversion Mukesh Tekwani
 
Hexadecimal to decimal conversion
Hexadecimal to decimal conversion Hexadecimal to decimal conversion
Hexadecimal to decimal conversion Mukesh Tekwani
 
Hexadecimal to octal conversion
Hexadecimal to octal conversionHexadecimal to octal conversion
Hexadecimal to octal conversionMukesh Tekwani
 
Gray code to binary conversion
Gray code to binary conversion Gray code to binary conversion
Gray code to binary conversion Mukesh Tekwani
 
Decimal to Binary conversion
Decimal to Binary conversionDecimal to Binary conversion
Decimal to Binary conversionMukesh Tekwani
 
Video Lectures for IGCSE Physics 2020-21
Video Lectures for IGCSE Physics 2020-21Video Lectures for IGCSE Physics 2020-21
Video Lectures for IGCSE Physics 2020-21Mukesh Tekwani
 
Refraction and dispersion of light through a prism
Refraction and dispersion of light through a prismRefraction and dispersion of light through a prism
Refraction and dispersion of light through a prismMukesh Tekwani
 
Refraction of light at a plane surface
Refraction of light at a plane surfaceRefraction of light at a plane surface
Refraction of light at a plane surfaceMukesh Tekwani
 
Atom, origin of spectra Bohr's theory of hydrogen atom
Atom, origin of spectra Bohr's theory of hydrogen atomAtom, origin of spectra Bohr's theory of hydrogen atom
Atom, origin of spectra Bohr's theory of hydrogen atomMukesh Tekwani
 
Refraction of light at spherical surfaces of lenses
Refraction of light at spherical surfaces of lensesRefraction of light at spherical surfaces of lenses
Refraction of light at spherical surfaces of lensesMukesh Tekwani
 
ISCE (XII) - PHYSICS BOARD EXAM FEB 2020 - WEIGHTAGE
ISCE (XII) - PHYSICS BOARD EXAM FEB 2020 - WEIGHTAGEISCE (XII) - PHYSICS BOARD EXAM FEB 2020 - WEIGHTAGE
ISCE (XII) - PHYSICS BOARD EXAM FEB 2020 - WEIGHTAGEMukesh Tekwani
 

More from Mukesh Tekwani (20)

Computer Science Made Easy - Youtube Channel
Computer Science Made Easy - Youtube ChannelComputer Science Made Easy - Youtube Channel
Computer Science Made Easy - Youtube Channel
 
The Elphinstonian 1988-College Building Centenary Number (2).pdf
The Elphinstonian 1988-College Building Centenary Number (2).pdfThe Elphinstonian 1988-College Building Centenary Number (2).pdf
The Elphinstonian 1988-College Building Centenary Number (2).pdf
 
Circular motion
Circular motionCircular motion
Circular motion
 
Gravitation
GravitationGravitation
Gravitation
 
ISCE-Class 12-Question Bank - Electrostatics - Physics
ISCE-Class 12-Question Bank - Electrostatics  -  PhysicsISCE-Class 12-Question Bank - Electrostatics  -  Physics
ISCE-Class 12-Question Bank - Electrostatics - Physics
 
Hexadecimal to binary conversion
Hexadecimal to binary conversion Hexadecimal to binary conversion
Hexadecimal to binary conversion
 
Hexadecimal to decimal conversion
Hexadecimal to decimal conversion Hexadecimal to decimal conversion
Hexadecimal to decimal conversion
 
Hexadecimal to octal conversion
Hexadecimal to octal conversionHexadecimal to octal conversion
Hexadecimal to octal conversion
 
Gray code to binary conversion
Gray code to binary conversion Gray code to binary conversion
Gray code to binary conversion
 
What is Gray Code?
What is Gray Code? What is Gray Code?
What is Gray Code?
 
Decimal to Binary conversion
Decimal to Binary conversionDecimal to Binary conversion
Decimal to Binary conversion
 
Video Lectures for IGCSE Physics 2020-21
Video Lectures for IGCSE Physics 2020-21Video Lectures for IGCSE Physics 2020-21
Video Lectures for IGCSE Physics 2020-21
 
Refraction and dispersion of light through a prism
Refraction and dispersion of light through a prismRefraction and dispersion of light through a prism
Refraction and dispersion of light through a prism
 
Refraction of light at a plane surface
Refraction of light at a plane surfaceRefraction of light at a plane surface
Refraction of light at a plane surface
 
Spherical mirrors
Spherical mirrorsSpherical mirrors
Spherical mirrors
 
Atom, origin of spectra Bohr's theory of hydrogen atom
Atom, origin of spectra Bohr's theory of hydrogen atomAtom, origin of spectra Bohr's theory of hydrogen atom
Atom, origin of spectra Bohr's theory of hydrogen atom
 
Refraction of light at spherical surfaces of lenses
Refraction of light at spherical surfaces of lensesRefraction of light at spherical surfaces of lenses
Refraction of light at spherical surfaces of lenses
 
ISCE (XII) - PHYSICS BOARD EXAM FEB 2020 - WEIGHTAGE
ISCE (XII) - PHYSICS BOARD EXAM FEB 2020 - WEIGHTAGEISCE (XII) - PHYSICS BOARD EXAM FEB 2020 - WEIGHTAGE
ISCE (XII) - PHYSICS BOARD EXAM FEB 2020 - WEIGHTAGE
 
Cyber Laws
Cyber LawsCyber Laws
Cyber Laws
 
XML
XMLXML
XML
 

Recently uploaded

Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 

Recently uploaded (20)

Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 

Sql ch 15 - sql security

  • 1. SQL – Ch 15 – SQL SECURITY 15. SQL SECURITY 1 What are the security requirements of a database? In any multiuser environment, data security is very important Some of the security requirements of an organization are: 1. The data in any given table should be accessible to certain users only. 2. Only authorized users should be allowed to update data in a particular table; others should only be allowed to retrieve data. 3. For some tables, access should be restricted on a column-by-column basis. 4. Some users should be denied interactive SQL access to a table but should be allowed to use applications programs that update the table. 2 With reference to SQL security, define the following concepts: users, database objects, and privileges. Users are a main component in the database. Every time the DBMS retrieves, inserts, deletes, or updates data, it does so on behalf of some user. The DBMS permits or prohibits the action depending on which user is making the request. Database objects are the items to which SQL security protection can be applied. Security is applied to tables, views, forms, application programs, and entire databases. Most users will have permission to use certain database objects but will be prohibited from using others. Privileges are the actions that a user is permitted to carry out for a given database object. A user may have permission to SELECT and INSERT rows in a certain table, for example, but may be denied permission to DELETE or UPDATE rows of the table. A different user may have a different set of privileges. 3 How is the security scheme established for a database? The SQL GRANT statement is used to specify which users have which privileges on which database objects. For example, the following GRANT statement lets Sam retrieve and insert data in the OFFICES table. Let Sam retrieve and insert data in the OFFICES table. GRANT SELECT, INSERT ON OFFICES TO SAM Here SAM is the user-id, the object is the OFFICES table, and the privileges are SELECT and INSERT. Take away the privileges granted earlier to Sam Clark. REVOKE SELECT, INSERT ON OFFICES FROM SAM Grant all privileges to SAM GRANT ALL PRIVILEGES ON SALESREPS TO SAM 4 What are the various security objects? SQL security protections apply to specific objects contained in a database. These are tables, views, domains, stored procedure. Privileges: The set of actions that a user can carry out against a database object are called the privileges for the object. The four basic privileges for tables and views are: 1. The SELECT privilege allows you to retrieve data from a table or view. With this privilege, you Prof. Mukesh N. Tekwani [9869 488 356] Page 1
  • 2. SQL - Ch 13 – SQL VIEWS can specify the table or view in the FROM clause of a SELECT statement or sub-query. 2. The INSERT privilege allows you to insert new rows into a table or view. With this privilege, you can specify the table or view in the INTO clause of an INSERT statement. 3. The DELETE privilege allows you to delete rows of data from a table or view. With this privilege, you can specify the table or view in the FROM clause of a DELETE statement. 4. The UPDATE privilege allows you to modify rows of data in a table or view. With this privilege, you can specify the table or view as the target table in an UPDATE statement. The UPDATE privilege can be restricted to specific columns of the table or view, allowing updates to these columns but disallowing updates to any other columns. 5 Views and SQL Security Views also play a key role in SQL security. THE DBA can define a view and give a user permission to access the view but not its source tables. This way we can restrict the user's access to only selected columns and rows. For example, suppose we wanted to enforce this security rule in the sample database: Accounts receivable personnel should be able to retrieve employee numbers, names, and office numbers from the SALESREPS table, but data about sales and quotas should not be available to them. We can implement this security rule by defining a view as follows: CREATE VIEW REPINFO AS SELECT EMPL_NUM, NAME, REP_OFFICE FROM SALESREPS 6 Queries on Security: a) Sam must be able to retrieve and insert data in the OFFICES table. GRANT SELECT, INSERT ON OFFICES TO SAM b) Give all users SELECT access to the OFFICES table. GRANT SELECT ON OFFICES TO PUBLIC c) Let order processing users change company names and salesperson assignments. GRANT UPDATE (COMPANY, CUST_REP) ON CUSTOMERS TO OPUSER d) The following query shows how a privilege can be passed by one user to another user. GRANT SELECT ON SALESREPS TO JIM e) Revoke the SALESREP table insert and update privileges. REVOKE INSERT, UPDATE ON SALESREPS FROM OPUSER f) Take away UPDATE & DELETE privileges for users ARUSER and OPUSER on the OFFICES table. REVOKE UPDATE, DELETE ON OFFICES FROM ARUSER, OPUSER Page 2 mukeshtekwani@hotmail.com
  • 3. SQL – Ch 15 – SQL SECURITY g) Take away all privileges on the OFFICES from to all users. REVOKE ALL PRIVILEGES ON OFFICES FROM PUBLIC h) User SAM wants to grant update and select privileges on the software table to another user GROFF and he wants to let him grant these permissions to other users. GRANT SELECT, UPDATE ON SOFTWARE TO GROFF WITH GRANT OPTION Prof. Mukesh N. Tekwani [9869 488 356] Page 3