Here are some Microsoft Knowledgebase articles on queries:
http://msdn2.microsoft.com/en-us/library/ms190659.aspx
http://msdn2.microsoft.com/en-us/library/ms188724.aspx
http://msdn2.microsoft.com/en-us/library/ms189245.aspx
Here are some basic queries you can use that may help when working with a SQL database:
Update Query
You can use this to update multiple records at once. In Microsoft SQL Server Management Studio you can write this query by choosing the New Query button. After you choose New Query you must select what database you are performing the query on in the Available Databases drop down menu.
Here's an example:
You want to assign all customers that are not a company to price level 2. The table where this data is stored is called CUSMER. The CUS_TYPE column determines if a customer is a company or not (Anything but P is a company). The CUS_PRICEID column is what price level the customer is assigned to.
Here's the script you would write for this example:
UPDATE CUSMER SET CUS_PRICEID='2' WHERE CUS_TYPE='P'
Delete Query
You can use this to delete a specific range of records. In Microsoft SQL Server Management Studio you can write this query by choosing the New Query button. After you choose New Query you must select what database you are performing the query on in the Available Databases drop down menu.
Here's an example:
You want to remove any items from your inventory label list that are not assigned to the label type "5660 Standard". The table where this data is stored is called LABELS. The LAB_LabelType column determines what label type an item is assigned to on the label list.
Here's the script you would write for this example:
DELETE FROM LABELS WHERE LAB_LabelType != '1'