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

Urgent need tutoring in conjunction with help on assignment!, Hi is anyone ...

Hi is anyone well versed in accounting information systems available now to help me work through an important assignment due tomorrow at noon?

ER-diagram, The State of NewYork certifies firefighters throughout state an...

The State of NewYork certifies firefighters throughout state and keep track all of them, as well as of the state’s fire departments. Each fire department has unique department numb

Mapping, How external/conceptual mapping and conceptual /internal mapping i...

How external/conceptual mapping and conceptual /internal mapping is performed

Explain about database system structure, Explain about database system stru...

Explain about database system structure? Storage manager Authorization and integrity manager Transaction manager File manager Buffer manager Storage manager

What is called query processing, What is called query processing? Query...

What is called query processing? Query processing refers to the range of activities included in extracting data from a database.

Guidelines for creation of table, Guidelines for creation of table: ...

Guidelines for creation of table: Table name should begin with an alphabet. In table name, single quotes and blank spaces are not allowed. Reserve words of that DBM

Determine the strong and weak entity, Determine the Strong and Weak Entity ...

Determine the Strong and Weak Entity Based on the method of foreign key, there might be arise a situation when we have to relate an entity having a primary key of its own and a

DBMS, give some example real life situation where DBMS are most suitable

give some example real life situation where DBMS are most suitable

Sorting field groups we cannot use more than one key field, While sorting f...

While sorting field groups we cannot use more than one key field False.

The natural join is equal to which product, The natural join is equal to wh...

The natural join is equal to which product? The natural join is equal to Combination of projection and Cartesian product

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