I looked a bit at that s3schools site. I would say that the SQL articles I've looked over are really bad. I could write an entire book on why this is bad:
Code:
CREATE TABLE Persons
(
P_Id int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255),
PRIMARY KEY (P_Id)
)
Then, head over to NULL, and read this:
Quote:
If a column in a table is optional, we can insert a new record or update an existing record without adding a value to this column. This means that the field will be saved with a NULL value.
Sort of ambiguous. How do make the column "optional?" Don't ask that site and don't bother searching for Google for that one.
Here's one that I am certain will not work in any RBDMS:
[snip] duh [/snip]
I could find more, but why?
Maybe maybe this is okay for someone building an ultra basic site that takes in some info and spits said info out, but these are very bad explanations and the site seems to get everything wrong.
The OP wants to learn how to build SQL and analyze data. This is considerably more complex and hard to intuit than a website. He will have to master the art of running sub-select queries, splitting tables apart and mashing them back together, and get decent at figuring out a faster version of the queries he is running. This is the very least he'll have to learn about and that w3schools site doesn't seem to touch on these subjects at all. In contrast, the SQL course I linked to above hammers this stuff into your brain, and I guess that if you are only out to build websites, you'd say that it isn't really valuable or practical, but believe me, when you are trying to query million-row tables of sales, customer, and product data and spit the data out into something you can actually use, all the things that class teaches comes in real handy.
Last edited by daveT; 04-12-2013 at 11:48 PM.