Jump to content

Brandy Spankin' New & Lookin' for Help


stats4gnats

Recommended Posts

I'm 67 and long been a baseball lover, and in enjoying the game, I've been the guy who keeps score, gathers data, mines it a bit, and produces lots of metrics for people to look at. Out of curiousity, I took a Sabermetrics class that was recently offered on-line and was introduced to SQL and R. I've been using Visual FoxPro since before it was visual, and in it there's a SQL set they use which I'm fairly familiar with.

 

In the class, we used MYSQL and databases readily availabe from various baseball sources, so what I'm tryinng to do is download those databases to my box, install MYSQL, and install R so I can continue to play around and learn. I've got the R Studio they had us in the class, and the databases shouldn't be a problem, but MYSQL is giving me fits. I installed this thing called MYSQL Workbench, but its pretty confusing and I can't find basic tutorials on it.

 

So that's where I'm at. My system is Windows 7. This isn't an avocation for me! Its my hobby and gives me many hours of enjoyment, and I'm looking for some basic help to expand what I can do. Any help will be greatly appreciated.

 

S4G

Link to comment
Share on other sites

Welcome to PHPFreaks. :)

MySQL Workbench is a client program, if I remember correctly.  [?]

You probably need "community server":  http://dev.mysql.com/downloads/mysql/

The Server Software is the actual "database", holds the data, etc.  You'd probably install it as a service, then use MySQL Workbench to connect to it, create queries, and so on, without having to program them (with 'R', I assume?)   #include disclaimer.h, YMMV, Idiots on the 'Web are not responsible if you blow up your system &c...

Your "R" program would also need to connect to the MySQL service to do its stats munging and so forth....

Incidentally, since this forum is mostly about PHP, I doubt you'll find many people who know much about 'R'.  I've heard of it ... that's about it.

Best of luck :)

Link to comment
Share on other sites

dalecosp,

 

Maybe I’m just jumpin’ in way over my head here, so let me go back a bit and try again.

 

In the class, they had something called the SQL sandbox. It was using MYSQL to access a couple different databases in order to grab baseball data. I have no idea if it was accessing the data, locally or through the web. All I know is, I typed a seql statement, ran it, and could download the results as a .csv I could put on my machine. Then I could run R to massage it, mainly to do plots, histograms, regressions, etc.. In FoxPro, you create .DBF files or databases, then use SQL statements mixed in with their version of Visual Basic language to put data in, massage it, and generate reports.

 

All I want to do, at least for now, is to be able to download the databases to my machine, then point MYSQL to it somehow so when I run a select, it goes to the right place, and generates a .CSV. Unfortunately, I don’t see anything in the workbench that gives me access to some kind of console where selects can be typed.

 

Thanx to you, I at least have someplace to look, with the community server. I’ll spend a bit of time checking it out and getting it on my box. Maybe then I’ll be able to speak a bit more intelligently in order to ask better questions.

 

Thank you very much. I really appreciate your time.

 

S4G

Link to comment
Share on other sites

  • 4 weeks later...

Dale gave you some good advice.

 

MySQL is a relational database engine. The difference between that and a PC database like Foxpro, is that the rdbms is suppossed to be a black box. You talk to it via SQL and you get back result sets. With Foxpro and other PC databases, while many of them support a dialect of SQL, they are basically programs that open the database files. If you have it networked, and 3 people are sharing a db, they are all running the engine on their local machines. With and RDMBS like mysql, it runs on only one machine (the server) even if that server happens to be your workstation.

 

All rdbms's have client libraries that allow you to talk to them, and people have built all sorts of client applications. As dale pointed out, mysql workbench is simply a client application that hides the SQL from you in a lot of cases. I think you already probably know this.

 

There is no magical "use mysql dataset through the internet" feature of mysql. You can connect to mysql using a client program. You can also import data into it in a few different ways. Once you have the server setup on your machine and running in the background (as a service) you can use any mysql client to query it. The simplest of these (mysql command line utility) will let you issue SQL statements and get the results back, and that's the first thing you want to make sure works.

 

It also comes with mysqlimport to let you import files into new tables.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.