Deletion / Updates

A deletion statement consists of: 1. The keywords DELETE FROM, 2. The name of a relation, say R, 3. The keyword WHERE, and 4. A condition. That is, the form of a deletion is DELETE FROM R WHERE ; The effect of executing this statement is that every tuple satisfying the condition (4) will be deleted from relation R.

Simple Table Declarations

The simplest form of declaration of a relation schema comprises the keywords CREATE TABLE followed by the name of the relation and a parenthesized list of the attribute names and their types.

Default Values / Indexes

When we create or change tuples, we sometimes do not have values for all components. For instance, we mentioned in "Simple Table Declarations" Example 2 that when we add a column to a relation schema, the existing tuples do not have a known value, and it was

Introduction to Selection of Indexes

Selection of indexes requires a trade-off by the database designer, and in fact, this choice is one of the principal factors that influence whether a database design is acceptable. Two important factors to examine are:

View Definitions

Relations that are defined with a CREATE TABLE statement in fact exist in the database. That is an SQL system stores tables in some physical organization. They are persistent, in the sense that they can be expected to exist indefinitely and not to change unless they are clearly told to

Modifying Views

In limited conditions it is possible to carry out an insertion, deletion, or update to a view. In the beginning, this idea makes no sense at all, since the view does not exist the way a base table (stored relation) does. What could it mean, say, to insert a new tuple into a view? Where

Constraints and Triggers

In this section we shall study those aspects of SQL that let us create "active" elements. An active element is an expression or statement that we write once, store in the database, and expect the element to execute at appropriate times. The time of action might be when a certain

Keys Declared With UNIQUE

One more way to declare a key is to use the keyword UNIQUE. This word can appear exactly where PRIMARY KEY can appear: either following an attribute and its type or as a separate item within a CREATE TABLE statement. The meaning of a UNIQUE declaration is nearly the

Tuple-Based CHECK Constraints

To declare a constraint on the tuples of a single table R, when we define that table with a CREATE TABLE statement we may add to the list of attributes and key or foreign-key declarations the keyword CHECK followed by a parenthesized condition. This condition can be anything that

Schema-Level Constraints and Triggers

The most powerful forms of active elements in SQL are not associated with specific tuples or components of tuples. These elements, called "triggers" and "assertions," are part of the database schema, on a par with the relations and views themselves.

Page 6 of 7 Previous 1 2 3 4 5 6 7 Next