flights(Airline,From,To,Departs,Arrives)with the sample data:
flights('UA','SF','DEN',930,1230). flights('AA','SF','DAL',900,1430). flights('UA','DEN','CHI',1500,1800). flights('UA','DEN','DAL',1400,1700). flights('AA','DAL','CHI',1530,1730). flights('AA','DAL','NY',1500,1930). flights('AA','CHI','NY',1900,2200). flights('UA','CHI','NY',1830,2130).
Write (a) Prolog programs and (b) Procedural programs (using embedded-SQL or JDBC or SQLJ) with a suitable user interface to answer the following queries:
create table flights ( airline char(2), dcity char(3), acity char(3), dtime integer, atime integer);and populate the table using the following statements:
insert into flights values ('UA','SF','DEN',930,1230). insert into flights values ('AA','SF','DAL',900,1430). insert into flights values ('UA','DEN','CHI',1500,1800). insert into flights values ('UA','DEN','DAL',1400,1700). insert into flights values ('AA','DAL','CHI',1530,1730). insert into flights values ('AA','DAL','NY',1500,1930). insert into flights values ('AA','CHI','NY',1900,2200). insert into flights values ('UA','CHI','NY',1830,2130).