Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Modifying columns
Modifying identities
Modifying sequences
Summary
13. Summary

Instruction

It's time to wrap things up! What did we learn?

  1. We only recommend modifying a column by extending the same type (e.g., varchar(32) to varchar(64)). To do so, you can use:
    ALTER TABLE artwork ALTER COLUMN title SET DATA TYPE varchar(64);
  2. To add auto-generation of an identity, use:
    ALTER TABLE country ALTER COLUMN id ADD GENERATED ALWAYS AS IDENTITY;
    Similarly, to delete auto-generation of an identity, use:
    ALTER TABLE country ALTER COLUMN id DROP IDENTITY;
  3. To start a sequence over with a given value, use:
    ALTER SEQUENCE car_sequence RESTART WITH 1;
  4. To remove a sequence, use:
    DROP SEQUENCE car_sequence;

How about a short quiz now?

Exercise

Click Next exercise to continue.