Page 1 of 1

Learning the Rudiments of MySQL

Posted: 23 Jun 2011, 13:55
by StarPhoenix
Someone in management believes that I would be able to relieve our developers of some nasty spade work if I were to learn some basic HTML and a few MySQL statements.

I have HTML covered, I think, but what would be the simplest way of learning the easier bits of the abovementioned database software? I would prefer not to shell out hundreds of rands to buy a book, so if you know of any good online resources, please let me know about them.

Thank you

Re: Learning the Rudiments of MySQL

Posted: 23 Jun 2011, 17:32
by hamin_aus
SQL is stupidly easy to learn.
mySQL is a stupidly simple DB

Get Toad or some other free front-end for mySQL and Google one of those teach yourself SQL in 7 days tutorials

Re: Learning the Rudiments of MySQL

Posted: 23 Jun 2011, 18:09
by rustypup
MySQL CE - available for free - be sure to grab workbench while you're about it, (workbench is similar in function to sql studio - DB managment, query, analysis, etc, etc)

the most important thing to learn is that there is no better query structure than SELECT * FROM <TABLE>... this is, simply put, the most efficient approach to extracting data... especially if used on multiple tables.... multiple times.... every minute....
Spoiler (show)
in the event you missed it: the last bit's a lie... the best query is still DELETE * FROM TABLE WHERE 1=1

Re: Learning the Rudiments of MySQL

Posted: 23 Jun 2011, 18:56
by Anakha56
Also Google w3schools for some great learning material.

@rusty & hamin any other tips for sql query writing? I understand the query structure and what the commands all do my problem is in writing the queries :-(.

Sent from my HTC Desire to annoy hamin... :P

Re: Learning the Rudiments of MySQL

Posted: 24 Jun 2011, 09:41
by rustypup
Anakha56 wrote:any other tips for sql query writing?
my preference is for a nice, wide, 2B... not too hard, not too soft and it provides for a pleasing roundness in the script... it also transitions nicely between different media...

1) use the indexes!... labels may be more readable, but they're only there to slow things down... no point bothering with relational databases if you're not going to use the indexes...
2) never use "SELECT *" anywhere near production...
3) avoid IN() and LIKE like the plague..
4) NOLOCK can be your bestest buddy
5) UNION instead of OR
6) don't sort views unless there's a specific reason, (row_number()).. particularly if the view was created to plug into a report somewhere down the line...

there are a million and one of these...