fasterthanlime / cs322

CS-323 project
2 stars 1 forks source link

Implement query M #22

Closed nddrylliog closed 12 years ago

nddrylliog commented 12 years ago

For coaches who coached at most 7 seasons but more than 1 season, who are the three more successful? (Success rate is season win percentage: season_win / (season_win + season_loss)). Be sure to count all seasons when computing the percentage.

nddrylliog commented 12 years ago

Why isn't it returning anything?

greut commented 12 years ago

It displays three coaches, can you check that the table coaches is correctly filled up?

nddrylliog commented 12 years ago

Just checked both the 'coaches' and 'players' tables are empty for me. I'll try dropping everything and running the import again.

nddrylliog commented 12 years ago

Just tried again, checking tables from SQL Developer, 'coaches' and 'players' are empty.

Here's what I did:

sqlplus DB2012_G06/DB2012_G06 < documents/sql/drop.sql
sqlplus DB2012_G06/DB2012_G06 < documents/sql/schema.sql
sqlplus DB2012_G06/DB2012_G06 < documents/sql/data.sql
cd path/to/nba
bundle exec rake db:migrate
bundle exec rake import:all

And every table is fine except coaches and players.

sadpanda :(

greut commented 12 years ago

fyi import:all does the drop/schema/data dance. Check that the triggers are okay, in the sqlplus output and/or using SQLDeveloper.

nddrylliog commented 12 years ago

In SQLDeveloper, in the 'triggers' tab, there are none listed.

How should I go about debugging them?

greut commented 12 years ago

The sqlplus output then. I'll try running the import on the production server to see if it works there.

nddrylliog commented 12 years ago

The SQLplus output for which command? Sqlplus is only used for the schema.sql and data.sql files, not the actual import? On May 22, 2012 10:05 PM, "Yoan Blanc" < reply@reply.github.com> wrote:

The sqlplus output then. I'll try running the import on the production server to see if it works there.


Reply to this email directly or view it on GitHub: https://github.com/nddrylliog/cs322/issues/22#issuecomment-5857314

greut commented 12 years ago

rake import:schema which runs (among others) sqlplus … < schema.sql. It should output something similar to trigger created.

greut commented 12 years ago

Bwahahaha.

$RAILS_ENV=production rake import:all
…
ORA-02393: exceeded call limit on CPU usage
Tasks: TOP => import:players
nddrylliog commented 12 years ago

Fuuuuuuuuuuuuuuuuuuuuuuuuuuu.

greut commented 12 years ago

I've run the import:schema command on the production server, using SQLDeveloper you can check the triggers out. They should exist on your install as well. We'll sort this out. Good nite buddy!

nddrylliog commented 12 years ago

Alrighty. I'll check that out. Night o/

nddrylliog commented 12 years ago

Just checked it out now that queries are working, all good! Closing.