alpar@1: CREATE DATABASE glpk; alpar@1: CREATE USER glpk@localhost IDENTIFIED BY 'gnu'; alpar@1: GRANT ALL PRIVILEGES ON glpk.* TO glpk@localhost; alpar@1: USE glpk; alpar@1: # production capacity alpar@1: DROP TABLE transp_capa; alpar@1: CREATE TABLE transp_capa ( alpar@1: PLANT TEXT(127), alpar@1: CAPA REAL, alpar@1: PRIMARY KEY ( PLANT(127) ) alpar@1: ); alpar@1: INSERT INTO transp_capa ( PLANT, CAPA ) VALUES ( 'Seattle', 350 ); alpar@1: INSERT INTO transp_capa ( PLANT, CAPA ) VALUES ( 'San Diego', 600 ); alpar@1: # demand alpar@1: DROP TABLE transp_demand; alpar@1: CREATE TABLE transp_demand ( alpar@1: MARKET TEXT(127), alpar@1: DEMAND REAL, alpar@1: PRIMARY KEY ( MARKET(127) ) alpar@1: ); alpar@1: INSERT INTO transp_demand ( MARKET, DEMAND ) VALUES ( 'New York', 325 ); alpar@1: INSERT INTO transp_demand ( MARKET, DEMAND ) VALUES ( 'Chicago', 300 ); alpar@1: INSERT INTO transp_demand ( MARKET, DEMAND ) VALUES ( 'Topeka', 275 ); alpar@1: # distance alpar@1: DROP TABLE transp_dist; alpar@1: CREATE TABLE transp_dist ( alpar@1: LOC1 TEXT(127), alpar@1: LOC2 TEXT(127), alpar@1: DIST REAL, alpar@1: PRIMARY KEY ( LOC1(127), LOC2(127) ) alpar@1: ); alpar@1: INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'Seattle', 'New York', 2.5 ); alpar@1: INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'Seattle', 'Chicago', 1.7 ); alpar@1: INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'Seattle', 'Topeka', 1.8 ); alpar@1: INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'San Diego', 'New York', 2.5 ); alpar@1: INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'San Diego', 'Chicago', 1.8 ); alpar@1: INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'San Diego', 'Topeka', 1.4 ); alpar@1: # result alpar@1: DROP TABLE transp_result; alpar@1: CREATE TABLE transp_result ( alpar@1: LOC1 TEXT(127), alpar@1: LOC2 TEXT(127), alpar@1: QUANTITY REAL, alpar@1: PRIMARY KEY ( LOC1(127), LOC2(127) ) alpar@1: );