# This script generates the sample database for Obligatory Exercise 2. # To use it first type the following two commands manually # create(Oblig2) # use(Oblig2) # then place this file in the newly created directory # database/Oblig2/source in the Leap directory, with .src as the # extension. For concreteness, assume that you have named the file # oblig2_leap.src. Then run the command # @ oblig2_leap # which will install the database. (In other words type @, followed # by a space, followed by the name of the file without the .src # extension. # If it is desired to have the database be "persistent," in the sense # that it will be available for subsequent invocations of Leap, issue # the command # set temporary off # before the create(Oblig2) command. # # If you prefer all lower case, just convert the entire script using your # favorite text editor. relation(Airport)((Code,String,3),(City,String,20),(Country,String,15),(Latitude,Integer,4),(Longitude,Integer,4)) relation(Airline)((Name,String,15),(Abbreviation,String,2),(HomeCountry,String,15),(Website,String,50)) relation(Flight)((Airline,String,2),(FlightNumber,String,4),(Origin,String,3),(Destination,String,3)) relation(Schedule)((Airline,String,2),(FlightNumber,String,4),(Date,String,10),(DepartureTime,String,4),(ArrivalTime,String,4)) relation(Ticket)((Number,Integer,3)(Airline,String,2),(FlightNumber,String,4),(Date,String,10),(Cost,Integer,4)) add(Airport)(ARN,Stockholm,Sweden,60,18) add(Airport)(UME,Umeċ,Sweden,67,18) add(Airport)(ORB,Örebro,Sweden,60,14) add(Airport)(GOT,Göteborg,Sweden,55,18) add(Airport)(MMX,Malmö,Sweden,52,18) add(Airport)(BMA,Stockholm,Sweden,52,18) add(Airport)(LYN,Lyon,France,46,5) add(Airport)(NCE,Nice,France,43,11) add(Airport)(CDG,Paris,France,48,2) add(Airport)(BOD,Bordeaux,France,44,0) add(Airport)(ORY,Paris,France,48,2) add(Airport)(JFK,New York,USA,40,-74) add(Airport)(IAD,Washington,USA,39,-77) add(Airport)(TUL,Tulsa,USA,36,-96) add(Airport)(LAX,Los Angeles,USA,34,-118) add(Airport)(BBI,Bhubaneswar,India,20,85) add(Airport)(BLR,Bangalore,India,12,77) add(Airport)(VNS,Varanasi,India,25,83) add(Airport)(BGO,Bergen,Norway,60,5) add(Airport)(KKN,Kirkenes,Norway,69,30) add(Airport)(LYR,Longyearbyen,Norway,78,16) add(Airport)(TRD,Trondheim,Norway,63,10) add(Airport)(GEN,Oslo,Norway,60,6) add(Airport)(LPA,Las Palmas,Spain,28,-15) add(Airport)(PMI,Palma Mallorca,Spain,39,3) add(Airport)(MAD,Madrid,Spain,39,3) add(Airport)(RHO,Rhodes,Greece,36,38) add(Airport)(SKG,Thessaloniki,Greece,40,22) add(Airport)(CHQ,Chania,Greece,35,24) add(Airport)(JNX,Naxos,Greece,37,25) add(Airport)(FRA,Frankfurt am Main,Germany,50,9) add(Airport)(MUC,München,Germany,48,12) add(Airport)(HAM,Hamburg,Germany,54,10) add(Airport)(TXL,Berlin,Germany,53,13) add(Airport)(THF,Berlin,Germany,53,13) add(Airport)(SXF,Berlin,Germany,53,13) add(Airline)(Scandinavian,SK,Sweden,http://www.sas.se) add(Airline)(AirBiscuit,ZZ,Bohemia,https://www.airbiscuit.com) add(Airline)(Delta,DL,USA,http://www.delta.com) add(Airline)(PamAm,PN,USA,http://www.flypanam.com) add(Airline)(Air France,AF,France,http://www.airfrance.com) add(Airline)(Aigle Azur,ZI,France,http://www.aigle-azur.fr) add(Airline)(Lufthansa,LH,Germany,http://www.lufthansa.com) add(Airline)(Linjeflyg,LZ,Sweden,http://www.linjeflyg.com) add(Airline)(FlyNordic,LF,Sweden,http://www.flynordic.com) add(Airline)(AirIndia,AI,India,http://www.airindia.com) add(Airline)(SAS Braathens,BU,Norway,http://www.sasbraathens.no) add(Airline)(Widerĝe,WF,Norway,http://www.wideroe.no) add(Airline)(IcelandAir,FI,Iceland,http://www.icelandair.is) add(Flight)(SK,0001,ARN,UME) add(Flight)(SK,0002,ARN,UME) add(Flight)(SK,0003,ARN,IAD) add(Flight)(SK,0004,UME,ARN) add(Flight)(SK,0005,UME,ARN) add(Flight)(SK,0006,ARN,IAD) add(Flight)(SK,0016,GOT,ARN) add(Flight)(SK,0007,MMX,ARN) add(Flight)(SK,0008,ARN,GOT) add(Flight)(SK,0009,ARN,MMX) add(Flight)(SK,0010,ARN,JFK) add(Flight)(SK,0028,ARN,UME) add(Flight)(SK,0034,ARN,UME) add(Flight)(SK,0029,UME,ARN) add(Flight)(SK,0035,UME,ARN) add(Flight)(SK,0030,GOT,ARN) add(Flight)(SK,0036,ARN,GOT) add(Flight)(SK,0232,ARN,IAD) add(Flight)(ZZ,0001,ARN,JFK) add(Flight)(ZZ,0002,CDG,LYN) add(Flight)(ZZ,0003,CDG,NCE) add(Flight)(ZZ,0004,JFK,NCE) add(Flight)(ZZ,0005,UME,ARN) add(Flight)(ZZ,0006,ARN,RHO) add(Flight)(ZZ,0007,ARN,SKG) add(Flight)(ZZ,0008,ARN,LPA) add(Flight)(DL,0001,JFK,CDG) add(Flight)(DL,0002,JFK,LYN) add(Flight)(DL,0003,CDG,JFK) add(Flight)(DL,0004,CDG,TUL) add(Flight)(DL,0005,ARN,ORB) add(Flight)(AI,0001,BLR,CDG) add(Flight)(AF,1234,CDG,LYN) add(Flight)(AF,1235,LYN,CDG) add(Flight)(AF,1244,ORY,LYN) add(Flight)(AF,1245,LYN,ORY) add(Flight)(AF,1264,LYN,NCE) add(Flight)(AF,1265,NCE,LYN) add(Flight)(AF,1334,CDG,NCE) add(Flight)(AF,1335,NCE,CDG) add(Flight)(AF,1344,ORY,NCE) add(Flight)(AF,1345,NCE,ORY) add(Flight)(LH,0101,FRA,CDG) add(Flight)(LH,0102,FRA,ORY) add(Flight)(LH,0103,FRA,LYN) add(Flight)(LH,0104,FRA,NCE) add(Flight)(LH,0105,FRA,BOD) add(Schedule)(SK,0003,12-11-2006,1158,1305) add(Schedule)(SK,0004,12-11-2006,1158,1305) add(Schedule)(SK,0005,12-11-2006,1158,1305) add(Schedule)(SK,0006,12-11-2006,1158,1305) add(Schedule)(SK,0007,12-11-2006,1158,1305) add(Schedule)(SK,0008,12-11-2006,1158,1305) add(Schedule)(SK,0009,12-11-2006,1158,1305) add(Schedule)(SK,0010,12-11-2006,1158,1305) add(Schedule)(SK,0003,14-11-2006,1158,1305) add(Schedule)(SK,0004,14-11-2006,1158,1305) add(Schedule)(SK,0005,14-11-2006,1158,1305) add(Schedule)(SK,0006,14-11-2006,1158,1305) add(Schedule)(SK,0007,14-11-2006,1158,1305) add(Schedule)(SK,0008,14-11-2006,1158,1305) add(Schedule)(SK,0009,14-11-2006,1158,1305) add(Schedule)(SK,0010,14-11-2006,1158,1305) add(Schedule)(SK,0001,23-12-2006,0855,1000) add(Schedule)(SK,0002,23-12-2006,1158,1305) add(Schedule)(SK,0003,23-12-2006,1158,1305) add(Schedule)(SK,0004,23-12-2006,1158,1305) add(Schedule)(SK,0005,23-12-2006,1158,1305) add(Schedule)(SK,0006,23-12-2006,1345,1605) add(Schedule)(SK,0007,23-12-2006,1158,1305) add(Schedule)(SK,0008,23-12-2006,1158,1305) add(Schedule)(SK,0009,23-12-2006,1158,1305) add(Schedule)(SK,0010,23-12-2006,1158,1305) add(Schedule)(SK,0007,26-12-2006,1158,1605) add(Schedule)(SK,0008,26-12-2006,1158,1605) add(Schedule)(SK,0009,26-12-2006,1158,1505) add(Schedule)(SK,0010,26-12-2006,1158,2305) add(Schedule)(ZZ,0001,12-11-2006,1000,2200) add(Schedule)(AI,0001,12-11-2006,0100,1245) add(Schedule)(SK,0001,12-11-2006,0855,1000) add(Schedule)(SK,0002,12-11-2006,1158,1305) add(Schedule)(SK,0001,13-11-2006,0855,1000) add(Schedule)(DL,0001,13-11-2006,0015,1505) add(Schedule)(DL,0001,14-11-2006,0045,1605) add(Schedule)(SK,0001,14-11-2006,0855,1000) add(Schedule)(SK,0002,14-11-2006,1158,1305) add(Ticket)(1,SK,0001,12-11-2006,100) add(Ticket)(2,SK,0002,12-11-2006,67) add(Ticket)(3,SK,0002,12-11-2006,90) add(Ticket)(4,SK,0003,12-11-2006,110) add(Ticket)(5,SK,0008,14-11-2006,100) add(Ticket)(6,SK,0008,14-11-2006,67) add(Ticket)(7,SK,0009,14-11-2006,90) add(Ticket)(8,SK,0007,14-11-2006,110) add(Ticket)(9,SK,0008,14-11-2006,67) add(Ticket)(10,SK,0009,14-11-2006,90) add(Ticket)(11,SK,0003,14-11-2006,110) add(Ticket)(12,SK,0007,26-12-2006,450) add(Ticket)(13,SK,0007,26-12-2006,323) add(Ticket)(14,SK,0009,26-12-2006,434) add(Ticket)(15,SK,0008,26-12-2006,660) add(Ticket)(16,SK,0010,26-12-2006,1020)