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.
Author |
Topic |
Hpolanco
Starting Member
7 Posts |
Posted - 2006-10-27 : 21:38:13
|
Help me please is very urgent if not i will get a 0 please give a hand thank youGeorge must frequently travel to various conferences and seminars. George sends you an e-mail with a script that he was working on before he left. He says that it should work, but it doesn't. He says by using the test data, it should produce two records if executed in the Query Manager. He also gives you the following background:The script is supposed to uniquely list each item for sale by name and show the quantity of each sold for a particular period of time. This is for a report that will eventually be used by one of the marketing executives. He couldn't get it to work. He knows there's something wrong with the Quantity column because he gets an error when he runs the script. He thinks there is something else wrong because when he removes the " (SUM(a.Quantity))as "Count" " clause that refers to the Quantity column, there is no output.Since George will be out of town for awhile, your supervisor sends you the original request. It asks for the ability to view each item name, its item price, count of units sold, and revenues generated for a given period of time. The request asks for data to be sorted by the revenue generated for each product where those with the most revenue appear at the top of the list. You sigh when you read this because you just committed to finishing the script in two days and now finishing it means doing more work. You're sure you can make it work, but you're not sure that you can make it work properly. You decide to bring in the whole team. Meet as a group and explain what you think is wrong. Do you think that something with the script must be changed or that something with the database must be changed? Because there are two problems, perhaps something should be changed in the database and something in the script. Provide your reasoning for why you would change the script or the database. As a group, decide upon a solution.this is the script does anyone know what is the problem whith this scriptuse KTCselect b.ItemName, (SUM(a.Quantity))as "Count"from Order_Details a join Items b on b.ItemID = a.ItemID join Orders c on a.OrderID = c.OrderIDWHERE c.OrderDate < CAST( '11/30/2004' AS datetime ) AND c.OrderDate > CAST( '11/11/2004' AS datetime )GROUP by b.ItemName, b.ItemUnitPrice |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-10-27 : 21:53:03
|
Why don't you try running the script and see what is the problem KH |
 |
|
Hpolanco
Starting Member
7 Posts |
Posted - 2006-10-27 : 22:00:41
|
I already try but i can't get a clear answer i see this messageServer: Msg 911, Level 16, State 1, Line 1Could not locate entry in sysdatabases for database 'KTC'. No entry found with that name. Make sure that the name is entered correctly.what do i have to do please help me |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-10-27 : 22:19:36
|
Your code is saying to run the select statement in a database named KTC. You apparently don't have this database on the system where you are running the query. Find out from your teacher or another classmate which database to run this in. You might want to try Northwind though.Tara Kizer |
 |
|
oracle_corrgi
Yak Posting Veteran
98 Posts |
Posted - 2006-10-28 : 00:17:09
|
hicheck for database exists or not just type use ktc and run if existsgive select * from Order_Details,Items,Ordersgo to enterprise manager click database and seetahnxscoorgi |
 |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2006-10-28 : 00:40:38
|
quote: Help me please is very urgent if not i will get a 0 please give a hand thank you
Sorry, we don't answer exam, homework, or certification questions on SQL Team. |
 |
|
|
|
|
|
|