Skip to content

Instantly share code, notes, and snippets.

@lifuzu
Last active February 17, 2016 19:16
Show Gist options
  • Save lifuzu/1768f127e5b7b461009f to your computer and use it in GitHub Desktop.
Save lifuzu/1768f127e5b7b461009f to your computer and use it in GitHub Desktop.
Cloud Computing Capstone Question 2.3 Solution for Task2
USE mykeyspace;
SELECT origin, dest, carrier, average FROM task1_part2_group2_3 WHERE origin = 'LGA' AND dest = 'BOS';
SELECT origin, dest, carrier, average FROM task1_part2_group2_3 WHERE origin = 'BOS' AND dest = 'LGA';
SELECT origin, dest, carrier, average FROM task1_part2_group2_3 WHERE origin = 'OKC' AND dest = 'DFW';
SELECT origin, dest, carrier, average FROM task1_part2_group2_3 WHERE origin = 'MSP' AND dest = 'ATL';
$ bash question2_3.sh
origin | dest | carrier | average
--------+------+---------+---------
LGA | BOS | TW | 0
LGA | BOS | PA 1 | 5.515
LGA | BOS | DL | 6.477
LGA | BOS | US | 6.827
LGA | BOS | EA | 8.6906
LGA | BOS | MQ | 17.3017
LGA | BOS | NW | 19.0549
LGA | BOS | AA | 28.5
LGA | BOS | OH | 29.5
(9 rows)
origin | dest | carrier | average
--------+------+---------+---------
BOS | LGA | TW | 0
BOS | LGA | DL | 6.1112
BOS | LGA | US | 8.1291
BOS | LGA | PA 1 | 9.1057
BOS | LGA | EA | 10.7925
BOS | LGA | NW | 17.8534
BOS | LGA | MQ | 19.1237
BOS | LGA | AA | 28
BOS | LGA | OH | 32.5517
BOS | LGA | TZ | 133
(10 rows)
origin | dest | carrier | average
--------+------+---------+---------
OKC | DFW | TW | 3.4094
OKC | DFW | AA | 7.8958
OKC | DFW | EV | 8.2998
OKC | DFW | DL | 8.3377
OKC | DFW | MQ | 10.8506
OKC | DFW | OO | 15.0088
OKC | DFW | OH | 47.5
(7 rows)
origin | dest | carrier | average
--------+------+---------+---------
MSP | ATL | EA | 7.8125
MSP | ATL | DL | 10.9791
MSP | ATL | OO | 11.993
MSP | ATL | NW | 12.3685
MSP | ATL | FL | 13.0721
MSP | ATL | OH | 14.0457
MSP | ATL | EV | 17.933
(7 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment