Prev | Current Page 66 | Next

David Berube

"Practical Reporting with Ruby and Rails"


Before you can use Gruff to graph the data, you must first load the data into a database.
Listing 3-3 shows some of the SQL you??™ll need, but much of the data has been
omitted for space considerations. You can download the full listing from http://
CHAPTER 3 n CREATING GRAPHS WITH RUBY 37
rubyreporting.com/examples/player_4.sql, or from the Source Code/Downloads area of
the Apress web site (http://.www.apress.com).
Listing 3-3. Team Performance SQL (player_4.sql)
DROP DATABASE IF EXISTS players_4 ;
CREATE DATABASE players_4;
USE players_4;
CREATE TABLE players (
id INT(11) NOT NULL AUTO_INCREMENT,
name TEXT,
nickname TEXT,
drink TEXT,
salary DECIMAL(9,2),
PRIMARY KEY (id)
);
INSERT INTO players (id, name, nickname, drink, salary) VALUES
(1, "Matthew Gifford", 'm_giff', "Moxie", 89000.00);
INSERT INTO players (id, name, nickname, drink, salary) VALUES
(2, "Matthew Bouley", 'Iron Helix', "Moxie", 75000.00);
INSERT INTO players (id, name, nickname, drink, salary) VALUES
(3, "Luke Bouley", 'Cable Boy', "Moxie", 75000.


Pages:
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
męskie skarpetki rowerowe wycieczki do Skandynawii pity mapa Niemiec Zamykanie naczynek kraków