Check out example codes for "delete all records from table except sql". It will help you in understanding the concepts better.

Code Example 1

delete from yourTableName where yourColumnName NOT
IN(‘yourValue1’,‘yourValue2’,‘yourValue3’,.........N);

Learn ReactJs, React Native from akashmittal.com