June 2018
Beginner to intermediate
210 pages
5h 12m
English
Once a table is created, we can still modify its metadata, such as adding new columns and changing the column's data type. In HQL, we use the ALTER command to modify the table's metadata. However, alter table is not able to update the data accordingly. We should make sure the actual data conforms to the metadata definition manually, otherwise the query will return nothing in expectation.
The following are examples for altering tables in HQL:
> ALTER TABLE cte_employee RENAME TO cte_employee_backup; No rows affected (0.237 seconds)
> ALTER TABLE c_employee SET TBLPROPERTIES ('comment'='New ...