Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Modifying table structure
Adding NOT NULL constraints
Summary
13. Question 2

Instruction

Nicely done! Just one more exercise ahead. Can you make it all the way?

Exercise

We have a table named language with the following columns: iso_code (varchar, primary key), english_name (varchar) and native_name (varchar).

Add column alphabet to table language. It should be a text column with a maximum length of 32 characters. Set its value to 'Latin' for all existing rows. Add a NOT NULL constraint.

Stuck? Here's a hint!

Type:

ALTER TABLE language ADD COLUMN alphabet varchar(32);
UPDATE language SET alphabet = 'Latin';
ALTER TABLE language ALTER COLUMN alphabet SET NOT NULL;