SQL Data Definition: Understanding Data Types, Views, Transactions, and Access Control, Slides of Database Management Systems (DBMS)

An overview of sql data definition, including data types supported by sql, integrity enhancement features, creating and using views, transactions, and access control. Topics covered include sql data types (boolean, character, bit, exact numeric, approximate numeric, date/time, interval, character/binary large object), required data, domain constraints, entity integrity, referential integrity, and enterprise constraints. The document also explains what a view is, how to create or delete a view, advantages and disadvantages of views, transactions, and access control using sql.

Typology: Slides

2012/2013

Uploaded on 05/06/2013

anuragini
anuragini 🇮🇳

4.4

(14)

134 documents

1 / 17

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Chapter 6
SQL: Data Definition
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download SQL Data Definition: Understanding Data Types, Views, Transactions, and Access Control and more Slides Database Management Systems (DBMS) in PDF only on Docsity!

Chapter 6

SQL: Data Definition

Overview

  • Data types supported by SQL.
  • Integrity enhancement feature of SQL.
  • Purpose and how to create views.
  • Advantage and disadvantage of views.
  • Transactions.
  • Access Control.

Integrity Enhancement Feature

  • Required data
  • Domain constraints
  • Entity integrity
  • Referential integrity
  • Enterprise constraints

Required data

  • Some columns contain a valid value must specified NOT NULL.
  • Example:

position VARCHAR(10) NOT NULL

Entity integrity

  • The primary key of a table must contain a unique, non-null value.

Referential integrity

  • A foreign key in each row of the child table links to the matching candidate key in the parent table.

Data Definition

  • SQL allows database objects such as schemas, domains, tables, views, and indexes to be created and destroyed.

Example: CREATE SCHEMA SqlTests AUTHORIZEATION Smith;

DROP SCHEMA SqlTests;

What is View?

  • View is a virtual table that does not necessarily exist in the database but can produced upon request by a user.

What are the advantages of view?

  • Data independence
  • Currency
  • Improve security
  • Reduced complexity
  • Convenience
  • Customization
  • Data integrity

What are the disadvantages of view?

  • Update restriction
  • Structure restriction
  • Performance

Access Control

  • SQL provides the GRANT and REVOKE statements to ensure the security on the database.
  • Example:

GRANT SELECT, UPDATE (salary) ON Staff TO Personnel, Director;

Access Control (cont.)

  • Example:

REVOKE ALL PRIVILEGES ON Staff FROM Director;