From 2c2248ca950212551c5e15e3a050ca5744ff7069 Mon Sep 17 00:00:00 2001 From: Martin Goik <goik@hdm-stuttgart.de> Date: Tue, 16 Jun 2015 16:02:40 +0200 Subject: [PATCH] RDBMS schema error (int/char) --- P/Sda1/catalog2rdbms/Schema/schema.sql | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/P/Sda1/catalog2rdbms/Schema/schema.sql b/P/Sda1/catalog2rdbms/Schema/schema.sql index 5e6f83099..b4c82d7c2 100644 --- a/P/Sda1/catalog2rdbms/Schema/schema.sql +++ b/P/Sda1/catalog2rdbms/Schema/schema.sql @@ -8,7 +8,7 @@ CREATE TABLE Product ( ); CREATE TABLE Description ( - product CHAR(20) NOT NULL REFERENCES Product + product INTEGER NOT NULL REFERENCES Product ,orderIndex int NOT NULL -- preserving the order of descriptions belonging to a given product ,text VARCHAR(255) NOT NULL ,UNIQUE(product, orderIndex) @@ -17,11 +17,11 @@ CREATE TABLE Description ( -- example data corresponding to products.xml -- -- Product lacking age property -- -INSERT INTO Product (id, name) VALUES ('mpt', 'Monkey Picked Tea'); -INSERT INTO Description VALUES('mpt', 0, 'Picked only by specially trained monkeys'); -INSERT INTO Description VALUES('mpt', 1, 'Rare wild Chinese tea'); +INSERT INTO Product (id, name) VALUES (1, 'Monkey Picked Tea'); +INSERT INTO Description VALUES(1, 1, 'Picked only by specially trained monkeys'); +INSERT INTO Description VALUES(1, 2, 'Rare wild Chinese tea'); -INSERT INTO Product VALUES ('instantTent', '4-Person Instant Tent', 15); -INSERT INTO Description VALUES('instantTent', 0, 'Exclusive WeatherTec system.'); -INSERT INTO Description VALUES('instantTent', 1, '4-person, 1-room tent'); -INSERT INTO Description VALUES('instantTent', 2, 'Pre-attached tent poles'); +INSERT INTO Product VALUES (2, '4-Person Instant Tent', 15); +INSERT INTO Description VALUES(2, 0, 'Exclusive WeatherTec system.'); +INSERT INTO Description VALUES(2, 1, '4-person, 1-room tent'); +INSERT INTO Description VALUES(2, 2, 'Pre-attached tent poles'); -- GitLab