NO is not a stand-alone command. Instead, it appears immediately before an option name (or as a literal value) to indicate that the associated feature is turned off, prohibited, or evaluates to FALSE. In the SQL Standard and in most major dialects, the keyword is seen in constructs such as:- Referential-integrity actions: ON DELETE NO ACTION / ON UPDATE NO ACTION (do nothing, leave child rows unchanged)- Sequence definitions: NO CYCLE, NO CACHE, NO ORDER (disable looping, caching, or ordering)- Locking hints: NOWAIT (derived from NO WAIT)- Boolean literals (PostgreSQL accepts NO as FALSE)- Dialect-specific session settings (SQL Server SET NOCOUNT ON treats NOCOUNT as the negation of COUNT)Because NO is context-sensitive, its exact behavior depends on the object it modifies. It does not accept parameters, nor can it be executed independently. Instead, it flips a default that would otherwise be YES, TRUE, ON, or the feature’s implicit state.
NO ACTION, NO CYCLE, NO CACHE, BOOLEAN Literals, YES, FALSE
SQL-92 (NO ACTION in foreign-key constraints)
Only PostgreSQL and a few extensions do. Most databases require FALSE, 0, or OFF.
Use NO ACTION when you want to forbid deletes or updates that would orphan child rows, while still allowing you to defer the check until commit (if your DBMS supports deferrable constraints).
The nextval call raises an error instead of restarting at MINVALUE.
Functionally yes – both prevent values from being preallocated – but the preferred syntax is NO CACHE.