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:28:57 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
What are called journaling file systems? File systems that support log disks are known as journaling file systems.

You are managing the following database system: • DBMS: Oracle 11g • OS: Sun Solaris • System architecture: Web-based application using ASP.Net • Purpose of Server: HR managem

Sequential File Organisation The most necessary way to organise the collection of records in a file is to use sequential Organisation. Records of the file are stored in series

What is document scanning and imaging? Document scanning and imaging, or digital archiving, is the method of scanning a document into a digital image to archive and retrieve a

What is a state chart diagram? State diagrams (State Chart Diagram) explain all possible states that a particular object can get into, and how object's state changes as result

Question: (a) What do you meant by content management and briefly describe four major components of a Content Management System? (b) Explain key benefits of a Content Manage

A basic model of Database Access Control Models of database access control have grown out of previous work on protection in operating systems. Let us talk about one simple mode



Explain the Static or conservative Two Phase Locking: Static (or conservative) Two Phase Locking: In this type of scheme, all the data items are locked earlier than any opera