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 ««12

Give Varibale as column name Expand / Collapse
Author
Message
Posted Saturday, November 3, 2012 12:02 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 12:12 PM
Points: 1,945, Visits: 3,180
He's not building a table, Joe. He's trying to build a dynamic cross-tab report.


That is even worse; he does not know how to use a report writer

Based on teaching SQL for a few decades is that you will need 2-3 years of hard work before you are able to write usable SQL code.
Not if you have a good teacher.


The student has to bring something. Today, there are a lot of kids who expect you "learn me some SQL" rather than the truth that "I teach, you learn".

What I found is that if I know their native programming language (or at least the language family), I know why they are doing what they do. People seldom make random errors. For example nouns in Japanese do not change form and the verbs and quasi-verbs (wa, ga, ka, etc) go at the end of the sentence. Compare that to English or (worse) strongly inflectional languages like Latin. So the Japanese speaker will forget plurals and cases, then put his verb in the wrong place. Oh, the Japanese temporal model is different for verb tenses.

A German speaker has a much easier time with English. Some of the words are common or close enough. Sentences have a subject, the verb tenses are pretty much the same, etc.

You simply expect the Japanese student to have a harder time than the German. About 3-5 years difference in learning time, if I remember teh stats. Same principle for RDBMS and SQL.

The only other declarative language most people know is Spreadsheet and that is not much help with SQL. The guys that really "get it" from the start are LISP and APL programmers!






Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
Post #1380734
Posted Saturday, November 3, 2012 12:52 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 7:27 AM
Points: 35,769, Visits: 32,437
There's not always a report writer to be had or allowed to be had, Joe. Learning how to do a cross tab on all sorts of data is an essential skill.

While I agree with everything you said in your latest post above, there was no need for you to bust the OPs chops in the post previous to that nor do I agree that it takes 2 to 3 years to teach someone to be really "useful" at T-SQL. Your comments were inappropriately negative. If you spent less time being negative with the student, there'd be more time to teach and exercise the student. Take the negativity out and you could probably get it down to 6 months or so.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1380738
Posted Saturday, November 3, 2012 2:03 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, December 12, 2014 10:09 AM
Points: 2,876, Visits: 5,201
Jeff Moden (11/3/2012)
... Take the negativity out and you could probably get it down to 6 months or so.


+100


_____________________________________________
"The only true wisdom is in knowing you know nothing"
"O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!"
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
Post #1380740
Posted Sunday, November 4, 2012 11:56 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 7:27 AM
Points: 35,769, Visits: 32,437
CELKO (11/3/2012)
He's not building a table, Joe. He's trying to build a dynamic cross-tab report.


That is even worse; he does not know how to use a report writer


What really amazes me about this comment is that your book (SQL for Smarties - Advanced SQL Programming - Third Edition) speaks specificially of why you might want to do a crosstab. I quote from Section 23.7 with the title of "Cross Tablulations" on page 538...

However, if you have to use the reporting package on the client side,
the extra time required to transfer data will make these methods on the
server side much faster.


So stop badmouthing the OP on what you, yourself, have justified in writing. At least read your own book before going negative on someone!


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1380812
Posted Sunday, November 4, 2012 10:08 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 12:12 PM
Points: 1,945, Visits: 3,180
I quote from Section 23.7 with the title of "Cross Tabulations" on page 538...
However, if you have to use the reporting package on the client side,
the extra time required to transfer data will make these methods on the
server side much faster.


So stop badmouthing the OP on what you, yourself, have justified in writing. At least read your own book before going negative on someone! [/quote]

1) I never advocate formatting the presentation in the DB layer of a tiered architecture. This guy wants to name columns! It is fine to assemble the data, but not to format it. If I did, I need to correct my next edition.

Return a table, but not a display.

These days, I find that I do not want even to have an ORDER BY to convert the result table into a sequential file structure for the front end. I am talking to a report server that will sort, compute, aggregate, colorize, etc a dozen different ways for a zillion reports. They eat and digest raw data better than than I can in SQL.

2) When the SQL is up to the task and efficient, do it in the database. In recent years that has meant more basic aggregation has been put into queries (rollup, cube, et al).

3) SQL FOR SMARTIES is in the 4-th edition now. The typesetting stinks. It was outsourced to India, crammed into one template for all MKP books and I have offered to pay for re-setting it.



Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
Post #1380872
Posted Monday, November 5, 2012 6:02 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 7:27 AM
Points: 35,769, Visits: 32,437
CELKO (11/4/2012)
2) When the SQL is up to the task and efficient, do it in the database. In recent years that has meant more basic aggregation has been put into queries (rollup, cube, et al).


That sometimes requires the naming of columns, Joe. There's no harm in doing so, either. The columns have to be named one way or the other.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1381037
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse