Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
6. Question 5
Summary

Instruction

Keep up the fantastic work! There's just one more exercise for you.

Exercise

We have a table named plant which consists of the following columns: id, latin_name, and english_name. Our task is to make the table more useful for biologists by adding more information to it.

Keeping the following requirements in mind, add column use_by_humans to table plant:

  1. It should be a text column with up to 32 characters.
  2. Its value should be 'none' for all existing rows.
  3. It should have the NOT NULL constraint.

Stuck? Here's a hint!

Type:

ALTER TABLE plant ADD COLUMN use_by_humans VARCHAR(32);
UPDATE plant SET use_by_humans = 'none';
ALTER TABLE plant ALTER COLUMN use_by_humans SET NOT NULL;