Answer:
SELECT* FROM Employee WHERE firstName = lastName;
Step-by-step explanation:
The first query you provided:
SELECT* FROM Employee WHERE (firstName = firstName) AND (lastName = lastName)
is not correct, because it's comparing the firstName column to itself, and the lastName column to itself, so it will always return true, and will return all the rows in the Employee table regardless of the firstName or lastName values.The second query:
SELECT* FROM Employee WHERE firstName = last NAME
is better, but it's not correct because it has a typo, it should be
SELECT* FROM Employee WHERE firstName = lastName
This query is checking if the firstName column is equal to the lastName column, and if so it will return the entire row of that employee.The third query:
SELECT FROM Employee JOIN Employee ON firstName = lastName
is not correct because it's trying to join the Employee table to itself, which is unnecessary and will not return the correct results. Also, it is missing the '*' after the SELECT statement.The fourth query:
Select DISTINCT firstName, lastName FROM Employee
is not correct because it is only returning the firstName and lastName columns and not the entire row. Also, it is using the DISTINCT keyword which will remove any duplicate rows, but since firstName and lastName should be unique for each employee, it's not necessary here.The correct query should be
SELECT * FROM Employee WHERE firstName = lastName;
This query will return all columns from the Employee table, where the firstName is equal to the lastName.