I need to write an SQL statement to run this query:
SALES has the following column names: vendorid, name, upc, move, price, qty, year, store
the table name is SALES... the sales is not a column in the SALES so it needs to be created in the query with the formula as well.
QUESTION BELOW:
Query 4: Return the vendor id, vendor name, product UPC code, move, and sales (price * move/qty) for each product sold by store 100 in 1995. Sort by sales descending. N.B since ‘year’ is a reserved word in SQL, you will need to surround the field year in quotes in order for it to work.
Since you have not provided the db schema, I am providing the queries by guessing the table and column names. Feel free to reach out in case of any concerns.
QUERY
SELECT vendor_id, vendor_name, upcCode, move, (price * move / qty) as sales from SALES where storeId = 100 and `year` = 1995 order by sales desc;
I need to write an SQL statement to run this query: SALES has the following column...
For each question, write a SQL query and save it as a "sql" file using a different query 2, etc. Please execute these queries sequentially name, for example, query1.query product id (PK) category brand production_cost (Not Null) (FK) name (Not Null) Toothpaste Supermarket 1 Multivitami Supermarket 2 Shampoo acket T-shirt Supplements Supermarket Department4 Department5 Pharmacy Pharmacy 6 6 10 Query1. Update the Product table by adding another column as shown above ucts (name) with uery2. Retrieve all the uction cost...
WRITE A SQL QUERY SQL SERVER Write a SELECT statement that returns one column from the Customers table named FullName that joins the LastName and FirstName columns. -- Format this column with the last name, a comma, a space, and the first name like this: -- Doe, John -- Sort the result set by last name in ascending sequence. -- Return only the contacts whose last name begins with a letter from M to Z. -- ...
QUESTION: (Answer in SQL) Write an SQL query to find all pairs of users (A,B) such that both A and B have blurted on a common topic but A is not following B. Your query should print the names of A and B in that order. BACKGROUND INFO: Users can post their thoughts in form of short messages that we call “blurts”. When signing up, users need to provide their email and a password of their choice. In addition, they...
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...
Hello, I need help answering all 8 of these questions for my BIS
422 class. I need the appropriate MySQL script to use for these
questions
Provide the SQL for the following data requests. Your SQL should
be written as a single script that can be pasted into MySQL and run
without edits. Make sure you use the proper notation for your
comments (see the practice solution for an example of the format).
There will be a 5% deduction for...
I have no experience with SQL and I need to write commands to query the following: List all patients with the last name of “Johnson”. List all patients who are female. List all patient last names and the medical record number of each. I've watched Khanacademy videos and tried some other online tutorials but I just cannot find the information or help I need to finish this assignment. I'm in an HIM program, but that is not an option on...
I need to write a SQL query that displays the first name and last name of each author along with the number of books he or she has written. Capitalize the first and last names. AUTHOR table: AUTHORID, LNAME, FNAME BOOKAUTHOR table: ISBN, AUTHORID BOOKS table: ISBN, TITLE, PUBDATE, PUBID, COST, RETAIL, DISCOUNT, CATEGORY
I need help creating an SQL for this question. Make a list of Sales for February 2014. Include the Sale ID, SaleDate, the total number of items sold (sum of quantity), and the total amount (sum of quantity times sale price) for each sale. Sort the output by SaleID. Name the new fields ItemCount and SaleTotal.
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:...
I need help with getting these SQL codes please, I can run them myself. I just need the codes Create a risk ranking of returned items in 2014. Create a new column of data that shows whether something is high risk, medium risk or low risk based on the following criteria. If the return was equal to or more than $1,000, it is high risk; if the return is equal to or more than $500 and less than $1,000, it...