SQL Question...

Discuss anything related to audio or music production.
H20nly
Posts: 16065
Joined: Sat Oct 27, 2007 9:15 pm
Location: The Wild West

SQL Question...

Post by H20nly » Thu Dec 13, 2012 6:46 pm

any of you two timing digislave by day musician by night types proficient in SQL?

if so, do you have any recommendations on learning the language?

it's the only hole in my resume that i really need to fill... i'd love to learn it... and have enough technical experience that i can talk the talk so i don't need a certificate... i just need to know the language.

thanks in advance for any help/recommendations.

H


P.S. i know Access and currently design GUIs for SQL... but i want to get deeper under the hood.

H20nly
Posts: 16065
Joined: Sat Oct 27, 2007 9:15 pm
Location: The Wild West

Re: SQL Question...

Post by H20nly » Fri Dec 14, 2012 11:48 pm

bump
LoopStationZebra wrote:it's like a hipster commie pinko manifesto. Rambling. Angry. Nearly divorced from all reality; yet strangely compelling with a ring of truth.

crumhorn
Posts: 2503
Joined: Fri Sep 26, 2008 6:04 pm

Re: SQL Question...

Post by crumhorn » Sat Dec 15, 2012 1:44 am

select first_name, last_name from forum_users where skill_name = 'SQL' and expert = true order_by post_count desc;
"The banjo is the perfect instrument for the antisocial."

(Allow me to plug my guitar scale visualiser thingy - www.fretlearner.com)

H20nly
Posts: 16065
Joined: Sat Oct 27, 2007 9:15 pm
Location: The Wild West

Re: SQL Question...

Post by H20nly » Mon Dec 17, 2012 4:48 pm

:lol:

damn it man!!

it was worth a try...

crumhorn
Posts: 2503
Joined: Fri Sep 26, 2008 6:04 pm

Re: SQL Question...

Post by crumhorn » Mon Dec 17, 2012 5:23 pm

I know a bit but I'm certainly no expert, It get's ugly pretty fast when you want to ask awkward questions. Since I discovered RAILS and Active Record I avoid SQL as much as possible.

A good way to learn is to download and install a copy of mySQL or sqlite and play around with it while working through the documentation. think of a useful project and have a crack at it.
"The banjo is the perfect instrument for the antisocial."

(Allow me to plug my guitar scale visualiser thingy - www.fretlearner.com)

H20nly
Posts: 16065
Joined: Sat Oct 27, 2007 9:15 pm
Location: The Wild West

Re: SQL Question...

Post by H20nly » Mon Dec 17, 2012 6:07 pm

8) thanks for that.

ttilberg
Posts: 587
Joined: Wed Oct 05, 2011 4:55 pm
Contact:

Re: SQL Question...

Post by ttilberg » Mon Dec 17, 2012 9:43 pm

H20, definitely the best way to learn it is to make a dummy db and mess around with it. You definitely need to have some sort of a test project in mind for SQL. The way I learned is basically coming across situations like "okay I need to organize this data this other way" and Googling it. After a few runs through it starts to stick. A helper program also makes a great set of training wheels:
If you are using MS SQL Server, you can download SQL Express for free, and it comes with "Management Studio" which is a great set of training wheels, immediately telling you where you have bad syntax.
If you are using MySQL, take a look at phpMyAdmin. There are probably other options out there, but those are the two I've always used.

Proper DBA stuff though, like management and maintenance is a different beast though.

Maybe consider starting with a very simple application that tracks account balances or something. My first project that I got cooking with SQL was a php web app I made to track if my room mates payed me their cable bill money, and to print them receipts. This simple project gives you all sorts of awesome experience with basic selection, inserting, sorting, etc.

Good luck!
Tim Tilberg - Duluth, MN | SoundCloud - Arsenal
2011 13" MBP w/8GB ram | Live 9 Suite, Reason 6.5, FXPansion DCAM/Etch/Maul, Izotope Ozone 5

jbodango
Posts: 521
Joined: Tue Oct 05, 2004 11:25 pm

Re: SQL Question...

Post by jbodango » Mon Dec 17, 2012 9:51 pm


H20nly
Posts: 16065
Joined: Sat Oct 27, 2007 9:15 pm
Location: The Wild West

Re: SQL Question...

Post by H20nly » Mon Dec 17, 2012 9:59 pm

thanks guys. that's great.

i've been needing to take some classes or study up, but i've been putting it off. what made me ask the other day is that i was working on a GUI and created a field that needed to be numeric, but i made it text... and then a field that needed to be decimal, but that i made numeric. without being able to go into the SQL and change the field type (i just created them so I KNOW there is no data in them) they will forever more be an eye sore when i create macros for the documents that will refer to them later. :x

experience is something you get right after you make a mistake... it's nice if someone will help guide you beyond their first few missteps.

thanks again for the advice.

