Codington
0 of 8 problems solved • 0%

Exercise prompt

Give a Service a Primary Key

Put PRIMARY KEY after a column type to make that column the identifier for each row. PostgreSQL then requires a value and rejects repeated IDs.

Example

CREATE TABLE jobs (id integer PRIMARY KEY, title text); INSERT INTO jobs VALUES (7, 'backup');

Your task

Create services with id integer as its primary key, followed by name text. Insert the service api with ID 10.

Opening the database…