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

Explain the functional mode with help of an example, Explain the Functional...

Explain the Functional Mode with help of an example. Functional Model  The functional model shows a computation and functional derivation of data values in it without ind

Please answer me., gyan gurukul is a software company that provides softwar...

gyan gurukul is a software company that provides software related solution.

Describe graphical user interface, Describe Graphical User Interface? ...

Describe Graphical User Interface? Graphical User Interfaces (GUIs) - A GUI typically displays a schema to the user in diagrammatic form. The user can then specify a query th

Database application development, The database application project (DAP) fo...

The database application project (DAP) for this assignment consists of the creation of a fully functional Microsoft Access database application for a real client. I recommend you s

Gui interfaces, Draw the database using the ER approach and then make the t...

Draw the database using the ER approach and then make the tables accordingly. Populate the tables so that every table have at least 10 tuples. Then using Java and SQL, execute the

For known, What are the function of DBA?

What are the function of DBA?

What is null, What is NULL? Simply NULL means not in value.

What is NULL? Simply NULL means not in value.

Explain optimistic locking and pessimistic locking, Explain the difference ...

Explain the difference between optimistic locking and pessimistic locking. Optimistic locking supposes no transaction conflict will occur and deals with the consequences if it

Prove that a relation which is 4nf must be bcnf, Prove that a relation whic...

Prove that a relation which is 4NF must be BCNF.   Ans Let R be in 4NF.  Suppose it is not in BCNF.  Hence, there exists an FD X→Y in R such that x is not a super key. Although

Describe identifying relationship, Describe identifying relationship? ...

Describe identifying relationship? Identifying relationship: It is relationship among strong entity and a weak entity it is represented through a doubly outlined diamond in C

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