Last active
October 26, 2022 06:24
-
-
Save marcopeg/f530da60fb2fd8408945a888ece0a82f to your computer and use it in GitHub Desktop.
Card deck db schema for PostgreSQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO "ranks" VALUES | |
('A'), ('K'), ('Q'), ('J'), ('1'), ('2'), ('3'), ('4'), ('5'), ('6'), ('7'), ('8'), ('9'), ('10'); | |
INSERT INTO "suits" VALUES | |
('♥️'), ('♠️'), ('♣️'), ('♦️'); | |
INSERT INTO "brands" VALUES | |
('b1'), ('b2'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE "ranks" ( | |
"name" TEXT PRIMARY KEY | |
); | |
CREATE TABLE "suits" ( | |
"name" TEXT PRIMARY KEY | |
); | |
CREATE TABLE "brands" ( | |
"name" TEXT PRIMARY KEY | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM "ranks" | |
CROSS JOIN "suits" | |
CROSS JOIN "brands"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DBFiddle:
https://www.db-fiddle.com/f/eo9h9Dd3AGEEVhrHG5S595/3