This code must be in SQL -
Run the script provided with the assignment. This will create the tables used for this assignment. Write the necessary SQL commands to perform the required actions. Run the queries to obtain results from the database. (Make sure all columns returned have proper headings.)
3 |
2 |
2 |
3 |
3 |
4 |
4 |
4 |
Example:
ACI 41002 is one of the products you should display because…
Price per unit is $0.76, 20 times that value is $15.20
The sum of all orders containing ACI 41002 is $48.64, which is
larger than $15.20!
5 |
Since you have not provided the table schema and column names, it is impossible for me to provide you correct working SQL Queries.
For time being, I am guessing the table and column names and providing you the queries. Hence, you might need to change the names accordingly in order to make them wrong. In case you need any help, reach out to me via comments section.
1. SELECT count(DISTINCT manufacturer), max(unitPrice), min(unitPrice) FROM Products;
2. SELECT avg(sales) FROM SalesRep WHERE work_location = 'Home';
3. SELECT CustNum, sum (amount) FROM Customer c JOIN Orders o ON c.CustNum = o.CustNum GROUP BY o.CustNum;
NOTE: As per Chegg policy, I am allowed to answer only 3 questions (including sub-parts) on a single post. Kindly post the remaining questions separately and I will try to answer them. Sorry for the inconvenience caused.
This code must be in SQL - Run the script provided with the assignment. This will...
If possible please just send the SQL statement. Thank you Each question within deliverable 3 must begin on a new page and be sure to document the question as the title of each item at the top of each page. Also, using a 12-point font, include the SQL statement and then provide a screen shot of each query. The screen shots must include both the SQL statement and the results for each item below based on the data entered in...
Questions in this part ask you to write SQL queriesthat would retrieve certain information from the tables. For each question, write the SQL query that would display the information asked by the question. Display information about parts that have their weights greater than the average weight of all parts. PNO PNAME P2 BOLT P3 SCREW Find supplier numbers who supply any screws (i.e., such that the part name is ‘screw’). The constraint is that you may not use any join or...
CIS336: Lab 6: Group Functions and Subqueries I desperatly need help with this MYSQL lab. Any help is appreciated. I don't need the outputs, I just need working codes. 1.Write a query to display the description of a product and the number of orders for that product. Sort the display by the description. 2.Redo the previous problem but this time just display those product names and the number of sales that have more than 3 sales. 3. Use a SubQuery...
I can provide my log in to my teradata database if necessary. Thanks 19:31 P B . Ch. 6 HW Assignment 4 - Saved SG 59% Make db_pvfc11_big as your default database when you log into SQL Assistant: Username userid Password: Default Database: db pufc11_big Database Descriptions Provide proof of ownership by using Current_User attribute in all SELECT statements. Use the PVFC database to answer the following questions: 1. For each customer, list the CustomerID and the total number of...
This assignment consists of a series of SQL questions. For each question, you will need to include: • SQL query. • An explanation of the query. Please include explanations as a comment AFTER your query, e.g., enclosed within a /* comments block */ ). See the first example in the SQL tutorial for a comment. You don’t need to explain straightforward code in comments. Only the parts that are interesting or different, so that we understand what you did. Question-1...
Given the following relational schema, write queries in SQL to answer the English questions. The Access Database for the schema is available, as is a DDL file. It is also available on the MySQL server. You must only submit the SQL for your answers. You can get your answers without using a DBMS or by using Access or MySQL. Customer(cid: integer, cname: string, address: string, city: string, state: string) Product(pid: integer, pname: string, price: currency, inventory: integer) Shipment(sid: integer, cid:...
Using MYSQL please help (#7){Screen shot} Write a script that removes the view, the two tables, and the database, with one click of the execute button. In the screen shot, display all the SQL code, and show the Object Explorer after the script executes. Add records to the Category table and the Products table. One screenshot should show the SQL code and the output of a SELECT statement showing the records in the table (two screenshots, one for each table)...
Use the give table below to answer the following questions. sName Smith sCity SI S2 PI P2 P3 P4 PS Nut Bolt Red Blue 12 17 17 10 Blake Paris Screw Red S4. S5 30 Athens Blue 12 SP SNo (PK) (FK S1 S1 S1 S1 S1 S2 S2 S3 S3 S3 S4 P1 P2 P3 P4 PS PI P2 Pl P2 P3 P2 P3 P4 200 100 100 200 200 200 S5 Table: Content of the Supplier-Parts DB Tables...
Use SQL to slove the problem 1. (7) List all condos in building C, the date they were cleaned, and the full name of the staff who cleaned them in August. 2. (5) Display the activities reserved in June for more than 3 people. Include the activity description and label the output as Activities Reserved in June. 3. (4) Listing for all guides and their certification renewal dates for next year. Include full name and hire date. 4. (6) Management...
Summarize these pages in your own style and you have to include in your report some figures highlighting the relation between these operations. Basic AGGREGATE functions (Revision) COUNT: returns the number of tuples, which meet the specified condition: SELECT COUNT(DISTINCT Dept) AS Num_Depts FROM subject: SUM: returns the sum of the values in a specified column (i.e. numeric column) SELECT COUNT(*) AS hi_sal, SUM(salary) FROM Lecturer WHERE Salary > 4500 MIN: returns the minimum value in a specified column (numeri...