Debian Codegraph @

test/syntax/source/code/sql

raw
1 BEGIN;
2 CREATE TABLE "topic" (
3 -- This is the greatest table of all time
4 "id" serial NOT NULL PRIMARY KEY,
5 "forum_id" integer NOT NULL,
6 "subject" varchar(255) NOT NULL -- Because nobody likes an empty subject
7 );
8 ALTER TABLE "topic" ADD CONSTRAINT forum_id FOREIGN KEY ("forum_id") REFERENCES "forum" ("id");
9
10 -- Initials
11 insert into "topic" ("forum_id", "subject") values (2, 'D''artagnian');
12
13 select /* comment */ count(*) from cicero_forum;
14
15 -- this line lacks ; at the end to allow people to be sloppy and omit it in one-liners
16 /*
17 but who cares?
18 */
19 COMMIT