Go Back   TalkBass Forums > Bass Guitar Forums > Bass Guitar Forums > Off Topic [BG]
Register Rules/FAQ/CUP Members List Search Today's Posts Mark Forums Read

Off Topic [BG] Non-music-related discussion and chat


Supporting Membership
Thank You

Latest Supporting Member
Donate to Upgrade Today

Reply
 
Thread Tools Search this Thread
  #1  
Old 02-17-2011, 05:24 PM
Balog's Avatar
Registered User
 
Join Date: Mar 2009
Location: Bothell, WA
Supporting Member
I need to learn sql... help?

Sign in to disble this ad
For various reasons, I find myself in a position where I need to learn the basics of using (not writing code for) sql as quick as humanly possible. Just a basic user level knowledge of writing queries.

I've been referred to the "Teach Yourself SQL in 21 Days" online book, but I'm a kinesthic learner so just reading it and not being able to do it is making it a real slog for me.

A friend got sqlite up and running on my computer, but I'm in the Catch-22 of needing to learn more about sql to write entries before I can go about searching those entries.

Anyone know of a pre-made database file I can download and use just to practice searching on? Or a better online resource than the book linked above?
  #2  
Old 02-17-2011, 06:37 PM
MIJ-VI's Avatar
Registered User
 
Join Date: Jan 2009
Supporting Member
fdeck may know something about this.
  #3  
Old 02-17-2011, 06:42 PM
Registered User
 
Join Date: Mar 2010
Location: Lexington, KY
http://www.w3schools.com/sql/sql_tryit.asp
__________________
Quote:
Originally Posted by michaeln View Post
Heck, the MIAs are made by Mexicans too.
  #4  
Old 02-17-2011, 06:43 PM
Registered User
 
Join Date: Mar 2010
Location: Lexington, KY
Feel free to PM me with any questions that you may have.
__________________
Quote:
Originally Posted by michaeln View Post
Heck, the MIAs are made by Mexicans too.
  #5  
Old 02-17-2011, 06:54 PM
Registered User
 
Join Date: Feb 2009
Send a message via Yahoo to JohnMCA72
Google: "SQL tutorial"

Plenty of good sites, right near the top, I can vouch for personally.
__________________
"I spent ten years starving to death playing great music. I write a one-chord song about poontang and make a million dollars. What would YOU do?" - Ted Nugent
  #6  
Old 02-17-2011, 06:56 PM
Registered User
 
Join Date: Jun 2005
Location: Lincoln, NE
Quote:
Originally Posted by busta_bird
Feel free to PM me with any questions that you may have.
Likewise.
  #7  
Old 02-17-2011, 07:04 PM
Registered User
 
Join Date: Nov 2010
Location: Australia
Quote:
Originally Posted by Balog View Post
Anyone know of a pre-made database file I can download and use just to practice searching on? Or a better online resource than the book linked above?
You can create your own easily enough. Yes SQLite is the right tool to start out with, have a look at their website for tutorials.

