?-dynamic(relation/4).
relation(p,[name],[string],
         [["Atlanta"],["Duluth"],["Wichita"],["Dodge City"]]).
relation(q,[name],[string],
         [["Atlanta"],["Duluth"],["Wichita"],["Dodge City"]]).
relation(c2,[city],[string],
         [["Carson City"],["Duluth"],["Chennai"]]).
relation(
  suppliers,
  [sno,sname,city],
  [string,string,string],
  [["S1","Jones","Atlanta"],
   ["S2","Smith","Duluth"],
   ["S3","Blake","Marietta"]]
).
relation(
  parts,
  [pno,pname,color,city],
  [string,string,string,string],
  [["P1","Nut","Red","Duluth"],
   ["P2","Bolt","Blue","Marietta"],
   ["P3","Screw","Red","Dunwoody"],
   ["P4","Axle","Green","Marietta"]]
).
relation(
  projects,
  [jno,jname,city],
  [string,string,string],
  [["J1","Bicycles","Duluth"],
  ["J2","Motorcycles","Dunwoody"]]
).
relation(
  spj,
  [sno,pno,jno,qty],
  [string,string,string,number],
  [["S1","P1","J1",100],
   ["S1","P2","J2",100],
   ["S1","P1","J2",100],
   ["S2","P1","J1",100],
   ["S2","P3","J1",100],
   ["S2","P3","J2",100],
   ["S3","P1","J1",100],
   ["S3","P2","J2",100]]
).

?-dynamic(relation/4).
relation(
  movies,
  [title,director],
  [string,string],
  [
    ["Godfather","Coppola"],
    ["Godfather II","Coppola"],
    ["Frenzy","Hitchcock"],
    ["Ran","Kurosawa"],
    ["Ran II","Kurosawa"],
    ["Nora Inu","Kurosawa"],
    ["Inubue","Kikushima"]
  ]
).

relation(
  actors,
  [title,actor],
  [string,string],
  [
    ["Godfather","Brando"],
    ["Godfather","Duvall"],
    ["Godfather","Pacino"],
    ["Godfather II","Brando"],
    ["Godfather II","Duvall"],
    ["Godfather II","Stewart"],
    ["Frenzy","Hitchcock"],
    ["Frenzy","Stewart"],
    ["Ran","Nakadai"],
    ["Ran","Nezu"],
    ["Ran","Terao"],
    ["Ran II","Brando"],
    ["Ran II","Duvall"],
    ["Ran II","Hitchcock"],
    ["Ran II","Nakadai"],
    ["Ran II","Pacino"],
    ["Ran II","Stewart"],
    ["Ran II","Sugawara"],
    ["Nora Inu","Akari"],
    ["Nora Inu","Nezu"],
    ["Nora Inu","Terao"],
    ["Nora Inu","Watari"],
    ["Inubue","Nezu"],
    ["Inubue","Sugawara"],
    ["Inubue","Terao"]
  ]
).

relation(
  theaters,
  [tname,address,phone],
  [string,string,string],
  [
    ["Odeon","123 Main Street","111-1111"],
    ["Plaza","234 Oak Street","111-1112"]
  ]
).

relation(
  plays,
  [tname,title,starttime],
  [string,string,string],
  [
    ["Odeon","Frenzy","9.00"],
    ["Odeon","Ran","8.00"],
    ["Plaza","Frenzy","9.00"],
    ["Plaza","Godfather","11.00"]
  ]
).

relation(
  student,
  [sno,sname],
  [number,string],
  [
    [111,"James"],
    [112,"John"],
    [113,"Sarah"],
    [114,"Emily"]
  ]
).
relation(
  course,
  [cno,subject],
  [string,string],
  [
    ["8710","Database"],
    ["6510","Automata"],
    ["6710","Database"]
  ]
).
relation(
  enroll,
  [sno,cno,grade],
  [number,string,string],
  [
    [111,"8710","A"],
    [111,"6510","B"],
    [112,"8710","B"],
    [112,"6710","A"],
    [112,"6510","C"],
    [113,"8710","C"]
  ]
).
