+ 2
CREATE TABLE IF NOT EXISTS Languages ( id INTEGER PRIMARY KEY, name TEXT ); To insert rows into the table only if it is empty, you can use the following syntax: INSERT INTO Languages (id, name) SELECT 1, 'c' WHERE (SELECT COUNT(*) FROM Languages) = 0 UNION ALL SELECT 2, 'c++' WHERE (SELECT COUNT(*) FROM Languages) = 0 UNION ALL SELECT 3, 'html' WHERE (SELECT COUNT(*) FROM Languages) = 0 UNION ALL SELECT 4, 'ruby' WHERE (SELECT COUNT(*) FROM Languages) = 0 UNION ALL SELECT 5, 'php' WHERE (SELECT COUNT(*) FROM Languages) = 0;
9th Jan 2023, 7:17 PM
Aditya Dixit