--- Get all unique values of columnSELECT DISTINCT column
FROM table
--- Get unique values of column and the count for eachSELECT column, COUNT(column)
FROM table
GROUP BY column
-- Get count of distinct values in columnSELECTCOUNT(DISTINCT column)
FROM table
-- Count number of rows that satisfy conditions (e.g. column>0, column=10)SELECTCOUNT(*)
FROM table
WHERE condition1
AND condition2
-- List all columns for the table in DBNAME..TABLENAME
USE DBNAME
SELECT COLUMN_NAME FROMINFORMATION_SCHEMA.COLUMNSWHERE TABLE_NAME='TABLENAME'ORDER BY COLUMN_NAMEsqlite3 chat.db
.tables
PRAGMA table_info(table_name);
exit;