Example of sequences, Database Management System

Example: Create a sequence named SEQSS that starts at 105, has a step of 1 and can take maximum value as 2000.

 CREATE SEQUENCE SEQSS START WITH 105

INCREMENT BY 1

MAX VALUE 2000;

How the sequence so formed is used? The following sequence of commands try to illustrate the use of the sequence SEQSS.

Suppose a table person exists as: SELECT * FROM PERSON;

Output:             CODE      NAME         ADDRESS

------                      -------    --------         ---------------

                               104       RAMESH    MUMBAI

Now, if we give the command:

INSERT INTO PERSON

VALUES (SEQSS.NEXTVAL, &NAME, &ADDRESS) 

On implementation of statement above do the following input:

Enter value for name: 'Rakhi'

Enter value for address: 'New Delhi'

Now, here is the following command to see the output:

SELECT * FROM PERSON;

CODE        NAME           ADDRESS

--------- --------------- -----------------

104        RAMESH         MUMBAI

105        Rakhi             NEW DELHI

 

The explanations of sequences such as minimum value, maximum value, increment or step are stored in the data dictionary.  For instance, in oracle it is stored in the table user_sequences. You can see the explanation of sequences by giving the SELECT command.

Posted Date: 3/11/2013 1:29:07 AM | Location : United States







Related Discussions:- Example of sequences, Assignment Help, Ask Question on Example of sequences, Get Answer, Expert's Help, Example of sequences Discussions

Write discussion on Example of sequences
Your posts are moderated
Related Questions
Explain the Concept of Two-phase Locking It concerns the positions of locking and unlocking operations in each transaction.  In this protocol every transaction issue lock and u

Consider the following relational scheme: R (a,b,c,d,e,f) and its corresponding set of FDs {d→ a, be → c, ac → e, b → f, f → d, a → c}. a. Is the following decomposition i) non

Explain the term - Handling Boundary Condition These are some circumstances that to be handled in any system initialization and termination. Describes how system is bro

Table_Name( attribute_1, attribute_2, attribute_3, ….. ,attribute_x) Primary Key ( attribute_1, attribute_2) Foreign Key attribute_4 References Table_Name_2 (repeat for each fore

What are the requirements to ensure the objectives of file management principle is realized?

A practice called Perfect Pets provides private health care for domestic pets throughout America. This service is provided through various clinics located in the main cities of Ame

Describe disk manager and their work? Disk Manager: Responsible for fetching data regulated through file Manager from disk storage within Main memory and deciding what data to

1. Identify the comparisons and exchanges made to sort the following array using the selection exchange sort technique. Note: you may not need all columns. Ori

The figure below depicts the conceptual diagram of a banking system. (a) Describe one example relevant to the system in figure, for each of the 4 types of enterprise appl

In a job interview with a branch manager of a bank that operates in multiple Canadian provinces and the Yukon, you learn that all of the information is captured in real time in a s