I bought the book "Oracle 10g:sql" and am trying to figure out SQL. I was able to set up the books example tables I am attaching the table's schema in hopes that it helps you help me (I have a sql file that sets up these tables if that would help?). I had some trouble reading the sqlplus output in a windows terminal window so I am now trying isql*plus.
OK, question time...
I am having trouble with some of the queries beyond the basic stuff (like looking at a whole table, or basic join of tables, creating tables, add, drop and the like). The examples in the book are ok but I am having trouble seeing how they translate to real world questions. The book seems to answer questions made to show how a specific function or clause works.
for example I understand how to use min to see the oldest/newest order but all I see is the one column, how do I get the whole row or record to show? There are 3 orders with the same date (looking at oldest) how do I get all three records to show or just one?
the error i seem to get most with this example is : not a single-group group function when I try to find a way to display more than just the oldest/newest date.
"select customer#, min(orderdate)"
I think I understand how to join two tables but once again I am lost on how to see a useful information from that join....like how would I see how many customers don't have an order? I think the count function would be used but not sure how? or what if I wanted to see a table with records (like those in customers) of customers that didn't have an order?
I have read about the functions but I guess I am not understanding their use in queries, like the avg: how would I go about finding the avg total cost of a customer's orders?
Thank you for your time and any effort put forth to help me understand. This is my first real post here, if I have done anything wrong in my post I am sorry.