Последние записи

Посты по категории -> SQL

Шпора по запросам SQL

Дата: 05-04-2011

http://www.w3schools.com/sql/default.asp

SELECT

SELECT column_name(s)
FROM table_name
WHERE column_name LIKE pattern
SELECT column_name(s)
FROM table_name1
INNER JOIN table_name2
ON table_name1.column_name=table_name2.column_name
SELECT column_name(s)
FROM table_name
WHERE column_name
BETWEEN value1 AND value2
SELECT TOP 2 * FROM Persons

INSERT

INSERT INTO Persons (P_Id, LastName, FirstName)
VALUES (5, 'Tjessem', 'Jakob')

UPDATE

UPDATE Persons
SET Address='Nissestien 67', City='Sandnes'
WHERE LastName='Tjessem' AND FirstName='Jakob'

DELETE

DELETE FROM Persons
WHERE LastName='Tjessem' AND FirstName='Jakob'