Introduction to SQL

User Generated

TreznvarAwvxv

Computer Science

Description

A SQL server was installed during unit 1. The installation included SQL Server Management Studio Express. This tool is used to create and manage your database. The next step is to ensure that the installed software was configured correctly. An existing database is available for this purpose. Using an existing database will also enable you experiment with querying a database. For this project, you will access a database to ensure your software was installed and configured properly. You will explore the SELECT statement by populating the tables with data and retrieve the data from the database tables. •Task 1 ◦Click here to download and install the AdventureWorks LT2012 database into the SQL environment. Unzip the file and store the data file and the log file into the Data folder within the folder Program Files (x86)/Microsoft SQL Server as follows: ◾For 64-bit operating systems: copy the files into the folder: C:/Program Files/Microsoft SQL Server/MSSQL11.SQLEXPRESS/MSSQL/DATA ◾For 32-bit operating systems: copy the files into the folder: C:/Program Files (x86)/Microsoft SQL Server/MSSQL11.SQLEXPRESS/MSSQL/DATA ◾The folder listed above will already exist. This is where you installed the SQL software to in DB1. ◾When trying to open the DATA folder, you may receive a message about concerns on accessing the folder. Click ‘continue’ or ‘ok’ ◦After the files are saved, the database needs to be attached. ◾Open Microsoft SQL Server Management Studio. In the Object Explorer window, right click on Databases, and select Attach. ◾On the Attach Databases window, click the Add button. ◾The Locate Files window will default to the DATA folder, where you just copied the files to. Select the AdventureWorksLT2012_Data.mdf file and click OK. ◾Back in the Attach Databases window, just click OK. ◾The AdventureWorksLT2012 database will now display in Object Explorer under Databases. •Task 2 ◦Generate a database diagram for all the tables in the database. ◾Include a screenshot of this diagram in your Word document. •Task 3 ◦Write SELECT statements for the following questions: ◾For each of these statements, include a screenshot of the SQL statements and results. Make sure to include the statement execution, including the resulting data. 1.Display all columns and all rows from the Customer table. 2.Display the ProductID, ProductNumber and ListPrice for all rows in the Product table. 3.Modify query 2 so that the column headings are as follows: ◾"ID," "Number," and "List Price" 4.Display the CustomerID, full customer name, and Company Name for all customers in the Customer table. The full customer name would be shown by displaying the values separately from the necessary columns. Another optional, and more advanced, approach to show full customer name would be to combine the necessary columns and associate an alias. 5.Display the CustomerID, full customer name, and Company Name for all customers in the Customer table. ◾Name the columns "ID," "Name," and "Company Name" (respectively), and sort the data by the company name. ◦Click here to download and install the AdventureWorks LT2012 database into the SQL environment. Unzip the file and store the data file and the log file into the Data folder within the folder Program Files (x86)/Microsoft SQL Server as follows: ◾For 64-bit operating systems: copy the files into the folder: C:/Program Files/Microsoft SQL Server/MSSQL11.SQLEXPRESS/MSSQL/DATA ◾For 32-bit operating systems: copy the files into the folder: C:/Program Files (x86)/Microsoft SQL Server/MSSQL11.SQLEXPRESS/MSSQL/DATA ◾The folder listed above will already exist. This is where you installed the SQL software to in DB1. ◾When trying to open the DATA folder, you may receive a message about concerns on accessing the folder. Click ‘continue’ or ‘ok’ ◦After the files are saved, the database needs to be attached. ◾Open Microsoft SQL Server Management Studio. In the Object Explorer window, right click on Databases, and select Attach. ◾On the Attach Databases window, click the Add button. ◾The Locate Files window will default to the DATA folder, where you just copied the files to. Select the AdventureWorksLT2012_Data.mdf file and click OK. ◾Back in the Attach Databases window, just click OK. ◾The AdventureWorksLT2012 database will now display in Object Explorer under Databases. •Task 2 ◦Generate a database diagram for all the tables in the database. ◾Include a screenshot of this diagram in your Word document. •Task 3 ◦Write SELECT statements for the following questions: ◾For each of these statements, include a screenshot of the SQL statements and results. Make sure to include the statement execution, including the resulting data. 1.Display all columns and all rows from the Customer table. 2.Display the ProductID, ProductNumber and ListPrice for all rows in the Product table. 3.Modify query 2 so that the column headings are as follows: ◾"ID," "Number," and "List Price" 4.Display the CustomerID, full customer name, and Company Name for all customers in the Customer table. The full customer name would be shown by displaying the values separately from the necessary columns. Another optional, and more advanced, approach to show full customer name would be to combine the necessary columns and associate an alias. 5.Display the CustomerID, full customer name, and Company Name for all customers in the Customer table. ◾Name the columns "ID," "Name," and "Company Name" (respectively), and sort the data by the company name. Combine all of the screenshots into a single Word document, and submit this for grading.

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Hello buddy, thank you for giving me this opportunity to work with you.
Hello buddy, I have finished the assignemnt. Thank you for giving me that opportunity to work with you.

Running Head: Introduction to SQL Database

Introduction to SQL database
{Student’s name}
{Professor’s name}
{Course title}
{Date}

Introduction to SQL Database
Task 1
• Install the AdventureWorks LT2012 database into the SQL environment.

Introduction to SQL Database
Task 2


Generate a database diagram for all the tables in the database.



Include a screenshot of this diagram in your Word document.

ErrorLog
ErrorLogID
ErrorTime
UserName
ErrorNumber

SalesOrderHeader (SalesLT) *

ProductModelProductDescription (SalesLT)

SalesOrderID

ProductModelID

Revision...


Anonymous
Really helped me to better understand my coursework. Super recommended.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Similar Content

Related Tags