Datenbanksysteme: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Oily (Diskussion | Beiträge) |
Omega (Diskussion | Beiträge) |
||
Zeile 1: | Zeile 1: | ||
* [[Datenbanksysteme:Prüfungsschwerpunkte|Prüfungsschwerpunkte]] | * [[Datenbanksysteme:Prüfungsschwerpunkte|Prüfungsschwerpunkte]] | ||
+ | |||
+ | ==== CREATE TABLE ==== | ||
+ | |||
+ | <pre> | ||
+ | CREATE TABLE tbl_name | ||
+ | ( | ||
+ | [ col_name type [NOT NULL | NULL] [DEFAULT default_value] [AUTO_INCREMENT] [ UNIQUE [KEY] | [PRIMARY] KEY] | ||
+ | | PRIMARY KEY [index_type] (index_col_name,...) | ||
+ | | FOREIGN KEY (index_col_name,...) [REFERENCES tbl_name [(index_col_name,...)]] | ||
+ | ] | ||
+ | , | ||
+ | ... | ||
+ | ); | ||
+ | </pre> | ||
+ | |||
+ | * [http://dev.mysql.com/doc/refman/5.0/en/create-table.html Soure(gekürzt)] | ||
+ | |||
+ | ==== SELECT ==== | ||
+ | |||
+ | <pre> | ||
+ | SELECT | ||
+ | [DISTINCT] | ||
+ | select_expr, ... | ||
+ | [FROM table_references | ||
+ | [WHERE where_condition] | ||
+ | [GROUP BY {col_name | expr | position} | ||
+ | [ASC | DESC], ... [WITH ROLLUP]] | ||
+ | [HAVING where_condition] | ||
+ | [ORDER BY {col_name | expr | position} | ||
+ | [ASC | DESC], ...] | ||
+ | </pre> | ||
+ | |||
+ | * [http://dev.mysql.com/doc/refman/5.0/en/select.html Soure(gekürzt)] | ||
+ | |||
+ | ==== INSERT ==== | ||
+ | |||
+ | <pre> | ||
+ | INSERT [INTO] tbl_name [(col_name,...)] | ||
+ | VALUES ({expr | DEFAULT},...),(...),... | ||
+ | |||
+ | Or: | ||
+ | INSERT [INTO] tbl_name | ||
+ | SET col_name={expr | DEFAULT}, ... | ||
+ | </pre> | ||
+ | |||
+ | * [http://dev.mysql.com/doc/refman/5.0/en/insert.html Source(gekürzt)] | ||
+ | |||
+ | ==== UPDATE ==== | ||
+ | |||
+ | <pre> | ||
+ | UPDATE table_references | ||
+ | SET col_name1=expr1 [, col_name2=expr2 ...] | ||
+ | [WHERE where_condition] | ||
+ | </pre> | ||
+ | |||
+ | * [http://dev.mysql.com/doc/refman/5.0/en/update.html Source(gekürzt)] | ||
+ | |||
+ | ==== DELETE ==== | ||
+ | |||
+ | <pre> | ||
+ | DELETE FROM tbl_name | ||
+ | [WHERE where_condition] | ||
+ | [ORDER BY ...] | ||
+ | [LIMIT row_count] | ||
+ | |||
+ | Multiple-table syntax: | ||
+ | DELETE | ||
+ | tbl_name[.*] [, tbl_name[.*]] ... | ||
+ | FROM table_references | ||
+ | [WHERE where_condition] | ||
+ | |||
+ | Or: | ||
+ | DELETE | ||
+ | FROM tbl_name[.*] [, tbl_name[.*]] ... | ||
+ | USING table_references | ||
+ | [WHERE where_condition] | ||
+ | </pre> | ||
+ | |||
+ | ka welchen wir hatten. | ||
+ | |||
+ | * [http://dev.mysql.com/doc/refman/5.0/en/delete.html Source(gekürzt)] |
Version vom 8. Februar 2006, 14:37 Uhr
CREATE TABLE
CREATE TABLE tbl_name ( [ col_name type [NOT NULL | NULL] [DEFAULT default_value] [AUTO_INCREMENT] [ UNIQUE [KEY] | [PRIMARY] KEY] | PRIMARY KEY [index_type] (index_col_name,...) | FOREIGN KEY (index_col_name,...) [REFERENCES tbl_name [(index_col_name,...)]] ] , ... );
SELECT
SELECT [DISTINCT] select_expr, ... [FROM table_references [WHERE where_condition] [GROUP BY {col_name | expr | position} [ASC | DESC], ... [WITH ROLLUP]] [HAVING where_condition] [ORDER BY {col_name | expr | position} [ASC | DESC], ...]
INSERT
INSERT [INTO] tbl_name [(col_name,...)] VALUES ({expr | DEFAULT},...),(...),... Or: INSERT [INTO] tbl_name SET col_name={expr | DEFAULT}, ...
UPDATE
UPDATE table_references SET col_name1=expr1 [, col_name2=expr2 ...] [WHERE where_condition]
DELETE
DELETE FROM tbl_name [WHERE where_condition] [ORDER BY ...] [LIMIT row_count] Multiple-table syntax: DELETE tbl_name[.*] [, tbl_name[.*]] ... FROM table_references [WHERE where_condition] Or: DELETE FROM tbl_name[.*] [, tbl_name[.*]] ... USING table_references [WHERE where_condition]
ka welchen wir hatten.