Title: Relational Database Management System Concepts(RDBMS)
Description:
Welcome to the comprehensive guide on Relational Database Management System (RDBMS) concepts, tailored for final year B.Sc. Computer Science students affiliated with Alagappa University. This document covers fundamental princ...
Title: Relational Database Management System Concepts(RDBMS)
Description:
Welcome to the comprehensive guide on Relational Database Management System (RDBMS) concepts, tailored for final year B.Sc. Computer Science students affiliated with Alagappa University. This document covers fundamental principles and advanced topics in RDBMS, offering a structured approach to understanding databases in the context of modern computing. PDF content is prepared from the text book Learn Oracle 8I by JOSE A RAMALHO.
Key Topics Covered:
Main Topic : DATA INTEGRITY, CREATING AND MAINTAINING A TABLE AND INDEX
Sub-Topic :
Data Integrity,Types of Integrity, Integrity Constraints, Primary Key, Foreign key, unique key, self referential integrity,
creating and maintain a table, Modifying a table, alter a table, Deleting a table
Create an Index, Alter Index, Drop Index, Function based index, obtaining information about index, Difference between ROWID and ROWNUM
Target Audience:
Final year B.Sc. Computer Science students at Alagappa University seeking a solid foundation in RDBMS principles for academic and practical applications.
About the Author:
Dr. S. Murugan is Associate Professor at Alagappa Government Arts College, Karaikudi. With 23 years of teaching experience in the field of Computer Science, Dr. S. Murugan has a passion for simplifying complex concepts in database management.
Disclaimer:
This document is intended for educational purposes only. The content presented here reflects the author’s understanding in the field of RDBMS as of 2024.
Size: 402.04 KB
Language: en
Added: Jul 09, 2024
Slides: 16 pages
Slide Content
RDBMS -Unit IV
Chapter 11
SEQUENCES
Prepared By
Dr. S.Murugan, Associate Professor
Department of Computer Science,
AlagappaGovernment Arts College, Karaikudi.
(Affiliated by AlagappaUniversity)
Mailid: [email protected]
Reference Book:
LEARN ORACLE 8i, JOSE A RAMALHO
Sequences
➢Asequenceissimplyanautomaticcounter,whichis
enabledwheneveritisaccessed.
➢
➢Thisguaranteesthattherearenotworowswiththe
samecode.
➢Adefaultsequencehasthefollowingcharacteristics:
•Always starts from the number 1.
•In ascending order.
•Increases by 1.
The CREATE SEQUENCE Command
➢TheSQLcommandusedtocreateasequenceisthe
CREATESEQUENCEcommand.
Using a Sequence
➢SQL>createnewseq3minval1000maxval1005.
➢Thesequenceisenabledthefirsttimeitisused,and
displaysitsinitialvalue:
SQL>selectnewseq3.nextvalfromdual;
NEXTVAL
-------
1000
➢Thesecondtimeitisused,itdisplaysthevalue
incrementedby1.
SQL>run
NEXTVAL
-------
1001
Using a Sequence
➢Whenweaccesstocurrval,itdoesnotchangethe
valueofthesequence:
SQL> select newseq3.currval from dual;
CURRVAL
-------
1001
SQL> run
CURRVAL
-------
1001
Using a Sequence
➢InsertingSequencenumbertothedatabase.
1.Createatable
2.createasequence
3.Insertsequenceintoatable.
3.Viewtherecordsfromtable.
1.Createtableproduct(snonumber(3),item_name
char(20),bill_datedate);
2.Createsequenceserialminvalue1maxvalue100;
3.Insertintoproductvalues(serial.nextval,’RICE’,’14-
JUL-19’);
4.Repeatthestep3asyouwanttoinsert.
5.Select*fromproduct;