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

Maping constraits, #question.what is mapping constraints and types?.

#question.what is mapping constraints and types?.

How can redundant associations be done, How can Redundant Associations be d...

How can Redundant Associations be done It can be done by asking questions: i)  Is there a specific arrangement of network which would optimize critical aspects of completed

What are the three types of data sources, What are the three types of data ...

What are the three types of data sources used with ODBC? An ODBC file data source is a file that can be shared between database users. An ODBC system data source is one that is

Benefits of using a relational database management system, Question 1: ...

Question 1: a) What is the difference between a non-impact and impact printer? b) Which type of printer is generally used in a supermarket to print your receipt? Describe

Write short notes on schema diagram, Write short notes on Schema diagram.  ...

Write short notes on Schema diagram.  A database schema along with primary key and foreign key dependencies can be depicted pictorially by schema  diagram. Every relation appea

Advantages of data distribution, Advantages of Data Distribution The pr...

Advantages of Data Distribution The primary benefit of distributed database systems is the ability to access and share data in a reliable and efficient manner.

#, How to use Oracle

How to use Oracle

What is a database, What is a Database? To know what database is, we ha...

What is a Database? To know what database is, we have to start from data, which is the basic building block of any DBMS. Data: Facts, figures, statistics etc. having no pa

What are the two methods for dealing deadlock problem, What are the two met...

What are the two methods for dealing deadlock problem? The two procedures for dealing deadlock problem is deadlock detection and deadlock recovery.

Foreign keys , Foreign Keys and NULL Let us take the relation:         ...

Foreign Keys and NULL Let us take the relation:                 DEPT DEPT ID DNAME BUDGET D1 M

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