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
 Question from a student.

Author  Topic 

TJRJ7
Starting Member

5 Posts

Posted - 2015-02-04 : 19:37:11
Thank you for the help, I have removed key words as to stop my fellow classmates from Googleing this

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-02-04 : 19:48:10
Show us what you have so far. Keep in mind that we don't have your database, so we don't know how the tables are designed.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

TJRJ7
Starting Member

5 Posts

Posted - 2015-02-04 : 19:59:41
It's a single table with 8 columns (ISBN, Title, Genre, Author, Years, Price, Publisher, and Pages) and the title of the table is Jonathan Marks House of Books
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-02-04 : 20:05:23
Show us your code so far. Our policy here is to not help with homework unless effort has been shown.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

TJRJ7
Starting Member

5 Posts

Posted - 2015-02-04 : 20:10:19
What's the best way to show the code? I don't see any where to attach. Should I just copy paste the code that created the table?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-02-05 : 12:11:13
I don't really need the create table statement since you posted the columns already, sometimes we do need it. I just need to see your SELECT statement which shows what you have attempted to solve this homework question. This is a fairly straightforward homework question. You'll be using an aggregate function with a group by.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

TJRJ7
Starting Member

5 Posts

Posted - 2015-02-08 : 15:43:25
Select Years
From tjr5379_Jonathan_Marks_House_of_Books
Where (Select Count(Title) From tjr5379_Jonathan_Marks_House_of_Books)
Group By (Years)

I'm guessing the problem is in the where statement but i'm not sure what
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-02-08 : 15:48:58
select Years, COUNT(*)
from tjr5379_Jonathan_Marks_House_of_Books
group by Years

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

TJRJ7
Starting Member

5 Posts

Posted - 2015-02-08 : 16:46:33
Thank you so much!!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-02-09 : 16:05:55


Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -