SQL

From mmmv_kos
Jump to: navigation, search
Drizzle H2 db-engines.com SQLite
PostgreSQL Example Example Example
Example Example Example Example

ABC

Tabeli loomine, sinna sisestamine, jne.:

CREATE TABLE tabelinimi (tulbanimi_1 int, tulbanimi_2 text, tulbanimi_3 real);
INSERT INTO tabelinimi (tulbanimi_1,tulbanimi_2,tulbanimi_3) values (42,'tere',4.7);
INSERT INTO tabelinimi (tulbanimi_1,tulbanimi_2,tulbanimi_3) values (1984,'head aega!',2.7182818);
INSERT INTO tabelinimi (tulbanimi_1,tulbanimi_2,tulbanimi_3) values (2001,'head aega!',6.022);
INSERT INTO tabelinimi (tulbanimi_1,tulbanimi_2,tulbanimi_3) values (2010,'head aega!',1.602176);
SELECT * FROM tabelinimi ;
SELECT tulbanimi_1, tulbanimi_2 FROM tabelinimi WHERE tulbanimi_2 LIKE 'head%' ;
SELECT tulbanimi_1, tulbanimi_2 FROM tabelinimi WHERE tulbanimi_2 LIKE 'head%' LIMIT 2;
DELETE FROM tabelinimi WHERE tulbanimi_1=2001 ;
SELECT * FROM tabelinimi ;
DROP TABLE tabelinimi;


Transaktsioonid