MySQL: SUBQUERIES

10 Views
Published
#MySQL #tutorial #course

SELECT first_name, last_name, hourly_pay,
(SELECT AVG(hourly_pay) FROM employees) AS avg_pay
FROM employees;

SELECT first_name, last_name
FROM customers
WHERE customer_id IN (SELECT DISTINCT customer_id
FROM transactions WHERE customer_id IS NOT NULL);
Category
Bro Code
Tags
MySQL tutorial for beginners, SQL tutorial for beginners, MySQL course
Be the first to comment