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 Queries

Author  Topic 

Fu
Starting Member

23 Posts

Posted - 2005-09-27 : 08:08:15
Label(LabelID,Label) labelid=pk
-------------------------------
Shelf(ShelfID,Shelf) shelfid=pk
-------------------------------
Country(CountryID,Country) countryid=pk
---------------------------------------
Track(TrackID,Track) trackid=pk
-------------------------------
Artist(ArtistID,Artist,ArtistPhoto,CountryID) artistid=pk,countryid=fk country(countryid)
-----------------------------------------------------------------------------------------
CD(CDID,CDTitle,CDDate,CDCover,LabelID,ShelfID) cdid=pk, labelid=fk label(labelid),shelfid=fk shelf(shelfid)
------------------------------------------------------------------------------------------------------------
CDTrack(TrackID,CDID) trackid,cdid=pk, trackid=fk track(trackid), cdid=fk CD(cdid)
----------------------------------------------------------------------------------
ArtistTrack(ArtistID,TrackID) artistid,trackid=pk, artistid=fk artist(artistid),trackid=fk track(trackid)
---------------------------------------------------------------------------------------------------------
I've already created these tables but i need some aid writing these queries coz i am still a beginner in sql

Search Queries
------------------------------------------------------------
Input Artist
Output CDTitle,CDDate,CDCover,Label,CDSection,Shelf 1
Group By CDSection
------------------------------------------------------------
Input CDTitle
Output CDTitle,CDDate,CDCover,Label,CDSection,Shelf 2
Group By CDSection
------------------------------------------------------------
Input Track
Output CDTitle,CDDate,CDCover,Label,CDSection,Shelf 3
Group By CDSection
------------------------------------------------------------
Input Label
Output CDTitle,CDDate,CDCover,Label,CDSection,Shelf 4
Group By CDSection
------------------------------------------------------------

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-27 : 08:14:18
You need to use Joins
See Books On Line, SQL Server help file
Also refer these for basics of SQL
www.sqlcourse2.com
www.sqlzoo.com

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Fu
Starting Member

23 Posts

Posted - 2005-09-27 : 08:27:10
thanx madhivanan i will check them
Go to Top of Page
   

- Advertisement -