Friday, June 8, 2007

Question 71

Which of the SQL statements below will retrieve persons of the same name from an “Employee” table?

Employee

Employee number Name Date of birth Department
0001 Kenji Arai 1950-02-04 Sales Department
0002 Taro Suzuki 1955-03-13 Administration Department
0003 Hiroshi Sato 1961-07-11 Technical Department
0004 Hiroshi Tanaka 1958-01-24 Planning Department
0005 Taro Suzuki 1948-11-09 Sales Department

a) SELECT DISTINCT Name FROM Employee ORDER BY Name
b) SELECT Name, COUNT (*) FROM Employee GROUP BY Name
c) SELECT Name FROM Employee GROUP BY Name HAVING COUNT (*) > 1
d) SELECT Name FROM Employee WHERE Name = Name

answer

No comments: