Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Primary keys - the basics
Single-column primary keys
Multicolumn primary keys
Auto-increment columns and sequences
29. Revision #3


Nice! There is one more task to go.


Create a table foreign_student which will keep track of students coming from abroad. Consider the following columns:

  • id - integer, primary key,
  • first_name and last_name - up to 32 characters long each,
  • year_born integer.
Mind the following: the university always assigns an id number for foreign students with the digit 9 at the end. This allows for quick identification of students coming from abroad. Use an IDENTITY to help you generate such numbers.

Stuck? Here's a hint!


CREATE TABLE foreign_student (
    id int identity(9,10) primary key,
    first_name varchar(32),
    last_name varchar(32),
    year_born int