State the use of sequence.

1 Answer

Answer :

A sequence refers to a database object that is capable of generating unique and sequential integer values.

Syntax:

Create sequence<seq_name> [increment by num][start with num]

[maxvaluenum] [minvaluenum][cycle/no cycle][cache/no cache]

OR

* Sequence is a set of integers 1, 2, 3 … that are generated and supported by some database systems to produce unique values on demand.

* A sequence is a user defined schema bound object that generates a sequence of numeric values.

* Sequences are frequently used in many databases because many applications require each row in a table to contain a unique value and sequences provides an easy way to generate them.

* The sequence of numeric values is generated in an ascending or descending order at defined intervals and can be configured to restart when max_value exceeds.

OR

Sequence:

* It is database object that generate/produce integer values in sequential order.

* It automatically generates primary key and unique key values.

* It may be ascending or descending order

* It can be used for multiple tables.

* Sequence numbers are stored and generated independently of tables

Related questions

Description : State the use of ‘Like’ Operator.

Last Answer : The LIKE operator is used in a WHERE clause to search for a specified pattern in a column. There are two operator often used in conjunction with the LIKE operator:  %:The percent sign represents zero, one, or multiple characters  _: The underscore represents a single character.

Description : State the properties of Transaction

Last Answer : The ACID properties of transaction. 1. Atomicity. 2. Consistency. 3. Isolation.  4. Durability

Description : Describe the use of primary key and unique key constraints with example?

Last Answer : There are two Entity constraints: 1.Primary Key constraint 2. Unique Constraint 1. Primary Key constraint: It is use to avoid redundant/duplicate value entry within the row of specified column in ... TABLE PERSONS (P_ID NUM CONSTRAINT P_UK UNIQUE , FIRSTNAME VARCHAR(20), CITY VARCHAR(20) );

Description : Enlist different types of database users.

Last Answer : Database users are the one who really use and take the benefits of database. There will be different types of users depending on their need and way of accessing the database. 1. Application Programmers 2. Sophisticated Users 3. Specialized Users 4. Native Users/ Naïve Users

Description : List the types of Cursor.

Last Answer : Cursor: A cursor is a temporary work area created in the system memory when a SQL statement is executed. Types of Cursor: 1.Implicit Cursor 2.Explicit Cursor

Description : Write syntax to create view.

Last Answer : Create view as select OR CREATE VIEW name ASSELECT column1, column2.....FROM table_nameWHERE [condition];