A laboratory uses the following PostgreSQL table:
CREATE TABLE Specimen ( sample_id INTEGER PRIMARY KEY, label VARCHAR(12) NOT NULL, mass_g DECIMAL(5,2) DEFAULT 0.00 );
The table initially contains exactly one row: sample_id 91, label 'Control', and mass_g 1.25. Evaluate each proposed statement independently against that initial state.
Which statements successfully add a new row with sample_id 92, label 'Trial', and mass exactly 3.50 g? Select every statement that meets the complete request.
INSERT INTO Specimen (mass_g, sample_id, label) VALUES (3.50, 92, 'Trial');
INSERT INTO Specimen (sample_id, label, mass_g) VALUES (92, NULL, 3.50);
INSERT INTO Specimen (sample_id, label) VALUES (92, 'Trial');
INSERT INTO Specimen VALUES (92, 'Trial', 3.50);
INSERT INTO Specimen (sample_id, label, mass_g) VALUES (91, 'Trial', 3.50);
Unlock full course notes by signing up
Choosing types by field meaning
A warehouse is defining columns for inspection records. Match each SQL declaration to the field requirement it best represents, preserving the stated meaning and capacity rather than relying only on how sample values look.
A default is not a missing-value rule
A museum plans this column declaration for a new table:
Staff require explicitly supplied NULL values to be rejected, while an empty text string may remain valid. Which two-keyword SQL clause should be added to the declaration?
Reusing part of a unique pair
A workspace uses the following SQL definition to identify desks within different sites. A desk number may be reused at another site.
The table currently contains exactly these rows:
For each candidate row below, enter yes if insertion is permitted or no if it is rejected. Test every candidate independently against the original three rows; no candidate is actually added. There are no other constraints or triggers.
Counting permitted equipment plans
An equipment-rental company stores proposed allocations of its fleet using this SQL table definition. Counts are whole numbers of equipment units. Equipment not loaned or held in reserve may remain idle.
Consider a new plan with total_units equal to 12 and an unused plan_id. There are no other constraints or triggers. SQL BETWEEN includes both endpoints.
Find the maximum permitted loaned_units, in equipment units, and the number of distinct integer pairs (loaned_units, reserve_units) that satisfy every constraint. Report both answers as exact integers.