SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Other SQL Server 2012 Topics
 I need help with this question
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Jmepoltcn
Starting Member

3 Posts

Posted - 03/14/2013 :  02:29:24  Show Profile  Reply with Quote
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

USA
1974 Posts

Posted - 03/14/2013 :  13:47:06  Show Profile  Visit chadmat's Homepage  Reply with Quote
Homework?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 03/15/2013 :  13:03:10  Show Profile  Reply with Quote
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

USA
15658 Posts

Posted - 03/15/2013 :  13:28:43  Show Profile  Visit robvolk's Homepage  Reply with Quote
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 - 03/15/2013 :  16:43:32  Show Profile  Reply with Quote
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

Edited by - Jmepoltcn on 03/15/2013 16:47:27
Go to Top of Page

TG
Flowing Fount of Yak Knowledge

USA
6059 Posts

Posted - 03/15/2013 :  16:59:34  Show Profile  Reply with Quote
>>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 - 03/16/2013 :  02:39:12  Show Profile  Reply with Quote
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

USA
5072 Posts

Posted - 03/16/2013 :  14:22:18  Show Profile  Visit russell's Homepage  Reply with Quote
Can download SQL Server Express Edition. Free.

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

TG
Flowing Fount of Yak Knowledge

USA
6059 Posts

Posted - 03/18/2013 :  11:39:00  Show Profile  Reply with Quote
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

India
8 Posts

Posted - 03/20/2013 :  02:15:36  Show Profile  Reply with Quote
Hi Jmepoltcn,

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


Regards
Vinoth
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000