0% found this document useful (0 votes)
29 views

Some of The Most Important SQL Commands: 1.select

The document discusses important SQL commands used to manipulate data in a database. It describes the DELETE command which removes data from a database table. It provides an example DELETE statement that would remove all customer records from Germany in the city of Berlin from the Customers table. The document also covers the INSERT INTO command for adding new data to a database table and includes an example statement.

Uploaded by

Trung Hieu
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Some of The Most Important SQL Commands: 1.select

The document discusses important SQL commands used to manipulate data in a database. It describes the DELETE command which removes data from a database table. It provides an example DELETE statement that would remove all customer records from Germany in the city of Berlin from the Customers table. The document also covers the INSERT INTO command for adding new data to a database table and includes an example statement.

Uploaded by

Trung Hieu
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

http://www.w3schools.com/sql/sql_delete.

asp

Some of The Most Important SQL Commands
SELECT - extracts data from a database
UPDATE - updates data in a database
DELETE - deletes data from a database
INSERT INTO - inserts new data into a database
CREATE DATABASE - creates a new database
ALTER DATABASE - modifies a database
CREATE TABLE - creates a new table
ALTER TABLE - modifies a table
DROP TABLE - deletes a table
CREATE INDEX - creates an index (search key)
DROP INDEX - deletes an index
1.SELECT
SELECT column_name,column_name FROM table_name;
and
SELECT * FROM table_name;


AND /OR:
The following SQL statement selects all customers from the country "Germany" AND the
city "Berlin", in the "Customers" table:
Example
SELECT * FROM Customers
WHERE Country='Germany'
AND City='Berlin';


The SQL ORDER BY Keyword
SELECT column_name,column_name
FROM table_name
ORDER BY column_name,column_name ASC|DESC;

SELECT * FROM Customers
ORDER BY Country DESC;

SELECT * FROM Customers
ORDER BY Country,CustomerName; // xp o name xp ththeo country , mi country

2. INSERT INTO
INSERT INTO table_name
VALUES (value1,value2,value3,...);
Hoc
INSERT INTO table_name (column1,column2,column3,...)
VALUES (value1,value2,value3,...);

You might also like