Results 1 to 14 of 14
  1. #1
    Join Date
    Apr 2006
    Posts
    13

    Post Unanswered: Is This Right And Is There Other Ways To Write This

    Give the SQL statements that determine the following:

    Which customers lives in New Jersey?


    SELECT *
    FROM orders
    WHERE shipdate > '01-APR-03'
    /

    Which orders were shipped after April 1, 2003


    SELECT *
    FROM orders
    WHERE shipdate > '01-APR-03'
    /

    Which books are not in Fitness Category?

    SELECT *
    FROM books
    WHERE category <> 'FITNESS'
    /


    Which customers live in either Georgia or New Jersey? Put the results in ascending order by last name.

    SELECT *
    FROM customers
    WHERE state = 'GA' or state = 'NJ'
    ORDER BY lastname
    /

    Which orders were place before April 2, 2003?

    SELECT *
    FROM orders
    WHERE orderdate < '02-APR-03'
    /

    List all authors whose last name contains the letter pattern "IN". Put the results in order of last name, then first name.
    SELECT *
    FROM author
    WHERE lname LIKE '%IN%'
    ORDER BY lname, fname
    /


    List all customers who were referred to the bookstore by another customer.

    SELECT *
    FROM customers
    WHERE referred IS NOT NULL
    /


    Use a search pattern to list all books in the Children and Cooking Categories. Do not use any logical operators in the WHERE clause.
    SELECT *
    FROM books
    WHERE category LIKE '%C%N%'
    /


    Use a search pattern to find any book where the title has an "A" for the second letter in the title, and an "N" for the fourth.

    SELECT *
    FROM books
    WHERE title LIKE '_A_N%'
    /

    List the title of any computer book that where published in 2001.

    SELECT *
    FROM books
    WHERE pubdate LIKE '%01'
    /


  2. #2
    Join Date
    Jan 2004
    Location
    New Delhi
    Posts
    7

    What was this question all about?

    With these simple SQL queries, what prompted you to ask this question ? Execute them one after another and see if you get the desired result.

  3. #3
    Join Date
    Apr 2006
    Posts
    13
    what r u trying to say...look i have a learning disablity am i do this right..just asking 4 help..please

  4. #4
    Join Date
    Apr 2006
    Posts
    13

    Red face

    MY TUTOR AT SCHOOL WAS RUDE, SO I HOPING THAT JUST 1 PERSON ON THESE ORACLE SITES WOULD WANT 2 HELP ME, SHOW ME WANT I DID RIGHT, WRONG, OR SHOW ME WAYS TO REWRITE IT..I AM A HARD WORKING PERSON WITH DISABLE NEEDS(VISUAL LEARNER)..JUST ASKING 4 HELP..I MADE A 4.0 LAST SEMESTER BECAUSE PEOPLE WANTED AND WAS WILLING TO HELP ME..


  5. #5
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Learning disabilities or not, but - if you were able to put those queries on this Forum, what prevents you to actually try them in your Oracle database?

    OK, a few words: What makes you think that this has anything to do with customers in New Jersey?

    SELECT *
    FROM orders
    WHERE shipdate > '01-APR-03';

    Next: this query

    SELECT *
    FROM orders
    WHERE shipdate > '01-APR-03';

    wouldn't work on my database because default date format is different from the one you specified. Never rely on on implicit conversion, always do it explicitly. In this case, something like this: "shipdate > TO_DATE('01.04.2003', 'dd.mm.yyyy')".

    The same goes for the last query:

    SELECT *
    FROM books
    WHERE pubdate LIKE '%01';

    Depending on the default date format, this might not work. Perhaps something like this would be better:

    WHERE to_char(trunc(pubdate, 'yyyy'), 'yyyy') = '2001';

    I think that the rest is correctly written.

  6. #6
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    These are being cross posted to http://www.orafaq.com/forum & a followup to posting here earlier this week.
    I refuse to provide answers to HOMEWORK assignment questions & facilitate what is essentially cheating.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  7. #7
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Well, if someone needs to cheat on this kind of queries, hm, he'd better change the school.

  8. #8
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Your tutor at school may have been RUDE, but so are you. I don't believe you for a second. If you could see will enough to type the questions, then you can see will enough to read a book. Just because people have a disability does not mean that they don't have to try.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  9. #9
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Right; however, MS Windows can be set up in order to help disabled people work more easily, but books can't be resized nor font enlarged.

    BTW, it seems that this discussion goes to wrong direction.

  10. #10
    Join Date
    Dec 2003
    Posts
    1,074
    Which orders were shipped after April 1, 2003


    SELECT *
    FROM orders
    WHERE shipdate > '01-APR-03'
    /

    Be careful with this one, because if time is an essential element of your date field, then you'll gather everything that happened on April 1 after 12am. A more reliable syntax would be:

    Code:
    SELECT * 
    FROM orders
    WHERE shipdate > to_date('01-APR-2003 23:59:59', 'DD-MON-YYYY HH24:MI:SS')
    -cf

  11. #11
    Join Date
    Jul 2003
    Posts
    2,296
    Hey, I'm just a duck with a small brain and no fingers with webbed feet.
    BUT I MAKE IT WORK DAMMIT!

    and look at LittleFoot? He doesn't even have a brain and is a SMALL foot to
    boot. He makes it work too.

    If you can find this website then you can figure out the answers to your
    basic/beginner/1st-day questions through google or online books or whatever.

    Saying that you are a retard is not really helping the situation since I can't
    imagine anyone here interested in helping a self-proclaimed retard join the
    Oracle community. Bad for business and such.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  12. #12
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    I wouldn't be quite so strong, but my point is that if he can read and type on the screen, then you can read books on-line. (when I said read books, I meant on the net. I only read paper books for pleasure).

    <My final word on this subject>
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  13. #13
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    This sort of thing seems to be more common in the Microsoft SQL forum next door, but over time the students have been learning to disguise their efforts a bit better. This is a pretty early one, but it is good for a laugh. I figure r937 will not mind me posting the link.
    http://www.dbforums.com/t973112.html

    I think this is the second time I have seen people asking questions about Oracle homework. Is Oracle trying to market to the Universities, now?

  14. #14
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    LOL, Rudy had his day

Posting Permissions

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