Northwind
Feb 10, 2006
Sorry if this is the wrong forum, but it seems the most appropriate. My "Teach yourself about .Net, Life, the Universe and Everything" book uses the Northwind database in Sql Server format. Is this available for download somewhere?
View 1 Replies
ADVERTISEMENT
Jan 14, 2008
Hi all,
From the http://msdn.microsoft.com/en-us/library/bb384469.aspx (Walkthrough: Creating Stored Procedures for the Northwind Customers Table, I copied the following sql code:
--UpdateSPforNWcustomersTable.sql--
USE NORTHWIND
GO
IF EXISTS (SELECT * FROM sysobjects WHERE name = 'SelectCustomers' AND user_name(uid) = 'dbo')
DROP PROCEDURE dbo.[SelectCustomers]
GO
CREATE PROCEDURE dbo.[SelectCustomers]
AS
SET NOCOUNT ON;
SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax FROM dbo.Customers
GO
IF EXISTS (SELECT * FROM sysobjects WHERE name = 'InsertCustomers' AND user_name(uid) = 'dbo')
DROP PROCEDURE dbo.InsertCustomers
GO
CREATE PROCEDURE dbo.InsertCustomers
(
@CustomerID nchar(5),
@CompanyName nvarchar(40),
@ContactName nvarchar(30),
@ContactTitle nvarchar(30),
@Address nvarchar(60),
@City nvarchar(15),
@Region nvarchar(15),
@PostalCode nvarchar(10),
@Country nvarchar(15),
@Phone nvarchar(24),
@Fax nvarchar(24)
)
AS
SET NOCOUNT OFF;
INSERT INTO [dbo].[Customers] ([CustomerID], [CompanyName], [ContactName], [ContactTitle], [Address], [City], [Region], [PostalCode], [Country], [Phone], [Fax]) VALUES (@CustomerID, @CompanyName, @ContactName, @ContactTitle, @Address, @City, @Region, @PostalCode, @Country, @Phone, @Fax);
SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax FROM Customers WHERE (CustomerID = @CustomerID)
GO
IF EXISTS (SELECT * FROM sysobjects WHERE name = 'UpdateCustomers' AND user_name(uid) = 'dbo')
DROP PROCEDURE dbo.UpdateCustomers
GO
CREATE PROCEDURE dbo.UpdateCustomers
(
@CustomerID nchar(5),
@CompanyName nvarchar(40),
@ContactName nvarchar(30),
@ContactTitle nvarchar(30),
@Address nvarchar(60),
@City nvarchar(15),
@Region nvarchar(15),
@PostalCode nvarchar(10),
@Country nvarchar(15),
@Phone nvarchar(24),
@Fax nvarchar(24),
@Original_CustomerID nchar(5)
)
AS
SET NOCOUNT OFF;
UPDATE [dbo].[Customers] SET [CustomerID] = @CustomerID, [CompanyName] = @CompanyName, [ContactName] = @ContactName, [ContactTitle] = @ContactTitle, [Address] = @Address, [City] = @City, [Region] = @Region, [PostalCode] = @PostalCode, [Country] = @Country, [Phone] = @Phone, [Fax] = @Fax WHERE (([CustomerID] = @Original_CustomerID));
SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax FROM Customers WHERE (CustomerID = @CustomerID)
GO
====================================================================================
I executed the above code in my SQL Server Management Studio Express (SSMSE) and I got the following error messages:
Msg 911, Level 16, State 1, Line 1
Could not locate entry in sysdatabases for database 'NORTHWIND'. No entry found with that name.
Make sure that the name is entered correctly.
===============================================================================================================
I know I recreated the NORTHWIND Database from a different Database before and I did not do anything for the entry in sysdatabases. How can I change the entry in sysdatabases for database 'NORTHWIND' now? Please help and advise.
Thanks in advance,
Scott Chang
View 5 Replies
View Related
Nov 2, 2006
I have to do an exercize where i am using Northwind sample database. I am normally accustomed to linking to a database on another server. Is there a way i can just include the Northwind database to my project. In general, I need to find out how to link to the Northwind db so I can start querying and processing data. thanks for your help
View 4 Replies
View Related
Apr 16, 2007
i need links from where i can download northwind database both access and sql format thanx
View 2 Replies
View Related
Dec 28, 2007
I want use the the Northwind database do some example! I had installed the Visual Web Deveplopment Express Edition and installed the SQL Server 2005 Express Edition .but I build one new Website and connect the Northwind database but i can't find the it from the Database Explorer.why?
View 1 Replies
View Related
Dec 8, 2005
Can't open Northwind - asp.net - dataaccess-sqldatasource
I remembered doing walkthrough using Northwind. However it wasn't an http project but a file project using the development server. Northwind allowed me to add, edit and insert, and the web page looked fine.
I opened a simple project just to see whether I could get my sqlserver on the internet. (vs studio 2005, sqlserver 2005)
I created the project in http location http://localhost/Northwind . I dragged a sqldatasource to the page, configuring it to display ID and ProductName. I clicked advanced, but noticed the generate insert, edit and delete were grayed out. That told me something was wrong with my authetification.
I configured my sqlserver 2005 to have integrated security.
I built the solution and website, then pressed cntl-F5. I got a login error. Nowhere did the page ask me for username and password. First questions - how do I get this to open up a web page, and how to I get it to allow me to generate insert, edit and delete statements?
dennist685
Server Error in '/Northwind' Application.--------------------------------------------------------------------------------
Cannot open database "Northwind" requested by the login. The login failed.Login failed for user 'YOUR-02910F1DF1ASPNET'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Cannot open database "Northwind" requested by the login. The login failed.Login failed for user 'YOUR-02910F1DF1ASPNET'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Cannot open database "Northwind" requested by the login. The login failed.Login failed for user 'YOUR-02910F1DF1ASPNET'.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735123 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70 System.Web.UI.WebControls.DetailsView.DataBind() +4 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.DetailsView.EnsureDataBound() +181 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69 System.Web.UI.Control.EnsureChildControls() +87 System.Web.UI.Control.PreRenderRecursiveInternal() +41 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
View 1 Replies
View Related
Nov 7, 2006
sara writes "Dear Sir/Madam,
I use Sql Server 2005.I want to use Northwind Database & I have it but I could not Execute That It is the error:
Msg 911, Level 16, State 1, Line 1
Could not locate entry in sysdatabases for database 'NorthwindCS'. No entry found with that name. Make sure that the name is entered correctly.
Would you please help me with that?
Regards,
Sara"
View 2 Replies
View Related
Mar 25, 2007
Hi I have just started using the SQL Server 2005 Express Edition and wondering how to install the InstNwnd.sql from the sql file. I can't find any way to insert the database
Any help would be very appreciated
Thanks
View 4 Replies
View Related
Apr 6, 2004
OK
I've loaded MSDE and its running OK
I've run config.exe to install the sample .net databases,
......but I cannot find northwind or anyother db on the server!
I've never done any db work befor so may be I'm being a bit of a tit!!! sorry in advance if i am...
stuart
View 3 Replies
View Related
Nov 17, 2004
I've running MSDE on a win xp box with SP2. The SQL server service manager indicates that the SQL server is running. I'm using Visual Studio 2003. According to the install page for 101 VB and C# Code Samples I should install the .NET frameword samples db.. See http://www.microsoft.com/downloads/details.aspx?FamilyId=08E3D5F8-033D-420B-A3B1-3074505C03F3&displaylang=en
I cd to the appropriate dir and run osql -E -S (local)NetSDK -i InstNwnd.sql (the cmd given on the page noted above). I get the following error:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:Documents and SettingsPhilip Toews>cd C:Program FilesMicrosoft Visual Stud
io .NET 2003SDKv1.1SamplesSetup
C:Program FilesMicrosoft Visual Studio .NET 2003SDKv1.1SamplesSetup>osql -
E -S (local)NetSDK -i InstNwnd.sql
[DBMSLPCN]SQL Server does not exist or access denied.
[DBMSLPCN]ConnectionOpen (Connect()).
C:Program FilesMicrosoft Visual Studio .NET 2003SDKv1.1SamplesSetup>
I'm a newbie to .NET and SQL server so this makes no sense to me. If the SQL server service manager indicates that the SQL server is running why do I get that error and what is the work around?
Thanks .NET great ones for helping a newbie get off the ground...
:-)
View 4 Replies
View Related
Jun 24, 2005
I'm installing Northwind Database onto Local Computer. The Computer's Name is (Localhost)The Installation Menu is asking to for the [Enter Name of the (Server)] "______________________" Am I correct in assuming to Enter Localhost - for the [Enter Name of the (Sever)]. "___Localhost_____" Can someone comfirm as to whether this is correct or not... Thank You.
View 2 Replies
View Related
Mar 3, 2004
I have installed MS SQL server eval edition and read through a lot of BOL, just about got my head around users and authentication etc and have a pretty good grounding on db design and architecture.
I now want to mess around with the sample databases a bit to get used to the SQL server interface before I start creating new ones etc but beyond random simple queries that I make up i'm struggling with what to do. I'm sure there are some microsoft tutorials based on the northwind and pubs databases I just cant seem to find any anywhere.
Any suggestions greatfully recieved, Cheers
Dan
View 8 Replies
View Related
Mar 11, 2004
I'm using XP Pro and I have the Developer's version of SQL Server installed. I downloaded SQLXML 3.0 and created a virtual directory named nwind.
I then entered the following on my IE browser:
http://<IIServer>/nwind?sql=SELECT FirstName, LastName FROM Employees FOR XML AUTO&root=root
the result is:
"The page cannot be displayed..."
I'd appreciate any help.
Thanks,
Pat
View 1 Replies
View Related
Jul 7, 2006
I have asked for the following questions and I need your advises.Utilizing the Northwind database suppied with SQL Server, create SQL tosolve each of the exercises listed.1.I want to contact all customers who have received over $1,000 indiscounts on orders this year. Give me the name and phone number of theperson to contact at the customers site. Also, list the orders wherethe total discount was greater than $100. Remember, discount is apercentage of the price.2.Give me a list of suppliers and products where we do not have thestock on hand to fill the orders to be shipped. List out the customerand order information for each of the products involved.3.Give me a list of all orders that were shipped after the requireddate for the week of Jan 7, 2001. I want to know the name of theemployees that were responsible for the orders.4.We are having a golf tournament and I need some prizes. Give me alist of the top 5 shippers by dollar amount in the last year.5.Some customers are taking us for a ride on shipping. Give me a listof customers and the orders involved where more than ½ of their ordersare being shipped to a region other than their home region.Please advise ...thanks a lot
View 2 Replies
View Related
Oct 3, 2006
Hi Everyone,
I have a question in regards to SQL Server 2000 and its Query Analyzer. I am trying to create certain queries and I need a Northwind database to work with. However, I can't seem to add the database to the dbs' combo box. Basically, I could not find the way to add this database to the analyzer so I can practice with it. Only databases that are there are the system's ones: Master, Model, MSDB and tempdb.
So how to add this database to the analyzer's settings?
Thanks in advance :)
View 1 Replies
View Related
May 9, 2006
I tried using some code for the new pivot function in the "Inside Microsoft SQL Server 2005 T-SQL Querying" book.
I was using the Northwind database but that was from a SQL 2000 database. There was an error that stated the database needed to be updated.
I have looked all over the web and have not seen where to download the SQL 2005 Northwind & Pubs database.
Anybody have the URL for this or is this not available?
Thanks,
Gene
View 3 Replies
View Related
Dec 13, 2006
I am learning SQL Server 2005 Express, and want to use the Northwind data base as used in many code examples. I wanted to attach the Northwind data base via SQL Management Studio, but cannot find a Northwind.mdf file.
When I do a search using 'Northwind', I see there are already a couple of different versions of Northwind already loaded. One appears to be associated with SQL Server Mobile Edition (Samples folder) and another seems to be associated with Visual Studio 8SDKv2.0Quickstart.
Can I use one of these existing Northwind databases (none have .mdf extention) for SQL Server 2005 or do I need to download yet another version?
View 3 Replies
View Related
Sep 15, 2006
i am getting an error ... given below and my web.config is also given below
can any one help me is my connection string right ...
i am using sql server 2005 ..
my system name is soft18 ..
Server Error in '/prjLogin' Application.
Cannot open database "Northwind" requested by the login. The login failed.
Login failed for user 'SOFT18Administrator'.
Description: An
unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the
error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Cannot open database "Northwind" requested by the login. The login failed.
Login failed for user 'SOFT18Administrator'.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Cannot open database "Northwind" requested by the login. The login failed.
Login failed for user 'SOFT18Administrator'.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +115
System.Data.SqlClient.TdsParser.ThrowExcepti....................
........................
................
...................
//web.config
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<connectionStrings>
<add name="QuickStartSqlServer" connectionString="Server=localhostSQLExpress;Integrated Security=SSPI;Database=Northwind;" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<authentication mode="Forms">
<forms name=".ASPXAUTH"
loginUrl="Login.aspx"
protection="All"
timeout="30"
path="/"
requireSSL="false"
slidingExpiration="true"
defaultUrl="Login.aspx"
cookieless="UseDeviceProfile"
enableCrossAppRedirects="false"/>
</authentication>
<membership defaultProvider="QuickStartMembershipSqlProvider"
userIsOnlineTimeWindow="15">
<providers>
<add
name="QuickStartMembershipSqlProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="QuickStartSqlServer"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
applicationName="LoginControls"
requiresUniqueEmail="true"
passwordFormat="Hashed"/>
</providers>
</membership>
<roleManager
enabled="true"
cacheRolesInCookie="true"
defaultProvider="QuickStartRoleManagerSqlProvider"
cookieName=".ASPXROLES"
cookiePath="/"
cookieTimeout="30"
cookieRequireSSL="false"
cookieSlidingExpiration="true"
createPersistentCookie="false"
cookieProtection="All">
<providers>
<add name="QuickStartRoleManagerSqlProvider"
type="System.Web.Security.SqlRoleProvider,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="QuickStartSqlServer"
applicationName="LoginControls"/>
</providers>
</roleManager>
<authorization>
<allow users="*"/>
</authorization>
<compilation debug="true"/>
</system.web>
</configuration>
View 1 Replies
View Related
Jan 27, 2008
Hi all,Does anyone know where I can find the Northwind database for SQL Server 2005 Express edition?Everywhere I look I get redirected to the AdventureWorks database, but it must be available because this article which is based on 2005 references it...http://weblogs.asp.net/scottgu/archive/2006/01/15/435498.aspxThanks
View 2 Replies
View Related
Jan 14, 2004
I've just installed SQL Server 2000 on my local machine. I'm using the following element in my web.config file for my connection string.
<add key="SqlNWind512" value="server=(local)141.705.84.745;database=Northwind;
user id=sa;pwd=h3fe8eq7;packet size=512;" />
Unfortunately, I'm getting the following error on my aspx page:
SQL Server does not exist or access denied.
I had no problem writing a connection string to connect to the MSDE installed on my computer, but making a connection to the Northwind database on my newly installed SQL Server 2000 Developer edition has been elusive to me.
I'm sure my IP address is correct. The authentication mode for logging into the database via Enterprise Manager is setup to require a password for sa. Therefore, I assume it's required in the connection string???
Maybe not so coincidentally, while I have been able to open this database through the Server Explorer in VS.NET, I'm not able to access it via Enterprise Mananger (no response, it just hangs) or my aspx pages.
I'm dying here!!! Is my connection string wrong? Any insights would be greatly appreciated!
View 3 Replies
View Related
Jan 30, 2004
I just downloaded and installed MSDE2000 sp3a for winform and asp.net
quickstart tutorial. But I found it has no sample database such as pubs
and northwind. It used to have these databases. At least in last September
when .Net web Matrix came out.
If this is the case, can someone tell me where to get the sql scripts
to create Northwind database in MSDE?
Becasue the winform tutorial uses this database.
Thanks in advance!
Lei Xu
View 1 Replies
View Related
Apr 30, 2004
Does anyone know where I can find a Northwind end to end database solutions (examples) written in ASP.NET (VB). I would like to reverse engineer this project to learn more about ASP.NET?
Thanks.
View 1 Replies
View Related
Aug 13, 2005
Suppose I have this query, which shows each order and the price of the most expensive item in each order:
SELECT Ord.OrderID, Ord.OrderDate, MAX(OrdDet.UnitPrice) AS maxUnitPrice
FROM Northwind.dbo.[Order Details] AS OrdDet INNER JOIN Northwind.dbo.Orders AS Ord ON Ord.OrderID = OrdDet.OrderID
GROUP BY Ord.OrderID, Ord.OrderDate
I need to also show the ProductID that has MaxUnitPrice from the Order
Details. I can't just add ProductID to the select list because
I'd have to group by it, and then I'd get a row for each product,
instead of a row for each order... I think I need a correlated subquery
but can't work out how to do it!
View 1 Replies
View Related
May 25, 2006
Hello.Does anyone have Northwind database file for SQLExpress ? I really need it for learning purpose now.Thanks in advanced.
View 1 Replies
View Related
Dec 14, 2006
I am trying to connect to SQL 7.0 northwind database via visual studio2005. But I can't open the connection. I get an error saying remoteaccess is not allowed. But the remote access is ok. I can used the samelogin and connect to the sql server via enterprise manage.SqlConnection conn = new SqlConnection("DataSource=(sqlserver:1433);Initial Catalog=Northwind;UserID=me;Password=mypassword");The above is the string I am trying to use.Is there a way to do this in Visual studio thanks
View 1 Replies
View Related
Apr 7, 2006
i hava tried installing the "SQL2000SampleDb" but the db is not
on the db list after the install
View 1 Replies
View Related
Oct 25, 2006
Hi.I'm very new to this so I apologise in advance for asking the blindibly obvious. I have installed SQL Express and SQL Server Management Studio Express and I have downloaded and attached the Northwind sample database. I can see and edit the data in the tables but when I try to open the Database Diagram node I get the following message:Database diagram support objects cannot be installed because this database does not have a valid owner. To continue, first use the Files page of the Database Properties dialog box or the ALTER AUTHORIZATION statement to set the database owner to a valid login, then add the database diagram support objects.I have no idea what a valid logon would be. Can somebody help? Thanks
View 3 Replies
View Related
Jan 14, 2008
i try create this example:http://www.codeproject.com/KB/webforms/ReportViewer.aspxI have Northwind database added in the SQL server management and i select Northwind databse in drop box and I push Execute!ALTER PROCEDURE ShowProductByCategory(@CategoryName nvarchar(15)
)ASSELECT Categories.CategoryName, Products.ProductName,
Products.UnitPrice, Products.UnitsInStockFROM Categories INNER JOIN
Products ON Categories.CategoryID = Products.CategoryIDWHERE
CategoryName=@CategoryNameRETURNbut error is:Msg 208, Level 16, State 6, Procedure
ShowProductByCategory, Line 11Invalid object name
'ShowProductByCategory'.on web not so clear what is issue pls. help
View 2 Replies
View Related
Feb 2, 2008
I am trying to execute the following query , in Management Studio. But it takes forever. Can someone tell me why is this happening? I am running the query in 'NorthWind' database.The windows account under which I am logged into WinXP (windows authentication is enabled for the SQL Server database) is the database owner for NorthWind database.
alter database NorthWind SET ENABLE_BROKER
View 3 Replies
View Related
Apr 15, 2008
Hi,Good morning to All.
While doing practice I did some modifications to some tables in Northwind database.Now, how can I get my original tables back again?
Take Oracle for example:We can modify table data. But when we run demobld.sql script then all tables will replaces with original entries.
Like this I want in SQL Server also. Is there any such facility available in SQL Server?
Thanks in advance,Ashok kumar.
View 2 Replies
View Related
Jul 26, 2006
Good day to all.
I'm a DB teacher in a University. Planning and developing SQL exercises for my students I found a "tricky" or extrange sql exercise.
The sql exercise using Northwind DB reads as follows:
"Wich is the total amount of the freight that corresponds to all orders containing products of seafood category ?"
The first sql code that comes to my mind was:
select sum(freight)
from orders o, "order details" d, products p, categories c
where o.orderid=d.orderid and d.productid=p.productid and p.categoryid=c.categoryid
and categoryname='seafood'
This is equivalent code constructed with Query constructor in Enterprise Manager:
SELECT SUM(dbo.Orders.Freight) AS Expr1
FROM dbo.Orders INNER JOIN
dbo.[Order Details] ON dbo.Orders.OrderID = dbo.[Order Details].OrderID INNER JOIN
dbo.Products ON dbo.[Order Details].ProductID = dbo.Products.ProductID INNER JOIN
dbo.Categories ON dbo.Products.CategoryID = dbo.Categories.CategoryID
WHERE (dbo.Categories.CategoryName = N'seafood')
These 2 equivalent queries output 27722.9600 as result, but the correct result (total freight) is 23791.1400.
Did you also think (as I did) that the exposed code is correct?
Now I know the correct sql code that gives the corect answer and also the explanation why the code exposed fails, but before share it under your posible request, want to know your tech comments about this exercise in order to know if this particular exercise is "tricky" (make people to fail) or is my total fault and need to review my strategies of applying/constructing sql (and teaching).
Thanks a lot.
Carlos
View 12 Replies
View Related
Jul 20, 2005
Hello,What are the default login/password to access pubs and northwind databases ?I remember the login = "sa", but nothing about the password.ThanksEric
View 4 Replies
View Related
Feb 23, 2008
I have been following the Visual Basic Guided Tour for VB 2008 Express and I'm having a problem with the following part.
ms-help://MS.VSCC.v90/MS.msdnexpress.v90.en/dv_vbcnexpress/html/48fcb538-d8c7-4299-a2bf-a5b6f80d879d.htm
Creating LINQ to SQL Classes: Using the O/R Designer
I am getting the error "Generating user instances in SQL Server is disabled. Use sp_configure 'user instances enabled' to generate user instances.", when I get to the Test Connection button.
I have found the following help page,
ms-help://MS.VSCC.v90/MS.msdnexpress.v90.en/SqlExpressBol/html/85385aae-10fb-4f8b-9eeb-cce2ee7da019.htm
but I have no idea how to use this information as it assumes the user knows what they are doing!
The solution appears to involve running a scipt of some sort, but where would that be run?
I have looked at the SQL server Express information, but can't find how to run sp_configure.
Your help would be much appreciated.
View 4 Replies
View Related