Page 1 of 2 12 LastLast
Results 1 to 15 of 19

Thread: SQL Questions

  1. #1
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401

    Unanswered: SQL Questions

    I have to judge the aptitude of a few trainees for SQL DBA training ....

    Can the gurus suggest some questions for the same ....
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  2. #2
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    http://vyaskn.tripod.com/iq.htm plus your experience.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  3. #3
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    All the questions coming to my mind seem to me to be a bit tough for the new guys ... out of a total of 14 guys I have to pick two and train them .... I just want to know which of them have an inclination towards sql
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  4. #4
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    You never know and referred link does have necessary information, go thru it.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    an incliniation towards sql or an inclination towards sql server?

    see TSQL knowledge test
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  6. #6
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    How did I miss out on that ...

    Bookmarked

    I think this should suffice

    Comments welcome
    Attached Files Attached Files
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  7. #7
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    hey, neat, let's all answer a question

    10. last day of the month:
    Code:
    select 
      dateadd( dd
       , -1
       , dateadd( mm
          , 1
          , dateadd( dd
             , -day(getdate())+1
             , getdate()
                   )
                )
             )
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  8. #8
    Join Date
    Jan 2003
    Location
    India
    Posts
    523
    Originally posted by r937
    hey, neat, let's all answer a question

    10. last day of the month:
    Code:
    select 
      dateadd( dd
       , -1
       , dateadd( mm
          , 1
          , dateadd( dd
             , -day(getdate())+1
             , getdate()
                   )
                )
             )
    this unfair
    I just came up with
    select dateadd(m,1,getdate())-day(getdate())
    and till that u posted reply.
    damn u r fast.

  9. #9
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    I believe Harshal's answer is better ... I too cam up with same logic
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  10. #10
    Join Date
    Jan 2003
    Location
    India
    Posts
    523
    Originally posted by Enigma
    I believe Harshal's answer is better ... I too cam up with same logic


  11. #11
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    as the saying goes, "bzzzzt, wrong!"

    try your query for today=january 30

    then try mine
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  12. #12
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    Yup ...

    You are right ... didnt think of that case ...

    I will have to revisit my procs ....
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  13. #13
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    i think it is safe to say that whenever you are coding an expression involving date arithmetic, it would be a good idea to test it over month-end boundaries, year-end boundaries, and february, both normal and leap years
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  14. #14
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    Originally posted by r937
    i think it is safe to say that whenever you are coding an expression involving date arithmetic, it would be a good idea to test it over month-end boundaries, year-end boundaries, and february, both normal and leap years
    Checked it for feb ... normal and leap years ... never thought of checking it for JAN
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  15. #15
    Join Date
    Jan 2003
    Location
    India
    Posts
    523
    Originally posted by r937
    as the saying goes, "bzzzzt, wrong!"

    try your query for today=january 30

    then try mine
    u r right ..

    there u go !!.

    time to open the learning books again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •