Write a sql query to return all the employee details

Assignment Help PL-SQL Programming
Reference no: EM133095466

Scenario 1

Table Customers:(cust)

1165_Table Customers.jpg

Table Orders:(order)

1976_Table Orders.jpg

These two tables will be joined on the columns id (table customer) and Cust_id (Table Orders)

Question 1. Write a SQL query to get all the customer who had placed orders with aggregated total order cost and total order count.

Return below columns

• Cust.id

• Cust.first_name

• Cust.last_name

• Cust.state

• Total_order_cost

• Total_order_count

Question 2. Write a SQL query to get the list of customers who hadn't place any orders before.

Return below columns:

• Cust.id

• Cust.First_name

• Cust.Last_name

• Cust.Phone_number

Question 3. Write a SQL query to return Customer record with highest aggregated total_order_cost Return below columns:
• Cust.id

• Cust.First_name

• Cust.Last_name

Question 4. Write a SQL query to return Customer record with 2nd highest aggregated total_order_cost Return below columns:
• Cust.id

• Cust.First_name

• Cust.Last_name

Scenario 2

2395_Table Orders1.jpg

Note:

The employees table stores employee details. There will be a new record inserted whenever there is a
change in the employee's details.

Question 5. Write a SQL Query to return all the employee details with latest record.

Scenario 3

825_Table Orders2.jpg

Note:

The employees table stores employee's details. There are duplicated records captured in the table.

Question 6. Write a SQL Query to remove/delete the duplicate row and only keep one record per employee.

Reference no: EM133095466

Questions Cloud

Describe two quality management compliance requirements : Describe two quality management compliance requirements relating to organisational learning.
What amount of joint processing cost is allocated to product : Wan, Tu, Tri, Por Joint production costs are as follows: Materials - P4,000; Labor - P3,000; Overhead- P2,000. What amount of joint processing cost is allocated
Developing an organisational learning strategy : Identity and describe two organisational learning theories that can be used as a basis for developing an organisational learning strategy.
Case-converging or diverging : Read the case study titled "Converging or Diverging? A Comparative Analysis of Trends in Contingent Employment Practice in Europe over a Decade
Write a sql query to return all the employee details : Write a SQL Query to return all the employee details with latest record - Write a SQL query to return Customer record with highest aggregated total_order_cost
Improve the workplace by providing workforce : How can businessmen improve the workplace by providing workforce, improvement in productivity and investment of money along with ideas?
Organization about lessons learned and best practices : Inform others in the organization about lessons learned and best practices
Prepare the entry to record depreciation : Peter M. Dell Co. purchased equipment for $510,000 which was estimated to have a useful life of 10 years. Prepare the entry to record depreciation
What is the payback period for the new machine : Management predicts that the machine can produce sales of $198,000 each year for the next 5 years. What is the payback period for the new machine

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Create a risk information sheet for five potential risks

Using the sample shown below, create a Risk Information Sheet for at least five potential risks that might be encountered during the conversion. At least three of the five risks you choose should be project management related.

  Write a program that does simplified bgp route advertising

Additionally, it will periodically check the modification time of the routing table file and if it detects that it has changed, it will re-read it and send BGP UPDATEs reflecting the changes to all connected peers. This functionality is described i..

  Write ten sql statements against the student schema

Write 10 SQL statements against the STUDENT schema you created for practice lab 1. Your statements should run error-free and should be valid.

  Gathering requirements to develop sql queries

Describe some techniques for gathering requirements to develop SQL queries. Provide an example using a business case.

  Understand the concept of sql

List  all the student Id and teacher Id where GPA is 3 or more than 3. List all the students of the teacher whose name is 'John Eric'. List student Id, name, and address of all the students whose date of birth is 1983. List all the Course Code  where..

  Develop a pl/sql user-defined function

Develop a PL/SQL user-defined function ZIP_CODE_SALES_WINNER that returns the zip code with the largest total car purchases. Since there can be a tie with two or more zip codes, ensure that the lowest numeric zip code is returned.

  Analyse er diagram and database schema

Display the structure details for which the smallest total billable activity (time) has been performed in the last month - Display details of all employees (number, name) for whom billingrecords have been created when they are not identified as havi..

  Display all columns and all rows from the customer table

Display all columns and all rows from the Customer table. Display the ProductID, ProductNumber and ListPrice for all rows in the Product table.

  Write a select statement that returns

Write a Select statement that returns four columns from the Invoices table, named Number, Total, Credits, and Balance

  Discussing sql injection

Discussing SQL Injection. Be sure to include ways to prevent this type of attack. Use at least two sources outside your text and course material for this paper

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Create a publication on your default instance of sql server

Create publication on your default instance of SQL server that creates transactional snapshot of the SUPPLIERS and PRODUCTS table located in Northwind database.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd