CSc 8710 Deductive Databases and Logic Programming
Fall 2008
Assignment #5 (Part of Exam 3 Grade)
December 9, 2008 (Tuesday) - STRICT DEADLINE
Consider the following Deductive Database and Query:
sflat(X,Y) :- flat(X,Y). sflat(X,Y) :- flat(Y,X). rsg(X,Y) :- sflat(X,Y). rsg(X,Y) :- up(X,X1), rsg(Y1,X1), down(Y1,Y). query(X) :- rsg(a,X).
The base tables in Oracle have the following schema:
create table up ( per1 varchar2(10), per2 varchar2(10)); create table flat ( per1 varchar2(10), per2 varchar2(10)); create table down ( per1 varchar2(10), per2 varchar2(10));and sample data is:
insert into up values ('a','e'). insert into up values ('a','f'). insert into up values ('f','m'). insert into up values ('g','n'). insert into up values ('h','n'). insert into up values ('i','o'). insert into up values ('j','o'). insert into flat values ('g','f'). insert into flat values ('m','n'). insert into flat values ('m','o'). insert into flat values ('p','m'). insert into down values ('l','f'). insert into down values ('m','f'). insert into down values ('g','b'). insert into down values ('h','c'). insert into down values ('i','d'). insert into down values ('p','k').Medium Data Set
JDBC Connect String: Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@tinman.cs.gsu.e du:1521:tinman",user,pass);Oracle JDBC Driver