If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Easy Database Help!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-28-08, 00:52
dbn00b13 dbn00b13 is offline
Registered User
 
Join Date: Apr 2008
Posts: 1
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
Reply With Quote
  #2 (permalink)  
Old 04-28-08, 03:26
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
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
Reply With Quote
  #3 (permalink)  
Old 04-28-08, 06:39
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On