0% found this document useful (0 votes)
7 views

Dbms

A DBMS is system software that allows users to create, manage, and retrieve data from a database. The main types of DBMS are hierarchical, network, relational, and object-relational. Relational DBMS organizes data into rows and columns and uses SQL. Oracle has various built-in data types including character, number, date, and rowid. SQL commands like CREATE, INSERT, SELECT, UPDATE, and DELETE are used to interact with database tables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Dbms

A DBMS is system software that allows users to create, manage, and retrieve data from a database. The main types of DBMS are hierarchical, network, relational, and object-relational. Relational DBMS organizes data into rows and columns and uses SQL. Oracle has various built-in data types including character, number, date, and rowid. SQL commands like CREATE, INSERT, SELECT, UPDATE, and DELETE are used to interact with database tables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

DBMS

•A database management system (DBMS) is system


software for creating and managing databases.

•The DBMS provides users and programmers with a


systematic way to create, retrieve, update and manage
data.

•DBMS is collection of information from different


resources which is stored under a single unit.

•Generally we gather inter related data into DBMS


which can be used for further references.
Types of DBMS:
The DBMS is mainly 4 types
1) Hierarchical DBMS
2) Network DBMS
3) Relational DBMS
4) Object- Relational Databases (ORDBMS)
1. Hierarchical DBMS:
The hierarchical DBMS follows parent to child relationship. It is tree
like structure. So the same data is copied many number of times. It
supports one-to-many relationship only.
Disadvantages:
It does not support many-to-many relationship.
The same data is copied many number of times (so the data
redundancy occurs)
2. Network DBMS:
The network data base management system stands for N-DBMS. It
supports many-to-many relationship.
The NDBMS model can easily be accessed by using table
record. As it uses many-to-many relationship the complexity is
very high for NDBMS.
Disadvantages:
Difficult for beginners to understand because of the many-to-many
relationship.
3. RDBMS:
RDBMS stands for relational database management system. It was
introduced by E F CODD in the year 1970.
In Relational Database Management System the data is organized in
the form of rows and columns.
SQL sub language:
The SQL has five sub languages. They are
1. DDL (Data definition language),
2. DML (Data manipulation language),
3. DCL (Data Control Language),
4. TCL (Transaction Control Language),
5. DRL/DQL (Data Retrieve language).
DATA TYPES IN ORACLE
The Built-in-data types of ORACLE are categorized as
•CHARACTER DATA TYPES,
•NUMBER DATA TYPES,
•LONG AND RAW DATA TYPES,
•DATE DATA TYPE,
•ROWID DATA TYPE.
Create sample tables, execute some sql queries:
For create table:
1)Table name 2)Column name 3)Data type
Table restriction:
•Table name must be unique in schema
•The table name should begin with a letter and can be 1-30 characters
long.
•Maximum 1000 columns
•Name can contain: A-Z, 0-9.
To Create Table
Syntax: create table<table name>
(<column1><Data type>,<column2><Data type>,….);

SQL>CREATE TABLE EMP


(EMPNO NUMBER(10),
ENAME VARCHAR2(10),
JOB VARCHAR2(10),
MGR NUMBER(10),
HIREDATE DATE,
SAL NUMBER(10),
COMM NUMBER(10),
DEPTNO NUMBER(10));

Table created.
DESCRIBE Command will give us with what columns we created
table and their datatype.

SQL> DESC EMP

Name Null? Type


EMPNO NUMBER(10)
ENAME VARCHAR2(10)
JOB VARCHAR2(10)
MGR NUMBER(10)
HIREDATE DATE
SAL NUMBER(10)
COMM NUMBER(10)
DEPTNO NUMBER(10)
INSERTING VALUES IN TO TABLE:
Syntax: INSERT into<table name>[list of columns] values(list of
values);
SQL> INSERT INTO EMP VALUES
(100,'PAVAN','CHAIRMAN',NULL,'01-JAN-
2005',30000,10000,10);
1 Row Inserted.

INSERTING DATA INTO REQURIED COLUMNS:


SQL> INSERT INTO EMP(EMPNO, ENAME, JOB, DEPTNO)
VALUES (100,'PAVAN','CHAIRMAN',10);
SELECTING VALUES FROM A TABLE:
SELECT
EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO
FROM EMP;

HERE INSTEAD OF TYPING ALL THE COLUMN NAMES


WE TYPE “*”
SQL> SELECT * FROM EMP;
SELECTING WITH WHERE CLAUSE:
Whenever we select using where clause we get particular
information depends on the column you specify in where
clause.
SQL> SELECT * FROM EMP WHERE EMPNO=100;
UPDATE STATEMENT:
While updating a table if you don’t give where clause whole table will
be updated.
SQL> UPDATE EMP SET SAL= SAL+1000;

UPDATE TABLE USING WHERE CLAUSE:


whenever we give where clause in updation only that column
corresponding rows will be updated.
SQL> UPDATE EMP SET SAL= SAL+1000 WHERE
EMPNO=100;

DELETING DATA FROM A TABLE:


If you want to delete info from a table, here if you won’t specify the
where clause whole table info will be deleted.
SQL> DELETE FROM EMPLOYEE_INFO WHERE
EMPNO=102;

You might also like