Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Other SQL Server 2012 Topics
 I need help with this question

Author  Topic 

Jmepoltcn
Starting Member

3 Posts

Posted - 2013-03-14 : 02:29:24
Write a SELECT statement that returns four columns:

VendorName From the Vendors table

InvoiceNumber From the Invoice table

InvoiceDate From the Invoice table

Balance InvoiceTotal minus the sum of
PaymentTotal and CreditTotal

The result set should have one row for each invoice with a non-zero balance. Sort the result by VendorName in ascending order.

chadmat
The Chadinator

1974 Posts

Posted - 2013-03-14 : 13:47:06
Homework?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-03-15 : 13:03:10
show us what you tried so far

This is not a site for spoonfeeding homework answers!

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2013-03-15 : 13:28:43
quote:
Originally posted by visakh16

show us what you tried so far

This is not a site for spoonfeeding homework answers!
Yes, that would be these sites:

http://www.spoonfeedSQLhomework.com/
http://www.domySQLhomeworkforme.com/

Let's see how long those domains remain unregistered.
Go to Top of Page

Jmepoltcn
Starting Member

3 Posts

Posted - 2013-03-15 : 16:43:32
well the thing is I don't have a database to try it out on all I can do is type out the answer and submit it via MOS word and hope that I get the right answer. This is what I have so far;

SELECT VendorName, InvoiceNumber, InvoiceDate, Balance
FROM Vendors JOIN Invoices
WHERE
ORDER BY

I don't understand the balance and how to do it especially for multiple tables

P.S. fake URLs... funny... I knew just by reading them
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2013-03-15 : 16:59:34
>>all I can do is type out the answer ... and hope that I get the right answer

I think there is another option. You could review your study materials, read the text, and look at, and try to understand, the examples.

Finally, if all else fails, ask robvolk specifically to help you. I think he was this close to giving you the answer.

Be One with the Optimizer
TG
Go to Top of Page

Jmepoltcn
Starting Member

3 Posts

Posted - 2013-03-16 : 02:39:12
okay, yeah I have read all of the material, watched the videos, the Power point presentations and searched the internet, and although I am fairly computer savvy this database/sql stuff is like trying to understand chinese... I have probably 6-8 hours into this one question and it sounds to me as though you all don't even know how to do it either so why do you even have this forum if you don't know how to do this stuff either
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2013-03-16 : 14:22:18
Can download SQL Server Express Edition. Free.

http://www.microsoft.com/en-us/download/details.aspx?id=29062
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2013-03-18 : 11:39:00
quote:
Originally posted by Jmepoltcn

okay, yeah I have read all of the material, watched the videos, the Power point presentations and searched the internet, and although I am fairly computer savvy this database/sql stuff is like trying to understand chinese... I have probably 6-8 hours into this one question and it sounds to me as though you all don't even know how to do it either so why do you even have this forum if you don't know how to do this stuff either


Well, in a way you are right. We don't know how to solve your problem because we don't know what tables are in your model how they relate to each other. It's like calling someone for directions and asking, "how do I get home?". If they don't know where you are and where you live then even Atlas himself can't help you.

I suspect you have at least two problems: How, syntactically, to form a SELECT statement from multiple tables. And how is your data model organized to store invoice, payments, and vendor information.

For help with the syntax Books online is a great resource. Also, you can probably randomly select any topic on this forum site to see examples. For help with your data model you would need to provide specific details to us as to the tables, their structure including the primary keys and foreign keys.

Be One with the Optimizer
TG
Go to Top of Page

Vinothkumar
Starting Member

8 Posts

Posted - 2013-03-20 : 02:15:36
Hi Jmepoltcn,

Could you show your table structure and what are the column using in your table.


Regards
Vinoth
Go to Top of Page
   

- Advertisement -