Hi there!

You need to be logged in to view this course.

Concept: Constraints

We have a number of constraints on our table and we really should understand what they do at a deeper level. In this video we'll dive into the constraint code below.

create table inms(
  id bigserial primary key,
  created_at timestamp not null,
  altitude numeric(9,2) not null check(altitude > 0),
  source text not null check(source in('osi','csn','osnb','osnt'))
  mass numeric(6,3) not null check(mass >=0.125 and mass < 100),
  high_sensitivity_count int not null check(high_sensitivity_count > 0),
  low_sensitivity_count int not null check(low_sensitivity_count > 0)