- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
how to create a sequence in sql oracle
how to create a sequence in sql oracle?
let us first understand what is sequence.
-it is a user created database object that can be shared by multiple users to generate integers.
-it is used for generating unique numbers automatically.
-used to create primary key values.
SYNTAX:
CREATE SEQUENCE sequence_name
START WITH initial_value
INCREMENTED BY increment_value
MINVALUE minimun value
MAXVALUE maximum value
CYCLE|NOCYCLE
STEP 1--------------------------------------------
now before creating a sequence lets create a table first...
create table managers(
col1 number(5)primary key,
col2 varchar2(20));
Name Null Type
---- -------- ------------
COL1 NOT NULL NUMBER(5)
COL2 VARCHAR2(20)
table created.
STEP 2--------------------------------------------
now lets move on to make a sequence using the above syntax..
create sequence manager_a
start with 10
increment by 10
maxvalue 100
minvalue 1
nocycle;
this sequence is with nocycle....lets create one more sequence with cycle...
create sequence manager_b
start with 100
increment by -2
maxvalue 100
minvalue 2
cycle;
now we have created 2 sequences....lets insert it.
STEP 3---------------------------------------------
insert into managers values(manager_a.nextval,manager_b.nextval);
by using this string we have inserted 5 values..
STEP 4-------------------------------------------
lets check it in the table.
so here we have successfully created 2 sequences one with minus incremented value and other with add values.
thanks for watching.
do like share and subscribe.
Видео how to create a sequence in sql oracle канала Oracle Training-Free Oracle Tutorials
let us first understand what is sequence.
-it is a user created database object that can be shared by multiple users to generate integers.
-it is used for generating unique numbers automatically.
-used to create primary key values.
SYNTAX:
CREATE SEQUENCE sequence_name
START WITH initial_value
INCREMENTED BY increment_value
MINVALUE minimun value
MAXVALUE maximum value
CYCLE|NOCYCLE
STEP 1--------------------------------------------
now before creating a sequence lets create a table first...
create table managers(
col1 number(5)primary key,
col2 varchar2(20));
Name Null Type
---- -------- ------------
COL1 NOT NULL NUMBER(5)
COL2 VARCHAR2(20)
table created.
STEP 2--------------------------------------------
now lets move on to make a sequence using the above syntax..
create sequence manager_a
start with 10
increment by 10
maxvalue 100
minvalue 1
nocycle;
this sequence is with nocycle....lets create one more sequence with cycle...
create sequence manager_b
start with 100
increment by -2
maxvalue 100
minvalue 2
cycle;
now we have created 2 sequences....lets insert it.
STEP 3---------------------------------------------
insert into managers values(manager_a.nextval,manager_b.nextval);
by using this string we have inserted 5 values..
STEP 4-------------------------------------------
lets check it in the table.
so here we have successfully created 2 sequences one with minus incremented value and other with add values.
thanks for watching.
do like share and subscribe.
Видео how to create a sequence in sql oracle канала Oracle Training-Free Oracle Tutorials
Комментарии отсутствуют
Информация о видео
14 декабря 2022 г. 19:21:59
00:09:23
Другие видео канала




















