Professional Documents
Culture Documents
6120be6daea4490011abe4aa-1629537650-Module 1-Lesson 2 - Part 1
6120be6daea4490011abe4aa-1629537650-Module 1-Lesson 2 - Part 1
6120be6daea4490011abe4aa-1629537650-Module 1-Lesson 2 - Part 1
Activity Analysis
Recall the time that you created 1. What do you call the language for creating databases?
your first database and what ____________________________________________
application did you use, and how ____________________________________________
did you install it? (Include 2. What are the two categories of SQL commands?
screenshot of your previous ____________________________________________
created database: table, records, ____________________________________________
etc. If you don’t have a previous ____________________________________________
created database, create a new
simple one.)
What is SQL?
✓ SQL is a standard language for storing, manipulating and retrieving data in databases.
✓ SQL stands for Structured Query Language
✓ SQL lets you access and manipulate databases
✓ SQL became a standard of the American National Standards Institute (ANSI) in 1986, and of
the International Organization for Standardization (ISO) in 1987
P a g e 1|5
UM DIGOS COLLEGE
DEPARTMENT OF TECHNICAL PROGRAMS
Information Technology Program
➢ However, to be compliant with the ANSI standard, they all support at least the major
commands (such as SELECT, UPDATE, DELETE, INSERT, WHERE) in a similar manner.
Note: Most of the SQL database programs also have their own proprietary extensions in
addition to the SQL standard!
RDBMS
RDBMS stands for Relational Database Management System.
✓ RDBMS is the basis for SQL, and for all modern database systems such as MS SQL Server,
IBM DB2, Oracle, MySQL, and Microsoft Access.
✓ The data in RDBMS is stored in database objects called tables. A table is a collection of
related data entries and it consists of columns and rows.
✓ Look at the "Customers" table:
Example
SELECT * FROM Customers;
Every table is broken up into smaller entities called fields. The fields in the Customers table consist
of:
✓ CustomerID, CustomerName, ContactName, Address, City, PostalCode and Country.
✓ A field is a column in a table that is designed to maintain specific information about every
record in the table.
✓ A record, also called a row, is each individual entry that exists in a table. For example, there
are 91 records in the above Customers table. A record is a horizontal entity in a table.
✓ A column is a vertical entity in a table that contains all information associated with a specific
field in a table.
P a g e 2|5
UM DIGOS COLLEGE
DEPARTMENT OF TECHNICAL PROGRAMS
Information Technology Program
Database Tables
A database most often contains one or more tables. Each table is identified by a name (e.g.
"Customers" or "Orders"). Tables contain records (rows) with data.
Below is a selection from the "Customers" table:
The table above contains five records (one for each customer) and seven columns (CustomerID,
CustomerName, ContactName, Address, City, PostalCode, and Country).
SQL Statements
Most of the actions you need to perform on a database are done with SQL statements.
Example
SELECT * FROM Customers;
P a g e 3|5
UM DIGOS COLLEGE
DEPARTMENT OF TECHNICAL PROGRAMS
Information Technology Program
SELECT Syntax
Here, column1, column2, ... are the field names of the table you want to select data from. If you want
to select all the fields available in the table, use the following syntax:
P a g e 4|5
UM DIGOS COLLEGE
DEPARTMENT OF TECHNICAL PROGRAMS
Information Technology Program
Example
Example
The following SQL statement lists the number of different (distinct) customer countries:
Example
P a g e 5|5