The document discusses creating and using synonyms and sequences in Oracle. It shows how to create a synonym "m" for a table "marks", create a public synonym "l" for a table "library", and drop the synonym "lib". It also demonstrates how to create a sequence "lib" to generate primary keys, retrieve the current and next sequence values, and insert rows into the "library" table using the sequence.
The document discusses creating and using synonyms and sequences in Oracle. It shows how to create a synonym "m" for a table "marks", create a public synonym "l" for a table "library", and drop the synonym "lib". It also demonstrates how to create a sequence "lib" to generate primary keys, retrieve the current and next sequence values, and insert rows into the "library" table using the sequence.
The document discusses creating and using synonyms and sequences in Oracle. It shows how to create a synonym "m" for a table "marks", create a public synonym "l" for a table "library", and drop the synonym "lib". It also demonstrates how to create a sequence "lib" to generate primary keys, retrieve the current and next sequence values, and insert rows into the "library" table using the sequence.
B) SEQUENCE: create sequence lib start with 100 increment by 2 minvalue 100 maxvalue 200 nocache nocycle;
select lib.currval from library;
select lib.nextval from library;
insert into library values(lib.nextval,110,'Maths','10/11/22','15/11/22');
insert into library values(lib.nextval,109,'Physics','09/07/22','15/07/22'); insert into library values(lib.nextval,102,'Biology','08/02/22','15/02/22'); insert into library values(lib.nextval,100,'History','23/09/22','5/10/22'); insert into library values(lib.nextval,106,'c programming','12/11/22','17/11/22'); insert into library values(lib.nextval,101,'java programming','13/11/22','18/11/22'); insert into library values(lib.nextval,105,'c++ programming','14/11/22','19/11/22'); insert into library values(lib.nextval,104,'web development','15/11/22','20/11/22');