COIN-OR::LEMON - Graph Library

source: glpk-cmake/examples/sql/transp.sql @ 1:c445c931472f

Last change on this file since 1:c445c931472f was 1:c445c931472f, checked in by Alpar Juttner <alpar@…>, 10 years ago

Import glpk-4.45

  • Generated files and doc/notes are removed
File size: 1.6 KB
Line 
1CREATE DATABASE glpk;
2CREATE USER glpk@localhost IDENTIFIED BY 'gnu';
3GRANT ALL PRIVILEGES ON glpk.* TO glpk@localhost;
4USE glpk;
5# production capacity
6DROP TABLE transp_capa;
7CREATE TABLE transp_capa (
8  PLANT TEXT(127),
9  CAPA  REAL,
10  PRIMARY KEY ( PLANT(127) )
11  );
12INSERT INTO transp_capa ( PLANT, CAPA ) VALUES ( 'Seattle',   350 );
13INSERT INTO transp_capa ( PLANT, CAPA ) VALUES ( 'San Diego', 600 );
14# demand
15DROP TABLE transp_demand;
16CREATE TABLE transp_demand (
17  MARKET TEXT(127),
18  DEMAND REAL,
19  PRIMARY KEY ( MARKET(127) )
20  );
21INSERT INTO transp_demand ( MARKET, DEMAND ) VALUES ( 'New York', 325 );
22INSERT INTO transp_demand ( MARKET, DEMAND ) VALUES ( 'Chicago', 300 );
23INSERT INTO transp_demand ( MARKET, DEMAND ) VALUES ( 'Topeka', 275 );
24# distance
25DROP TABLE transp_dist;
26CREATE TABLE transp_dist (
27  LOC1 TEXT(127),
28  LOC2 TEXT(127),
29  DIST REAL,
30  PRIMARY KEY ( LOC1(127), LOC2(127) )
31  );
32INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'Seattle',   'New York', 2.5 );
33INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'Seattle',   'Chicago', 1.7 );
34INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'Seattle',   'Topeka', 1.8 );
35INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'San Diego', 'New York', 2.5 );
36INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'San Diego', 'Chicago', 1.8 );
37INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'San Diego', 'Topeka', 1.4 );
38# result
39DROP TABLE transp_result;
40CREATE TABLE transp_result (
41  LOC1     TEXT(127),
42  LOC2     TEXT(127),
43  QUANTITY REAL,
44  PRIMARY KEY ( LOC1(127), LOC2(127) )
45  );
Note: See TracBrowser for help on using the repository browser.