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

Which are two ways that entities participate relationship, Which are the tw...

Which are the two ways in which entities can participate in a relationship? Total and partial are the two ways in which entities can participate in a relationship

Icloud based storage, Advantages and disadvantages of icloud based storage

Advantages and disadvantages of icloud based storage

Define raid structure, Define raid? Briefly explain it? A range of disk...

Define raid? Briefly explain it? A range of disk organization methods, collectively called redundant arrays of independent disks (RAID) o   Improvement of reliability throug

Domain constraints, Domain Constraints Domain constraints are primarily...

Domain Constraints Domain constraints are primarily formed for defining the logically correct values for an attribute of a relation. The relation allows attributes of a relatio

Mention the several levels in security measures, Mention the several levels...

Mention the several levels in security measures. A) Database system B) Operating system C) Network D) Physical Human

Order by clause-data manipulation language, Order by clause By usin...

Order by clause By using this rows can be sorted It is used in the last portion of select statement By default it gets ascending order DESC: is used

Create an er diagram completely with attributes, A database is to be constr...

A database is to be constructed to remain track of the teams and games of a sport league. A team has a number of players, not all of whom participate in every game. It is desired

By which techniquestransaction processing is associated, By which technique...

By which techniquesTransaction processing is associated? Transaction processing is associated by producing detail, summary, or exception reports and recording a business activi

Explain differance between primary and secondary storage, Explain differanc...

Explain differance between Primary and secondary storage ? Primary and secondary storage Computer storage is classified within primary(main) memory and secondary(per

Data flow diagram of structured analysis and design, From SAD to OOAD (Stru...

From SAD to OOAD (Structured Analysis and Design (SAD) to Object Oriented Analysis and Design (OOAD). We will find here how we can map various models in SAD to different model

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