What Can SQL Do?: SQL (Structured Query Language)
What Can SQL Do?: SQL (Structured Query Language)
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.
A table is a collection of related data entries and it consists of columns and rows.
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.
SQL Statements
Most of the actions you need to perform on a database are done with SQL statements.
and
The following SQL statement will select all the records in the "Persons" table:
The DISTINCT keyword can be used to return only distinct (different) values.
Operator Description
= Equal
<> Not equal
> Greater than
< Less than
>= Greater than or equal
<= Less than or equal
BETWEEN Between an inclusive range
LIKE Search for a pattern
IN To specify multiple possible values for a column
The OR operator displays a record if either the first condition or the second condition is true.
If you want to sort the records in a descending order, you can use the DESC keyword.
The first form doesn't specify the column names where the data will be inserted, only their values:
The second form specifies both the column names and the values to be inserted:
Note: Notice the WHERE clause in the UPDATE syntax. The WHERE clause specifies which record or records
that should be updated. If you omit the WHERE clause, all records will be updated!
Note: Notice the WHERE clause in the DELETE syntax. The WHERE clause specifies which record or records
that should be deleted. If you omit the WHERE clause, all records will be deleted!
or
Note: Be very careful when deleting records. You cannot undo this statement!