MySQL sub-queries using WHERE and HAVING clauses

233 views Asked by At

Create three queries using tables Employee_T and hoursWorked_T.

  1. Returns a single column and single row in the outer query's WHERE clause
  2. Returns a single column and single row in the outer query's HAVING clause
  3. Returns a multi-column table in the outer-query's FROM clause

MySQL tables

  CREATE TABLE IF NOT EXISTS Employee_T
  (
     empName VARCHAR(25)),
     empNo INT,
     Primary Key(empName)
  );

  CREATE TABLE IF NOT EXISTS hoursWorked_T
  (
   empName VARCHAR(20),
   plannedHours INT,
   actualHours INT,
   Foreign Key(empName)
  );
0

There are 0 answers