Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Chapter 2 How to use SQL Server Management Studio and other development tools Before you start the exercises Before you start these exercises, you need

Chapter 2 How to use SQL Server Management Studio and other development tools

Before you start the exercises Before you start these exercises, you need to install SQL Server and the SQL Server Management Studio. The procedures for doing both of these tasks are provided in appendix A.

In addition, youll need to get the Exercise Starts directory from your instructor. This directory contains some script files that you need to do these exercises.

Exercises

In these exercises, youll use SQL Server Management Studio to create the MyGuitarShop database, to review the tables in the MyGuitarShop database, and to enter SQL statements and run them against this database.

Create the database

1. Start SQL Server Management Studio and open a connection using either Windows or SQL Server authentication.

2. Open the script file named CreateMyGuitarShop.sql thats in the Exercise Starts directory by clicking the Open File button in the toolbar and then using the resulting dialog box to locate and open the file.

3. Execute the entire script by clicking the Execute button in the SQL Editor toolbar or by pressing F5. When you do, the Messages tab displays indicates whether the script executed successfully.

Review the database

4. In the Object Explorer window, expand the node for the database named MyGuitarShop so you can see all of the database objects it contains. If it isnt displayed in the Object Explorer window, you may need to click on the Refresh button to display it.

5. View the data for the Categories and Products tables.

6. Navigate through the database objects and view the column definitions for at least the Categories and Products tables

Enter and run SQL statements

7. Select the MyGuitarShop database from the Available Databases dropdown menu (Crtl + U) to choose it as the default database. 8. Open a new Query Editor window. Then, enter and run this SQL statement:

SELECT ProductName FROM Products

9. Delete the e at the end of ProductName and run the statement again. Note the error number and the description of the error.

10. Open another Query Editor window by clicking the New Query button. Then, enter and run this statement:

SELECT COUNT(*) AS NumberOfProducts FROM Products

Open and run scripts

11. Open the script named ProductDetails.sql thats in the Exercise Starts directory. Note that this script contains just one SQL statement. Then, run the statement.

12. Open the script named ProductSummary.sql thats in the Exercise Starts directory. Note that this opens another Query Editor window.

13. Open the script named ProductStatements.sql thats in the Exercise Starts directory. Notice that this script contains two SQL statements that end with semicolons.

14. Press the F5 key or click the Execute button to run both of the statements in this script. Note that this displays the results in two Results tabs. Make sure to view the results of both SELECT statements.

15. Exit from SQL Server Management Studio

Submit:

a single text file containing completed assignment to the Chapter 2 Exercise

Dropbox.

NOTE: Include the SQL statement from step #8 and #10 and the number of

rows you have when running the statement.

Also include just a count of the number or

rows returned while running the scripts from #11, #12, and #14.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

2. Identify and choose outcomes to evaluate a training program.

Answered: 1 week ago

Question

6. Conduct a cost-benefit analysis for a training program.

Answered: 1 week ago