[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SQL Q's.




Now that I've been forced (well it was my idea, so maybe that's a bit
inaccurate) to start writing SQL queries, I need to know some things.

1)  When selecting a row for updating, the quickest way to select it is by
the primary key.  True?  Are there times when you wouldn't want to use the
primary key?

2) How to you write a SQL statement to select the fields from rows in a
table based on the value of another field in the table.  Ie:

SELECT CategoryID,CategoryName,Description FROM Categories WHERE Approved
= 'Y'

3) How do I insert a row in a table for which the primary key is
auto-incrementing or not auto-inc?

3) How do I update one or more fields in a row?

4) How do I update one field in multiple rows based on a value of a field
in that row?

5) Anyone know any good SQL sites?  Something like SQL for Dummies?

Thanks.

--
Aaron Turner, Core Developer       http://vodka.linuxkb.org/~aturner/
Linux Knowledge Base Organization  http://linuxkb.org/
Because world domination requires quality open documentation.