Introduction To Database
Introduction To Database
Introduction To Database
Why databases?
For collection, storage, aggregation, manipulation, dissemination, and management of data.
Telecommunications companies such as Sprint and AT&T are known to have systems that keep data on
trillions of phone calls, with new data being added to the system at speeds up to 70,000 calls per second! Not
only do these companies have to store and manage these immense collections of data, they have to be able to
find any given fact in that data quickly..
Consider the case of Internet search staple Google. While Google is reluctant to disclose many details about
its data storage specifications, it is estimated that the company responds to over 91 million searches per day
across a collection of data that is several terabytes in size. Impressively, the results of these searches are
available nearly instantly
It can only be possible using databases.
Databases are specialized structures that allow computer-based systems to store, manage, and
retrieve data very quickly.
Data and Information
The word raw indicates that the facts have not yet been
processed to reveal their meaning.
Keep in mind that raw data must be properly formatted for storage, processing, and presentation.
Show: Shift-> 1-Morning 2->Evening
Datatype Description
Fixed length with a maximum length of
CHAR
8,000 characters
Variable-length storage with a maximum
VARCHAR
length of 8,000 characters
Variable-length storage with provided
VARCHAR(max) max characters, not supported in
MySQL
Variable-length storage with maximum
TEXT
size of 2GB data
SQL Unicode Character and String Data Types
Datatype Description
Fixed length with maximum length of
NCHAR
4,000 characters
Variable-length storage with a maximum
NVARCHAR
length of 4,000 characters
Variable-length storage with provided
NVARCHAR(max)
max characters
Variable-length storage with a maximum
NTEXT
size of 1GB data
SQL Binary Data Types
Datatype Descripation
Fixed length with a maximum length of
BINARY
8,000 bytes
Variable-length storage with a maximum
VARBINARY
length of 8,000 bytes
Variable-length storage with provided
VARBINARY(max)
max bytes
Variable-length storage with maximum
IMAGE
size of 2GB binary data
SQL Miscellaneous Data Types
Datatype Description
Character large objects that can hold up
CLOB
to 2GB
BLOB For binary large objects
XML for storing XML data
JSON for storing JSON data
Database management system (DBMS)
A database management system (DBMS) is a collection of programs that manages the database
structure and controls access to the data stored in the database.
In a sense, a database resembles a very well-organized electronic filing cabinet in which powerful
software, known as a database management system, helps manage the cabinet’s contents.
DBMS provides advantages such as:
• Improved data sharing. The DBMS helps create an environment in which end users have
better access to more and better-managed data. Such access makes it possible for end users to
respond quickly to changes in their environment.
• Improved data security. The more users access the data, the greater the risks of data security
breaches. Corporations invest considerable amounts of time, effort, and money to ensure that
corporate data are used properly. A DBMS provides a framework for better enforcement of
data privacy and security policies.
• Better data integration. Wider access to well-managed data promotes an integrated view of
the organization’s operations and a clearer view of the big picture. It becomes much easier to
see how actions in one segment of the company affect other segments.
• Minimized data inconsistency. Data inconsistency exists when different versions of the same
data appear in different places. For example, data inconsistency exists when a company’s sales
department stores a sales representative’s name as “Bill Brown” and the company’s personnel
department stores that same person’s name as “William G. Brown,” or when the company’s
regional sales office shows the price of a product as $45.95 and its national sales office shows
the same product’s price as $43.95. The probability of data inconsistency is greatly reduced in a
properly designed database.
• Improved data access. The DBMS makes it possible to produce quick answers to ad hoc
queries. From a database perspective, a query is a specific request issued to the DBMS for data
manipulation—for example, to read or update the data.
What is the sales bonus figure for each of our salespeople during the past three months?
• Improved decision making. Better-managed data and improved data access make it possible
to generate better-quality information, on which better decisions are based. The quality of the
information generated depends on the quality of the underlying data. Data quality is a
comprehensive approach to promoting the accuracy, validity, and timeliness of the data.
While the DBMS does not guarantee data quality, it provides a framework to facilitate data
quality initiatives. Data quality concepts will be covered in more detail in Chapter 15,
Database Administration and Security.
• Increased end-user productivity. The availability of data, combined with the tools that
transform data into usable information, empowers end users to make quick, informed
decisions that can make the difference between success and failure in the global economy.