Two lockers must not share a label. Keep labels required as before, and now protect their uniqueness too.
This exercise starts without tables. The following dictionaries describe the tables to create, not preloaded tables.
lockersOne row represents one locker.
| Field / SQL type | Meaning | Rules |
|---|---|---|
locker_id · integer | Identifier of the locker. | Primary key. Required; cannot be NULL. |
label · text | Readable locker label. | Unique. Required; cannot be NULL. |
Write your query in script.sql. Use Run to inspect it, then Submit.
Apply UNIQUE to the label as well as the already familiar NOT NULL rule.