SQL Tutorial - What Is A Database?
SQL Tutorial - What Is A Database?
(Book Definition) – A Data Base is an Organized Collection of Data which can be easily accessed,
managed and updated.
In today’s World, Data plays a vital role in every business. In our day to day life, we see or interact
with many applications and Software’s, every application that we see or work with will have two parts:
2. Database
To keep it simple GUI is the part where user interacts with (like Facebook application’s – look and feel)
and the Data that we see in the application (like Facebook profile, messages, images and videos) are
pulled from Database.
End User who interacts with the application may not know how the data is being fetched and where so
much of information is stored. Internally all the dynamic content that we see in the application is
fetched from Database.
Database and all its components should be designed and configured at the time of application
development. Once the application is developed we will not be able to make changes to the database
structure as every change will hugely affect the business application GUI code.
It is very important to make sure that data is securely maintained and accurately stored. So to
maintain security and accuracy in database a set of rules / software system is defined and that we call
it as DBMS (Data Base Management System – which performs all the operations on the database)
A database management system contains a set of programs that control the creation, maintenance,
and use of a database. Like:
DBMS allows different user application programs to concurrently access the same database.
Before Database and DBMS were introduced, traditional approach was to store data in flat files
(physical files in system) but there were some disadvantages with it.
Following are some of the advantages of using a database over a traditional file-processing system:
Flexibility.
The external level (this is where application developer or end user interacts with database)
The conceptual level (At this level all the DBMS functions resides, that is functions for
adding , modifying and deleting data)
The internal or the physical level is the level where the data resides. (the physical storage
happens)
Facts about DBMS:
DBMS came into picture when database was introduced (i.e. just a simple software to interact with
database)
According to DBMS data can be stored in any format. (not necessary that data should be stored in
form of tables)
DBMS was a simple system to access database. There were issues for huge data.
In DBMS, there were no proper set of rules defined on how data should be stored, how to avoid
redundancy (duplicate records) and how to maintain data relationships.
As the time progressed data complexity increased as usual, time and technology brains have
introduced RDBMS and came up with some set of rules.
The rules:
Rule (0): The system must qualify as relational, as a database, and as a management
system.
For a system to qualify as a relational database management system (RDBMS), that system must use
its relational facilities (exclusively) to manage the database.
Rule 3: Systematic treatment of null values: The DBMS must allow each field to remain null (or
empty). Specifically, it must support a representation of “missing information and inapplicable
information” that is systematic, distinct from all regular values (for example, “distinct from zero or any
other number”, in the case of numeric values), and independent of data type. It is also implied that
such representations must be manipulated by the DBMS in a systematic way.
As a result of this CODD rules a RDBMS (relational database management system) ensures and
enforce the database to follow ACID properties.
Now let’s see what ACID rules are?
Atomicity:- Atomicity requires that each transaction is “all or nothing”: if one part of the transaction
fails, the entire transaction should fails, and the database state is left unchanged. An atomic system
must guarantee atomicity in each and every situation, including power failures, errors, and crashes.
Consistency states that only valid data will be written to the database. If, for some reason, a
transaction is executed that violates the database’s consistency rules, the entire transaction will be
rolled back and the database will be restored to a state consistent with those rules. On the other hand,
if a transaction successfully executes, it will take the database from one state that is consistent with
the rules to another state that is also consistent with the rules.
Isolation:- The isolation property ensures that the concurrent execution of transactions results in a
system state that could have been obtained if transactions are executed serially i.e. one after the
other.[citation needed] The isolation property ensures that the concurrent execution of transactions
should not impact each other’s execution.
For example, if Mark issues a transaction against a database at the same time that Scott issues a
different transaction; both transactions should operate on the database in an isolated manner. The
database should either perform Mark’s entire transaction before executing Scott’s or vice-versa. This
prevents Mark’s transaction from reading intermediate data produced as a side effect of part of Scott’s
transaction that will not eventually be committed to the database. Note that the isolation property
does not ensure which transaction will execute first, merely that they will not interfere with each
other.
Durability:- Durability means that once a transaction has been committed, it will remain so, even in
the event of power loss, crashes, or errors. In a relational database, for instance, once a group of SQL
statements execute, the results need to be stored permanently (even if the database crashes
immediately thereafter).
SQL Tutorial - What is SQL?
SQL is a standard language designed for accessing and managing data in Relational Database
Management Systems (RDBMS).
SQL is based on ANSI (American National Standards Institute) standard introduced in 1986 and there
are many SQL database software’s available in the market which follows the ANSI standard like:
Oracle
Mysql
Sqlserver
DB2 ……etc
Note: Most of the SQL database programs currently available in the market also have their own
proprietary extensions in addition to the SQL standard.
Using SQL we execute different commands on RDBMS software’s to perform different operations on
the data available in the database.
Whenever we execute a SQL command the RDBMS software translates our command into
understandable format of the database and do the necessary operation on data.
To make it simple SQL Commands are divided into five categories, depending upon what they do.
Newton Apples has separate training course for PL/SQL, Please go through PL/SQL content for more
details.
1. Oracle
Oracle began its journey in 1979 and it is the first commercially available relational database
management system (RDBMS). There is no doubt that Oracle ranks top among all the enterprise
database systems as it delivers industry leading performance, scalability, security and reliability
and handles complex database solutions with ease.
Most of the ERP systems that are available in the market use Oracle as the database because of it
performance and ability to handle huge data.
roduct Owner First Public Release Date Latest Stable Version Latest Release Date
2. SQL Server
SQL server is a Microsoft. Microsoft SQL Server is widely used for small and mid level industries. SQL
server is mostly used in developing countries because of it easy to use and easy to maintain features.
SQL Server has tight Windows operating system integration and makes it an easy choice for firms that
choose Microsoft products for their enterprises.
roduct Owner First Public Release Date Latest Stable Version Latest Release Date
3. DB2
DB2 is an IBM product and it is mostly used in IBM products like IBM Tivoli TSM etc. DB2 runs on
Linux, UNIX, Windows and mainframes. IBM pits its DB2 9.7 system squarely in competition with
Oracle’s 11g, via the International Technology Group, and shows significant cost savings for those that
migrate to DB2 from Oracle.
roduct Owner First Public Release Date Latest Stable Version Latest Release Date
4. Sybase
Sybase, an SAP company, is an enterprise software and services company offering software to
manage, analyze, and mobilize information using relational databases. Although its market share
slowed for few years, it’s returning with powerful positioning in the next-generation transaction
processing space. Sybase has also thrown a considerable amount of weight behind the mobile
enterprise by delivering partnered solutions to the mobile device market. Sybase now works with
other industry leaders in infrastructure, data storage and virtualization to optimize technologies for
delivery into public and virtual private cloud environments that provide greater technology availability
and flexibility to Sybase customers looking to unwire their enterprise.
roduct Owner First Public Release Date Latest Stable Version Latest Release Date
MYSQL is most preferred choice for Web based and low cost products, this is an open source product.
Using a free / open source minimize a product cost by significant amount. MySQL sold to Sun
Microsystems in 2008 and now MySQL is currently part of the Oracle empire (January 2010) as Sun
Microsystems is acquired by Oracle. More than just a niche database now, MySQL powers commercial
websites by the hundreds of thousands and a huge number of internal enterprise applications.
Although MySQL’s community and commercial adopters had reservations about Oracle’s ownership of
this popular open source product, Oracle has publicly declared its commitment to ongoing
development and support.
Product Owner First Public Release Date Latest Stable Version Latest R
6. PostgreSQL
PostgreSQL is an open source database and widely used in online gaming applications, data center
automation suites and domain registries. The vast majority of Linux distributions have PostgreSQL
available in supplied packages. Mac OS X, starting with Lion, has PostgreSQL server as its standard
default database in the server edition and PostgreSQL client tools in the desktop edition.
Product Owner First Public Release Date Latest Stable Version Latest
7. Teradata
Teradata is mainly used for for data warehouses and analytic applications because its products are
meant to consolidate data from different sources and make the data easily available for analysis and
reporting. Teradata was incorporated in 1979 and was formerly a division of NCR Corporation, with the
spinoff from NCR on October 1, 2007.
Product Owner First Public Release Date Latest Stable Version Latest Re
8. Informix
Informix is another IBM product. The Informix products were originally developed by Informix
Corporation, whose Informix Software subsidiary was acquired by IBM in 2001. IBM has continued
active development and marketing of the key Informix products and offers several Informix. Informix
database is often associated with universities and colleges. Informix customers often speak of its low
cost, low maintenance and high reliability.
Product Owner First Public Release Date Latest Stable Version Latest Rele
9. Ingres
Ingres Database is fully open source with a growing global community of contributors. Ingres is all
about choice and choosing might mean lowering your total cost of ownership for an enterprise
database system. Ingres was first created as a research project at the University of California,
Berkeley, starting in the early 1970s and ending in the early 1980s. Ingres prides itself on its ability to
ease your transition from costlier database systems. Ingres also incorporates security features
required for HIPPA and Sarbanes Oxley compliance.
roduct Owner First Public Release Date Latest Stable Version Latest Release Date
10. MaxDB
MaxDB is an ANSISQL-92 (entry level) compliant relational database management system (RDBMS)
from SAP AG. MaxDB is targeted for large SAP environments e.g. mySAP Business Suite and other
applications that require enterprise-level database functionality. It is able to run terabyte-range data
in continuous operation.
roduct Owner First Public Release Date Latest Stable Version Latest Release Date