Prepare the report input
Original synthetic tolerance accepts integer deviations with magnitude at most two. delta<=2 bounds only the positive side and admits −5. BETWEEN -2 AND 2 bounds both sides without an absolute-value calculation; this is an example threshold, not an engineering standard.
Every record and report rule below is original and fictional. Reproduce the setup in a fresh SQLite test database; input previews include every table in this small fixture.
| id | delta |
|---|---|
| A | -5 |
| B | -2 |
| C | 2 |
| D | 3 |
CREATE TABLE deviations(id TEXT PRIMARY KEY,delta INTEGER NOT NULL); INSERT INTO deviations VALUES('A',-5),('B',-2),('C',2),('D',3);Compare misleading and corrected results
SELECT id,delta FROM deviations WHERE delta<=2 ORDER BY id;| id | delta |
|---|---|
| A | -5 |
| B | -2 |
| C | 2 |
SELECT id,delta FROM deviations WHERE delta BETWEEN -2 AND 2 ORDER BY id;| id | delta |
|---|---|
| B | -2 |
| C | 2 |
The correction keeps −2 and +2, excludes −5 and +3. Signed raw deviations stay visible in the result.
Check a fresh boundary case
Add zero and the signed 64-bit minimum. Zero qualifies; the minimum is excluded by the lower bound without requiring abs of that extreme integer.
Recreate the original setup in another fresh database, then apply the change and corrected query below. For an empty result, the table displays a labelled empty-result marker rather than a data record.
INSERT INTO deviations VALUES('E',0),('F',-9223372036854775808);
SELECT id,delta FROM deviations WHERE delta BETWEEN -2 AND 2 ORDER BY id;| id | delta |
|---|---|
| B | -2 |
| C | 2 |
| E | 0 |
Does −5 qualify merely because it is below +2?
Show the worked answer
No. Its magnitude is five, above the supplied two-unit limit. The boundary values −2 and +2 both qualify.