MySQL: MySQL INNER JOIN dept names #34
Toolliyo Coach
Progressive help: Nudge → Guide → Approach. Full solution stays behind the Solution tab.
Editor is open — no login wall to practice.
| Test | Status | Details |
|---|
Ready — edit the code above and click Run or Submit.
-- MySQL sample schema
CREATE TABLE employees (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
dept_id INT,
salary DECIMAL(10,2),
hired DATE
);
CREATE TABLE departments (id INT PRIMARY KEY, name VARCHAR(50));
INSERT INTO employees (name, dept_id, salary, hired) VALUES
('Ali', 1, 90000.00, '2020-01-15'),
('Sara', 2, 120000.00, '2019-06-01'),
('Raj', 1, 75000.00, '2021-03-20');
INSERT INTO departments VALUES (1,'Engineering'),(2,'Sales');
SELECT e.name, d.name AS department
FROM employees e
INNER JOIN departments d ON e.dept_id = d.id;
Prefer Coach (Nudge → Guide → Approach) before revealing. No forced signup.
MySQL-specific syntax: LIMIT, AUTO_INCREMENT, ENGINE=InnoDB, DELIMITER for procedures.
Sign in to save and review your submission history. You can still Run code on the Editor tab as a guest.
Sign in