I’ve never touched SQL, past a few references to commands in XKCD. A couple quick Google searches have not produced anything that has seemed usable. I want a software environment that lets me do stuff like your example. Frankly, I’m so unfamiliar with what exists than I don’t want to be much more specific than that, aside from saying that I want it to have a good help function if possible(I’ve used help to self-teach complex Excel functions, so it should be sufficient).
My recommendation is to (if not on linux already), download and set up a VM with a linux install on it. For a toy example, it should be as easy as installing a recent ubuntu, going to the command line, typing “sudo apt-get install postgres”.
To log in to the database you can then use “sudo -u postgres psql” (Postgres creates a system user called postgres who by default is a superuser with passwordless local authentication.)
From here you can get help by typing \? to list available commands and \h SQL STATEMENT BEGINNING to get some basic help on an sql statement. eg, “\h create table” will show you the valid syntax for a create table statement.
This W3Schools tutorial seems adequate as a very basic level tutorial to give you an idea of what’s possible and where you’d want to go from there.
It should be fairly easy to get python, php, ruby, etc to talk to the database, when you want to try to integrate it with an external program.
Alternatively, since you’ll probably be doing VBA in a Windows, environment you could install SQL Server Express edition to play around with, but I’m not particularly familiar with it, or its environment. Someone else can probably help you out with that better.
I’ve tried Linux before, and seen nothing about it that would make it worth the effort of learning a whole new command interface. Is there any particular advantage to it here, or is this a matter of personal preference?
If you want to be a programmer, you know the command line so that when the guy interviewing you for a job asks you how you’d remove all phone numbers from the bodies of 50 000 HTML files, you will say “use sed” instead of starting to sketch a 500 line C program that does directory traversal, input buffering and token lexing.
The command line isn’t just a different command interface, it’s an actual programming environment in itself, which the modern GUIs never are.
I’m not going for comp sci jobs, I’m going for finance. Programming is a secondary skill, more used for Excel macros than general-purpose tasks. And virtually nobody uses Linux environments.
Going for a field where Linux isn’t used is a pretty good reason not to bother with it. You can cover the regexp/scripting-fu the linked article is talking about pretty well by just being handy with Perl or Python instead.
Linux seems universally seen as the platform best suited for programming in general, from my observations. There aren’t the arbitrary restrictions from OS features found in Windows or iOS, the filesystem is much more optimized, etc.
It’s never been presented to me as anything but something obvious that one should try if one intends to do anything fancy with computers, and the learning curve has always been presented to me as negligible. I’ve tried a Linux-style shell via Putty and Cygwin, and things did not turn out usefully. Putty I could not figure out at all without a CS professor walking me through it, and I get the strong impression that Cygwin choked on the fact that my Windows username has a space in it and I had no clue how to get around that. It doesn’t help that my main uses were compiling C programs and trying to compile Festvox (for making arbitrary Festival-style text-to-speech engines), the former more trivial than the latter. I haven’t found it worth looking into learning a new OS without a significant reason, and it didn’t turn out well the two times I had reasons (and said reasons that did not last, so I didn’t end up making enough of an effort to learn it).
Again, the internet and every computer science department I’ve encountered insist that Linux is optimized for anything more complicated than HTML or Windows/iOS-specific code, and is definitely worth learning. I expect circumstances will force me to learn it properly, eventually. My experiences so far do not leave me eager, however.
[edit]: D’oh, I think I just repeated everything you said, only longer. :( [/edit]
Partly personal preference, partly an inability to answer your question in a Windows programming environment, not being particularly familiar with SQL Server. While you can install things such as postgres, python, etc on Windows, getting a working setup on an ubuntu system to play with for free, is trivial:
e.g.
Install OS
Open command prompt
sudo apt-get install python
sudo apt-get install python-pip
sudo apt-get install postgres
sudo apt-get install python2.7-dev
sudo pip install psycopg2
sudo -u postgres psql “—command=CREATE USER test PASSWORD testing;”
(Code not tested, don’t currenty have an environment to test it on… you get the idea though.)
Again though, this is the environment I do nearly all my coding work in. I’d not be surprised if a Windows developer found getting an SQL Server Express install up and running on their system to be far easier for them. I’m just not able to walk you through that.
Understood. I do not expect that learning Linux is a useful way to spend my time, however, so I’ll pass. But Postgres does seem to have a Windows version, so I’ll give that a shot. It seems to be what I’m looking for.
I’ve never touched SQL, past a few references to commands in XKCD. A couple quick Google searches have not produced anything that has seemed usable. I want a software environment that lets me do stuff like your example. Frankly, I’m so unfamiliar with what exists than I don’t want to be much more specific than that, aside from saying that I want it to have a good help function if possible(I’ve used help to self-teach complex Excel functions, so it should be sufficient).
My recommendation is to (if not on linux already), download and set up a VM with a linux install on it. For a toy example, it should be as easy as installing a recent ubuntu, going to the command line, typing “sudo apt-get install postgres”.
To log in to the database you can then use “sudo -u postgres psql” (Postgres creates a system user called postgres who by default is a superuser with passwordless local authentication.)
From here you can get help by typing \? to list available commands and \h SQL STATEMENT BEGINNING to get some basic help on an sql statement. eg, “\h create table” will show you the valid syntax for a create table statement.
This W3Schools tutorial seems adequate as a very basic level tutorial to give you an idea of what’s possible and where you’d want to go from there.
It should be fairly easy to get python, php, ruby, etc to talk to the database, when you want to try to integrate it with an external program.
Alternatively, since you’ll probably be doing VBA in a Windows, environment you could install SQL Server Express edition to play around with, but I’m not particularly familiar with it, or its environment. Someone else can probably help you out with that better.
I’ve tried Linux before, and seen nothing about it that would make it worth the effort of learning a whole new command interface. Is there any particular advantage to it here, or is this a matter of personal preference?
If you want to be a programmer, you know the command line so that when the guy interviewing you for a job asks you how you’d remove all phone numbers from the bodies of 50 000 HTML files, you will say “use sed” instead of starting to sketch a 500 line C program that does directory traversal, input buffering and token lexing.
The command line isn’t just a different command interface, it’s an actual programming environment in itself, which the modern GUIs never are.
I’m not going for comp sci jobs, I’m going for finance. Programming is a secondary skill, more used for Excel macros than general-purpose tasks. And virtually nobody uses Linux environments.
Going for a field where Linux isn’t used is a pretty good reason not to bother with it. You can cover the regexp/scripting-fu the linked article is talking about pretty well by just being handy with Perl or Python instead.
Linux seems universally seen as the platform best suited for programming in general, from my observations. There aren’t the arbitrary restrictions from OS features found in Windows or iOS, the filesystem is much more optimized, etc.
It’s never been presented to me as anything but something obvious that one should try if one intends to do anything fancy with computers, and the learning curve has always been presented to me as negligible. I’ve tried a Linux-style shell via Putty and Cygwin, and things did not turn out usefully. Putty I could not figure out at all without a CS professor walking me through it, and I get the strong impression that Cygwin choked on the fact that my Windows username has a space in it and I had no clue how to get around that. It doesn’t help that my main uses were compiling C programs and trying to compile Festvox (for making arbitrary Festival-style text-to-speech engines), the former more trivial than the latter. I haven’t found it worth looking into learning a new OS without a significant reason, and it didn’t turn out well the two times I had reasons (and said reasons that did not last, so I didn’t end up making enough of an effort to learn it).
Again, the internet and every computer science department I’ve encountered insist that Linux is optimized for anything more complicated than HTML or Windows/iOS-specific code, and is definitely worth learning. I expect circumstances will force me to learn it properly, eventually. My experiences so far do not leave me eager, however.
[edit]: D’oh, I think I just repeated everything you said, only longer. :( [/edit]
Putty is fairly terrible, and a major pain in the arse if you do need to ssh from a windows box.
Partly personal preference, partly an inability to answer your question in a Windows programming environment, not being particularly familiar with SQL Server. While you can install things such as postgres, python, etc on Windows, getting a working setup on an ubuntu system to play with for free, is trivial:
e.g.
Install OS
Open command prompt
sudo apt-get install python
sudo apt-get install python-pip
sudo apt-get install postgres
sudo apt-get install python2.7-dev
sudo pip install psycopg2
sudo -u postgres psql “—command=CREATE USER test PASSWORD testing;”
sudo -u postgres psql “—command=CREATE DATABASE testdb OWNER test;”
python
import psycopg2
connection = psycopg2.connect(username=‘test’, password=‘testing’, dbname=‘testdb’)
cursor = connection.cursor()
cursor.execute(‘SELECT 1;’)
print cursor.fetchone()
(Code not tested, don’t currenty have an environment to test it on… you get the idea though.)
Again though, this is the environment I do nearly all my coding work in. I’d not be surprised if a Windows developer found getting an SQL Server Express install up and running on their system to be far easier for them. I’m just not able to walk you through that.
Understood. I do not expect that learning Linux is a useful way to spend my time, however, so I’ll pass. But Postgres does seem to have a Windows version, so I’ll give that a shot. It seems to be what I’m looking for.