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
 General SQL Server Forums
 New to SQL Server Programming
 please,solve the problem
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

DARSHAN
Starting Member

Canada
2 Posts

Posted - 09/08/2010 :  11:34:30  Show Profile  Reply with Quote
3a. Obtain the cast list for 'Casablanca'. Use the id value that you obtained in the previous question.
actor(id, name)
casting(movieid, actorid, ord)

id = 27
I wrote
select name from actor join casting on (actor.id=casting.movieid) where id = 27
but it says wrong.
please,write the correct query.

Edited by - DARSHAN on 09/08/2010 11:46:04

tkizer
Almighty SQL Goddess

USA
37143 Posts

Posted - 09/08/2010 :  11:35:23  Show Profile  Visit tkizer's Homepage  Reply with Quote
Show us what you got so far.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

DARSHAN
Starting Member

Canada
2 Posts

Posted - 09/08/2010 :  11:50:47  Show Profile  Reply with Quote
i updated my response.please,somebody give me correcr query.
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37143 Posts

Posted - 09/08/2010 :  11:52:08  Show Profile  Visit tkizer's Homepage  Reply with Quote
actor.id=casting.actorid

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

GilaMonster
Flowing Fount of Yak Knowledge

South Africa
4507 Posts

Posted - 09/08/2010 :  14:18:26  Show Profile  Visit GilaMonster's Homepage  Reply with Quote
Homework? Seems to be a lot of that going around lately.

If so, may I suggest you go back to your coursework and revise the section on joins

--
Gail Shaw
SQL Server MVP
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37143 Posts

Posted - 09/08/2010 :  14:47:04  Show Profile  Visit tkizer's Homepage  Reply with Quote
It's only September, and they already need help. I can't imagine what kind of stuff we'll get as they get further into the semester. You'd think the easy stuff in September wouldn't appear on these sites as it should be easy enough for them to figure out on their own.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Transact Charlie
Flowing Fount of Yak Knowledge

United Kingdom
3451 Posts

Posted - 09/08/2010 :  16:13:30  Show Profile  Visit Transact Charlie's Homepage  Reply with Quote
There isn't an ID on the casting table so your where clause will actually be filtering on actor.Id

If you are asking this level of question and having this much difficulty you need to go back and study the basics. You query should probably look like

SELECT
     a.[name] AS [Actor Name]
FROM
    casting AS c
    JOIN actor AS a ON a.[id] = c.[actorid]
WHERE
    c.[movieid] = 27

(Note this sql is transact specific take out the square brackets and it'll work on most anything (probably))


Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION

Edited by - Transact Charlie on 09/08/2010 16:15:18
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.05 seconds. Powered By: Snitz Forums 2000