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

Instruction

Good job! Let's try another exercise.

Exercise

Add a new column rating (a column that stores a single character) to the store table. It should have a value of 'A' for all existing rows. Add a NOT NULL constraint to it.

Stuck? Here's a hint!

Type:

ALTER TABLE store ADD COLUMN rating varchar(1);
UPDATE store SET rating = 'A';
ALTER TABLE store ALTER COLUMN rating SET NOT NULL;