CSCI 5020 Assignment 1solution

$24.99

Original Work ?

Download Details:

  • Name: A1-1.zip
  • Type: zip
  • Size: 409.69 KB

Category: You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (2 votes)

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.
Part 1
Chapter 2 Exercises 1 through 6 on page 81. Note the solutions to the chapter exercises in the
book are provided through the student download and posted in D2L as well. For learning purpose,
make sure you complete each exercise before checking the solution.
Part 2
You’ll use the provided Exercise Starts directory which contains some script files that you need
to do these exercises. You’ll 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 that’s 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 SQLEditor 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 MyGuitarShopso
you can see the entire database objects it contains. If it isn’t 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 MyGuitarShopdatabase from the Available Databases dropdown menu (Crtl + U)
to choose it as the default database.
8. Open a new QueryEditor 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 that’s 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 that’s in the Exercise Starts directory. Note that
this opens another Query Editor window.
13. Open the script named ProductStatements.sql that’s 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 screenshot of Exercises 3, 4, 5, 6, 9, 10, 14.