Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this exercise you will use Azure Data Studio ( ADS ) to browse your local database and runs SQL commands on the AP database.
In this exercise you will use Azure Data Studio ADS to browse your local database and runs SQL commands on the AP database. Before you do the exercises for this assignment If youre working on your own computer, youll need to set up your system as described in appendix A before you can do these exercises. Exercises Use Azure Data Studio to view all of the databases that are available from your server. View the tables that are available from the AP database. Please paste a screenshot of the tables in the tables folder below View the columns that are available from the Invoices table. Note the primary and foreign keys for this table and the definition for each column. Please paste a screenshot of the columns in the Invoices table below Rightclick on the Vendors table and select Design to display the Vendors table in a Table Designer window. Review the properties for each column in this table. In particular, note that the VendorID column is defined as an identity column. Please paste a screenshot of the VendorID columns properties below Open a new Query Editor window and enter this SELECT statement: SELECT VendorName, VendorState FROM Vendors WHERE VendorState CA Press F to run the query and display the results. If you get an error message that indicates that Vendors isnt a valid object, select the AP database from the dropdown list in the toolbar. Save the query with a name of VendorsInCA and close it Open the saved query named VendorsInCA. Then, click the Run button in the toolbar to run it Please paste a screenshot of the querys result below Create a new query and enter this SELECT statement: SELECT InvoiceDate, SUMInvoiceTotal AS Total FROM Invoices Save the query with a name of Chart Run the query and view the results. Note that it includes one row for each invoice date and that each row includes the total for the invoices on each date. Please paste a screenshot of the querys result below Click the Charts icon in the Results tab. Adjust the settings to create a bar graph showing the invoice totals by date. Hint: Set the data direction to vertical. Note that this chart displays one bar for each date that has an invoice. Please paste a screenshot of the querys result below Save the Chart query with a new name of Chart Edit the query so it becomes this SELECT statement: SELECT DATEBUCKETMONTH InvoiceDate AS Month, SUMInvoiceTotal AS Total FROM Invoices GROUP BY DATEBUCKETMONTH InvoiceDate; To do that, you need to add the DATEBUCKET function in two places. When you do make sure to type the code exactly as shown above. Please paste a screenshot of the querys result below Run the query and note that the results now show one row for each of the months that contain invoices. Click the Charts icon in the Results tab. Adjust the settings to create a bar graph showing the invoice totals by month. Note that this chart displays one bar for each month that has an invoice. Please paste a screenshot of the querys result below
In this exercise you will use Azure Data Studio ADS to browse your local database and runs SQL commands on the AP database.
Before you do the exercises for this assignment
If youre working on your own computer, youll need to set up your system as described in appendix A before you can do these exercises.
Exercises
Use Azure Data Studio to view all of the databases that are available from your server.
View the tables that are available from the AP database.
Please paste a screenshot of the tables in the tables folder below
View the columns that are available from the Invoices table. Note the primary and foreign keys for this table and the definition for each column.
Please paste a screenshot of the columns in the Invoices table below
Rightclick on the Vendors table and select Design to display the Vendors table in a Table Designer window. Review the properties for each column in this table. In particular, note that the VendorID column is defined as an identity column.
Please paste a screenshot of the VendorID columns properties below
Open a new Query Editor window and enter this SELECT statement:
SELECT VendorName, VendorState
FROM Vendors
WHERE VendorState CA
Press F to run the query and display the results. If you get an error message that indicates that Vendors isnt a valid object, select the AP database from the dropdown list in the toolbar.
Save the query with a name of VendorsInCA and close it
Open the saved query named VendorsInCA. Then, click the Run button in the toolbar to run it
Please paste a screenshot of the querys result below
Create a new query and enter this SELECT statement:
SELECT InvoiceDate, SUMInvoiceTotal AS Total
FROM Invoices
Save the query with a name of Chart
Run the query and view the results. Note that it includes one row for each invoice date and that each row includes the total for the invoices on each date.
Please paste a screenshot of the querys result below
Click the Charts icon in the Results tab. Adjust the settings to create a bar graph showing the invoice totals by date. Hint: Set the data direction to vertical. Note that this chart displays one bar for each date that has an invoice.
Please paste a screenshot of the querys result below
Save the Chart query with a new name of Chart
Edit the query so it becomes this SELECT statement:
SELECT DATEBUCKETMONTH InvoiceDate AS Month, SUMInvoiceTotal AS Total
FROM Invoices
GROUP BY DATEBUCKETMONTH InvoiceDate;
To do that, you need to add the DATEBUCKET function in two places. When you do make sure to type the code exactly as shown above.
Please paste a screenshot of the querys result below
Run the query and note that the results now show one row for each of the months that contain invoices.
Click the Charts icon in the Results tab. Adjust the settings to create a bar graph showing the invoice totals by month. Note that this chart displays one bar for each month that has an invoice.
Please paste a screenshot of the querys result below
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started