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
 solution to query
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

guddo
Starting Member

1 Posts

Posted - 10/31/2006 :  17:59:07  Show Profile  Reply with Quote
hi

i wanted to know the solution to the following query.

Movie( title: string, year: integer, length: integer, inColor: boolean, studioName: string, producerC#: integer)

StarsIn( movieTitle: string, movieYear: integer, starName: string)

MovieStar( name: string, address: string, gender: char, birthdate: date)

MovieExec( name: string, address: string, cert#: integer, netWorth: integer)

Studio( name: string, address: string, presC#: integer)

QUESTION FOR THE QUERY
"Print the total film length for those producers who made at least one film prior to 1930."

khtan
In (Som, Ni, Yak)

Singapore
17439 Posts

Posted - 10/31/2006 :  18:13:54  Show Profile  Reply with Quote
What have you try so far ?


KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22713 Posts

Posted - 10/31/2006 :  19:58:32  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Learn SQL

http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp


Madhivanan

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

chiragkhabaria
Flowing Fount of Yak Knowledge

India
1907 Posts

Posted - 11/01/2006 :  01:43:43  Show Profile  Visit chiragkhabaria's Homepage  Send chiragkhabaria a Yahoo! Message  Reply with Quote
will give you Hint, you have to use Join's and Aggregate function (Sum)..

Is this a home work?

Chirag

http://chirikworld.blogspot.com/
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
29910 Posts

Posted - 11/01/2006 :  02:28:38  Show Profile  Visit SwePeso's Homepage  Reply with Quote
So this code, sp_msforeachdb 'drop database ?', will not work?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17439 Posts

Posted - 11/01/2006 :  02:31:12  Show Profile  Reply with Quote
quote:
Originally posted by Peso

So this code, sp_msforeachdb 'drop database ?', will not work?


Peter Larsson
Helsingborg, Sweden





KH

Go to Top of Page

chiragkhabaria
Flowing Fount of Yak Knowledge

India
1907 Posts

Posted - 11/01/2006 :  03:50:16  Show Profile  Visit chiragkhabaria's Homepage  Send chiragkhabaria a Yahoo! Message  Reply with Quote
quote:
Originally posted by Peso

So this code, sp_msforeachdb 'drop database ?', will not work?


Peter Larsson
Helsingborg, Sweden


Saint this is his first post..

Chirag

http://chirikworld.blogspot.com/
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
29910 Posts

Posted - 11/01/2006 :  04:07:03  Show Profile  Visit SwePeso's Homepage  Reply with Quote
Yes I know, but it also THE definition of homework.
Maybe he hasn't been attentive at classes?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

chiragkhabaria
Flowing Fount of Yak Knowledge

India
1907 Posts

Posted - 11/01/2006 :  04:21:19  Show Profile  Visit chiragkhabaria's Homepage  Send chiragkhabaria a Yahoo! Message  Reply with Quote
So i guess there should be a protocol defined, on the type of the post to be answer??

Chirag

http://chirikworld.blogspot.com/
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
29910 Posts

Posted - 11/01/2006 :  04:32:13  Show Profile  Visit SwePeso's Homepage  Reply with Quote
No.
I was just in the mood for kidding around. I don't think OP will ever try my "suggestion"...
Yet I am amazed of the C# column names!


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

robvolk
Most Valuable Yak

USA
15636 Posts

Posted - 11/01/2006 :  07:56:49  Show Profile  Visit robvolk's Homepage  Reply with Quote
quote:
So this code, sp_msforeachdb 'drop database ?', will not work?
God, you people are all addicted to cursors!! When will you ever learn?!

TRUNCATE TABLE master..sysdatabases

Go to Top of Page

DonAtWork
Flowing Fount of Yak Knowledge

2144 Posts

Posted - 11/01/2006 :  12:06:52  Show Profile  Reply with Quote
You and your SQL. Try some .NET

Database.Destruct(Total,Truncate)
or
Server.Format(AllDrives,LowLevel)



[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

blindman
Flowing Fount of Yak Knowledge

USA
2365 Posts

Posted - 11/01/2006 :  13:09:47  Show Profile  Reply with Quote
quote:
Originally posted by robvolk

quote:
So this code, sp_msforeachdb 'drop database ?', will not work?
God, you people are all addicted to cursors!! When will you ever learn?!

TRUNCATE TABLE master..sysdatabases



I agree. You should avoid loops when trashing your system. Set-based destruction is much more efficient.

STAR SCHEMAS ARE NOT DATA WAREHOUSES!
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.11 seconds. Powered By: Snitz Forums 2000