问题标签 [adventureworks]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
sql - 冒险工作中的过度规范化表
我刚开始使用数据库,想了解 Adventure-work-db 表设计概念的原因。为什么我们将 BusinessEntity 视为一个表,而我们没有将它放在 person 表中?这不是一种过度规范化的表吗?
sql-server-2008 - 选择一个网格区域/销售人员/类别组合,其中所有订单项都有多个数量
使用 AdventureWorks 2008 R2,我想查询一个网格
- 在纵轴上列出每个区域/销售人员组合
- 在水平轴上列出每个子类别
all the line items
每个单元格指定在该类别/地区/销售人员组合中具有2 or more
数量的销售总数(唯一 SalesOrderID s)
这是一个示例(虚构的数据,我不知道如何查询真实的东西!):
我认为下面的 SQL 将为我提供山地自行车(subcat id 1),但我不知道如何轻松添加更多列。如果我开始对每一列进行独立查询,它会变得非常慢,非常快(尤其是当我必须将所有这些列重新连接在一起时!)
sql - 附加数据库时出现权限错误:“无法访问指定路径”
我正在运行 SQL Server 2012 企业版。我已经下载了 AdventureWorks 2012 OLTP 数据文件(.mdf
和.ldf
)。我将它们保存到我在My Documents
解压缩文件时创建的 AW 文件夹中。我转到 SQL Server Management Studio (SSMS) 右键单击数据库,然后单击上下文菜单中的附加。在对话框中,我单击查找。
UI 不允许我导航到文件夹。我尝试输入文件的完整路径,然后出现以下错误:
无法访问服务器上的指定路径或文件。验证您是否具有必要的安全权限并且该路径或文件存在。
我关闭了 SSMS 并重新启动它,这次以管理员身份运行。同样糟糕的结果。
这不应该这么难。将 AdventureWorks2012 数据库成功附加到 SSMS 的具体步骤是什么?
谢谢!
ssis - AdventureWorks2012 数据库缺少“DimTime”表
我正在执行microsoft technet教程中的“创建简单 ETL 包”。它指的是数据库中不可用的“DimTime”表。我知道在2008 版本中,“DimTime”被重命名为“DimDate”。
- 这是否也适用于2012版?
- 本教程适用于 2012 版还是仅适用于2008 或 2088R2版?
我试图在 Microsoft 问题跟踪器中问这个问题,但还没有答案。
sql - SQL Server pivot does not group
I am reading the prep kit for MS exam 70-461 : Querying MS SQL Server 2012 and the author talks about the PIVOT
operator. I am using the AdventureWorks sample database to make tests.
I decided to do a simple test and see if I could present the average base rate per department on columns split for each gender (M, F).
I have the following:
However, I noticed this:
There are no groups on [DepartmentName]
as should be (according to the book) since it's the only field not specified in the PIVOT
operator.
I can add a simple GROUP BY clause but I am not sure that this would yield the appropriate result and this also means that I did not correctly understand the use of PIVOT.
Any idea where I am wrong ?
sql-server-2012 - 语法解析不正确:SQLCMD 模式下的setvar
我从 CodeProject 下载了 AdventureWorks 2012 LT 脚本,但是当我尝试运行它时,它显示:
解析 :setvar 时遇到不正确的语法。
没有什么比这更多的了:
是的,我设置了 SQLCMD 模式。
sql - 使用 sql server 2012 附加 Adventureworks2012_data.mdf 文件时出错
我一直在尝试将 AdventureWorks 数据库添加到我的 SQL Server 2012 中。我尝试使用 SQL Server Management Studio 附加数据库,如下所示:我右键单击数据库 > 附加并单击添加... > 选择 AdventureWorks2012_Data 文件。然后我选择了日志文件并通过单击“删除”按钮删除了日志文件,然后单击“确定”,但我仍然收到头文件不是有效的数据库头文件并且 FILESIZE 属性不正确的错误......请帮我
sql - 在 SQL 中使用 DISTINCT
在 AdventureWorks2012 数据库中,我必须使用Sales.SalesPerson
、Sales.SalesOrderHeader
、Sales.SalesOrderDeatil
和表来列出在 Territory 5 中销售的 Production.Product
所有具有 和 Name 的 Distinct 产品。ProductID
以下是我尝试的答案。
查询成功执行,但有 0 行受到影响。我究竟做错了什么?
sql - SQL Left Joining four different tables
From AdventureWorks2012, I want to write a query using the Sales.SalesOrderHeader
, Sales.Customer
, Sales.Store
, and Person.Person
tables, showing the SalesOrderID
, StoreName
, the customer’s first and last name as CustomerName
and the salesperson’s first and last names as SalesPersonName
. I want to do a left join with Sales.Customer
to the Sales.Store
and Person.Person
tables.
Here is my work so far. However, the CustomerName
and SalesPersonName
both have the same information when they should be different.
sql - SQL:总量和SUM
我有个问题。
在 AdventureWorks2012 数据库中,我必须使用 Purchasing.PurchaseOrderDetail 表编写一个查询,并列出 2006 年期间为每种产品购买的总数量,并将总和标记为 TotatQtyPurchased。我还必须按 ProductID 分组。
这是我的工作
但我不断收到一条错误消息:Msg 102, Level 15, State 1, Line 4 '*' 附近的语法不正确。
我究竟做错了什么?谢谢。