Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Primary keys – the basics
Single-column primary keys
Multi-column primary keys
NOT NULL
Review
26. Question 2

Instruction

100% correct! Are you ready for the second task?

Exercise

We want a table called parcel which will register pieces of land within our country. The table has the following columns:

  • city – up to 25 characters and NOT NULL.
  • street – up to 25 characters.
  • num – an integer.
  • area – an integer number.

The first three columns constitute a multi-column primary key.

Stuck? Here's a hint!

Type:

CREATE TABLE parcel (
  city varchar(25) NOT NULL,
  street varchar(25),
  num integer,
  area integer,
  PRIMARY KEY(city, street, num)
);