Chapter+2+ +Database+Query+Languages
Chapter+2+ +Database+Query+Languages
SQL
A relational database model contains tables, and the records in those tables
are accessed using Structured Query Language (SQL). SQL is used to create
the database access sections of applications.
IBM created the original relational database technology. SQL was initially
called SEQUEL.
TRUNCATE table_name
* Removes All Rows
Deletes all rows in the table instantly, without logging each row
deletion individually (unlike DELETE).
SQL Data Manipulation
Data Manipulation Language (DML) statements access and manipulate
data in existing schema objects.
Basic Query — The most simple of queries retrieves all records from a
single table.
The * character tells the query to retrieve all fields from the table
UPDATE Persons
SET LastName=’Edogawa’, FirstName=’Conan’
WHERE P_ID=5
DELETE Statement
The DELETE command allows deletion of one or more records from a
table, at once.
UPDATE products
SET stock = 32
WHERE id = 1
Destroy/ Delete