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 2008 Forums
 Other SQL Server 2008 Topics
 Assistance Required

Author  Topic 

bethaliz
Starting Member

2 Posts

Posted - 2007-10-13 : 11:47:34
Hi,

I am a first year computer programming student. I have been doing quite well in my classes (as well as you can do in the first 6 weeks), unfortunately I have become hospitalized and I am trying to stay on top of my assignments online as not to fall behind in my classes. Because I am not able to attend class I do not get to ask questions or get help, so I'm hoping to get a hand here.

I have an assignment due in my Database class, and I am having trouble with one of the questions. I'm not looking for anyone to do my work, just for a point in the right direction.

We have been working on the One to Many relationship. Right now I'm just working with a table called BREWER and BEER. This is the question I'm having trouble with

"Display all of the information for brewers that don’t have any beers in our database."

I tried something like this

SELECT * FROM brewer
WHERE brewer.brewCode!=beer.brewCode;


But I get a list of everything. I"m not sure how to query where they do not equal or where one is not in the other.

Thanks in advance for any assistance

Kristen
Test

22859 Posts

Posted - 2007-10-13 : 13:34:37
Have a look in the Help File (Books Online) for NOT EXISTS or NOT IN

Come back if you are still stuck.

Kristen
Go to Top of Page

bethaliz
Starting Member

2 Posts

Posted - 2007-10-14 : 15:09:16
Thanks for your help. I did a search in help like you suggested, but it just gives me downloads.?
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-10-14 : 15:18:34
this should be of help:
http://weblogs.sqlteam.com/mladenp/archive/2007/05/18/60210.aspx

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-10-14 : 15:21:26
"but it just gives me downloads.?"

Not quite sure where you are looking ... it should be installed on your PC (along with the SQL Server client tools).

But its online too:

http://msdn2.microsoft.com/en-us/library/ms188336.aspx
http://msdn2.microsoft.com/en-us/library/ms177682.aspx

Kristen
Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2007-10-14 : 15:23:28
here is the reference for IN and NOT IN in BOL http://msdn2.microsoft.com/en-us/library/ms177682.aspx


-ec
Go to Top of Page
   

- Advertisement -