WEEK 6 Flashcards

(6 cards)

1
Q

Question: What is the purpose of the ALTER TABLE command?

A

Answer: The ALTER TABLE command is used to make changes in the table structure such as adding a column, modifying column characteristics, or deleting a column. It can also be used to add or remove table constraints.

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

Question: What are the keywords used with the ALTER TABLE command?

A

Answer: The keywords used with the ALTER TABLE command are ADD, MODIFY, and DROP.

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

Question: How is the data type and data characteristics of a column changed using the ALTER TABLE command?

A

Answer: The ALTER TABLE command is used to change the data type and characteristics of a column. The syntax for changing the data type is ALTER TABLE tablename MODIFY (columnname(datatype)). The syntax for changing the data characteristic is ALTER TABLE tablename MODIFY (columnname(characteristic)).

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

Question: How is a column added using the ALTER TABLE command?

A

Answer: To add a column, the ALTER TABLE and ADD keywords are used. The NOT NULL clause is not included for the new column.

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

Question: How is a column dropped using the ALTER TABLE command?

A

Answer: To drop a column, the ALTER TABLE and DROP keywords are used. Some RDBMSs impose restrictions on the deletion of an attribute.

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

Question: What is the purpose of the UPDATE command?

A

Answer: The UPDATE command is used to update data in existing rows. If a relationship is established between entries and existing columns, the relationship can assign values to appropriate slots.

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