Sample Exam Questions
※This sample exam is different from those that appear in the actual OSS-DB Exam.
2024/05/01
While it is ideal to carefully design your table definitions in advance and make as few changes as possible after creating them with CREATE TABLE, the ALTER TABLE command is available for when changes are necessary, allowing you to modify most of the elements that can be specified with CREATE TABLE.
To change the name of a table, you would use ALTER TABLE old_name RENAME TO new_name. To change the owner, you would use ALTER TABLE table_name OWNER TO new_owner.
The name of a column can be changed with ALTER TABLE old_name RENAME old_column_name TO new_column_name.
The data type of a column can be changed with ALTER TABLE table_name ALTER column_name SET DATA TYPE new_type.
The order of the columns, which affects the order in which they are displayed when performing a search like SELECT * FROM table_name, cannot be changed with ALTER TABLE in PostgreSQL (although some RDBMSs do allow this). The order of column display is controlled by explicitly specifying the columns, as in SELECT column1, column2...
So the correct answer is E.
Of course, caution is required when executing ALTER TABLE due to its potential to significantly impact existing data. Additionally, it's important to note that there can be many subtle differences in syntax between different types of RDBMSs.
© EDUCO All Rights Reserved.