Deliverable 1. Simple SQL Statements
Caution: Read the instructions carefully! Each question is based on a single SQL statement, and the single SQL statement might contain sub-queries (additional SELECT statements) within the statement.
Provide a list all of the Customer ID, Customer Names, and States and sort the list in alphabetical order by Customer Name.
SELECT customerID, CustomerName, CustomerState
FROM customer_t
ORDER BY CustomerName;
---
Provide a list of all of the Customer ID, Customer Names, and States, and sort the list by state with the Customer Names in alphabetical order within each state.
SELECT customerID, CustomerName, CustomerState
FROM customer_t
ORDER BY CustomerState LIKE '%[a-z]%';
---
What is the full address of the customer named Kaneohe Homes? That includes the street, city, state, and zip code
SELECT CustomerAddress, CustomerCity, CustomerState,
CustomerPostalCode
FROM customer_t
WHERE CustomerName = 'Kaneohe Homes';
---
Provide a list of the product name, product ID, and unit price for all of the products in the Product table, sorted in alphabetical order by product name
SELECT ProductID, ProductStandardPrice,
ProductDescription
FROM product_t
WHERE ProductDescription LIKE '%[a-z]%';
---
What is the standard price and standard price if increased by 15% for every product?
UPDATE product_t
SET ProductStandardPrice = ProductStandardPrice *
1.15;
---
What is the average standard price for the products with a product finish of natural ash?
SELECT AVG(ProductStandardPrice) as
ProductStandardPrice
FROM Product_t
WHERE ProductFInish = 'Natural Ash';
---
Provide a listing of all of the products that includes the difference between its standard price and the overall average standard price of all products.
SELECT ProductDescription, ProductStandardPrice –
(SELECT AVG(ProductStandarPrice) FROM product_t) AS
Difference
FROM product_t;
---
What is the product name, product ID and price of most expensive product in the product table?
SELECT ProductDescription, ProductId,
ProductStandardPrice
FROM product_t
WHERE ProductStandardPrice >=800;
---
Which orders have been placed since October 20, 2005?
SELECT * FROM order_t
WHERE OrderDate <= 2005-10-20;
---
List the product name, standard price, and finish for all tables that cost more than $300 and all desks that cost more than $300.
SELECT ProductDescription, ProductStandardPrice,
ProductFinish
FROM product_t
WHERE ProductDescription
LIKE '%_T%' '_D%'
AND ProductStandardPrice > 300;
---
Provide a listing of the unique product IDs for the products in the Order Line table
SELECT DISTINCT ProductID
FROM order_t;
--
Solved all the questions except last question, really sorry for that
If you have any doubt, please mention, love to help
all the best
please upvote
Deliverable 1. Simple SQL Statements Caution: Read the instructions carefully! Each question is based on a...
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...
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...
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:...
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...
SQL Homework 1. For each reservation, list the reservation ID, trip ID, customer number, and customer last name. Order the results by customer last name. 2. For each reservation for customer Ryan Goff, list the reservation ID, trip ID, and number of persons. 3. List the trip name of each trip that has Miles Abrams as a guide. 4. List the trip name of each trip that has the type Biking and that has Rita Boyers as a guide. 5....
I need this written in SQL Employee EMP ID EMP FNAME EMP LNAME EMP STREET EMP CITY EMP STATE EMP ZIP EMP START DATE Table TABLE ID AREA IDTABLE SEATS Area AREA ID AREA NAME AREA SUPERVISOR EMPLOYEE ID Customer CUST ID CUST LAST NAME CUST NUMBER OF GUESTS Assignment EMPID TABLE ID Seating CUST IDTABLE ID SEATING COST SEATING DATE SEATING TIP Question 29 (10 points) Write an SQL query to list the employee ID and first and last...
There are 7 problems that require using joins. Each problem has 10 points. 1. Write an SQL command that will find any customers who have not placed orders and sort them out by CustomerID in ascending order. 2. List the employees and supervisors names for each supervisor who supervises more than two employees. 3. List the name of each employee, his or her birth date, the name of his or her manager, and the manager’s birth date for those employees...
Write SQL code please. Tables are attached with their appropriate fields for reference. The Marketing Department requires a vendor listing that shows the following fields: 1. - Vendor Name Vendor Contact First Name - Vendor Contact Last Name - Vendor City - Vendor State - Vendor Zip Code Note: Sort by vendor state The Finance Department requires a report that shows payment totals greater than $50.00. List the following fields 2. - Vendorid - Payment Total - Payment Date The...
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...
need a solution/explanation for this SQL problem. 7. Display a list of customer names with furniture series that purchased more than twice by this customer. Also, display the number of times of purchase. 8. Display a list of furniture series that are priced above the average of all other series. 9. Display the customer ID of the the customers, the series and price of the most expensive furniture they purchased. Sort the result by customer ID in ascending order CUSTOMER...