1.创建自然连接,NATURAL JOIN子句,会以两个表中具有相同名字的列为条件创建等值连接。
SQL> select department_id,department_name,location_id,city 2 from departments natural join locations;DEPARTMENT_ID DEPARTMENT_NAME LOCATION_ID------------- ------------------------------ -----------CITY------------------------------ 60 IT 1400Southlake 50 Shipping 1500South San Francisco 10 Administration 1700SeattleDEPARTMENT_ID DEPARTMENT_NAME LOCATION_ID------------- ------------------------------ -----------CITY------------------------------ 30 Purchasing 1700Seattle 90 Executive 1700Seattle 100 Finance 1700SeattleDEPARTMENT_ID DEPARTMENT_NAME LOCATION_ID------------- ------------------------------ -----------CITY------------------------------ 110 Accounting 1700Seattle 120 Treasury 1700Seattle 130 Corporate Tax 1700SeattleDEPARTMENT_ID DEPARTMENT_NAME LOCATION_ID------------- ------------------------------ -----------CITY------------------------------ 140 Control And Credit 1700Seattle 150 Shareholder Services 1700Seattle 160 Benefits 1700SeattleDEPARTMENT_ID DEPARTMENT_NAME LOCATION_ID------------- ------------------------------ -----------CITY------------------------------ 170 Manufacturing 1700Seattle 180 Construction 1700Seattle 190 Contracting 1700SeattleDEPARTMENT_ID DEPARTMENT_NAME LOCATION_ID------------- ------------------------------ -----------CITY------------------------------ 200 Operations 1700Seattle 210 IT Support 1700Seattle 220 NOC 1700SeattleDEPARTMENT_ID DEPARTMENT_NAME LOCATION_ID------------- ------------------------------ -----------CITY------------------------------ 230 IT Helpdesk 1700Seattle 240 Government Sales 1700Seattle 250 Retail Sales 1700SeattleDEPARTMENT_ID DEPARTMENT_NAME LOCATION_ID------------- ------------------------------ -----------CITY------------------------------ 260 Recruiting 1700Seattle 270 Payroll 1700Seattle 20 Marketing 1800TorontoDEPARTMENT_ID DEPARTMENT_NAME LOCATION_ID------------- ------------------------------ -----------CITY------------------------------ 40 Human Resources 2400London 80 Sales 2500Oxford 70 Public Relations 2700Munich27 rows selected.
2.使用 USING 子句创建连接,如果多个列具有相同的名称,但自然连接的数据类型又不匹配,则可以使用using子句来指定,使用一个等值的列。
SQL> select employee_id,last_name,location_id,department_id 2 from employees join departments using (department_id);EMPLOYEE_ID LAST_NAME LOCATION_ID DEPARTMENT_ID----------- ------------------------- ----------- ------------- 200 Whalen 1700 10 201 Hartstein 1800 20 202 Fay 1800 20 114 Raphaely 1700 30 119 Colmenares 1700 30 115 Khoo 1700 30 116 Baida 1700 30 117 Tobias 1700 30 118 Himuro 1700 30 203 Mavris 2400 40 198 OConnell 1500 50EMPLOYEE_ID LAST_NAME LOCATION_ID DEPARTMENT_ID----------- ------------------------- ----------- ------------- 199 Grant 1500 50 120 Weiss 1500 50 121 Fripp 1500 50 122 Kaufling 1500 50 123 Vollman 1500 50 124 Mourgos 1500 50 125 Nayer 1500 50 126 Mikkilineni 1500 50 127 Landry 1500 50 128 Markle 1500 50 129 Bissot 1500 50EMPLOYEE_ID LAST_NAME LOCATION_ID DEPARTMENT_ID----------- ------------------------- ----------- ------------- 130 Atkinson 1500 50 131 Marlow 1500 50 132 Olson 1500 50 133 Mallin 1500 50 134 Rogers 1500 50 135 Gee 1500 50 136 Philtanker 1500 50 137 Ladwig 1500 50 138 Stiles 1500 50 139 Seo 1500 50 140 Patel 1500 50EMPLOYEE_ID LAST_NAME LOCATION_ID DEPARTMENT_ID----------- ------------------------- ----------- ------------- 141 Rajs 1500 50 142 Davies 1500 50 143 Matos 1500 50 144 Vargas 1500 50 180 Taylor 1500 50 181 Fleaur 1500 50 182 Sullivan 1500 50 183 Geoni 1500 50 184 Sarchand 1500 50 185 Bull 1500 50 186 Dellinger 1500 50EMPLOYEE_ID LAST_NAME LOCATION_ID DEPARTMENT_ID----------- ------------------------- ----------- ------------- 187 Cabrio 1500 50 188 Chung 1500 50 189 Dilly 1500 50 190 Gates 1500 50 191 Perkins 1500 50 192 Bell 1500 50 193 Everett 1500 50 194 McCain 1500 50 195 Jones 1500 50 196 Walsh 1500 50 197 Feeney 1500 50EMPLOYEE_ID LAST_NAME LOCATION_ID DEPARTMENT_ID----------- ------------------------- ----------- ------------- 104 Ernst 1400 60 103 Hunold 1400 60 107 Lorentz 1400 60 106 Pataballa 1400 60 105 Austin 1400 60 204 Baer 2700 70 176 Taylor 2500 80 177 Livingston 2500 80 179 Johnson 2500 80 175 Hutton 2500 80 174 Abel 2500 80EMPLOYEE_ID LAST_NAME LOCATION_ID DEPARTMENT_ID----------- ------------------------- ----------- ------------- 173 Kumar 2500 80 172 Bates 2500 80 171 Smith 2500 80 170 Fox 2500 80 169 Bloom 2500 80 168 Ozer 2500 80 145 Russell 2500 80 146 Partners 2500 80 147 Errazuriz 2500 80 148 Cambrault 2500 80 149 Zlotkey 2500 80EMPLOYEE_ID LAST_NAME LOCATION_ID DEPARTMENT_ID----------- ------------------------- ----------- ------------- 150 Tucker 2500 80 151 Bernstein 2500 80 152 Hall 2500 80 153 Olsen 2500 80 154 Cambrault 2500 80 155 Tuvault 2500 80 156 King 2500 80 157 Sully 2500 80 158 McEwen 2500 80 159 Smith 2500 80 160 Doran 2500 80EMPLOYEE_ID LAST_NAME LOCATION_ID DEPARTMENT_ID----------- ------------------------- ----------- ------------- 161 Sewall 2500 80 162 Vishney 2500 80 163 Greene 2500 80 164 Marvins 2500 80 165 Lee 2500 80 166 Ande 2500 80 167 Banda 2500 80 101 Kochhar 1700 90 100 King 1700 90 102 De Haan 1700 90 110 Chen 1700 100EMPLOYEE_ID LAST_NAME LOCATION_ID DEPARTMENT_ID----------- ------------------------- ----------- ------------- 108 Greenberg 1700 100 111 Sciarra 1700 100 112 Urman 1700 100 113 Popp 1700 100 109 Faviet 1700 100 206 Gietz 1700 110 205 Higgins 1700 110106 rows selected.
3.自然连接中是以具有相同名字的列为连接条件的,使用ON子句指定要连接任意条件或指定列连接条件。
SQL> select e.employee_id,e.last_name,e.department_id,d.department_id,d.location_id 2 from employees e join departments d on (e.department_id = d.department_id);EMPLOYEE_ID LAST_NAME DEPARTMENT_ID DEPARTMENT_ID LOCATION_ID----------- ------------------------- ------------- ------------- ----------- 200 Whalen 10 10 1700 201 Hartstein 20 20 1800 202 Fay 20 20 1800 114 Raphaely 30 30 1700 119 Colmenares 30 30 1700 115 Khoo 30 30 1700 116 Baida 30 30 1700 117 Tobias 30 30 1700 118 Himuro 30 30 1700 203 Mavris 40 40 2400 198 OConnell 50 50 1500EMPLOYEE_ID LAST_NAME DEPARTMENT_ID DEPARTMENT_ID LOCATION_ID----------- ------------------------- ------------- ------------- ----------- 199 Grant 50 50 1500 120 Weiss 50 50 1500 121 Fripp 50 50 1500 122 Kaufling 50 50 1500 123 Vollman 50 50 1500 124 Mourgos 50 50 1500 125 Nayer 50 50 1500 126 Mikkilineni 50 50 1500 127 Landry 50 50 1500 128 Markle 50 50 1500 129 Bissot 50 50 1500EMPLOYEE_ID LAST_NAME DEPARTMENT_ID DEPARTMENT_ID LOCATION_ID----------- ------------------------- ------------- ------------- ----------- 130 Atkinson 50 50 1500 131 Marlow 50 50 1500 132 Olson 50 50 1500 133 Mallin 50 50 1500 134 Rogers 50 50 1500 135 Gee 50 50 1500 136 Philtanker 50 50 1500 137 Ladwig 50 50 1500 138 Stiles 50 50 1500 139 Seo 50 50 1500 140 Patel 50 50 1500EMPLOYEE_ID LAST_NAME DEPARTMENT_ID DEPARTMENT_ID LOCATION_ID----------- ------------------------- ------------- ------------- ----------- 141 Rajs 50 50 1500 142 Davies 50 50 1500 143 Matos 50 50 1500 144 Vargas 50 50 1500 180 Taylor 50 50 1500 181 Fleaur 50 50 1500 182 Sullivan 50 50 1500 183 Geoni 50 50 1500 184 Sarchand 50 50 1500 185 Bull 50 50 1500 186 Dellinger 50 50 1500EMPLOYEE_ID LAST_NAME DEPARTMENT_ID DEPARTMENT_ID LOCATION_ID----------- ------------------------- ------------- ------------- ----------- 187 Cabrio 50 50 1500 188 Chung 50 50 1500 189 Dilly 50 50 1500 190 Gates 50 50 1500 191 Perkins 50 50 1500 192 Bell 50 50 1500 193 Everett 50 50 1500 194 McCain 50 50 1500 195 Jones 50 50 1500 196 Walsh 50 50 1500 197 Feeney 50 50 1500EMPLOYEE_ID LAST_NAME DEPARTMENT_ID DEPARTMENT_ID LOCATION_ID----------- ------------------------- ------------- ------------- ----------- 104 Ernst 60 60 1400 103 Hunold 60 60 1400 107 Lorentz 60 60 1400 106 Pataballa 60 60 1400 105 Austin 60 60 1400 204 Baer 70 70 2700 176 Taylor 80 80 2500 177 Livingston 80 80 2500 179 Johnson 80 80 2500 175 Hutton 80 80 2500 174 Abel 80 80 2500EMPLOYEE_ID LAST_NAME DEPARTMENT_ID DEPARTMENT_ID LOCATION_ID----------- ------------------------- ------------- ------------- ----------- 173 Kumar 80 80 2500 172 Bates 80 80 2500 171 Smith 80 80 2500 170 Fox 80 80 2500 169 Bloom 80 80 2500 168 Ozer 80 80 2500 145 Russell 80 80 2500 146 Partners 80 80 2500 147 Errazuriz 80 80 2500 148 Cambrault 80 80 2500 149 Zlotkey 80 80 2500EMPLOYEE_ID LAST_NAME DEPARTMENT_ID DEPARTMENT_ID LOCATION_ID----------- ------------------------- ------------- ------------- ----------- 150 Tucker 80 80 2500 151 Bernstein 80 80 2500 152 Hall 80 80 2500 153 Olsen 80 80 2500 154 Cambrault 80 80 2500 155 Tuvault 80 80 2500 156 King 80 80 2500 157 Sully 80 80 2500 158 McEwen 80 80 2500 159 Smith 80 80 2500 160 Doran 80 80 2500EMPLOYEE_ID LAST_NAME DEPARTMENT_ID DEPARTMENT_ID LOCATION_ID----------- ------------------------- ------------- ------------- ----------- 161 Sewall 80 80 2500 162 Vishney 80 80 2500 163 Greene 80 80 2500 164 Marvins 80 80 2500 165 Lee 80 80 2500 166 Ande 80 80 2500 167 Banda 80 80 2500 101 Kochhar 90 90 1700 100 King 90 90 1700 102 De Haan 90 90 1700 110 Chen 100 100 1700EMPLOYEE_ID LAST_NAME DEPARTMENT_ID DEPARTMENT_ID LOCATION_ID----------- ------------------------- ------------- ------------- ----------- 108 Greenberg 100 100 1700 111 Sciarra 100 100 1700 112 Urman 100 100 1700 113 Popp 100 100 1700 109 Faviet 100 100 1700 206 Gietz 110 110 1700 205 Higgins 110 110 1700106 rows selected.
4.使用ON 子句创建多表连接
SQL> select employee_id,city,department_name 2 from employees e join departments d on d.department_id = e.department_id 3 join locations l on d.location_id = l.location_id;EMPLOYEE_ID CITY DEPARTMENT_NAME----------- ------------------------------ ------------------------------ 100 Seattle Executive 101 Seattle Executive 102 Seattle Executive 103 Southlake IT 104 Southlake IT 105 Southlake IT 106 Southlake IT 107 Southlake IT 108 Seattle Finance 109 Seattle Finance 110 Seattle FinanceEMPLOYEE_ID CITY DEPARTMENT_NAME----------- ------------------------------ ------------------------------ 111 Seattle Finance 112 Seattle Finance 113 Seattle Finance 114 Seattle Purchasing 115 Seattle Purchasing 116 Seattle Purchasing 117 Seattle Purchasing 118 Seattle Purchasing 119 Seattle Purchasing 120 South San Francisco Shipping 121 South San Francisco ShippingEMPLOYEE_ID CITY DEPARTMENT_NAME----------- ------------------------------ ------------------------------ 122 South San Francisco Shipping 123 South San Francisco Shipping 124 South San Francisco Shipping 125 South San Francisco Shipping 126 South San Francisco Shipping 127 South San Francisco Shipping 128 South San Francisco Shipping 129 South San Francisco Shipping 130 South San Francisco Shipping 131 South San Francisco Shipping 132 South San Francisco ShippingEMPLOYEE_ID CITY DEPARTMENT_NAME----------- ------------------------------ ------------------------------ 133 South San Francisco Shipping 134 South San Francisco Shipping 135 South San Francisco Shipping 136 South San Francisco Shipping 137 South San Francisco Shipping 138 South San Francisco Shipping 139 South San Francisco Shipping 140 South San Francisco Shipping 141 South San Francisco Shipping 142 South San Francisco Shipping 143 South San Francisco ShippingEMPLOYEE_ID CITY DEPARTMENT_NAME----------- ------------------------------ ------------------------------ 144 South San Francisco Shipping 145 Oxford Sales 146 Oxford Sales 147 Oxford Sales 148 Oxford Sales 149 Oxford Sales 150 Oxford Sales 151 Oxford Sales 152 Oxford Sales 153 Oxford Sales 154 Oxford SalesEMPLOYEE_ID CITY DEPARTMENT_NAME----------- ------------------------------ ------------------------------ 155 Oxford Sales 156 Oxford Sales 157 Oxford Sales 158 Oxford Sales 159 Oxford Sales 160 Oxford Sales 161 Oxford Sales 162 Oxford Sales 163 Oxford Sales 164 Oxford Sales 165 Oxford SalesEMPLOYEE_ID CITY DEPARTMENT_NAME----------- ------------------------------ ------------------------------ 166 Oxford Sales 167 Oxford Sales 168 Oxford Sales 169 Oxford Sales 170 Oxford Sales 171 Oxford Sales 172 Oxford Sales 173 Oxford Sales 174 Oxford Sales 175 Oxford Sales 176 Oxford SalesEMPLOYEE_ID CITY DEPARTMENT_NAME----------- ------------------------------ ------------------------------ 177 Oxford Sales 179 Oxford Sales 180 South San Francisco Shipping 181 South San Francisco Shipping 182 South San Francisco Shipping 183 South San Francisco Shipping 184 South San Francisco Shipping 185 South San Francisco Shipping 186 South San Francisco Shipping 187 South San Francisco Shipping 188 South San Francisco ShippingEMPLOYEE_ID CITY DEPARTMENT_NAME----------- ------------------------------ ------------------------------ 189 South San Francisco Shipping 190 South San Francisco Shipping 191 South San Francisco Shipping 192 South San Francisco Shipping 193 South San Francisco Shipping 194 South San Francisco Shipping 195 South San Francisco Shipping 196 South San Francisco Shipping 197 South San Francisco Shipping 198 South San Francisco Shipping 199 South San Francisco ShippingEMPLOYEE_ID CITY DEPARTMENT_NAME----------- ------------------------------ ------------------------------ 200 Seattle Administration 201 Toronto Marketing 202 Toronto Marketing 203 London Human Resources 204 Munich Public Relations 205 Seattle Accounting 206 Seattle Accounting106 rows selected.
5.使用AND子句或WHERE子句适用附加条件:
①SQL> SELECT e.employee_id, e.last_name, e.department_id, d.department_id, d.l 2 ocation_idFROM employees e JOIN departments dON (e.department_id = d.department_id)AND e.manager_id = 149 ; 3 4 5 EMPLOYEE_ID LAST_NAME DEPARTMENT_ID DEPARTMENT_ID LOCATION_ID----------- ------------------------- ------------- ------------- ----------- 174 Abel 80 80 2500 175 Hutton 80 80 2500 179 Johnson 80 80 2500 177 Livingston 80 80 2500 176 Taylor 80 80 2500②SQL> SELECT e.employee_id, e.last_name, e.department_id, d.department_id, d.location_idFROM employees e JOIN departments dON (e.department_id = d.dep 2 3 4 artment_id)WHERE e.manager_id = 149 ; 5 EMPLOYEE_ID LAST_NAME DEPARTMENT_ID DEPARTMENT_ID LOCATION_ID----------- ------------------------- ------------- ------------- ----------- 174 Abel 80 80 2500 175 Hutton 80 80 2500 179 Johnson 80 80 2500 177 Livingston 80 80 2500 176 Taylor 80 80 2500
6.左右连接:
①SQL> SELECT e.last_name, e.department_id, d.department_nameFROM employees e LEFT O 2 UTER JOIN departments dON (e.department_id = d.department_id) ; 3 LAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Whalen 10 AdministrationFay 20 MarketingHartstein 20 MarketingColmenares 30 PurchasingHimuro 30 PurchasingTobias 30 PurchasingBaida 30 PurchasingKhoo 30 PurchasingRaphaely 30 PurchasingMavris 40 Human ResourcesFeeney 50 ShippingLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Walsh 50 ShippingJones 50 ShippingMcCain 50 ShippingEverett 50 ShippingBell 50 ShippingPerkins 50 ShippingGates 50 ShippingDilly 50 ShippingChung 50 ShippingCabrio 50 ShippingDellinger 50 ShippingLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Bull 50 ShippingSarchand 50 ShippingGeoni 50 ShippingSullivan 50 ShippingFleaur 50 ShippingTaylor 50 ShippingVargas 50 ShippingMatos 50 ShippingDavies 50 ShippingRajs 50 ShippingPatel 50 ShippingLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Seo 50 ShippingStiles 50 ShippingLadwig 50 ShippingPhiltanker 50 ShippingGee 50 ShippingRogers 50 ShippingMallin 50 ShippingOlson 50 ShippingMarlow 50 ShippingAtkinson 50 ShippingBissot 50 ShippingLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Markle 50 ShippingLandry 50 ShippingMikkilineni 50 ShippingNayer 50 ShippingMourgos 50 ShippingVollman 50 ShippingKaufling 50 ShippingFripp 50 ShippingWeiss 50 ShippingGrant 50 ShippingOConnell 50 ShippingLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Lorentz 60 ITPataballa 60 ITAustin 60 ITErnst 60 ITHunold 60 ITBaer 70 Public RelationsJohnson 80 SalesLivingston 80 SalesTaylor 80 SalesHutton 80 SalesAbel 80 SalesLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Kumar 80 SalesBates 80 SalesSmith 80 SalesFox 80 SalesBloom 80 SalesOzer 80 SalesBanda 80 SalesAnde 80 SalesLee 80 SalesMarvins 80 SalesGreene 80 SalesLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Vishney 80 SalesSewall 80 SalesDoran 80 SalesSmith 80 SalesMcEwen 80 SalesSully 80 SalesKing 80 SalesTuvault 80 SalesCambrault 80 SalesOlsen 80 SalesHall 80 SalesLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Bernstein 80 SalesTucker 80 SalesZlotkey 80 SalesCambrault 80 SalesErrazuriz 80 SalesPartners 80 SalesRussell 80 SalesDe Haan 90 ExecutiveKochhar 90 ExecutiveKing 90 ExecutivePopp 100 FinanceLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Urman 100 FinanceSciarra 100 FinanceChen 100 FinanceFaviet 100 FinanceGreenberg 100 FinanceGietz 110 AccountingHiggins 110 AccountingGrant107 rows selected.②SQL> SELECT e.last_name, e.department_id, d.department_nameFROM employees e RIGHT OUTER JOIN departments dON (e.department_id = d.department_id) ; 2 3 LAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Whalen 10 AdministrationFay 20 MarketingHartstein 20 MarketingTobias 30 PurchasingColmenares 30 PurchasingBaida 30 PurchasingRaphaely 30 PurchasingKhoo 30 PurchasingHimuro 30 PurchasingMavris 40 Human ResourcesFeeney 50 ShippingLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Fleaur 50 ShippingFripp 50 ShippingGates 50 ShippingGee 50 ShippingGeoni 50 ShippingGrant 50 ShippingJones 50 ShippingKaufling 50 ShippingLadwig 50 ShippingEverett 50 ShippingDilly 50 ShippingLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Dellinger 50 ShippingDavies 50 ShippingChung 50 ShippingCabrio 50 ShippingBull 50 ShippingBissot 50 ShippingBell 50 ShippingAtkinson 50 ShippingLandry 50 ShippingWeiss 50 ShippingWalsh 50 ShippingLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Vollman 50 ShippingVargas 50 ShippingTaylor 50 ShippingMallin 50 ShippingMarkle 50 ShippingMarlow 50 ShippingMatos 50 ShippingMcCain 50 ShippingMikkilineni 50 ShippingMourgos 50 ShippingNayer 50 ShippingLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------OConnell 50 ShippingOlson 50 ShippingPatel 50 ShippingPerkins 50 ShippingPhiltanker 50 ShippingRajs 50 ShippingRogers 50 ShippingSarchand 50 ShippingSeo 50 ShippingStiles 50 ShippingSullivan 50 ShippingLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Austin 60 ITPataballa 60 ITErnst 60 ITLorentz 60 ITHunold 60 ITBaer 70 Public RelationsAbel 80 SalesAnde 80 SalesBanda 80 SalesBates 80 SalesBernstein 80 SalesLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Bloom 80 SalesCambrault 80 SalesCambrault 80 SalesDoran 80 SalesErrazuriz 80 SalesFox 80 SalesGreene 80 SalesHall 80 SalesHutton 80 SalesJohnson 80 SalesKing 80 SalesLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Kumar 80 SalesLee 80 SalesLivingston 80 SalesMarvins 80 SalesMcEwen 80 SalesOlsen 80 SalesOzer 80 SalesPartners 80 SalesRussell 80 SalesSewall 80 SalesSmith 80 SalesLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Smith 80 SalesSully 80 SalesTaylor 80 SalesTucker 80 SalesTuvault 80 SalesVishney 80 SalesZlotkey 80 SalesKochhar 90 ExecutiveKing 90 ExecutiveDe Haan 90 ExecutivePopp 100 FinanceLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------Urman 100 FinanceChen 100 FinanceFaviet 100 FinanceSciarra 100 FinanceGreenberg 100 FinanceGietz 110 AccountingHiggins 110 Accounting Treasury Corporate Tax Control And Credit Shareholder ServicesLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------ Benefits Manufacturing Construction Contracting Operations IT Support NOC IT Helpdesk Government Sales Retail Sales RecruitingLAST_NAME DEPARTMENT_ID DEPARTMENT_NAME------------------------- ------------- ------------------------------ Payroll122 rows selected.