> sqlite3 test.db
create table foo (field1 varchar(30), field2(varchar(30));
insert into foo values "data1", "data2";
insert into foo values "data1", "data3";
insert into foo values "data1", "data2";
select field2, count(field2) from foo group by field2 order by field2;

there you go, that's a start. If you screw something up just delete test.db and start again!
  #8  
Old 02-17-2011, 09:59 PM
Registered User
 
Join Date: Jun 2005
Location: Lincoln, NE
I'd suggest you get some kind of good tool that will do query formatting, keyword highlighting, etc.

I know some purists will tell you to code in notepad, but having a good IDE helps with the learning process IMO. You can get notepad++ and set the language to SQL or a more advanced tool like PL/SQL developer or MySql workbench.

http://www.stackoverflow.com is also a great coding resource.
  #9  
Old 02-17-2011, 10:12 PM
fdeck's Avatar
Registered User

Maker of HPF-Pre upright bass preamp
 
Join Date: Mar 2004
Location: Madison WI
Supporting Member
Quote:
Originally Posted by MIJ-VI View Post
fdeck may know something about this.
Aaack!

My one and only exposure to SQL was when I took a Visual Basic programming course more than a decade ago. One of the course sessions was on talking to the database engine through a VB program. And it was pretty neat, but I never used the knowledge, and have now forgotten it.

At the time I was more interested in using VB programming to control machinery. Indeed, VB was primarily why I abandoned the Mac and joined the Windows camp.
__________________
DIY gear articles and HPF-Pre
  #10  
Old 02-17-2011, 10:52 PM
MIJ-VI's Avatar
Registered User
 
Join Date: Jan 2009
Supporting Member
Quote:
Originally Posted by fdeck View Post
Aaack!

My one and only exposure to SQL was when I took a Visual Basic programming course more than a decade ago. One of the course sessions was on talking to the database engine through a VB program. And it was pretty neat, but I never used the knowledge, and have now forgotten it.

At the time I was more interested in using VB programming to control machinery. Indeed, VB was primarily why I abandoned the Mac and joined the Windows camp.
Another cherished sentimentality dashed?! (I've had a few...)

I don't know which is more depressing: this, or the fact that I recently had to line up at a post office three times within the span of one month... *mumbles to himself* Waitaminute...
  #11  
Old 02-17-2011, 10:56 PM
Banned
 
Join Date: Nov 2007
Location: Maine/Vermont
These guys'll teach you to SQL like a piggie!
  #12  
Old 02-18-2011, 07:32 PM
4Mal's Avatar
Endorsing Curmudgeon: Mal's Kitchen Cruelties ...
 
Join Date: Jun 2002
Location: Columbia River Gorge
Supporting Member
Another offer for pm assistance. As in you may pm me for help as well...
__________________
I think I'd know normal if I saw it ... 'Calvin
  #13  
Old 02-18-2011, 07:42 PM
fdeck's Avatar
Registered User

Maker of HPF-Pre upright bass preamp
 
Join Date: Mar 2004
Location: Madison WI
Supporting Member
Quote:
Originally Posted by MIJ-VI View Post
Another cherished sentimentality dashed?! (I've had a few...)

I don't know which is more depressing: this, or the fact that I recently had to line up at a post office three times within the span of one month... *mumbles to himself* Waitaminute...
LOL, I still use my 1998 copy of Visual Basic 5. You can pry it from my cold dead hands.

One of the things I haven't done with Linux yet is come up with a satisfactory alternative to VB. A colleague has given me an incentive to learn Python, which looks like it will probably be my best bet. I have to be able to control homemade hardware.
__________________
DIY gear articles and HPF-Pre
  #14  
Old 02-18-2011, 09:23 PM
MIJ-VI's Avatar
Registered User
 
Join Date: Jan 2009
Supporting Member
Quote:
Originally Posted by fdeck View Post
LOL, I still use my 1998 copy of Visual Basic 5. You can pry it from my cold dead hands.

One of the things I haven't done with Linux yet is come up with a satisfactory alternative to VB. A colleague has given me an incentive to learn Python, which looks like it will probably be my best bet. I have to be able to control homemade hardware.
What are the make and model numbers of the chips you've used in making your own hardware?

Beginner's Guide to Python
http://wiki.python.org/moin/BeginnersGuide

Python (programming language)
http://en.wikipedia.org/wiki/Python_...ng_language%29

Ubuntu, Python
http://www.google.ca/search?hl=en&so...=Google+Search

There's plenty of other Python links too.
http://www.google.ca/search?hl=en&so...=Google+Search

Since GNU/Linux is working its way into nearly everything which can be microprocessor controlled I'd expect that Python has something for your needs. Then there's the opportunities to collaborate with other Python-using hardware designers.
  #15  
Old 02-18-2011, 09:59 PM
fdeck's Avatar
Registered User

Maker of HPF-Pre upright bass preamp
 
Join Date: Mar 2004
Location: Madison WI
Supporting Member
Quote:
Originally Posted by MIJ-VI View Post
What are the make and model numbers of the chips you've used in making your own hardware?
Thanks for those links!

For now I'm doing really low level stuff, mainly for PC based data acquisition. My "universal peripheral" is a PIC18F chip with built-in 12 bit ADC, coupled to a packaged USB interface module that uses the FTDI chip. It's old school, but prior to my migration to Linux, it had the advantages of being the devil known, with circuit board layouts and a reasonable code base, both on the PIC chip and on the PC side. I think the FTDI chip is the most friendly in terms of the ease of using their Windows drivers. They also have Linux drivers that I haven't played with yet.

I built a gaggle of homemade 12-bit data acquisition boards with VB software that I took to work. Granted, we should be using commercial gear, but the nice thing about my tools is that they are cheap enough to give away, meaning that people aren't ashamed to use them for mundane things.

I have some friends who are fairly heavily into embedded systems. They all hate PIC chips, and I understand their objections, but most of them relate to supporting more elaborate firmware. However, they've suggested that I get myself up to speed on the lower end TI chips, such as the one in that cool wristwatch development kit. I will probably buy one of those and try to come up with a music related app. The TI chips are supported by GCC.

On the programming side, half of me wants to get away from writing "code" altogether. I wouldn't miss slinging C code, just as I don't miss writing assembly any more. Most of my programming is for short term problem solving rather than creating distributable apps. I am making increasing use of high level tools such as WxMaxima and GNU Octave. Anything I write that shows commercial potential gets turned into C++ or whatever by a professional programmer.
__________________
DIY gear articles and HPF-Pre
  #16  
Old 02-18-2011, 10:47 PM
MIJ-VI's Avatar
Registered User
 
Join Date: Jan 2009
Supporting Member
Quote:
Originally Posted by fdeck View Post
Thanks for those links!

For now I'm doing really low level stuff, mainly for PC based data acquisition. My "universal peripheral" is a PIC18F chip with built-in 12 bit ADC, coupled to a packaged USB interface module that uses the FTDI chip. It's old school, but prior to my migration to Linux, it had the advantages of being the devil known, with circuit board layouts and a reasonable code base, both on the PIC chip and on the PC side. I think the FTDI chip is the most friendly in terms of the ease of using their Windows drivers. They also have Linux drivers that I haven't played with yet.

I built a gaggle of homemade 12-bit data acquisition boards with VB software that I took to work. Granted, we should be using commercial gear, but the nice thing about my tools is that they are cheap enough to give away, meaning that people aren't ashamed to use them for mundane things.

I have some friends who are fairly heavily into embedded systems. They all hate PIC chips, and I understand their objections, but most of them relate to supporting more elaborate firmware. However, they've suggested that I get myself up to speed on the lower end TI chips, such as the one in that cool wristwatch development kit. I will probably buy one of those and try to come up with a music related app. The TI chips are supported by GCC.

On the programming side, half of me wants to get away from writing "code" altogether. I wouldn't miss slinging C code, just as I don't miss writing assembly any more. Most of my programming is for short term problem solving rather than creating distributable apps. I am making increasing use of high level tools such as WxMaxima and GNU Octave. Anything I write that shows commercial potential gets turned into C++ or whatever by a professional programmer.
DISCLAIMER: I know nothing about hardware beyond assembling obsolete PC components into a usable computer (which I find to be oddly relaxing) and doing simple troubleshooting via part swaps (@#^%$).

Perhaps starting a thread in: Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Development & Programming > Programming Talk and listing your current resources & future goals would draw in some useful assistance.

There's a lot of Windows ex-pats and current dual-booters over at the Ubuntu Forums thus there's bound to be migrants from Visual Basic who are also investigating Python.

It might be an idea to ask if there's any good hardware developers forums which are popular with GNU/Linux users.

BTW. PIC18F, Python
http://www.google.ca/search?hl=en&so...9d62e1ee9c6a86

Caution: WOT has flagged 'pic18f books - full Megaupload - DLseek' as being dangerous.

Certification Hardware certification
http://www.canonical.com/engineering...-certification

Perhaps an e-mail to Canonical would be in order. The folks there may have some suggestions re hardware control via Python. They're likely keen to help anyone to get GNU/Linux running on more systems.
  #17  
Old 08-28-2011, 05:51 PM
mattsk42's Avatar
$100 off new Directv subsp.PM me BEFORE signing up
 
Join Date: Oct 2004
Location: SiouxFalls by way of Pierre,SD
Send a message via AIM to mattsk42 Send a message via MSN to mattsk42 Send a message via Yahoo to mattsk42
Supporting Member
That seemed to get derailed, but I'm in a similar situation so suggestions are great!
__________________
Subscribe/buy Bass Gear Magazine
www.bassgearmag.com

Spector Club #231
  #18  
Old 08-28-2011, 07:22 PM
fdeck's Avatar
Registered User

Maker of HPF-Pre upright bass preamp
 
Join Date: Mar 2004
Location: Madison WI
Supporting Member
Quote:
Originally Posted by fdeck View Post
LOL, I still use my 1998 copy of Visual Basic 5. You can pry it from my cold dead hands.

One of the things I haven't done with Linux yet is come up with a satisfactory alternative to VB. A colleague has given me an incentive to learn Python, which looks like it will probably be my best bet. I have to be able to control homemade hardware.
LOL, thanks for bringing this thread back. It's a good lesson in "never say never."

I've abandoned Visual Basic in favor of Python. Well, I mean that I will continue using VB for supporting stuff that I've already written, and at my day job for writing Excel macros. As for Python:

Satisfactory alternative to VB: Check. I've found a very easy way to build dialogs -- possibly easier than drawing them.

Controlling homemade hardware: Check. Support for a widely available general purpose USB interface is part of Linux.

Because I'm a "learn by doing" kind of person, I gave myself a small number of projects to see how Python compares to similar projects that I've written in VB:

* Audio spectrum analyzer

* Data logger using my homemade hardware

* Speaker design program, which is something that I plan on sharing once I'm convinced that the computations are all correct.

As for learning database programming, it's possible to put a SQL database server on your own computer, against which you can write queries. This would be a pretty painless way to try database projects. But I still haven't learned how to do it myself.
__________________
DIY gear articles and HPF-Pre
  #19  
Old 08-28-2011, 09:01 PM
Rusty Chainsaw's Avatar
Working on his world citizenship...
 
Join Date: Oct 2002
Location: The Colonies
Send a message via ICQ to Rusty Chainsaw Send a message via AIM to Rusty Chainsaw Send a message via MSN to Rusty Chainsaw Send a message via Yahoo to Rusty Chainsaw
Supporting Member
SQL's pretty easy to begin with, but like most programming "languages", it gets more complicated as your demands on it increase. On the basic level, the CREATE/SELECT/UPDATE commands will provide you with most of the tools you might need. It's also worth learning about stored procedures (similar to using functions in most other programming languages) that can save a lot of time for repetitive tasks and take the load off the application server, moving it to the database server, which can execute the queries internally much faster than calling them from your program code.

For practical programming purposes, you often don't even need to touch SQL these days - there are plenty of ORM (object-relational mapping) solutions for the various programming languages out there, which basically map the properties of a SQL table to an object, then you can query it within the program code itself using a framework like LINQ (.NET), Hibernate (Java) or ActiveRecord (Ruby). This works best within the structure of a MVC (model-view-controller) programming environment (ASP.NET MVC, Django, CakePHP, Ruby On Rails, etc), where the database just becomes part of the program's "model" and your commands to it become part of the "controller", with the resulting output being rendered as a "view", each programmed separately and with their interactions and relationships explicitly specified. The advantage here is that the source code is more concise, easier to maintain and, since the actual data layer is abstracted, portable across different systems and database technologies. The downside is that the resulting object code can end up being larger and more bloated than if you coded it yourself without using a framework, plus it's a lot easier to get your hands dirty "under the hood" if you code without these tools.
__________________
Sei - Musicman - Spector - Fender - Krappy - MarkBass - Line6 - DigiTech
Sei club member #2
Twitter
Tumblr
Work
  #20  
Old 08-28-2011, 10:28 PM
cewillm's Avatar
FREE JimmyM!
 
Join Date: Jan 2010
Location: Philadelphia, PA
Supporting Member
Quote:
Originally Posted by Rusty Chainsaw View Post
SQL's pretty easy to begin with, but like most programming "languages", it gets more complicated as your demands on it increase. On the basic level, the CREATE/SELECT/UPDATE commands will provide you with most of the tools you might need. It's also worth learning about stored procedures (similar to using functions in most other programming languages) that can save a lot of time for repetitive tasks and take the load off the application server, moving it to the database server, which can execute the queries internally much faster than calling them from your program code.

For practical programming purposes, you often don't even need to touch SQL these days - there are plenty of ORM (object-relational mapping) solutions for the various programming languages out there, which basically map the properties of a SQL table to an object, then you can query it within the program code itself using a framework like LINQ (.NET), Hibernate (Java) or ActiveRecord (Ruby). This works best within the structure of a MVC (model-view-controller) programming environment (ASP.NET MVC, Django, CakePHP, Ruby On Rails, etc), where the database just becomes part of the program's "model" and your commands to it become part of the "controller", with the resulting output being rendered as a "view", each programmed separately and with their interactions and relationships explicitly specified. The advantage here is that the source code is more concise, easier to maintain and, since the actual data layer is abstracted, portable across different systems and database technologies. The downside is that the resulting object code can end up being larger and more bloated than if you coded it yourself without using a framework, plus it's a lot easier to get your hands dirty "under the hood" if you code without these tools.
That's actually a really good two-minute overview of MVC. I sometimes have a hard time describing the technology to peers so succinctly. You lose some flexibility with MVC but a lot of web apps are just boilerplate CRUD operations anyhow -- perfect for MVC.
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Follow TalkBass on Twitter   Visit TalkBass on Facebook  

All times are GMT -6. The time now is 01:24 AM.




Copyright 2011 Talk Music Group Inc. All rights reserved.
Play guitar? Visit our new sister site TalkGuitar.com [beta]
Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.