English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

4 answers

The mechanics of SQL are very straightforward. Basically, you build queries out clauses that start with key words, like SELECT, FROM, AS, WHERE, GROUP BY, ORDER BY, etc. You can create a simple query like

SELECT *
FROM MyCustomers
WHERE City="New York"

It selects all of the records in a hypothetical table called MyCustomers where the value in the City column is "New York." This is the SQL way of asking "Who are my customers in new york?" Of course, it can get far more complicated than this -- I've seen SQL code that would take up an entire letter-sized page of 12-point font.

Like all languages, some people are better at speaking it than others. It is possible to write two different SQL statements that accomplish the same thing. One may be longer, one may run faster, one may access fewer tables, etc. The key to writing good SQL code is to balance these aspects. Usually performance is a key concern, because faster is always better for your users.

Good luck with it!

2007-02-17 09:20:52 · answer #1 · answered by Anonymous · 4 0

As with most things, the basics are easy, but to become an expert takes years of hard work and practice. However, the "80-20" rule usually applies: that is, 80% of the work uses the fairly easy stuff and 20% uses the obscure and difficult stuff. Then again, it's the difficult stuff that makes you valuable and respected in the community of dbas and developers.

2007-02-17 08:25:43 · answer #2 · answered by Gene 3 · 1 1

The best bet is to get a decent tool to build the SQL for you, and then view the code. Eventually, to optimize a large database and to get into efficient design, you WILL have to get deeper into the code. It's not necessarily the best way to start though.

I'd begin with MySQL and SQLYog, both of which are free.

2007-02-17 11:28:20 · answer #3 · answered by Anonymous · 1 1

http://www.w3schools.com/sql/default.asp

2007-02-17 08:28:32 · answer #4 · answered by Zlavzilla 3 · 1 1

fedest.com, questions and answers