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
 General SQL Server Forums
 New to SQL Server Programming
 sql count function

Author  Topic 

onlyneedtoask1question
Starting Member

1 Post

Posted - 2014-11-17 : 09:42:20
hey guys I Need some help with my SQL homework.
I Need to find the names, persnr and number of assistants per Professor, including those who have no assistants, which wilkl have values 0 in the 'anzahl' column. so far i've only managed to find the ones for professors who do have assistants and can't add the ones who don't.
<a href="http://de.tinypic.com?ref=2zyjv38" target="_blank"><img src="http://i58.tinypic.com/2zyjv38.jpg" border="0" alt="Image and video hosting by TinyPic"></a>

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-11-17 : 10:07:04
Welcome to the forum! We'd love to help you learn more (and ace your course!) but we need you to help us. Would you please post:

1. The table definitions for the tables you need to query. the best way is to post CREATE TABLE statements so we can see all the columns and types
2. Some test data to populate the tables in step 1. The best way to post that is as a series of INSERT INTO statements, so that we can copy and paste your code directly into the IDE (usually SSMS)
3. The query you have developed so far (free of syntax errors!)
4. the desired results when executing a complete, correct query against the tables set up in steps 1 and 2.
Go to Top of Page
   

- Advertisement -