Important alert: (current site time 7/15/2013 7:00:59 PM EDT)
 

winzip icon

Tedious queries 150

Email
Submitted on: 4/17/2002 1:05:24 AM
By: pompyk 
Level: Intermediate
User Rating: By 31 Users
Compatibility: Oracle
Views: 22848
(About the author)
 
     These are the worlds most tedious queries....all r solved. If you solve these queries then u will become the master of sql...This shows examples of using joins, subqueries, functions etc etc....just look in...and do vote for me for my work.....thx....The table is all given...the queries are totally solved..... These are about 150 queries..related to date..joins..etc etc...
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

4/18/2002 9:02:25 AMRasputin

Looks like a massive reference by example - cool!

I give it 5 globes!

Thanks Somdutt

-Ras

(If this comment was disrespectful, please report it.)

 
4/19/2002 12:30:20 AMsomdutt ganguly

Thx friend for your feedback....There are 150 queries with 4 levels..u know if u get the queries then u can solve the most crucked queries ever
(If this comment was disrespectful, please report it.)

 
4/19/2002 3:51:24 PMParas

Aaye this is the exactly same list of queries that I had studied 4 yrs back when I was learning Oracle & VB. And to your surprise I just opened up my files to find the same list of queries. :-)! great coincidence...



Its a very nice practice material. Do go thru it before you go for an interview
(If this comment was disrespectful, please report it.)

 
5/28/2002 4:31:05 AMyumok

I think I have found an error... or i have missunderstood the question:

21) How many programmers don't know Pascal & C?

your query:
SELECT COUNT(NAME) AS PROGRAMMER
FROM PROGRAMMER
WHERE PROF1!='C'
AND PROF1!='PASCAL'
AND PROF2!='C'
AND PROF2!='PASCAL'

my query:
SELECT COUNT(NAME) AS PROGRAMMER
FROM PROGRAMMER
WHERE
(PROF1!='C' AND PROF2!='PASCAL')
or
(PROF2!='C' AND PROF1!='PASCAL')

(If this comment was disrespectful, please report it.)

 
5/28/2002 4:33:39 AMyumok

anyway... nice job
(If this comment was disrespectful, please report it.)

 
5/30/2002 4:51:20 PMsomdutt ganguly

good job!!..yes..or is required ..may be i have made an error in typing
(If this comment was disrespectful, please report it.)

 
7/8/2002 3:13:37 AMRed Python

Thanx somdutt for this toughtfull Idea!
This stuff is worth 5 stars!

Thanx & keep up the good work!
(If this comment was disrespectful, please report it.)

 
11/19/2002 3:43:37 PM

Hi

Its a very good compilation of a variety of queries. However, please note that most of these queries ( particularly complex queries) should not be used as u have given for performance reasons. If u use NOT IN for negation, the query will take forever for 100,000 records. Always use Exist and Not exist for the same.

Good work.

(If this comment was disrespectful, please report it.)

 
10/14/2004 12:27:44 PMMark Kahn

to the person that said to use NOT EXISTS as opposed to NOT IN: wrong. They both have their place and the performance of both is -very- dependant on how the data is structured.

and I'm sorry, but saying these are the world's most difficult queries is well...rediculous. I can show you dozens of queries that are far more complicated.
(If this comment was disrespectful, please report it.)

 
12/20/2004 5:00:01 PM

I can appreciate your enthusiasm, but there seems to be a lot more involved in becoming a master (first rule of being a master - don't call yourself one.), but in any case, sql also involves user administration, stored procs, error handling, table alterations, log handling, data cleansing, application interfaces, shells, and much much more.
(If this comment was disrespectful, please report it.)

 
2/4/2005 7:20:32 AM

MOST OF THE QUERIES UNDER LEVEL 3 ARE SOLVED IN WRONG MANNER. ALSO ALL THOSE QUERIES ARE ALREADY AVAILABLE AT ANATHER SITE.
(If this comment was disrespectful, please report it.)

 
7/3/2005 5:33:09 PMsomdutt ganguly

The queries i made along time back. Yes these are complicated queries in intermediate level. (IF YOU WANT TO PLACE MORE COMPLEX QUERIES THEN POST IT IN ADVANCE LEVEL...)..... that's why i haven't placed the above stuffs in advance level.!!!!!...i told before!!. the queries may be solved in wrong manner!
(If this comment was disrespectful, please report it.)

 
7/24/2006 5:54:23 AMSaqib

Nice work. keep it up.
(If this comment was disrespectful, please report it.)

 
3/7/2007 6:41:31 AMMohanraj

Nice work Ganguly, Though there are several alternate methods and ways... and as there are several methods to approach a problem.. the readers may have different ideas.. In general it was very good work and expecting more from you.. Keep it up.. Thanks..
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.