DDL Flashcards

1
Q

ALTER Syntax to Add Column

A

ALTER TABLE table_1

ADD COLUMN column_1 INT

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

ALTER Syntax to Drop column

A

ALTER TABLE table_1

DROP COLUMN column_1

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

SAFE UPDATES

A

SET SQL_SAFE_UPDATES = 0;

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

Steps to Alter

A
  1. Alter table

2. Update table

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

ALTER command

A

Add and Remove table Columns

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

CHANGE command

A

Modify table columns

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

CHANGE Syntax

A

ALTER TABLE table_1

CHANGE COLUMN old_column_name New_column_name INT;

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

CHANGE syntax structure

A
  1. Old Column name
  2. New Column name
  3. New Data Type
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

ALTER and Change

A
  1. Alter table

2. Change column

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

FLOAT vs INT

A

Float includes decimals. Useful for Cost/Price.

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

CREATE Command

A

Generate New tables

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

DROP command

A

removes table from a database

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

CREATE TABLE syntax

A
CREATE TABLE table_name_(
column_1 data_type,
column_2 data_type, 
column_3 data_type
);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

CHAR vs VARCHAR

A
  1. Char=fixed length string(can contain letters, numbers, and special characters)
  2. VARCHAR=variable length string (can contain letters, numbers, and special characters)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

CREATE DATABASE Syntax

A

CREATE DATABASE database_name;

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

DROP Statement

A

Used to delete databases, tables, and columns.

17
Q

DROP Syntax

A

DROP TABLE table_1;

DROP DATABASE database_name;

18
Q

TRUNCATE command

A

remove all data from a table

19
Q

To convert a column to a new data type, you only need to list the new data type, not the old one.

A

True