Tables Flashcards

1
Q

Creating a Table

A

CREATE TABLE table_name();

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

Define Three Columns

A

column_name DATA_TYPE,
column_name DATA_TYPE,
column_name DATA_TYPE

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

Define a Column as an Integer

A

column_name INT

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

Define a Column as a Variable Character

A

column_name VARCHAR(# of chars.)

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

Define a Column as a Decimal

A

column_name DECIMAL(# of total digits, # of digits after decimal point)

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

Look at a Table Schema

A

DESCRIBE table_name;

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

Delete Table

A

DROP TABLE table_name;

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

Add Column to Table

A

ALTER TABLE table_name ADD column_name DATA_TYPE;

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

Remove Column from Table

A

ALTER TABLE table_name DROP column_name;

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

Set Primary Key

A

column_name DATA_TYPE PRIMARY KEY

or

PRIMARY KEY column_name

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

Look at Specific Table Columns

A

SELECT column_name, column_name, etc. FROM table_name

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

Look at All Table Columns

A

SELECT * FROM table_name

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

Add Data to Table

A

INSERT INTO table_name(column_name1, column_name2) VALUES(numerical_value1, ‘string_value2’);

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