The Brush kit has been retired. Remove its row while preserving the gear table and all other equipment. Use its identifier so another item with a similar name would not be removed accidentally.
These tables are already loaded at the start of this lesson.
gearOne row represents one equipment catalog entry.
| Field / SQL type | Meaning | Rules |
|---|---|---|
gear_id · integer | Identifier of the equipment entry. | Primary key. Required; cannot be NULL. |
name · text | Equipment display name. | Required; cannot be NULL. |
category · text | Equipment grouping, such as repair, outdoors or art. | Required; cannot be NULL. |
fee · numeric(6,2) | Daily borrowing charge in currency units, stored to two decimal places. | Required; cannot be NULL. |
available · boolean | Whether the equipment is available to borrow: true or false. | Required; cannot be NULL. |
note · text | Optional handling note. | Nullable; NULL means no note is recorded. |
Only note may be missing. Category labels are sample values, not an enforced vocabulary. No currency code or nonnegative-fee constraint is declared; a fee is a daily charge, not a count of items.
The setup below is already loaded before each attempt. It is reference material, not code to paste into script.sql.
CREATE TABLE gear (
gear_id integer PRIMARY KEY,
name text NOT NULL,
category text NOT NULL,
fee numeric(6,2) NOT NULL,
available boolean NOT NULL,
note text
);
INSERT INTO gear VALUES
(1, 'Hand drill', 'repair', 4.00, true, NULL),
(2, 'Tent', 'outdoors', 12.00, true, 'Dry before return'),
(3, 'Saw', 'repair', 6.00, false, 'New blade'),
(4, 'Camp stove', 'outdoors', 6.00, true, NULL),
(5, 'Brush kit', 'art', 3.00, false, 'Wash bristles');
Edit script.sql, use Run to inspect the result, then Submit.
| gear_id | name |
|---|---|
| 1 | Hand drill |
| 2 | Tent |
| 3 | Saw |
| 4 | Camp stove |
DELETE with a primary-key predicate limits which row is removed.