Example of sequences, Database Management System

Assignment Help:

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.


Related Discussions:- Example of sequences

BOGUS VS GENUINE EMPOWERMENT, what is bogus empowerment. And what is genuin...

what is bogus empowerment. And what is genuine empowerment

Explain the concept of qbe, Explain the concept of QBE? Query-by-exampl...

Explain the concept of QBE? Query-by-example represents a visual/graphical approach for accessing information in a database by the use of query templates called as skeleton tab

What is a project operation, What is a PROJECT operation? The project o...

What is a PROJECT operation? The project operation is a unary operation that returns its argument relation with particular attributes left out. Projection is shown by pie (π).

What is data defination language, What is DDL? Make a list of commands with...

What is DDL? Make a list of commands with short description used in DDL Ans: Data Definition Language that is abbreviated as DDL is a computer language for defining data struct

Describe logical data independence, Describe logical data independence ? ...

Describe logical data independence ? Logical Data Independence - It is the capacity to modify the conceptual schema without having to change external schemas or application p

Database backup, Discuss the importance and characteristics of database bac...

Discuss the importance and characteristics of database backup and recovery procedures, then describe the actions that must be detailed in backup and recovery plan

Primary interface between a visual basic application, Question (a) Visu...

Question (a) Visual Basic is governed by an event processor. Explain the meaning of this phrase. (b) Differentiate between an general procedure and event procedure. (c)

Define null values, Define null values. In some cases a certain entity ...

Define null values. In some cases a certain entity may not have an applicable value for an attribute or if we do not know the value of an attribute for a certain entity. In the

Union - basic set operation, UNION If R1 and R2 are two union compatibl...

UNION If R1 and R2 are two union compatible relations then R3 = R1 ∪ R2 is the relation having tuples that are either in R1 or in R2 or in both. In case, R3 will have tuples

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd