a.
1. Link the tables
Open the access database (called Access_Practice.accdb), select “Enable Content” in the yellow SECURITY WARNING to work on the assignment. If you do not see the warning, proceed to step 2.
2. Select the “DATABASE TOOLS” tab. Select “Relationships” in the “Relationships” box to open the Show Table window. Holding down shift, select “Inventory,” “Sales,” and “SalesItems” from the Tables list. Select Add then Close.
The following screen will show up:
3. Link the tables by dragging the primary key to its foreign key in the appropriate table. For each link place a check in the Enforce Referential Integrity box. Select Create.
4. Save your work then close the relationship window.
b.
Create the Item_Extension_Calculation query:
1. Select the CREATE tab. Select Query Design in the Queries box.
2. Select SalesItems in the Show Tables box. Select Add, then Close:
3. Drag InvoiceID, InventoryID, Quantity, and UnitPrice to the Field row of the design grid creating four columns.
4. In the blank column on the right of the design grid, type Amt: then select Builder in the Query Setup box of the DESIGN tab:
5. Expand Access_Practice.accdb by selecting its plus sign (+). Select Tables. (Either select the plus sign or double-click Tables). Select SalesItems from the Expression Elements list, then double-click Quantity from the Expression Categories list. Type, * in the calculated query field. Double-click UnitPrice in the Expression Categories list. In the calculated query field delete <>. Select OK.
6. Verify the Show: box in the Amt: column is selected. Then, select Property Sheet in the Show/Hide box of the DESIGN tab. The Property Sheet appears on the right side of the screen.
7. Choose currency for the Format, close (x) the Property Sheet:
8. Select in the Results box of the DESIGN tab. The extended amount of sales will appear.
9. Select Save Save the query as Item_Extension_Calculation. Select OK.
c.
Calculate the total dollar amount of each sale.
1. Select the CREATE tab. Select Query Design in the Queries box.
a. Select the Queries tab. Choose Item_Extension_Calculation, then Add. Select the Tables tab. Choose Item_Extension_Calculation, then Add.
2. Double-click InvoiceID, InvoiceDate, CustomerID, EmployeeID in the Sales table and Amt in the Item_Extension_Calculation query.
3. Select in the Show/Hide box of the DESIGN tab. Select Sum for Amt and leave the others as Group by. Format Amt as Currency using the Property Sheet as previously discussed.
4. Select
you will get the total dollar amount of each sale. Save the query as Sale_Amount_Calculation.
d.
Calculate total sales for each inventory item.
1. Create new query and select SalesItems and Inventory under the Tables tab.
2. Double-click Inventory ID and Name in the Inventory table to add them to the design grid. In the blank column on the right, type Amount and select Builder in the Query Setup section of Design tab.
3. In the Expression Builder under Expression Elements select the SalesItems table and double-click Quantity in the Expression Category list. Type *. Double-click UnitPrice under Expression Category. Delete <>, then click OK.
4. Click and select Sum for Amount in the Total row.
5. Format Amount as Currency.
6. Select you will get total sales for each inventory item.
Save the query as Sales_for_Inventory_Items.
e.
Calculate Total Sales.
1. Select the CREATE tab. Select Query Design in the Queries box. Select SalesItems.
2. In the first column, select Builder in the Query Setup section of Design tab. Type in the formula written in the calculated query field in the Expression Builder image below. Select OK.
3. Select
to see the query result.
4. Save the Query as Total_Sales.
f.
Calculate the month in which each sale occurred
1. Select the CREATE tab. Select Query Design in the Queries box Select Sales.
2. Double-click Invoice ID and Invoice Date to insert into the first two columns. In the third column select Builder and type the formula written in the Expression Builder:
3.
4. Select
and see the result:
5. Save the query as Sales_Month.
g.
Calculate the sum of sales for each month.
Select the CREATE tab. Select Query Design in the Queries box. Select the SalesItems table and Sales_Month query.
2. Link the table and query by dragging InvoiceID from the SalesItems table to InvoiceID in the Sales_Month query.
3. Double-click Month from the Sales_Month query. In the second column, select Builder and type the following formula:
4. Select select Group By for Month and Sum for Sales_Month in the Total row.
5. Format Sales_Month as Currency using the Property Sheet.
6. Click and save the query as Sales_by_Month.
8. Use the Access_Practice.accdb database to complete the following tasks in Access. O LO 4-2 a....
Using the database: Write SQL queries for each of the questions below. 1. Find the media type which has 100 or more tracks. Print the name of such media type. Number of rows returned in the result = 3 A) Find the playlists which have one or more tracks that have never been purchased in California (CA). Print the Id, and the name of such playlists. Number of rows returned in the result = 18 B) Find the customers who...
Question 2 (60 points): You need the Sales OrdersExample database to complete this project. To install the database, first, download Data code 1 and run it, then download Data code 2 and run (provided on D2L). Now answer the following questions. 2.1: (20 Points) Use the customers' table inside of the salesordersexample database, and write a query statement to show records from the CustFirstName, CustLastName, and CustCity columns 2.2: (20 Points) Use the employees' table inside of the salesordersexample database,...
Hi i need Help. i use MYSQL command line. THE QUESTION ARE BELOW please check the answer before you submit because sometimes query gives error thank you For Full database of SQL you can DOWNLOAD from this link: https://drive.google.com/file/d/1xh1TcBfMtvKoxvJr7Csgnts68fF53Q1t/view?usp=sharing ------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- What are the total sales for each year. Note that you will need to use the YEAR function. Order by year with the newest year first. ------------------------------------------------------- How many employees have no customers? ------------------------------------------------------------------ List the total sales for...
Write an SQL query against the Chinook Database v1.4. Each query must run successfully using DB Browser for SQLite. Create the exact query below. Must use sub query. I saw that a similar solution for this question used IF and CONCAT functions which do not work and return errors. If it is possible to use the CASE function in place of IF that would be greatly appreciated. Also I really hate to ask but if it could be organized neatly...
can someone solve these quick please and thank you! sql chapter 4 Query #1: List the company name, contact name, contact title and the phone number for customers who HAVE NOT put in an order. Use an outer join. Query #2: Create a listing displaying the employee first name, last name and the full name (First name space Last Name) of the person they report to (Supervisor). This is a self-join. If an employee does not report to anyone then...
Topic: Inventory Manangement Part A. Database Creation Your database should have a minimum of 4 tables and include both one-to-many and many-to-many relationships. Be sure to include some numeric and/or date fields. Define all appropriate constraints, using the proper naming conventions (see Structure Notes below). Populate your database with at least 30 records in the main table(s), and whatever is needed in related tables. Submit the following: • a short description of the purpose of the database and what the...
K3 K3 School of CS & IT, RMIT Introduction to Database Systems Tutorial Sheet 2: SQL The database below is for a department store, and describes stock, staff, clients, and sales. Each question in this tutorial concerns this "store" database. SALE ITEM ITEM STAFF NUMSOLD CLIENT SDATE TYPE DESCRIP PRICE K3 Simon 6 Clark 19980311 Knife set $17.95 K11 Simon Cilla 19980121 K5 Ladle $6.95 K11 Simon Cilla 19980123 K11 Scraper $0.95 L12 Sorcha 5 Charles 19971130 L12 Rack $22.95...
Questions are based on the Northwind database. a. A data dictionary (Excel file) that describes each of the tables. (Attached in question) b. Write good, clean SQL that answers the following questions. c. Separate your queries as I have done in the following example. End each query with a semicolon (;) and insert the word "go" between each query. Queries can span multiple lines if required. Select CustomerID from Customers; go Select Count(*) from Employees; go Select max(productID) from Products; 18. Produce...
Prepare and execute each of the queries listed using the "Adventureworks2012" database in SQL: Server: http://msftdbprodsamples.codeplex.com/releases/view/93587 When all of your queries are complete, cut and paste the SQL Syntax into a word document. In order to see what the column names are, you need to click on the table and then Columns to see the field names. Make sure to include column headings that make sense in the queries (use the as “Field Name” after the field selected). Multi-table Queries...
You are given a database in a MS Access file called ‘DBP-e14-Cape-Codd’ that contains data collected in an outdoor sports retail store. The retail store hired you as a data analyst to answer questions in order to help them make business decisions that will help them grow. Write the SQL statement for each query and save them in MS Access as Q1, Q2,… Please submit the MS Access and MS Word to help speed the grading turnout! in Blackboard. (to...