Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2008
    Posts
    1

    Unanswered: Easy Database Help!

    Im very new to database and i have about 30 mins of experience and I figured i'd seek help here. I've got my tables and I need to list the customers living in the town of 'NEW' or 'OLD' who have recently placed an order totaling more than $50. How would my SQL statement look? I can't get it to execute

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so what is the problem
    you can't create the SQL to extract the data
    OR you can't exectute/run that SQL

    SQL is a psudo English language
    so you need soemhtign like
    SELECT column1,column2,column3,column4 FROM ATable
    WHERE town IN ("NEW","OLD")
    AND ordervalue>=50
    ORDER BY some columns

    the WHERE clause can be rewritten if you prefer as
    SELECT column1,column2,column3,column4 FROM ATable
    WHERE town ="NEW" OR town="OLD"
    AND ordervalue>=50
    ORDER BY some columns

    as to how you execute that SQL.. it depends on what yu want to do with the result of the data, and that would depend on what your application environment is (eg Visual STudio, MS Access, Java, PHP or whatever)

    if all you want to do is 'play' around with the SQL then consider downloading the MySQL tools formt he MyQL website.. it includes a query browser that will eanbale you to run SQL.. it also has a , albeit limited, help panel on usage of SQL commands

    HTH

    as you are u

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    dear dbn00b13

    we love helping students with their homework assignments

    however, we will not do them for you

    you must do the work, we will only provide advice

    so to begin, you must show us what you have tried, and what happens when you test it

    if you say "i don't know how to do such-and-such" the answer you will get from us is to go back and study it some more before trying it again
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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