Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Importance of Style on Exam? Expand / Collapse
Author
Message
Posted Wednesday, April 24, 2013 12:00 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Yesterday @ 10:21 AM
Points: 529, Visits: 1,567
I've noticed that the 70-461 Exam guide contains quite a bit of the authors' opinions on the style issues of query writing that are not enforced by the database engine and not all code writers adhere too.

For example, the book may use an example like

SELECT s.St_Id AS 'Student ID', s.FIRST AS 'First Name', s.LAST AS 'Last Name', m.DESCRIPTION AS 'Major'
FROM STUDENT AS s
INNER JOIN MAJOR AS m ON s.M_ID = m.M_ID;


Where I might have written it like

select s.st_id 'Student ID', s.first 'First Name', s.last 'Last Name'
from student s inner join major m on m.m_ID = s.m_ID


There is the argument that some forms are more readable, but people who have been writing queries for years using a different style may disagree.

Is knowledge of the "preferred" styles of query writing needed on the exam? Or is it just being able to recognize what will and will not produce the desired output?

Post #1446154
Posted Wednesday, April 24, 2013 12:05 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 6:20 AM
Points: 23,045, Visits: 31,571
dan-572483 (4/24/2013)
I've noticed that the 70-461 Exam guide contains quite a bit of the authors' opinions on the style issues of query writing that are not enforced by the database engine and not all code writers adhere too.

For example, the book may use an example like

SELECT s.St_Id AS 'Student ID', s.FIRST AS 'First Name', s.LAST AS 'Last Name', m.DESCRIPTION AS 'Major'
FROM STUDENT AS s
INNER JOIN MAJOR AS m ON s.M_ID = m.M_ID;


Where I might have written it like

select s.st_id 'Student ID', s.first 'First Name', s.last 'Last Name'
from student s inner join major m on m.m_ID = s.m_ID


There is the argument that some forms are more readable, but people who have been writing queries for years using a different style may disagree.

Is knowledge of the "preferred" styles of query writing needed on the exam? Or is it just being able to recognize what will and will not produce the desired output?



Speaking of style, neither of the above is how I would write that code.
I would write it like this:


select
s.st_id as StudentID,
s.first as FirstName,
s.last as LastName
from
dbo.student s
inner join dbo.major m
on m.m_ID = s.m_ID;


Also, quite possible, I would leave out the 'as' in the column list as it is optional but adds to readability.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1446159
Posted Wednesday, April 24, 2013 12:10 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 4:09 PM
Points: 21,252, Visits: 14,960
You need to know what the query does and not necessarily the style



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1446163
Posted Wednesday, April 24, 2013 12:11 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Yesterday @ 10:21 AM
Points: 529, Visits: 1,567
But you wouldn't miss an exam question because you picked the answer that left out the AS would you?
Post #1446165
Posted Wednesday, April 24, 2013 12:13 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 4:09 PM
Points: 21,252, Visits: 14,960
dan-572483 (4/24/2013)
But you wouldn't miss an exam question because you picked the answer that left out the AS would you?


No, but AS is preferred for readability.

The exam does not test style.




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1446168
Posted Wednesday, April 24, 2013 12:15 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 6:20 AM
Points: 23,045, Visits: 31,571
dan-572483 (4/24/2013)
But you wouldn't miss an exam question because you picked the answer that left out the AS would you?


That I can't answer as I have yet to take any MS certification exams as much as I have wanted to for many years.

If you have the option between two queries that are identical except for the use os AS, I would probably choose the one using the AS.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1446169
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse