summaryrefslogtreecommitdiff
path: root/dbschema.sql
diff options
context:
space:
mode:
Diffstat (limited to 'dbschema.sql')
-rw-r--r--dbschema.sql21
1 files changed, 21 insertions, 0 deletions
diff --git a/dbschema.sql b/dbschema.sql
new file mode 100644
index 0000000..b46aa88
--- /dev/null
+++ b/dbschema.sql
@@ -0,0 +1,21 @@
+-- Could have saved two table here. But having them avoids redundancy as well as
+-- make it possible for future enhancements.
+
+CREATE TABLE artist (
+ name varchar(200) NOT NULL,
+ PRIMARY KEY(name)
+);
+
+CREATE TABLE song (
+ title varchar(200) NOT NULL,
+ album varchar(200),
+ artistname varchar(200),
+ genrename varchar(200),
+ year int,
+ PRIMARY KEY(title, artistname, year)
+);
+
+CREATE TABLE genre (
+ name varchar(200) NOT NULL,
+ PRIMARY KEY(name)
+)