Joining Tables

SQL JOIN on Equal Column Values
AskAI

Write a SQL query to find all pairs of records from two tables, A and B, such that the records have the same value for a given column, C.

147
Oct 22
find all customers who have made at least one purchase
AskAI

This technical problem involves finding all customers who have made at least one purchase from each of three different categories. An example input and output is provided.

186
Oct 21
Finding the total number of employees in each department
AskAI

This technical problem involves writing a SQL query to find the total number of employees in each department, based on data from two tables, "employees" and "departments".

164
Oct 21
Finding common elements between two tables
AskAI

Given two tables, A and B, write a SQL query to find the common elements between the two tables.

159
Oct 21
SQL query to find the total number of products ordered for each product.
AskAI

This technical problem involves writing a SQL query to find the total number of products ordered for each product. The query should use two tables - products and orders - as input and return the product name and total number of products ordered for each product as output.

157
Oct 18
SQL query to return customers who have placed orders over $100
AskAI

Write a SQL query that returns the names of customers who have placed orders totaling more than $100.

160
Oct 18
Finding All Pairs of Rows in Two Tables Where Column Values Match
AskAI

Write a SQL query to find all pairs of rows from two tables, A and B, such that the values in the columns match.

161
Oct 17
Get number of customers served by each employee
AskAI

This technical problem involves writing a SQL query that returns the number of customers served by each employee at a store. The input data consists of three tables: customers, employees, and customer_employ ee. The output should be a table with two columns: employee_name and customers_served.

144
Oct 17