What Is SQL?: Database Background
What Is SQL?: Database Background
Database Background
Originally, databases were flat. This means that the information was stored
in one long text file, called a tab delimited file. Each entry in the tab
delimited file is separated by a special character, such as a vertical bar (|).
Each entry contains multiple pieces of information (fields) about a particular allows you to easily find specific information.
object or person grouped together as a record. The text file makes it difficult
It also allows you to sort based on any field and generate
to search for specific information or to create reports that include only
reports that contain only certain fields from each record.
certain fields from each record. Here's an example of the file created by a
flat database: use tables to store information.
Lname, FName, Age, Salary|dela Cruz, Juan, 35, 15000|Doe, Jane, 28,
The standard fields and records are represented as columns
13589|Brown, Scott, 41, 19290|Manalo, Ronnel, 48, 20000|Taylor, Swift,
(fields) and rows (records) in a table.
22, 12990
you can quickly compare information because of the
You can see that you have to search sequentially through the entire file arrangement of data in columns.
to gather related information, such as age or salary.
SQL is the standard language for Relation Database System
What is Relational DBase?
Relational databases are created using a special computer language,
is a collection of data items organized as a set of formally structured query language (SQL), that is the standard for database
described tables from which data can be accessed easily. interoperability. SQL is the foundation for all of the popular database
applications available today
LName FName Age Salary All relational database management systems like
Database
Objects
Table Parts
SQL Commands
o Field - is a column in a table that is designed
o DQL - Data Query Language
to maintain specific information about every
record in the table Command Description
SELECT Retrieves certain records from one or more tables
o Row / Record - is a horizontal entity in a
table.
o DML - Data Manipulation Language
o Column - is a vertical entity in a table that Command Description
contains all information associated with a INSERT Creates a record
specific field in a table. UPDATE Modifies records
DELETE Deletes records
SELECT column_name(s)
FROM table_name
WHERE column_name operator value
Practice
SQL scalar functions return a single value, based on the input value.