Introduction To Database

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 21

Fundamentals of Database Systems

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

Data are raw facts.

The word raw indicates that the facts have not yet been
processed to reveal their meaning.

Compare: Leche Flan

For example, suppose that you want to know what the


users of a computer lab think of its services. Typically,
you would begin by surveying users to assess the
computer lab’s performance.
When the survey form has been
completed, the form’s raw data are
saved to a data repository.
Now it’s possible to get quick answers to
questions such as “What is the composition
of our lab’s customer base?”

Compare: Segregate manually

In this case, you can quickly determine that


most of your customers are juniors
(24.59%) and seniors (53.01%).
Because graphics can enhance your ability to
quickly extract meaning from data, you show the
data summary bar graph.
Information is the result of processing raw data to reveal its meaning.

Keep in mind that raw data must be properly formatted for storage, processing, and presentation.
Show: Shift-> 1-Morning 2->Evening

SQL Data Types

SQL data types can be broadly divided into following categories.


1.Numeric data types such as int, tinyint, bigint, float, real, etc.
2.Date and Time data types such as Date, Time, Datetime, etc.
3.Character and String data types such as char, varchar, text, etc.
4.Unicode character string data types, for example nchar, nvarchar, ntext, etc.
5.Binary data types such as binary, varbinary, etc.
6.Miscellaneous data types - clob, blob, xml, cursor, table, etc.
SQL Numeric Data Types
Datatype From To
bit 0 1
tinyint 0 255
smallint -32,768 32,767
int -2,147,483,648 2,147,483,647
-9,223,372,036, 9,223,372,036,
bigint
854,775,808 854,775,807
decimal -10^38 +1 10^38 -1
numeric -10^38 +1 10^38 -1
float -1.79E + 308 1.79E + 308
real -3.40E + 38 3.40E + 38
SQL Date and Time Datatype Description
Data Types Stores date in the format YYYY-
DATE
MM-DD
Stores time in the format
TIME
HH:MI:SS
Stores date and time information
DATETIME in the format YYYY-MM-DD
HH:MI:SS
Stores number of seconds passed
TIMESTAMP since the Unix epoch (‘1970-01-
01 00:00:00’ UTC)
Stores year in 2 digits or 4 digit
format. Range 1901 to 2155 in 4-
YEAR
digit format. Range 70 to 69,
representing 1970 to 2069.
SQL Character and String Data Types

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.

You might also like