

Under the existing query, write and execute a Transact-SQL statement that returns the SalesOrderID, OrderDate columns from the Sales.SalesOrderHeader table, and use a WHERE clause to return only the rows with a SalesPersonID value of 279 and an OrderDate value that includes the year 2014.Ĭlose SQL Server Management Studio without saving changes. Verify that the second query returned more rows. Review the results and note the number of rows that the query returned. Under the existing query, write and execute a Transact-SQL statement that returns the SalesOrderID, OrderDate columns from the Sales.SalesOrderHeader table, and use a WHERE clause to return only the rows with a SalesOrderID value that is between 5700. Under the existing query, write and execute a Transact-SQL statement that returns the SalesOrderID, OrderDate, SalesPersonID columns from the Sales.SalesOrderHeader table, and use a WHERE clause to return only the rows with a SalesPersonID value of 279 or 282. Under the existing query, write and execute a Transact-SQL statement that returns the SalesOrderID, OrderDate, SalesPersonID columns from the Sales.SalesOrderHeader table, and use a WHERE clause to return only the rows with a SalesPersonID value of 279. Task 2: Write Transact-SQL SELECT Statements with a WHERE Clause Verify that both queries return the same number of rows. In the same query window, under the existing query, write and execute a Transact-SQL statement that returns the SalesOrderID, OrderDate, SalesPersonID columns and all rows from the Sales.SalesOrderHeader table. Write and execute a Transact-SQL query that returns all columns and all rows from the Sales.SalesOrderHeader table. In SQL Server Management Studio, open a new query window connected to the AdventureWorks2016 database. Task 1: Write Transact-SQL SELECT Statements You will now continue your exploration of the Adventure Works OLTP database by writing and executing SELECT statements and examining the result sets. Exercise 2: Querying a Database by Using Transact-SQL Scenario Results: In this exercise, you created a database diagram in the AdventureWorks2016 database and a database diagram in the AdventureWorksDW2016 database. Save the database diagram as AdventureWorks Data Warehouse Diagram, and then close the diagram window. In the AdventureWorksDW2016 database, create a database diagram and add then the following tables to it: Save the database diagram as AdventureWorks Diagram, and then close the diagram window. In the AdventureWorks2016 database, create a database diagram and then add the following tables to it:Įxamine the primary key columns and the foreign key relationships between the tables in the diagram, and note which columns are involved in the relationships.


ADVENTUREWORKS DATABASE TABLES WINDOWS
Open SQL Server Management Studio and connect to the MIA-SQL Database Engine instance by using Windows Authentication. You will begin your exploration of the databases by creating two database diagrams, one for the Adventure Works OLTP database, and one for the Adventure Works data warehouse.
ADVENTUREWORKS DATABASE TABLES PASSWORD
Log on to 10985C-MIA-SQL as ADVENTUREWORKS\Student with the password Ps$$w0rd.īrowse to the D:\Labfiles\Lab01\Starter folder, and then run Setup.cmd as Administrator.Įxercise 1: Exploring an OLTP Schema and a Data Warehouse Schema Scenario Write Transact-SQL SELECT statements that include a WHERE clause.Įnsure that the 10985C-MIA-DC and 10985C-MIA-SQL virtual machines are both running. You intend to create database diagrams of parts of the OLTP database and data warehouse database, and examine the table ObjectivesĪfter completing this lab, you will be able to:Ĭreate database diagrams to explore databases. Your line manager has asked you to familiarize yourself with the databases that you will be working with, and has given your user account the required permissions to do so. You have recently started working as a database developer at Adventure Works, manufacturers and retailers of bicycles and associates products. Module 1: Introduction to Databases Lab: Exploring and Querying SQL Server Databases Scenario
