By Alvin Alexander. Last updated: September 27, 2022
SQLite FAQ: How do I create comments in SQLite?
SQLite lets you create comments using two different constructs, either two hyphens in sequence ("--"), or the "/.../" C-style comments. Here are examples of each approach, with the SQLite comments preceding the two database table definitions:
-- -- salespeople -- CREATE TABLE salespeople ( id INTEGER PRIMARY KEY, first_name TEXT NOT NULL, last_name TEXT NOT NULL, commission_rate REAL NOT NULL ); /* * customers */ CREATE TABLE customers ( id INTEGER PRIMARY KEY, company_name TEXT NOT NULL, street_address TEXT NOT NULL, city TEXT NOT NULL, state TEXT NOT NULL, zip TEXT NOT NULL );
Although the C-style comments are made for multiline comments, I actually prefer the --
approach myself, but either one is fine.