Username: Password:

Author Topic: SQL  (Read 3798 times)

Ian Price

  • Welterweight
  • ****
  • Posts: 4571
SQL
« on: July 10, 2009, 11:28:38 AM »
Hello all,

Does anyone on here use SQL? If so do you know of any good reference websites? I'm pretty much self taught on it and can do basic queries, joins etc but want to learn a bit more detailed stuff.

Cheers,

Ian.
I think I hate being indecisive.

shobet

  • Welterweight
  • ****
  • Posts: 1582
  • Look into my eye...
    • http://www.dusksky.com
Re: SQL
« Reply #1 on: July 10, 2009, 02:45:14 PM »
Try http://www.w3schools.com/sql/default.asp for a reference otherwise Google is my friend when I forget how to do things or need some specifics. There should be plenty of example sites out there. Best way to learn is to do just do it. 
There are 10 kinds of people who understand binary.
Those who do and those who do not.

PhilKing

  • Welterweight
  • ****
  • Posts: 3655
Re: SQL
« Reply #2 on: July 10, 2009, 04:32:13 PM »
I've used it for almost 20 years now, starting with DB2, then Sybase, Informix, Oracle, SQL Server and even Access!  What you could do is download Oracle for your personal use - it is free and there is a lot of documentation around for it.  Other than that, as Shobet says, just playing with it is the best way to learn it.
So many pickups, so little time

MrBump

  • Welterweight
  • ****
  • Posts: 3405
  • Essex! Home of the Brave!!!
    • This Is Essex
Re: SQL
« Reply #3 on: July 10, 2009, 05:37:47 PM »
What are you going to be doing with it, Ian?  SQL has some subtle differences in its flavour, certainly between Oracle and MSSQL.

Personally, I'm a big fan of O'Reilly books.  I know that there are loads of resources online, but sometimes you just need a good solid book and a few hours of geek time!!!

Mark.
BKPs Past and Present - Nailbombs, Mules, Blackguard Flat 50's, VHII's & Trilogy Suite with Neck & Bridge Baseplates!

Ben_W

  • Bantamweight
  • **
  • Posts: 192
Re: SQL
« Reply #4 on: July 10, 2009, 07:16:29 PM »
+1 for w3schools, I used it for loads of stuff. Very good for learning from scratch or just brushing up on some skills. The tests are a nice addition too.
Cold Sweat, Irish Tour, Miracle Man

ailean

  • Welterweight
  • ****
  • Posts: 1357
Re: SQL
« Reply #5 on: July 11, 2009, 10:17:11 AM »
I use MS SQL (2000 mostly for work, and 2005 for a side project). I'm self taught and I don't consider myself an expert at all, but I find most thing I need with a google search. However that isn't a structured approach. If that's what you are after then O'Reily are pretty good, or even the Dummies books depending on where you are starting from.

Is there a specific problem you have?
Gibson LP std + Nailbomb set
Diezel VH4 & Orange Rockerverb 50

Ian Price

  • Welterweight
  • ****
  • Posts: 4571
Re: SQL
« Reply #6 on: July 12, 2009, 10:37:12 AM »
Cheers for the responses guys - very useful. I think practice makes perfect is the solution for me.

As far as problems go there is nothing specific. The role I do at the moment relies on quite a few queries on our database (pretty sure it's oracle 10g). I can code and run a few myself but struggle with more detailed ones and creating in line views (still don't fully understand this but the link provided earlier in the thread may help). The issue is that some of my work is not project related meaning that there is no analyst assigned and I have to go through the hell of IT prioritisation!

Also, it is only reporting I do against the database and as such I only have view access.
I think I hate being indecisive.

ailean

  • Welterweight
  • ****
  • Posts: 1357
Re: SQL
« Reply #7 on: July 12, 2009, 12:25:24 PM »
By inline views I assume you mean temp tables, of the type:

SELECT temp.*
FROM (SELECT *
            FROM Table1 AS t1
                    INNER JOIN Table2 AS t2 ON t1.id = t2.id
          ) AS temp
WHERE temp.id = @something

They are very useful, particularly if you need to put counts or other calculated values into a single row. You can nest these as well, although that really bakes my noodle.

One tip I'd offer (although you probably already know this) the graphic query compilers write really ugly SQL code, I always code 'by hand', and I always use alias's as it makes the select and where clauses much easier to read.
Gibson LP std + Nailbomb set
Diezel VH4 & Orange Rockerverb 50

Ted 'N' Leo

  • Lightweight
  • ***
  • Posts: 670
Re: SQL
« Reply #8 on: July 13, 2009, 10:48:48 PM »
Basically when i have a problem with something, i just google it!

The O'Reilly books are good though, we have a few of those lying around the office, its just important to remember the differences between Oracle SQL, iSql etc etc.
Driving in my car, smoking my cigar, the only time i'm happys when i'm playing my guitar!