Cursors give us a choice of how we move through the tuples of the relation. The default, and most common choice is to start at the beginning and fetch the tuples in order, until the end. On the other hand, there are other orders in which tuples may be fetched, and tuples could be scanned many times before the cursor is closed. To take advantage of these options, we need to do two things.

1. When declaring the cursor, put the keyword SCROLL before the keyword CURSOR. This change tells the SQL system that the cursor may be used in a manner other than moving forward in the order of tuples.

2. In a FETCH statement, follow the keyword FETCH by one of various options that tell where to find the desired tuple. These options are:

(a) NEXT or PRIOR to get the next or previous tuple in the order. Remember that these tuples are relative to the current position of the cursor. NEXT is the default if no option is specified, and is the usual choice.

(b) FIRST or LAST to get the first or last tuple in the order.

(c) RELATIVE followed by a positive or negative integer, which indicates how many tuples to move forward (if the integer is positive) or backward (if negative) in the order. For example, RELATIVE 1 is a synonym for NEXT, and RELATIVE -1 is a synonym for PRIOR.

(d) ABSOLUTE followed by a positive or negative integer, which indicates the position of the desired tuple counting from the front (if positive) or back (if negative). For instance, ABSOLUTE 1 is a synonym for FIRST and ABSOLUTE -1 is a synonym for LAST.

Example 1:  Let us rewrite the function of “Modifications by Cursor” Figure 1 to begin at the last tuple and move backward through the list of tuples. First, we need to declare cursor execCursor to be scrollable, which we do by adding the keyword SCROLL in line (6), as:


Also, we need to initialize the fetching of tuples with a FETCH LAST statement, and in the loop we use FETCH PRIOR. The loop that was lines (8) through (14) in “Modifications by Cursor” Figure 1 is rewritten in “Dynamic SQL” Figure 1. The reader should not assume that there is any advantage to reading tuples in the reverse of the order in which they are stored in MovieExec.


sql system
Dynamic SQL
Protecting Against Concurrent Updates
Modifications by Cursor
Triggers in SQL
Schema-Level Constraints and Triggers
Tuple-Based CHECK Constraints
Keys Declared With UNIQUE
Constraints and Triggers
Modifying Views
View Definitions
Introduction to Selection of Indexes
Default Values / Indexes
Simple Table Declarations
Defining a Relation Schema in SQL
Deletion / Updates
Database Modifications
Grouping / HAVING Clauses
Full-Relation Operations
Union, Intersection, and Difference of Queries
Tuple Variables
Disambiguating Attributes
Queries Involving More Than One Relation
Null Values and Comparisons Involving NULL
Projection in SQL
The Database Language SQL
Additional Constraint Examples
Extending the Projection Operator
Extended Operators of Relational Algebra
Selection on Bags / Product of Bags / Joins of Bags
Union, Intersection, and Difference of Bags
Relational Operations on Bags
Dependent and Independent Operations
Selection / Cartesian Product
Set Operations on Relations
An Algebra of Relational Operations
Relational Algebra
Information Integration Via Semistructured Data
Nested Relations
The Object-Relational Model
Representing ODL Relationships
Representing Other Type Constructors
Nonatomic Attributes in Classes
Relationships in ODL / Inverse Relationships
Reasoning About Multivalued Dependencies
Definition of Multivalued Dependencies
Multivalued Dependencies
Boyce-Codd Normal Form
Decomposing Relations
Why the Closure Algorithm Works
Trivial Functional Dependencies
Rules About Functional Dependencies
Keys of Relations
Using Null Values to Combine Relations – Comparison of Approaches
Converting Subclass Structures to Relations
From E/R Diagrams to Relational Designs
Relation Instances
Equivalent Representations of a Relation
Tuples / Domains
Converting Multiway Relationships to Binary
Multiway Relationships
Database System Implementation
Database Design
Multimedia Data
Relational Database Systems

Crazy, high rhythm of life and technological capacity open countless opportunities to create business at home. You can go into a single swimming, do creative work or to provide services to small businesses. Today there is no shortage of opportunities to follow your abilities.

Professional organizer at home

For some people, maintaining cleanliness and order in the house is as natural as walking. For others it is a daily struggle. If you belong to the first group, you have the ability to help the second group. Inspired by multiple TV shows featuring professional organizers, Nettie Owens and her husband realized that their ability to “tame” a mess could create a potentially profitable business. “I read a lot, doing research on the Internet and I still decided to try it,” – she says. Owens set up a booth at a local fair of goods for home and garden in 2004, which gradually grew into a company Sappari Solutions. Their home business now provides a variety of services, including small businesses: the organization of storage space, cleaning, workshops and master classes.

The unusual aquarium

Are you tired of a simple stupid tank with dirty fish inside? It is not easy to find a proper design. Since the aquarium is an integral part of your interior, it is necessary to make sure that it will be in harmony with the overall situation. In this collection we have no simple rectangular glass boxes. These aquariums are creative, innovative and properly-designed. They represent the best decisions in the world of home interior.


If you cannot decide whom to choose as a pet, birds, or a fish, why not choose both? Even better, why not keep them in the same cage / aquarium? This amazing double aquarium was created by Constance Eide and allows your favorite pet to live in close proximity to each other, without mixing them in the habitat. The Aquarium is formed in such a way that allows the bird to climb to the top and go into one visual space with fish. You will be able to adore the sight of your pets in the artificial glamorous surrounding.

Get to know three simple facts about tea consumption.

First, you have a desire to organize a profitable business on the popular product: tea.

Second, tea is a profitable product.

Third, people are starting to think about what they drink, and the “invisible tea” in teabags replaced tea in bulk.

What you need

*Choose a place in a good area, close to a good flow of people, large shopping and office centers

*In residential areas is better to open the tea units, designed for the mass market with the traditional range of products and affordable prices, and for tea boutique with a large assortment of varieties and elite you need the room or in the central business districts.

Tea is one of the impulse purchases. Even if a person did not plan to buy tea, but he liked the showcase or bewitched atmosphere, he would make the purchase. That is why it is necessary to pay special attention to the creation of comfort in the store. As experience shows, almost 60% of buyers prefer to go back to the tea shops they liked. Create homelike atmosphere of coziness.