SQL 1 - Einführung, Datendefinition und -manipulation Flashcards

1
Q

Tabelle Erzeugen

A

CREATE TABLE < Tabellenname > (< Spaltenname1 > < Datentyp 1 >, < Spaltenname2 > < Datentyp2 >,…);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Tabelle Erzeugen (Mit Primärschlüssel)

A

CREATE TABLE < Tabellenname > ( < Spaltenname1 > < Datentyp 1 > PRIMARY KEY, …);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Zusammengesetzter Primärschlüssel

A

CREATE TABLE (< Spaltenname1 > < Datentyp 1 > PRIMARY KEY(< Spaltenname2 > < Datentyp2 >…),…));

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Eindeutige Attribute

A

UNIQUE Schlüsselwort nach dem Datentyp beim erzeugen der Tabelle hinzufügen

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Attribute, die nicht NULL enthalten dürfen (z.B. ID)

A

NOT NULL Schlüsselwort nach dem Datentyp beim erzeugen der Tabelle hinzufügen

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Fremdschlüssel

A

CREATE TABLE < Tabellenname >( < Spaltenname1 > < Datentyp1 > REFERENCES < TabellennameP > (< SpaltennameP >),…);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Anlegen von Tupeln in Tabelle

A

INSERT INTO < Tabelle > (< Spaltenname1 >, < Spaltenname2 >,…) VALUES ( < Wert1 > , < Wert2 > ,…);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Ändern von Tupeln

A

UPDATE < Tabelle > SET < Attribut > = < neuer Wert > WHERE < Bedingung > ;

WHERE ist hier optional

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Löschen von Tupeln

A

DELETE FROM < Tabelle > WHERE < Bedinung >;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Bedingungen

A

WHERE < Attribut > = < Wert >;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly