Change types with ALTER COLUMN
The syntax for changing the data type of a column is straightforward. The following code changes the data type of the column_name column in table_name to varchar(10):
ALTER TABLE table_name
ALTER COLUMN column_name
TYPE varchar(10)
Now it's time to start adding constraints to your database.
Questo esercizio fa parte del corso
Introduction to Relational Databases in SQL
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
-- Select the university_shortname column
SELECT ___(___)
FROM professors;