Oracle - It is called as relational database software used to store large volume of data.
Oracle works
from laptop to multiprocessor servers. It contains enterprise level database features i.e., it can
accept multiple requests and can give response at a time.
Oracle 11g introduced in 2007. Oracle12c introduced in 2013.
Grid computing is used to create single IT infrastructure or unit which can be shared by difference
business processes or different business in each business group.
Grid computing is application oriented.
Cloud computing is service oriented. ( on demand access )
Any project or application contains 2 tools or software
1) Front end tool
It is used to used to develop applications or projects. It contains designing and coding.
ex: java, ms-net,python etc
2) Back end tool
It is used to store and to maintain the data related to applications or projects.
ex: Oracle, Sql Server,mysql etc
Oracle contains
sql - (structure query language) - sequel
pl/sql - procedure language
DBMS - database management system
Data - collection of related information.
Database - it is the base or layer to store information.
DBMS - it is used to store,manage and used to access the data from database. in dbms, data is stored
in the form of tables. table has 2 dimension i.e., rows and columns
ex : ms-access, foxpro etc
RDBMS - Relational database management system.
(it is the combination dbms features with relational data model )
ex: oracle, sql server, mysql etc
ORDBMS - object relational database management system
ex: oracle
Other relational database softwares:
SQLite, MongoDB. Cassandra, PostgreSQL, DB2, MariaDB, Informix, OrientDB, HBase, Couchbase,
BigTable, Teradata, Neo4j, SimpleDB, NuoDB, Hana, SymmetricDS, Firebird, MarkLogic
SQL vs NoSQL
SQL databases are primarily called as Relational Databases (RDBMS); whereas NoSQL database are
primarily called as non-relational or distributed database. SQL databases are table based databases
whereas NoSQL databases are document based, key-value pairs, graph databases or wide-column
stores.
Popular SQL databases :
MySQL, Oracle, IMB DB2, Sybase , MS SQL Server, Microsoft Azure, MariaDB ,PostgreSQL
Popular NoSQL Databases:
MongoDB, Apache’s CouchDB, HBase, Oracle NoSQL — Oracle’s entry into the NoSQL category.
Apache’s Cassandra DB, Riak
DBMS features
1) Redundancy can be reduced and Inconsistency can be avoided:
Redundancy means data repetition or duplicate data. Inconsistency means incorrect data or
Invalid data. If table contains redundancy then inconsistency may exist in the table. By using
constraints redundancy can be reduced and inconsistency can be avoided.
Employee
Eno Ename Sal Dno Dname
1001 Ajay 15000 10 Sales
1002 Ram 9000 10 Operations
1004 Vikram 12000 20 Accounting
1004 Vikram 12000 20 Accounting
2) Security
a) Authentication
b) Authorization
3) Data Integrity
If table maintains standards or data integrity then valid or meaningful data is stored in
tables. Data Integrity works with constraints.
Employee
Eno Ename Doj
101 Rajesh 31-feb-14 10:64:00
4) Atomicity
All the commands in transaction are executed or none of them are executed. Transaction
work with ACID properties. They are
Atomicity
Consistency
Isolation
Durability
RDBMS features :
1) Large amount of data is stored
2) Structured Query Language
It constraint sub languages or sub versions:
a) Data Manipulation Language
b) Data Definition Language
c) Data Control Language
d) Transaction Control language
e) Data Query Language.
3) Multiple tables can be joined as one table (joins)
4) Multiple relations can be created on tables.
1:1
1:M
M:1
M:N (1:M & M:1)
DEPT
DNO DNAME LOC
10 IT HYD
20 ACCOUNTING HYD
EMPDET
ENO ENAME SAL DNO
101 RAM 12000 10
102 VIKAS 11000 10
103 ARVIND 15000 10
104 AMAR 13000 20
PROJECT
PID PNAME BUDGET
1 HMS 2000 dollars
2 CRMS 1800 dollars
3 HRMS 2000 dollars
EMPLOYEE1
ENO ENAME PID
101 RAM 1
102 VIKAS 1
103 ARVIND 2,3
1: M means 1 parent rows is having relation with multiple rows in child table. M:1 means multiple
parent rows are having relation with 1 child row in child table.
Data Models
After introducing DBMS features, different data models are introduced. They are used to define
different ways of storing data in different ways.
1) Physical Data Model : It is used to define how the data is physically stored in database.
2) Conceptual data model : It is used to define what data is stored and the relations existing
between data. The famous conceptual data model in Entity Relationship Diagrams.
3) Logical data Model : It is used to define what data is stored and the relations existing
between data. The data and relations are identified using softwares.
Logical Data Models are classified into 5 types.
1) Hierarchal Data Model : It is used to store data in tree data structure (inverted tree
view). This model support 1 : M relations, but M:1 relations are not possible. To
overcome this drawback Network data model is introduced.
Ex : IMS (information Management System)
2) Network Data Model : It is used to store data in tree data structure. It support 1 : M and
M: 1 relation. In this model accessing the data and data manipulations are difficult. If any
value is deleted then the values depending upon deleted value are not re-arranged.
With these drawbacks Relational Data Model is introduced.
Ex:IDS (information Data Store)
3) Relation Data Model : It is introduced by E.F. CODD. [Link] introduced 12 CODD
rules so that all the relational databases should follow. In the model data is stored in the
form of rows and columns. This model has Data Independence i.e., each value is the
table is independent value. If any value is modified or deleted then it does not effect the
other values in table.
Ex: Sql Server
4) Object Data Model : support object oriented programming concepts.
Ex: Cactus, Object Store
5) Object Relational Data Model : It is the combination of Object data model and Relational
Data Model.
Ex: Oracle
Constraints
Constraints are used to give conditions or rules on the table so that valid or meaningful data can be
stored in tables.
1) Unique (different) : accept new values and accept null values.
Note: SQL server accepts only one null value.
2) Not null : It does not accept null values, but can store duplicate values.
3) Primary key : It is the combination of unique and not null constraint. It does not accept
duplicate values and does not accept null values. A table can contain only one primary key.
Primary key is the example of super key.
a) Candidate key : uniquely identifies each row in the table.
If column contains unique values then it can be called as candidate key column. Table
can contain multiple candidate key columns. Out of all the candidate key columns, one
column can be used as primary key columns
b) Alternate key (Secondary key) : Uniquely identifies each row in a table when primary
key fails.
PK
STUDENT
Secondary key
4) Foreign key: Used to create relation between tables and used to maintain referential data
integrity. To create child table, foreign key is used. It can accept duplicate values and can
accept null values. A table can contain multiple foreign key constraints. Referential data
integrity means foreign key values given in child table are referred to primary key column
values in parent table.
Composite key : It is given on multiple columns and work with composite or mixed data.
If primary key is given on 2 columns then it is called composite primary key.
Normalization
De-composing of larger and complex data in simple or smaller tables. Before normalization data can
be in table format or else in ms-excel file or raw data ( data in text file).
Advantages :
1) Redundancy can be reduced. Redundancy means data repetition or duplicate data.
2) Inconsistency can be avoided. In consistency means incorrect data or invalid data.
3) Related data is stored in tables.
De-Normalization : It is the reverse of normalization. It contains data repititation or duplicate values.
Database is classified into 2 types.
1) Online Transaction Processing (OLTP) : It contains normalized data. It is used to store
current data which is for 90 to 100 days. In any java application or project or website, OLTP
database.
2) Online Analytical Processing (OLAP) : It contains de-normalized data. It is used to maintain
historical data which is for 10 to 15 years. It is used in data warehouse. Data Warehouse
means it is used to maintain old data of any company or business.
First Normal Form : All the columns should be atomic. Each column in the table should single valued
column. Repeating groups or duplicative columns are not allowed in 1st normal form.
PK
Employee
PK Customer
Second Normal Form : It should follow the rules of 1st normal form. All the columns in the table
should functionally depend upon primary key column existing in the table. Partial dependency is not
allowed in second normal form.
Third Normal Form : It should follow the rules of 2nd normal form. All the columns should depend
upon primary key column. Transitive dependency is not allowed in 3rd normal form. Transitive
dependency means non-key column depending upon non-key column in the table.
Boyce Codd Normal Form (BCNF ) : It should follow the rules of 3rd normal form. All the columns in
the table should depend upon composite primary key existing in the table.