loydb
Posts: 178
Joined: Wed Jan 06, 2010 9:28 pm

Re: SQL Question...

Post by loydb » Tue Dec 18, 2012 3:25 pm

The best way to learn it is to get VMWare, or Parallels, or whatever virtual machine environment you want. Download a turnkey LAMP image (http://www.turnkeylinux.org/lampstack). Boot that puppy up and start playing. This way, you're using SQL in the context you're most likely to IRL -- in an Apache environment with Perl, Python, PHP, Ruby, whatever floats your boat (I'm partial to Perl myself, but I'm an old man...). The biggest thing to remember if you're using the command-line MySQL interface is that you need a ; at the end or the statement won't execute... :)

There are a million "learn SQL" tutorials on the web. O'Reilly also has some good LAMP stack books, look at safaribooksonline.

In your specific case, you can do (MySQL):
SHOW CREATE TABLE tablename;

This gives you the SQL code that can be used to re-create your table. If you've already got data in it, look for 'mysqldump' so you can preserve the data as well. Stick this into the file fixtable.sql, and change the type for the field you want.

Once you have the table creation script, you can delete the original table with:
DROP TABLE tablename;

Then, from a shell prompt (not from the mysql command line), do
mysql -uroot -p < fixtable.sql

It will prompt you for the password, then execute the SQL code in the file, giving you a spiffy new table.

You are correct to want to learn this. SQL is one of the few things that I've used in nearly every professional engagement I've had since the late 80s/early 90s. Once you know it on one system, it's pretty easy to pick up the variations (e.g. SQL Server vs. PostGres vs. MySQL vs. Access).

Good luck!
MFOS Ultimate Expand-o-tron Build Log: http://www.electro-music.com/forum/view ... 797#308797
MFOS Mini-Controller Build Log [FINISHED!]: http://www.electro-music.com/forum/view ... hp?t=42968

ian_halsall
Posts: 1715
Joined: Fri May 27, 2011 8:52 am
Location: South London
Contact:

Re: SQL Question...

Post by ian_halsall » Tue Dec 18, 2012 3:31 pm

Sadly I am an expert in SQL of almost 2 decades (f*ck).

It's not that difficult - download sql server express - free - it will run on a decent laptop or desktop.

Create a simple relation structure.

Usual crap is employees, managers, address, payroll.

Start selecting, updating, deleting.

Oracle, sql server, sybase - they're all much the same from a raw sql perspective although the differ in stored procedure implementation - I used them all.

I never used a book or found one that useuful - SQL is quite simple - relational design is more difficult.....

crumhorn
Posts: 2503
Joined: Fri Sep 26, 2008 6:04 pm

Re: SQL Question...

Post by crumhorn » Tue Dec 18, 2012 3:48 pm

Rule of thumb for Relational Design - remember that every attribute in a table should be dependent on "The key, the whole key and nothing but the key"
"The banjo is the perfect instrument for the antisocial."

(Allow me to plug my guitar scale visualiser thingy - www.fretlearner.com)

H20nly
Posts: 16065
Joined: Sat Oct 27, 2007 9:15 pm
Location: The Wild West

Re: SQL Question...

Post by H20nly » Tue Dec 18, 2012 5:39 pm

^ indeed!

thanks guys. more great info.

@ loydb 8O extra Wow!! very nice. thank you. i'm tempted to try that later in the day with a boggus table... once i get done fighting off the support requests :x




pencils are the pinnacle of headache-less technology

Angstrom
Posts: 14926
Joined: Mon Oct 04, 2004 2:22 pm
Contact:

Re: SQL Question...

Post by Angstrom » Tue Dec 18, 2012 6:12 pm

With regard to the suggestion of running paralells. I'm not sure you need an OS emulation layer.

I run Xampp on a windows box, also available to run on Linux, and Osx .

It will install all you need and you can toy around in the interface of PHPmyadmin, which is a quite standard method of interacting with that variant of SQL.

http://www.apachefriends.org/en/xampp.html
The distribution for Windows 2000, 2003, XP, Vista, and 7. This version contains: Apache, MySQL, PHP + PEAR, Perl, mod_php, mod_perl, mod_ssl, OpenSSL, phpMyAdmin, Webalizer, Mercury Mail Transport System for Win32 and NetWare Systems v3.32, Ming, FileZilla FTP Server, mcrypt, eAccelerator, SQLite, and WEB-DAV + mod_auth_mysql.
It's a simple install.

crumhorn
Posts: 2503
Joined: Fri Sep 26, 2008 6:04 pm

Re: SQL Question...

Post by crumhorn » Tue Dec 18, 2012 6:53 pm

also don't forget cygwin for a linux type environment that runs under windows, contains all things LAMP and RAILS related -> http://www.cygwin.com/
"The banjo is the perfect instrument for the antisocial."

(Allow me to plug my guitar scale visualiser thingy - www.fretlearner.com)

Post Reply