SQL Flashcards Preview

Business Information Management > SQL > Flashcards

Flashcards in SQL Deck (13)
Loading flashcards...
1

To set up a table

CREATE TABLE table name (column 1, column 2, ...)

2

To delete table

DROP TABLE table name

3

add a column

ALTER TABLE table name ADD COLUMN column name

4

Drop a column

ALTER TABLE table name DROP COLUMN column name

5

create a primary key

CREATE TABLE table name (column 1 data type PRIMARY KEY)

6

add a row

INSERT INTO table name VALUES (value column 1, value column 2)

7

add a specific value to a column

INSERT INTO table name (column name1, ..) VALUES (column value1, ..)

8

Delete contents of a column

DELETE FROM table name WHERE column name

9

changes values in a table

UPDATE table name SET column name = new value WHERE column name = old value

10

find specific rows

SELECT*FROM table name WHERE column name = value

11

to find all distinct (combinations of) column values

SELECT DISTINCT column name FROM table name

12

avg or max etc

SELECT AVG (column name) FROM table name

13

Order certain values

SELECT *FROM table name ORDER BY column name