Consider the CUSTOMERS table having the following records: +----+----------+----
ID: 667735 • Letter: C
Question
Consider the CUSTOMERS table having the following records:
+----+----------+-----+-----------+----------+
| ID | NAME | AGE | ADDRESS | SALARY |
+----+----------+-----+-----------+----------+
| 1 | Ramesh | 22 | PA | 2000.00 |
| 2 | James | 25 | DE | 1500.00 |
| 3 | Jill | 23 | NY | 2000.00 |
| 4 | John | 25 | OH | 6500.00 |
| 5 | Wang | 27 | PA | 8500.00 |
| 6 | Komal | 22 | CA | 4500.00 |
| 7 | April | 24 | NY | 10000.00 |
+----+----------+-----+-----------+----------+
Write a SQL statement that displays the ID, NAME, ADDRESS and SALARY of individuals of same age. (
Hint: Use Group By function and Having Clause ) – 10 Pts
Explanation / Answer
SELECT ID, NAME,ADDRESS, SALARY FROM CUSTOMERS GROUP BY age HAVING COUNT(age) >= 2;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.