Basic sql structure

Barry83

New member
Local time
Today, 19:19
Joined
May 13, 2014
Messages
9
I am used to running queries in access using the design view but want more of an understanding of sql so i can write more complex queries.

I have a good understanding (not expert) of design builder but is there a good fundamental flow/structure i should understand when in sql mode?

Any advice is greatly appreciated.
 
Can you tell us, or describe an example of, what you mean by
there a good fundamental flow/structure i should understand when in sql model

One of the best references to sql is Simply SQL by Rudy.
You can see a pdf version here. I believe it is one of the best sources of SQL info and usage.
 
Last edited:
Suggest you use the query designer to create a query then look at it is sql view.

The query builder always uses sql brackets, round brackets and table names regardless and when writing sql you can sometime do away with them.

For example the query builder will generate

SELECT [Table1].[ID], [Table1].[AcName] FROM [Table1]

but this code is just the same.

SELECT ID, AcName FROM Table1

square brackets are required if you have spaces in your table or field names. The table name only needs to be referred to if the field name is not unique or for joins. So far as I am aware, using or not using table names does not have an impact on the performance of the sql code.

There are basic constructs so this link will help

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

although there are plenty of sites to tell you much the same thing.

The query builder will not build aliased tables so as with union queries you have to go into sql editor to complete these anyway.
 
Thanks jDraw,Cj_London has summarised it. I am looking at when the square brackets, round brakets, full stop, commas are used etc.

and basic language when writing queries like the use of FROM or ELSE, this type of thing.
 
Yes, Access adds a lot of fluff as CJ suggested.
W3Schools has a great set of tutorials; but Simply SQL (Rudy Limeback) is a reference. Whenever you need the details and/or rationale for something --this is the source of info.
 

Users who are viewing this thread

Back
Top Bottom