Hello Query Guru's,
I am having issue writing the SQL statements efficiently, please help/guide me to learn how to write SQL’s more efficiently and logically. At my work I am being a fun every day by my team when comes the coding please guide me to become an efficient query writer. I am starving and ready to do hard work but need to know the correct path.
Thanks in Advance.
I do understand your position and feeling. Learning depends upon wish. Wish with a perfect time table. Time table which is only wish oriented. Don't try to learn the things in one go or as a big chunk, take them in small pieces for example, what is group clause, where having clause implemented, what is its use, output. One more example, what is join, types, syntax, where when they uses and what they produces with ORA etc. Make your "Knowledge Tower" by "Small Bricks". Don't hesitate to post your question even if they are basic; the only thing is we all welcome any fool question but hate every intelligent question which is asked in fool manner; i.e. question can be idiotic but manner should be enough good.
You could pick up examples from introductory books on Oracle.
For example the Certification Guides for the Oracle SQL Fundamentals Guide (1Z0-051 http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=5001&get_params=p_exam_id:1Z0-051&p_org_id=&lang= ) . Search bookstores / amazon.com for books for 1Z0-051
You could also look at Jason Price's book Oracle Database 11g SQL : http://www.amazon.com/Oracle-Database-11g-SQL-Press/dp/0071498508/ref=sr_1_1?ie=UTF8&qid=1372742972&sr=8-1&keywords=Jason+Price
Hemant K Chitale
in order to understand how to write efficient queries, you need to learn to read explain plans, understand wait events and become familiar with basic performance diagnostic tools. Of course, before that, you'd need to have a good understanding of basic Oracle architecture (OCA/OCP certification level would suffice).
I recommend following books:
1) Tom Kyte, "Efficient Oracle by Design"
2) Milsap, Holt, "Optimizing Oracle Performance"
3) Christian Antognini, "Troubleshooting Oracle Performance"
4) J. Lewis, "Cost Based Fundamentals"
And of course you can find lots of useful stuff in blogs -- by Tanel Poder, Jonathan Lewis, Richard Foote, Andrey Nikolaev and many others.