WEEK 6 Flashcards
(6 cards)
Question: What is the purpose of the ALTER TABLE command?
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.
Question: What are the keywords used with the ALTER TABLE command?
Answer: The keywords used with the ALTER TABLE command are ADD, MODIFY, and DROP.
Question: How is the data type and data characteristics of a column changed using the ALTER TABLE command?
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)).
Question: How is a column added using the ALTER TABLE command?
Answer: To add a column, the ALTER TABLE and ADD keywords are used. The NOT NULL clause is not included for the new column.
Question: How is a column dropped using the ALTER TABLE command?
Answer: To drop a column, the ALTER TABLE and DROP keywords are used. Some RDBMSs impose restrictions on the deletion of an attribute.
Question: What is the purpose of the UPDATE command?
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.