You are on page 1of 1

PRACTICAL8

SOURCE CODE:
SQL> create table student(studid number(5) primary key, studname varchar(10),address varchar(50 number(3)); Table created. SQL> 1 create sequence stud_sequence 2 increment by 1 3 start with 1 4 maxvalue 40 5 minvalue 1 6 nocycle; SQL> / Sequence created. SQL> insert into student values(stud_sequence.nextval,'abc','xyz',20); 1 row created. SQL> alter sequence stud_sequence maxvalue 60; Sequence altered. SQL> select * from user_sequences; SEQUENCE_NAME MIN_VALUE MAX_VALUE INCREMENT_BY C O CACHE_SIZE ------------------------------ ---------- ---------- ------------ - - ---------LAST_NUMBER ----------STUD_SEQUENCE 1 60 1NN 20 2

SQL> drop sequence stud_sequence; Sequence dropped.

You might also like