Hi Pal,
In general, I think you will find that people on discussion groups aren't eager to answer test questions for other people.
Let me suggest you do the following:
First, number the questions 1..n for easy reference.
Then, for each question, give your thoughts on the question and individual answers. This will give us a good feeling that you are actually doing the work and not just asking us to feed you the answers.
You might also want to download and install a free development server, as a number of these questions could be answered by just experimenting on a server.
I will note that I don't think the test itself is entirely correct.
As an example, question 1:
Identify the error in the following query? (Choose 2)
Select col1, col2, col3 from TableA, TableB, TableC
Where TableA.col1 = TableB.col1 group by col3
- There is no order by clause [only an error if the query is supposed to generate sorted results. There is nothing in the problem statement that says the result set should be ordered, so I wouldn't call this an error.]
- There is no join clause for table C. [without a join clause, ASE will generate a Cartesian product. A Cartesian product usually isn't what is desired, but can be valid in some cases, so I don't think this is necessarily an error either, the lack of a join clause does not make the query invalid TSQL]
- There are no aliases. [Seems poorly worded as an answer to the question, but probably what is intended as the 2nd correct answer as the error in the query could be corrected by using correlation names (aliases) throughout the query. The aspect that gives me problems here is in the WHERE clause - would you call the "TableA" in "TableA.col1" an alias or just a qualified column name? If it is an alias, then the statement "There are no aliases" is factually incorrect. If "TableA" is considered simply part of a qualified column name rather than an alias, then "the error in the following query" is that neither (aliases are used consistently throughout the query) nor (qualified column names are used in the SELECT clause).
- Identically named columns in two separate tables are not permitted [simply not true. Column names must be unique within a table, but multiple tables may use the same column name - sysobjects and syscolumns both have a column named "name"]
- “col1” is ambiguously named but [badly written answer as this is a sentence fragment. "but" what? However, it is true that "col1" in the SELECT clause is ambiguous as both TableA and TableB have a column named "col1" per the WHERE clause, and that ambiguity is a problem.]