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
 solution to query

Author  Topic 

guddo
Starting Member

1 Post

Posted - 2006-10-31 : 17:59:07
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)

17689 Posts

Posted - 2006-10-31 : 18:13:54
What have you try so far ?


KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-10-31 : 19:58:32
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
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-11-01 : 01:43:43
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

30421 Posts

Posted - 2006-11-01 : 02:28:38
So this code, sp_msforeachdb 'drop database ?', will not work?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-11-01 : 02:31:12
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
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-11-01 : 03:50:16
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

30421 Posts

Posted - 2006-11-01 : 04:07:03
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
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-11-01 : 04:21:19
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

30421 Posts

Posted - 2006-11-01 : 04:32:13
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

15732 Posts

Posted - 2006-11-01 : 07:56:49
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
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2006-11-01 : 12:06:52
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
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2006-11-01 : 13:09:47
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
   

- Advertisement -