Re: Small typographical mistake

Hi Fabian,

Thank you for your comments. I have incorporated this change [1].

[1] http://www.w3.org/2001/sw/rdb2rdf/directMapping/



Juan Sequeda
+1-575-SEQ-UEDA
www.juansequeda.com


On Mon, Oct 10, 2011 at 10:17 AM, Fabian Pijcke <fabian.pijcke@gmail.com>wrote:

> Dear list,
>
> In section 2.2 of "A direct mapping of relational data to RDF", the
> following snippet of code can't be executed because "Department" is
> mispelled:
>
> CREATE TABLE Addresses (
> 	ID INT,
> 	city CHAR(10),
> 	state CHAR(2),
> 	PRIMARY KEY(ID)
> )
>
> CREATE TABLE Deparment (
> 	ID INT,
> 	name CHAR(10),
> 	city CHAR(10),
> 	manager INT,
> 	PRIMARY KEY(ID),
> 	UNIQUE (name, city),
> 	FOREIGN KEY(manager) REFERENCES People(ID)
> )
>
> CREATE TABLE People (
> 	ID INT,
> 	fname CHAR(10),
> 	addr INT,
> 	deptName CHAR(10),
> 	deptCity CHAR(10),
> 	PRIMARY KEY(ID),
> 	FOREIGN KEY(addr) REFERENCES Addresses(ID),
> 	FOREIGN KEY(deptName, deptCity) REFERENCES Department(name, city)
> )
>
> In addition, the two last tables uses "cross" foreign keys (Department
> points to People, and People points to Department)
>
> This is embarassing because one can't just copy and paste the SQL code to
> make some experiments (which is what I want to do), I propose the following
> code to replace it:
>
> CREATE TABLE Addresses (
> 	ID INT,
> 	city CHAR(10),
> 	state CHAR(2),
> 	PRIMARY KEY(ID)
> );
>
> CREATE TABLE Department (
> 	ID INT,
> 	name CHAR(10),
> 	city CHAR(10),
> 	manager INT,
> 	PRIMARY KEY(ID),
> 	UNIQUE (name, city)
> 	-- , FOREIGN KEY(manager) REFERENCES People(ID) -- [added below]
> );
>
> CREATE TABLE People (
> 	ID INT,
> 	fname CHAR(10),
> 	addr INT,
> 	deptName CHAR(10),
> 	deptCity CHAR(10),
> 	PRIMARY KEY(ID),
> 	FOREIGN KEY(addr) REFERENCES Addresses(ID),
> 	FOREIGN KEY(deptName, deptCity) REFERENCES Department(name, city)
> );
>
> ALTER TABLE Department ADD FOREIGN KEY(manager) REFERENCES People(ID);
>
> I hope this may help ...
>
>
>
> Fabian Pijcke
>
>

Received on Tuesday, 15 November 2011 06:01:45 UTC