MAP Business Solutions Inc. Contact Us

Home

Services

Expertise

How it works

Why custom

Miscellaneous

SQL 101

What is SQL?

SQL is the abbreviation for Structured Query Language pronounced one of two ways; SEQUEL or ESS-Q-L

Talking to SQL

Firstly a connection to a SQL database must be made. With SQL tools, you can use Enterprise Manager or in Visual FoxPro create a data source connection and then use the SQLCONNECT(datasource, username, password)

Once you have a File Handle, you can then use SQLEXEC(FH, [SQL Command], [cCursor])

Show me the Data

To get the data

SELECT [ALL | DISTINCT] [column1, column2, ]
FROM [table1, table2]
WHERE conditions
GROUP BY [column-list]
HAVING "conditions "
ORDER BY "column-list" ASC | DESC

 

Delete Data

 

Tip: You cannot get back deleted data without a backup
Tip 2: Before doing a delete, I always use a select first, verify that the result set is what I want to delete and then change the SELECT to a DELETE

DELETE FROM <table> WHERE condition

 

Updating Data

UPDATE <table> SET FIELD Field1 = SomeValue WHERE condition

 

Home Copyright © 2005
MAP Business Solutions