SQL Statement to display only the duplicate zip codes from two different tables
<pre><code>Small Part of the Instructor Table
--------------------------------------------------
Instructor_ID Salutation First     Last     Street Address  Zip
101           Mr         Fernand   Hanks    100 East 87th   10015
102           Mr         Tom       Wojick   518 West 120th  10025
103           Ms         Nina      Schorin  210 West 101st  10025
104           Mr         Gary      Pertez   34 Sixth Ave    10035
105           Ms         Anita     Morris   34 Maiden Lane  10015
106           Rev        Todd      Smythe   210 West 101st  10025
107           Dr         Marilyn   Frantzen 254 Bleeker     10005
108           Mr         Charles   Lowry    518 West 120th  10025
109           Hon        Rick      Chow     56 10th Avenue  10015
110           Ms         Irene     Willig   415 West 101st  (null) 
------------------------------------------------------------------
Small Part of the Student Table

152     Mr.    Thomas       Edwards     501 W. Elm                      07036
157     Ms.    Shirley      Jameson     101 Daniel St.                  07008
158     Mr.    Roy          Limate      5 Horizon Rd.                   07024
159     Mr.    Thomas       Edwards     45 Maplewood Ave.               07040
160     Mr.    John T.      Beitler     100 Plaza Dr, ITT CSI Emp. Dpt  07096
168     Ms.    Sally        Naso        812 79th St.                    07047
182     Mr.    Jeffrey      Delbrun     PO Box 1091                     07024
185     Mr.    Dennis       Mehta       371 Monmouth St.                07302
186     Ms.    Christine    Sheppard    16 Seymour St.                  07042
187     Mr.    O.           Garnes      125 Great Hills Rd              07078
</code></pre>

<p>Write a set operation, using the UNION set operator, to list all the duplicate zip codes in the INSTRUCTOR and STUDENT tables.</p>

<p>Here is what I have come up with, not sure if its right or not.</p>

<pre><code>select zip, count(*) from instructor
group by zip
having count(*) &gt; 1
union
select zip, count(*) from student
group by zip
having count(*)&gt;1
</code></pre>

<p>Please Help!!</p>

<pre><code>OUTPUT:
Zip     Count(*)
06820   3
06830   3
06880   2
06903   2
07003   2
07010   6
07011   2
07012   2
07016   2
07024   9    
</code></pre>