You are on page 1of 20

6/7/22, 4:30 PM shruti gupta 2101730019

In [4]:
import pandas as pd

path =r"C:\Users\shrut\Desktop\employees.csv"

df=pd.read_csv(path)

df.head()

Out[4]: employee_id first_name last_name email phone_number hire_date job_id salary manager_id department_id

0 100.0 Steven King steven.king@sqltutorial.org 515.123.4567 6/17/1987 4 24000 NaN 9

1 101.0 Neena Kochhar neena.kochhar@sqltutorial.org 515.123.4568 9/21/1989 5 17000 100.0 9

2 102.0 Lex De Haan lex.de haan@sqltutorial.org 515.123.4569 1/13/1993 5 17000 100.0 9

3 103.0 Alexander Hunold alexander.hunold@sqltutorial.org 590.423.4567 1/3/1990 9 9000 102.0 6

4 104.0 Bruce Ernst bruce.ernst@sqltutorial.org 590.423.4568 5/21/1991 9 6000 103.0 6

In [ ]:
#_1 create a full name column in df which is first_name+last_name

#_2 drop the column first_name and last_name and email column

#_3 find the count of null values in each column

#_4 deal with the null values in the dataframe

#_5 sort the columns name in ascending order

#_6 sort the df based on salary ascending if salary same then full_name desending

#_7 count the number of employees whose manager is with manager_id= 103

#_8 plot a box plot for salary column

#_9 look for any outlier in the boxplot if any then remove it

#_10 find out the department_id which is getting maximum salary,minimum salary from the firm

#_11 count of employees per department and its bar graph

In [7]:
df['full_name']=df['first_name']+df['last_name']

df

Out[7]: employee_id first_name last_name email phone_number hire_date job_id salary manager_id department_id full_name

0 100.0 Steven King steven.king@sqltutorial.org 515.123.4567 6/17/1987 4 24000 NaN 9 StevenKing

1 101.0 Neena Kochhar neena.kochhar@sqltutorial.org 515.123.4568 9/21/1989 5 17000 100.0 9 NeenaKochhar

2 102.0 Lex De Haan lex.de haan@sqltutorial.org 515.123.4569 1/13/1993 5 17000 100.0 9 LexDe Haan

3 103.0 Alexander Hunold alexander.hunold@sqltutorial.org 590.423.4567 1/3/1990 9 9000 102.0 6 AlexanderHunold

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 1/20


6/7/22, 4:30 PM shruti gupta 2101730019

employee_id first_name last_name email phone_number hire_date job_id salary manager_id department_id full_name

4 104.0 Bruce Ernst bruce.ernst@sqltutorial.org 590.423.4568 5/21/1991 9 6000 103.0 6 BruceErnst

5 105.0 David Austin david.austin@sqltutorial.org 590.423.4569 6/25/1997 9 4800 103.0 6 DavidAustin

6 106.0 Valli Pataballa valli.pataballa@sqltutorial.org 590.423.4560 2/5/1998 9 4800 103.0 6 ValliPataballa

7 107.0 Diana Lorentz diana.lorentz@sqltutorial.org 590.423.5567 2/7/1999 9 4200 103.0 6 DianaLorentz

8 108.0 Nancy Greenberg nancy.greenberg@sqltutorial.org 515.124.4569 8/17/1994 7 12000 101.0 10 NancyGreenberg

9 109.0 Daniel Faviet daniel.faviet@sqltutorial.org 515.124.4169 8/16/1994 6 9000 108.0 10 DanielFaviet

10 110.0 John Chen john.chen@sqltutorial.org 515.124.4269 9/28/1997 6 8200 108.0 10 JohnChen

11 111.0 Ismael Sciarra ismael.sciarra@sqltutorial.org 515.124.4369 9/30/1997 6 7700 108.0 10 IsmaelSciarra

Jose jose Jose


12 112.0 Urman 515.124.4469 3/7/1998 6 7800 108.0 10
Manuel manuel.urman@sqltutorial.org ManuelUrman

13 113.0 Luis Popp luis.popp@sqltutorial.org 515.124.4567 12/7/1999 6 6900 108.0 10 LuisPopp

14 114.0 Den Raphaely den.raphaely@sqltutorial.org 515.127.4561 12/7/1994 14 11000 100.0 3 DenRaphaely

15 115.0 Alexander Khoo alexander.khoo@sqltutorial.org 515.127.4562 5/18/1995 13 3100 114.0 3 AlexanderKhoo

16 116.0 Shelli Baida shelli.baida@sqltutorial.org 515.127.4563 12/24/1997 13 2900 114.0 3 ShelliBaida

17 117.0 Sigal Tobias sigal.tobias@sqltutorial.org 515.127.4564 7/24/1997 13 2800 114.0 3 SigalTobias

18 118.0 Guy Himuro guy.himuro@sqltutorial.org 515.127.4565 11/15/1998 13 2600 114.0 3 GuyHimuro

19 119.0 Karen Colmenares karen.colmenares@sqltutorial.org 515.127.4566 8/10/1999 13 2500 114.0 3 KarenColmenares

20 120.0 Matthew Weiss matthew.weiss@sqltutorial.org 650.123.1234 7/18/1996 19 8000 100.0 5 MatthewWeiss

21 121.0 Adam Fripp adam.fripp@sqltutorial.org 650.123.2234 4/10/1997 19 8200 100.0 5 AdamFripp

22 115.0 Alexander Khoo alexander.khoo@sqltutorial.org 515.127.4562 5/18/1995 13 3100 114.0 3 AlexanderKhoo

23 122.0 Payam Kaufling payam.kaufling@sqltutorial.org 650.123.3234 5/1/1995 19 7900 100.0 5 PayamKaufling

24 123.0 Shanta Vollman shanta.vollman@sqltutorial.org 650.123.4234 10/10/1997 19 6500 100.0 5 ShantaVollman

25 126.0 Irene Mikkilineni irene.mikkilineni@sqltutorial.org 650.124.1224 9/28/1998 18 2700 120.0 5 IreneMikkilineni

26 145.0 John Russell john.russell@sqltutorial.org NaN 10/1/1996 15 14000 100.0 8 JohnRussell

27 146.0 Karen Partners karen.partners@sqltutorial.org NaN 1/5/1997 15 13500 100.0 8 KarenPartners

28 176.0 Jonathon Taylor jonathon.taylor@sqltutorial.org NaN 3/24/1998 16 8600 100.0 8 JonathonTaylor

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 2/20


6/7/22, 4:30 PM shruti gupta 2101730019

employee_id first_name last_name email phone_number hire_date job_id salary manager_id department_id full_name

29 177.0 Jack Livingston jack.livingston@sqltutorial.org NaN 4/23/1998 16 8400 100.0 8 JackLivingston

30 178.0 Kimberely Grant kimberely.grant@sqltutorial.org NaN 5/24/1999 16 7000 100.0 8 KimberelyGrant

31 179.0 Charles Johnson charles.johnson@sqltutorial.org NaN 1/4/2000 16 6200 100.0 8 CharlesJohnson

32 192.0 Sarah Bell sarah.bell@sqltutorial.org 650.501.1876 2/4/1996 17 4000 123.0 5 SarahBell

33 193.0 Britney Everett britney.everett@sqltutorial.org 650.501.2876 3/3/1997 17 3900 123.0 5 BritneyEverett

34 200.0 Jennifer Whalen jennifer.whalen@sqltutorial.org 515.123.4444 9/17/1987 3 4400 101.0 1 JenniferWhalen

35 201.0 Michael Hartstein michael.hartstein@sqltutorial.org 515.123.5555 2/17/1996 10 13000 100.0 2 MichaelHartstein

36 NaN Sarah Bell sarah.bell@sqltutorial.org 650.501.1876 2/4/1996 17 4000 123.0 5 SarahBell

37 202.0 Pat Fay pat.fay@sqltutorial.org 603.123.6666 8/17/1997 11 6000 201.0 2 PatFay

38 203.0 Susan Mavris susan.mavris@sqltutorial.org 515.123.7777 6/7/1994 8 6500 101.0 4 SusanMavris

39 204.0 Hermann Baer hermann.baer@sqltutorial.org 515.123.8888 6/7/1994 12 10000 101.0 7 HermannBaer

40 205.0 Shelley Higgins shelley.higgins@sqltutorial.org 515.123.8080 6/7/1994 2 12000 101.0 11 ShelleyHiggins

41 206.0 William Gietz william.gietz@sqltutorial.org 515.123.8181 6/7/1994 1 8300 205.0 11 WilliamGietz

In [8]:
df.drop(['first_name','last_name','email'],axis=1)

Out[8]: employee_id phone_number hire_date job_id salary manager_id department_id full_name

0 100.0 515.123.4567 6/17/1987 4 24000 NaN 9 StevenKing

1 101.0 515.123.4568 9/21/1989 5 17000 100.0 9 NeenaKochhar

2 102.0 515.123.4569 1/13/1993 5 17000 100.0 9 LexDe Haan

3 103.0 590.423.4567 1/3/1990 9 9000 102.0 6 AlexanderHunold

4 104.0 590.423.4568 5/21/1991 9 6000 103.0 6 BruceErnst

5 105.0 590.423.4569 6/25/1997 9 4800 103.0 6 DavidAustin

6 106.0 590.423.4560 2/5/1998 9 4800 103.0 6 ValliPataballa

7 107.0 590.423.5567 2/7/1999 9 4200 103.0 6 DianaLorentz

8 108.0 515.124.4569 8/17/1994 7 12000 101.0 10 NancyGreenberg

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 3/20


6/7/22, 4:30 PM shruti gupta 2101730019

employee_id phone_number hire_date job_id salary manager_id department_id full_name

9 109.0 515.124.4169 8/16/1994 6 9000 108.0 10 DanielFaviet

10 110.0 515.124.4269 9/28/1997 6 8200 108.0 10 JohnChen

11 111.0 515.124.4369 9/30/1997 6 7700 108.0 10 IsmaelSciarra

12 112.0 515.124.4469 3/7/1998 6 7800 108.0 10 Jose ManuelUrman

13 113.0 515.124.4567 12/7/1999 6 6900 108.0 10 LuisPopp

14 114.0 515.127.4561 12/7/1994 14 11000 100.0 3 DenRaphaely

15 115.0 515.127.4562 5/18/1995 13 3100 114.0 3 AlexanderKhoo

16 116.0 515.127.4563 12/24/1997 13 2900 114.0 3 ShelliBaida

17 117.0 515.127.4564 7/24/1997 13 2800 114.0 3 SigalTobias

18 118.0 515.127.4565 11/15/1998 13 2600 114.0 3 GuyHimuro

19 119.0 515.127.4566 8/10/1999 13 2500 114.0 3 KarenColmenares

20 120.0 650.123.1234 7/18/1996 19 8000 100.0 5 MatthewWeiss

21 121.0 650.123.2234 4/10/1997 19 8200 100.0 5 AdamFripp

22 115.0 515.127.4562 5/18/1995 13 3100 114.0 3 AlexanderKhoo

23 122.0 650.123.3234 5/1/1995 19 7900 100.0 5 PayamKaufling

24 123.0 650.123.4234 10/10/1997 19 6500 100.0 5 ShantaVollman

25 126.0 650.124.1224 9/28/1998 18 2700 120.0 5 IreneMikkilineni

26 145.0 NaN 10/1/1996 15 14000 100.0 8 JohnRussell

27 146.0 NaN 1/5/1997 15 13500 100.0 8 KarenPartners

28 176.0 NaN 3/24/1998 16 8600 100.0 8 JonathonTaylor

29 177.0 NaN 4/23/1998 16 8400 100.0 8 JackLivingston

30 178.0 NaN 5/24/1999 16 7000 100.0 8 KimberelyGrant

31 179.0 NaN 1/4/2000 16 6200 100.0 8 CharlesJohnson

32 192.0 650.501.1876 2/4/1996 17 4000 123.0 5 SarahBell

33 193.0 650.501.2876 3/3/1997 17 3900 123.0 5 BritneyEverett

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 4/20


6/7/22, 4:30 PM shruti gupta 2101730019

employee_id phone_number hire_date job_id salary manager_id department_id full_name

34 200.0 515.123.4444 9/17/1987 3 4400 101.0 1 JenniferWhalen

35 201.0 515.123.5555 2/17/1996 10 13000 100.0 2 MichaelHartstein

36 NaN 650.501.1876 2/4/1996 17 4000 123.0 5 SarahBell

37 202.0 603.123.6666 8/17/1997 11 6000 201.0 2 PatFay

38 203.0 515.123.7777 6/7/1994 8 6500 101.0 4 SusanMavris

39 204.0 515.123.8888 6/7/1994 12 10000 101.0 7 HermannBaer

40 205.0 515.123.8080 6/7/1994 2 12000 101.0 11 ShelleyHiggins

41 206.0 515.123.8181 6/7/1994 1 8300 205.0 11 WilliamGietz

In [10]:
df.isnull().sum()

employee_id 1

Out[10]:
first_name 0

last_name 0

email 0

phone_number 6

hire_date 0

job_id 0

salary 0

manager_id 1

department_id 0

full_name 0

dtype: int64

In [11]:
df.dropna()

Out[11]: employee_id first_name last_name email phone_number hire_date job_id salary manager_id department_id full_name

1 101.0 Neena Kochhar neena.kochhar@sqltutorial.org 515.123.4568 9/21/1989 5 17000 100.0 9 NeenaKochhar

2 102.0 Lex De Haan lex.de haan@sqltutorial.org 515.123.4569 1/13/1993 5 17000 100.0 9 LexDe Haan

3 103.0 Alexander Hunold alexander.hunold@sqltutorial.org 590.423.4567 1/3/1990 9 9000 102.0 6 AlexanderHunold

4 104.0 Bruce Ernst bruce.ernst@sqltutorial.org 590.423.4568 5/21/1991 9 6000 103.0 6 BruceErnst

5 105.0 David Austin david.austin@sqltutorial.org 590.423.4569 6/25/1997 9 4800 103.0 6 DavidAustin

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 5/20


6/7/22, 4:30 PM shruti gupta 2101730019

employee_id first_name last_name email phone_number hire_date job_id salary manager_id department_id full_name

6 106.0 Valli Pataballa valli.pataballa@sqltutorial.org 590.423.4560 2/5/1998 9 4800 103.0 6 ValliPataballa

7 107.0 Diana Lorentz diana.lorentz@sqltutorial.org 590.423.5567 2/7/1999 9 4200 103.0 6 DianaLorentz

8 108.0 Nancy Greenberg nancy.greenberg@sqltutorial.org 515.124.4569 8/17/1994 7 12000 101.0 10 NancyGreenberg

9 109.0 Daniel Faviet daniel.faviet@sqltutorial.org 515.124.4169 8/16/1994 6 9000 108.0 10 DanielFaviet

10 110.0 John Chen john.chen@sqltutorial.org 515.124.4269 9/28/1997 6 8200 108.0 10 JohnChen

11 111.0 Ismael Sciarra ismael.sciarra@sqltutorial.org 515.124.4369 9/30/1997 6 7700 108.0 10 IsmaelSciarra

Jose jose Jose


12 112.0 Urman 515.124.4469 3/7/1998 6 7800 108.0 10
Manuel manuel.urman@sqltutorial.org ManuelUrman

13 113.0 Luis Popp luis.popp@sqltutorial.org 515.124.4567 12/7/1999 6 6900 108.0 10 LuisPopp

14 114.0 Den Raphaely den.raphaely@sqltutorial.org 515.127.4561 12/7/1994 14 11000 100.0 3 DenRaphaely

15 115.0 Alexander Khoo alexander.khoo@sqltutorial.org 515.127.4562 5/18/1995 13 3100 114.0 3 AlexanderKhoo

16 116.0 Shelli Baida shelli.baida@sqltutorial.org 515.127.4563 12/24/1997 13 2900 114.0 3 ShelliBaida

17 117.0 Sigal Tobias sigal.tobias@sqltutorial.org 515.127.4564 7/24/1997 13 2800 114.0 3 SigalTobias

18 118.0 Guy Himuro guy.himuro@sqltutorial.org 515.127.4565 11/15/1998 13 2600 114.0 3 GuyHimuro

19 119.0 Karen Colmenares karen.colmenares@sqltutorial.org 515.127.4566 8/10/1999 13 2500 114.0 3 KarenColmenares

20 120.0 Matthew Weiss matthew.weiss@sqltutorial.org 650.123.1234 7/18/1996 19 8000 100.0 5 MatthewWeiss

21 121.0 Adam Fripp adam.fripp@sqltutorial.org 650.123.2234 4/10/1997 19 8200 100.0 5 AdamFripp

22 115.0 Alexander Khoo alexander.khoo@sqltutorial.org 515.127.4562 5/18/1995 13 3100 114.0 3 AlexanderKhoo

23 122.0 Payam Kaufling payam.kaufling@sqltutorial.org 650.123.3234 5/1/1995 19 7900 100.0 5 PayamKaufling

24 123.0 Shanta Vollman shanta.vollman@sqltutorial.org 650.123.4234 10/10/1997 19 6500 100.0 5 ShantaVollman

25 126.0 Irene Mikkilineni irene.mikkilineni@sqltutorial.org 650.124.1224 9/28/1998 18 2700 120.0 5 IreneMikkilineni

32 192.0 Sarah Bell sarah.bell@sqltutorial.org 650.501.1876 2/4/1996 17 4000 123.0 5 SarahBell

33 193.0 Britney Everett britney.everett@sqltutorial.org 650.501.2876 3/3/1997 17 3900 123.0 5 BritneyEverett

34 200.0 Jennifer Whalen jennifer.whalen@sqltutorial.org 515.123.4444 9/17/1987 3 4400 101.0 1 JenniferWhalen

35 201.0 Michael Hartstein michael.hartstein@sqltutorial.org 515.123.5555 2/17/1996 10 13000 100.0 2 MichaelHartstein

37 202.0 Pat Fay pat.fay@sqltutorial.org 603.123.6666 8/17/1997 11 6000 201.0 2 PatFay

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 6/20


6/7/22, 4:30 PM shruti gupta 2101730019

employee_id first_name last_name email phone_number hire_date job_id salary manager_id department_id full_name

38 203.0 Susan Mavris susan.mavris@sqltutorial.org 515.123.7777 6/7/1994 8 6500 101.0 4 SusanMavris

39 204.0 Hermann Baer hermann.baer@sqltutorial.org 515.123.8888 6/7/1994 12 10000 101.0 7 HermannBaer

40 205.0 Shelley Higgins shelley.higgins@sqltutorial.org 515.123.8080 6/7/1994 2 12000 101.0 11 ShelleyHiggins

41 206.0 William Gietz william.gietz@sqltutorial.org 515.123.8181 6/7/1994 1 8300 205.0 11 WilliamGietz

In [13]:
df.sort_index(axis=1,inplace=True)

df

Out[13]: department_id email employee_id first_name full_name hire_date job_id last_name manager_id phone_number salary

0 9 steven.king@sqltutorial.org 100.0 Steven StevenKing 6/17/1987 4 King NaN 515.123.4567 24000

1 9 neena.kochhar@sqltutorial.org 101.0 Neena NeenaKochhar 9/21/1989 5 Kochhar 100.0 515.123.4568 17000

2 9 lex.de haan@sqltutorial.org 102.0 Lex LexDe Haan 1/13/1993 5 De Haan 100.0 515.123.4569 17000

3 6 alexander.hunold@sqltutorial.org 103.0 Alexander AlexanderHunold 1/3/1990 9 Hunold 102.0 590.423.4567 9000

4 6 bruce.ernst@sqltutorial.org 104.0 Bruce BruceErnst 5/21/1991 9 Ernst 103.0 590.423.4568 6000

5 6 david.austin@sqltutorial.org 105.0 David DavidAustin 6/25/1997 9 Austin 103.0 590.423.4569 4800

6 6 valli.pataballa@sqltutorial.org 106.0 Valli ValliPataballa 2/5/1998 9 Pataballa 103.0 590.423.4560 4800

7 6 diana.lorentz@sqltutorial.org 107.0 Diana DianaLorentz 2/7/1999 9 Lorentz 103.0 590.423.5567 4200

8 10 nancy.greenberg@sqltutorial.org 108.0 Nancy NancyGreenberg 8/17/1994 7 Greenberg 101.0 515.124.4569 12000

9 10 daniel.faviet@sqltutorial.org 109.0 Daniel DanielFaviet 8/16/1994 6 Faviet 108.0 515.124.4169 9000

10 10 john.chen@sqltutorial.org 110.0 John JohnChen 9/28/1997 6 Chen 108.0 515.124.4269 8200

11 10 ismael.sciarra@sqltutorial.org 111.0 Ismael IsmaelSciarra 9/30/1997 6 Sciarra 108.0 515.124.4369 7700

jose Jose Jose


12 10 112.0 3/7/1998 6 Urman 108.0 515.124.4469 7800
manuel.urman@sqltutorial.org Manuel ManuelUrman

13 10 luis.popp@sqltutorial.org 113.0 Luis LuisPopp 12/7/1999 6 Popp 108.0 515.124.4567 6900

14 3 den.raphaely@sqltutorial.org 114.0 Den DenRaphaely 12/7/1994 14 Raphaely 100.0 515.127.4561 11000

15 3 alexander.khoo@sqltutorial.org 115.0 Alexander AlexanderKhoo 5/18/1995 13 Khoo 114.0 515.127.4562 3100

16 3 shelli.baida@sqltutorial.org 116.0 Shelli ShelliBaida 12/24/1997 13 Baida 114.0 515.127.4563 2900

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 7/20


6/7/22, 4:30 PM shruti gupta 2101730019

department_id email employee_id first_name full_name hire_date job_id last_name manager_id phone_number salary

17 3 sigal.tobias@sqltutorial.org 117.0 Sigal SigalTobias 7/24/1997 13 Tobias 114.0 515.127.4564 2800

18 3 guy.himuro@sqltutorial.org 118.0 Guy GuyHimuro 11/15/1998 13 Himuro 114.0 515.127.4565 2600

19 3 karen.colmenares@sqltutorial.org 119.0 Karen KarenColmenares 8/10/1999 13 Colmenares 114.0 515.127.4566 2500

20 5 matthew.weiss@sqltutorial.org 120.0 Matthew MatthewWeiss 7/18/1996 19 Weiss 100.0 650.123.1234 8000

21 5 adam.fripp@sqltutorial.org 121.0 Adam AdamFripp 4/10/1997 19 Fripp 100.0 650.123.2234 8200

22 3 alexander.khoo@sqltutorial.org 115.0 Alexander AlexanderKhoo 5/18/1995 13 Khoo 114.0 515.127.4562 3100

23 5 payam.kaufling@sqltutorial.org 122.0 Payam PayamKaufling 5/1/1995 19 Kaufling 100.0 650.123.3234 7900

24 5 shanta.vollman@sqltutorial.org 123.0 Shanta ShantaVollman 10/10/1997 19 Vollman 100.0 650.123.4234 6500

25 5 irene.mikkilineni@sqltutorial.org 126.0 Irene IreneMikkilineni 9/28/1998 18 Mikkilineni 120.0 650.124.1224 2700

26 8 john.russell@sqltutorial.org 145.0 John JohnRussell 10/1/1996 15 Russell 100.0 NaN 14000

27 8 karen.partners@sqltutorial.org 146.0 Karen KarenPartners 1/5/1997 15 Partners 100.0 NaN 13500

28 8 jonathon.taylor@sqltutorial.org 176.0 Jonathon JonathonTaylor 3/24/1998 16 Taylor 100.0 NaN 8600

29 8 jack.livingston@sqltutorial.org 177.0 Jack JackLivingston 4/23/1998 16 Livingston 100.0 NaN 8400

30 8 kimberely.grant@sqltutorial.org 178.0 Kimberely KimberelyGrant 5/24/1999 16 Grant 100.0 NaN 7000

31 8 charles.johnson@sqltutorial.org 179.0 Charles CharlesJohnson 1/4/2000 16 Johnson 100.0 NaN 6200

32 5 sarah.bell@sqltutorial.org 192.0 Sarah SarahBell 2/4/1996 17 Bell 123.0 650.501.1876 4000

33 5 britney.everett@sqltutorial.org 193.0 Britney BritneyEverett 3/3/1997 17 Everett 123.0 650.501.2876 3900

34 1 jennifer.whalen@sqltutorial.org 200.0 Jennifer JenniferWhalen 9/17/1987 3 Whalen 101.0 515.123.4444 4400

35 2 michael.hartstein@sqltutorial.org 201.0 Michael MichaelHartstein 2/17/1996 10 Hartstein 100.0 515.123.5555 13000

36 5 sarah.bell@sqltutorial.org NaN Sarah SarahBell 2/4/1996 17 Bell 123.0 650.501.1876 4000

37 2 pat.fay@sqltutorial.org 202.0 Pat PatFay 8/17/1997 11 Fay 201.0 603.123.6666 6000

38 4 susan.mavris@sqltutorial.org 203.0 Susan SusanMavris 6/7/1994 8 Mavris 101.0 515.123.7777 6500

39 7 hermann.baer@sqltutorial.org 204.0 Hermann HermannBaer 6/7/1994 12 Baer 101.0 515.123.8888 10000

40 11 shelley.higgins@sqltutorial.org 205.0 Shelley ShelleyHiggins 6/7/1994 2 Higgins 101.0 515.123.8080 12000

41 11 william.gietz@sqltutorial.org 206.0 William WilliamGietz 6/7/1994 1 Gietz 205.0 515.123.8181 8300

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 8/20


6/7/22, 4:30 PM shruti gupta 2101730019

In [14]: df.sort_values(by=['salary'], ascending=[False])

Out[14]: department_id email employee_id first_name full_name hire_date job_id last_name manager_id phone_number salary

0 9 steven.king@sqltutorial.org 100.0 Steven StevenKing 6/17/1987 4 King NaN 515.123.4567 24000

2 9 lex.de haan@sqltutorial.org 102.0 Lex LexDe Haan 1/13/1993 5 De Haan 100.0 515.123.4569 17000

1 9 neena.kochhar@sqltutorial.org 101.0 Neena NeenaKochhar 9/21/1989 5 Kochhar 100.0 515.123.4568 17000

26 8 john.russell@sqltutorial.org 145.0 John JohnRussell 10/1/1996 15 Russell 100.0 NaN 14000

27 8 karen.partners@sqltutorial.org 146.0 Karen KarenPartners 1/5/1997 15 Partners 100.0 NaN 13500

35 2 michael.hartstein@sqltutorial.org 201.0 Michael MichaelHartstein 2/17/1996 10 Hartstein 100.0 515.123.5555 13000

40 11 shelley.higgins@sqltutorial.org 205.0 Shelley ShelleyHiggins 6/7/1994 2 Higgins 101.0 515.123.8080 12000

8 10 nancy.greenberg@sqltutorial.org 108.0 Nancy NancyGreenberg 8/17/1994 7 Greenberg 101.0 515.124.4569 12000

14 3 den.raphaely@sqltutorial.org 114.0 Den DenRaphaely 12/7/1994 14 Raphaely 100.0 515.127.4561 11000

39 7 hermann.baer@sqltutorial.org 204.0 Hermann HermannBaer 6/7/1994 12 Baer 101.0 515.123.8888 10000

3 6 alexander.hunold@sqltutorial.org 103.0 Alexander AlexanderHunold 1/3/1990 9 Hunold 102.0 590.423.4567 9000

9 10 daniel.faviet@sqltutorial.org 109.0 Daniel DanielFaviet 8/16/1994 6 Faviet 108.0 515.124.4169 9000

28 8 jonathon.taylor@sqltutorial.org 176.0 Jonathon JonathonTaylor 3/24/1998 16 Taylor 100.0 NaN 8600

29 8 jack.livingston@sqltutorial.org 177.0 Jack JackLivingston 4/23/1998 16 Livingston 100.0 NaN 8400

41 11 william.gietz@sqltutorial.org 206.0 William WilliamGietz 6/7/1994 1 Gietz 205.0 515.123.8181 8300

10 10 john.chen@sqltutorial.org 110.0 John JohnChen 9/28/1997 6 Chen 108.0 515.124.4269 8200

21 5 adam.fripp@sqltutorial.org 121.0 Adam AdamFripp 4/10/1997 19 Fripp 100.0 650.123.2234 8200

20 5 matthew.weiss@sqltutorial.org 120.0 Matthew MatthewWeiss 7/18/1996 19 Weiss 100.0 650.123.1234 8000

23 5 payam.kaufling@sqltutorial.org 122.0 Payam PayamKaufling 5/1/1995 19 Kaufling 100.0 650.123.3234 7900

jose Jose Jose


12 10 112.0 3/7/1998 6 Urman 108.0 515.124.4469 7800
manuel.urman@sqltutorial.org Manuel ManuelUrman

11 10 ismael.sciarra@sqltutorial.org 111.0 Ismael IsmaelSciarra 9/30/1997 6 Sciarra 108.0 515.124.4369 7700

30 8 kimberely.grant@sqltutorial.org 178.0 Kimberely KimberelyGrant 5/24/1999 16 Grant 100.0 NaN 7000

13 10 luis.popp@sqltutorial.org 113.0 Luis LuisPopp 12/7/1999 6 Popp 108.0 515.124.4567 6900

24 5 shanta.vollman@sqltutorial.org 123.0 Shanta ShantaVollman 10/10/1997 19 Vollman 100.0 650.123.4234 6500

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 9/20


6/7/22, 4:30 PM shruti gupta 2101730019

department_id email employee_id first_name full_name hire_date job_id last_name manager_id phone_number salary

38 4 susan.mavris@sqltutorial.org 203.0 Susan SusanMavris 6/7/1994 8 Mavris 101.0 515.123.7777 6500

31 8 charles.johnson@sqltutorial.org 179.0 Charles CharlesJohnson 1/4/2000 16 Johnson 100.0 NaN 6200

4 6 bruce.ernst@sqltutorial.org 104.0 Bruce BruceErnst 5/21/1991 9 Ernst 103.0 590.423.4568 6000

37 2 pat.fay@sqltutorial.org 202.0 Pat PatFay 8/17/1997 11 Fay 201.0 603.123.6666 6000

5 6 david.austin@sqltutorial.org 105.0 David DavidAustin 6/25/1997 9 Austin 103.0 590.423.4569 4800

6 6 valli.pataballa@sqltutorial.org 106.0 Valli ValliPataballa 2/5/1998 9 Pataballa 103.0 590.423.4560 4800

34 1 jennifer.whalen@sqltutorial.org 200.0 Jennifer JenniferWhalen 9/17/1987 3 Whalen 101.0 515.123.4444 4400

7 6 diana.lorentz@sqltutorial.org 107.0 Diana DianaLorentz 2/7/1999 9 Lorentz 103.0 590.423.5567 4200

36 5 sarah.bell@sqltutorial.org NaN Sarah SarahBell 2/4/1996 17 Bell 123.0 650.501.1876 4000

32 5 sarah.bell@sqltutorial.org 192.0 Sarah SarahBell 2/4/1996 17 Bell 123.0 650.501.1876 4000

33 5 britney.everett@sqltutorial.org 193.0 Britney BritneyEverett 3/3/1997 17 Everett 123.0 650.501.2876 3900

15 3 alexander.khoo@sqltutorial.org 115.0 Alexander AlexanderKhoo 5/18/1995 13 Khoo 114.0 515.127.4562 3100

22 3 alexander.khoo@sqltutorial.org 115.0 Alexander AlexanderKhoo 5/18/1995 13 Khoo 114.0 515.127.4562 3100

16 3 shelli.baida@sqltutorial.org 116.0 Shelli ShelliBaida 12/24/1997 13 Baida 114.0 515.127.4563 2900

17 3 sigal.tobias@sqltutorial.org 117.0 Sigal SigalTobias 7/24/1997 13 Tobias 114.0 515.127.4564 2800

25 5 irene.mikkilineni@sqltutorial.org 126.0 Irene IreneMikkilineni 9/28/1998 18 Mikkilineni 120.0 650.124.1224 2700

18 3 guy.himuro@sqltutorial.org 118.0 Guy GuyHimuro 11/15/1998 13 Himuro 114.0 515.127.4565 2600

19 3 karen.colmenares@sqltutorial.org 119.0 Karen KarenColmenares 8/10/1999 13 Colmenares 114.0 515.127.4566 2500

In [15]:
df['manager_id'].value_counts()[103]

4
Out[15]:

In [19]:
import seaborn as sns

import matplotlib.pyplot as plt

df.boxplot(by = 'salary', column = ['job_id'], grid = False)

df

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 10/20


6/7/22, 4:30 PM shruti gupta 2101730019

Out[19]: department_id email employee_id first_name full_name hire_date job_id last_name manager_id phone_number salary

0 9 steven.king@sqltutorial.org 100.0 Steven StevenKing 6/17/1987 4 King NaN 515.123.4567 24000

1 9 neena.kochhar@sqltutorial.org 101.0 Neena NeenaKochhar 9/21/1989 5 Kochhar 100.0 515.123.4568 17000

2 9 lex.de haan@sqltutorial.org 102.0 Lex LexDe Haan 1/13/1993 5 De Haan 100.0 515.123.4569 17000

3 6 alexander.hunold@sqltutorial.org 103.0 Alexander AlexanderHunold 1/3/1990 9 Hunold 102.0 590.423.4567 9000

4 6 bruce.ernst@sqltutorial.org 104.0 Bruce BruceErnst 5/21/1991 9 Ernst 103.0 590.423.4568 6000

5 6 david.austin@sqltutorial.org 105.0 David DavidAustin 6/25/1997 9 Austin 103.0 590.423.4569 4800

6 6 valli.pataballa@sqltutorial.org 106.0 Valli ValliPataballa 2/5/1998 9 Pataballa 103.0 590.423.4560 4800

7 6 diana.lorentz@sqltutorial.org 107.0 Diana DianaLorentz 2/7/1999 9 Lorentz 103.0 590.423.5567 4200

8 10 nancy.greenberg@sqltutorial.org 108.0 Nancy NancyGreenberg 8/17/1994 7 Greenberg 101.0 515.124.4569 12000

9 10 daniel.faviet@sqltutorial.org 109.0 Daniel DanielFaviet 8/16/1994 6 Faviet 108.0 515.124.4169 9000

10 10 john.chen@sqltutorial.org 110.0 John JohnChen 9/28/1997 6 Chen 108.0 515.124.4269 8200

11 10 ismael.sciarra@sqltutorial.org 111.0 Ismael IsmaelSciarra 9/30/1997 6 Sciarra 108.0 515.124.4369 7700

jose Jose Jose


12 10 112.0 3/7/1998 6 Urman 108.0 515.124.4469 7800
manuel.urman@sqltutorial.org Manuel ManuelUrman

13 10 luis.popp@sqltutorial.org 113.0 Luis LuisPopp 12/7/1999 6 Popp 108.0 515.124.4567 6900

14 3 den.raphaely@sqltutorial.org 114.0 Den DenRaphaely 12/7/1994 14 Raphaely 100.0 515.127.4561 11000

15 3 alexander.khoo@sqltutorial.org 115.0 Alexander AlexanderKhoo 5/18/1995 13 Khoo 114.0 515.127.4562 3100

16 3 shelli.baida@sqltutorial.org 116.0 Shelli ShelliBaida 12/24/1997 13 Baida 114.0 515.127.4563 2900

17 3 sigal.tobias@sqltutorial.org 117.0 Sigal SigalTobias 7/24/1997 13 Tobias 114.0 515.127.4564 2800

18 3 guy.himuro@sqltutorial.org 118.0 Guy GuyHimuro 11/15/1998 13 Himuro 114.0 515.127.4565 2600

19 3 karen.colmenares@sqltutorial.org 119.0 Karen KarenColmenares 8/10/1999 13 Colmenares 114.0 515.127.4566 2500

20 5 matthew.weiss@sqltutorial.org 120.0 Matthew MatthewWeiss 7/18/1996 19 Weiss 100.0 650.123.1234 8000

21 5 adam.fripp@sqltutorial.org 121.0 Adam AdamFripp 4/10/1997 19 Fripp 100.0 650.123.2234 8200

22 3 alexander.khoo@sqltutorial.org 115.0 Alexander AlexanderKhoo 5/18/1995 13 Khoo 114.0 515.127.4562 3100

23 5 payam.kaufling@sqltutorial.org 122.0 Payam PayamKaufling 5/1/1995 19 Kaufling 100.0 650.123.3234 7900

24 5 shanta.vollman@sqltutorial.org 123.0 Shanta ShantaVollman 10/10/1997 19 Vollman 100.0 650.123.4234 6500

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 11/20


6/7/22, 4:30 PM shruti gupta 2101730019

department_id email employee_id first_name full_name hire_date job_id last_name manager_id phone_number salary

25 5 irene.mikkilineni@sqltutorial.org 126.0 Irene IreneMikkilineni 9/28/1998 18 Mikkilineni 120.0 650.124.1224 2700

26 8 john.russell@sqltutorial.org 145.0 John JohnRussell 10/1/1996 15 Russell 100.0 NaN 14000

27 8 karen.partners@sqltutorial.org 146.0 Karen KarenPartners 1/5/1997 15 Partners 100.0 NaN 13500

28 8 jonathon.taylor@sqltutorial.org 176.0 Jonathon JonathonTaylor 3/24/1998 16 Taylor 100.0 NaN 8600

29 8 jack.livingston@sqltutorial.org 177.0 Jack JackLivingston 4/23/1998 16 Livingston 100.0 NaN 8400

30 8 kimberely.grant@sqltutorial.org 178.0 Kimberely KimberelyGrant 5/24/1999 16 Grant 100.0 NaN 7000

31 8 charles.johnson@sqltutorial.org 179.0 Charles CharlesJohnson 1/4/2000 16 Johnson 100.0 NaN 6200

32 5 sarah.bell@sqltutorial.org 192.0 Sarah SarahBell 2/4/1996 17 Bell 123.0 650.501.1876 4000

33 5 britney.everett@sqltutorial.org 193.0 Britney BritneyEverett 3/3/1997 17 Everett 123.0 650.501.2876 3900

34 1 jennifer.whalen@sqltutorial.org 200.0 Jennifer JenniferWhalen 9/17/1987 3 Whalen 101.0 515.123.4444 4400

35 2 michael.hartstein@sqltutorial.org 201.0 Michael MichaelHartstein 2/17/1996 10 Hartstein 100.0 515.123.5555 13000

36 5 sarah.bell@sqltutorial.org NaN Sarah SarahBell 2/4/1996 17 Bell 123.0 650.501.1876 4000

37 2 pat.fay@sqltutorial.org 202.0 Pat PatFay 8/17/1997 11 Fay 201.0 603.123.6666 6000

38 4 susan.mavris@sqltutorial.org 203.0 Susan SusanMavris 6/7/1994 8 Mavris 101.0 515.123.7777 6500

39 7 hermann.baer@sqltutorial.org 204.0 Hermann HermannBaer 6/7/1994 12 Baer 101.0 515.123.8888 10000

40 11 shelley.higgins@sqltutorial.org 205.0 Shelley ShelleyHiggins 6/7/1994 2 Higgins 101.0 515.123.8080 12000

41 11 william.gietz@sqltutorial.org 206.0 William WilliamGietz 6/7/1994 1 Gietz 205.0 515.123.8181 8300

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 12/20


6/7/22, 4:30 PM shruti gupta 2101730019

In [35]:
#fig=plt.figure(figsize=(1500,1500))

sns.set(rc = {'figure.figsize':(15,8)})

df.boxplot(by = 'salary', column = ['job_id'], grid = False)

plt.show()

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 13/20


6/7/22, 4:30 PM shruti gupta 2101730019

In [36]:
import seaborn as sns

import matplotlib.pyplot as plt

df.boxplot(by = 'salary', column = ['job_id'], grid = False,showfliers=False)

df

Out[36]: department_id email employee_id first_name full_name hire_date job_id last_name manager_id phone_number salary

0 9 steven.king@sqltutorial.org 100.0 Steven StevenKing 6/17/1987 4 King NaN 515.123.4567 24000

1 9 neena.kochhar@sqltutorial.org 101.0 Neena NeenaKochhar 9/21/1989 5 Kochhar 100.0 515.123.4568 17000

2 9 lex.de haan@sqltutorial.org 102.0 Lex LexDe Haan 1/13/1993 5 De Haan 100.0 515.123.4569 17000

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 14/20


6/7/22, 4:30 PM shruti gupta 2101730019

department_id email employee_id first_name full_name hire_date job_id last_name manager_id phone_number salary

3 6 alexander.hunold@sqltutorial.org 103.0 Alexander AlexanderHunold 1/3/1990 9 Hunold 102.0 590.423.4567 9000

4 6 bruce.ernst@sqltutorial.org 104.0 Bruce BruceErnst 5/21/1991 9 Ernst 103.0 590.423.4568 6000

5 6 david.austin@sqltutorial.org 105.0 David DavidAustin 6/25/1997 9 Austin 103.0 590.423.4569 4800

6 6 valli.pataballa@sqltutorial.org 106.0 Valli ValliPataballa 2/5/1998 9 Pataballa 103.0 590.423.4560 4800

7 6 diana.lorentz@sqltutorial.org 107.0 Diana DianaLorentz 2/7/1999 9 Lorentz 103.0 590.423.5567 4200

8 10 nancy.greenberg@sqltutorial.org 108.0 Nancy NancyGreenberg 8/17/1994 7 Greenberg 101.0 515.124.4569 12000

9 10 daniel.faviet@sqltutorial.org 109.0 Daniel DanielFaviet 8/16/1994 6 Faviet 108.0 515.124.4169 9000

10 10 john.chen@sqltutorial.org 110.0 John JohnChen 9/28/1997 6 Chen 108.0 515.124.4269 8200

11 10 ismael.sciarra@sqltutorial.org 111.0 Ismael IsmaelSciarra 9/30/1997 6 Sciarra 108.0 515.124.4369 7700

jose Jose Jose


12 10 112.0 3/7/1998 6 Urman 108.0 515.124.4469 7800
manuel.urman@sqltutorial.org Manuel ManuelUrman

13 10 luis.popp@sqltutorial.org 113.0 Luis LuisPopp 12/7/1999 6 Popp 108.0 515.124.4567 6900

14 3 den.raphaely@sqltutorial.org 114.0 Den DenRaphaely 12/7/1994 14 Raphaely 100.0 515.127.4561 11000

15 3 alexander.khoo@sqltutorial.org 115.0 Alexander AlexanderKhoo 5/18/1995 13 Khoo 114.0 515.127.4562 3100

16 3 shelli.baida@sqltutorial.org 116.0 Shelli ShelliBaida 12/24/1997 13 Baida 114.0 515.127.4563 2900

17 3 sigal.tobias@sqltutorial.org 117.0 Sigal SigalTobias 7/24/1997 13 Tobias 114.0 515.127.4564 2800

18 3 guy.himuro@sqltutorial.org 118.0 Guy GuyHimuro 11/15/1998 13 Himuro 114.0 515.127.4565 2600

19 3 karen.colmenares@sqltutorial.org 119.0 Karen KarenColmenares 8/10/1999 13 Colmenares 114.0 515.127.4566 2500

20 5 matthew.weiss@sqltutorial.org 120.0 Matthew MatthewWeiss 7/18/1996 19 Weiss 100.0 650.123.1234 8000

21 5 adam.fripp@sqltutorial.org 121.0 Adam AdamFripp 4/10/1997 19 Fripp 100.0 650.123.2234 8200

22 3 alexander.khoo@sqltutorial.org 115.0 Alexander AlexanderKhoo 5/18/1995 13 Khoo 114.0 515.127.4562 3100

23 5 payam.kaufling@sqltutorial.org 122.0 Payam PayamKaufling 5/1/1995 19 Kaufling 100.0 650.123.3234 7900

24 5 shanta.vollman@sqltutorial.org 123.0 Shanta ShantaVollman 10/10/1997 19 Vollman 100.0 650.123.4234 6500

25 5 irene.mikkilineni@sqltutorial.org 126.0 Irene IreneMikkilineni 9/28/1998 18 Mikkilineni 120.0 650.124.1224 2700

26 8 john.russell@sqltutorial.org 145.0 John JohnRussell 10/1/1996 15 Russell 100.0 NaN 14000

27 8 karen.partners@sqltutorial.org 146.0 Karen KarenPartners 1/5/1997 15 Partners 100.0 NaN 13500

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 15/20


6/7/22, 4:30 PM shruti gupta 2101730019

department_id email employee_id first_name full_name hire_date job_id last_name manager_id phone_number salary

28 8 jonathon.taylor@sqltutorial.org 176.0 Jonathon JonathonTaylor 3/24/1998 16 Taylor 100.0 NaN 8600

29 8 jack.livingston@sqltutorial.org 177.0 Jack JackLivingston 4/23/1998 16 Livingston 100.0 NaN 8400

30 8 kimberely.grant@sqltutorial.org 178.0 Kimberely KimberelyGrant 5/24/1999 16 Grant 100.0 NaN 7000

31 8 charles.johnson@sqltutorial.org 179.0 Charles CharlesJohnson 1/4/2000 16 Johnson 100.0 NaN 6200

32 5 sarah.bell@sqltutorial.org 192.0 Sarah SarahBell 2/4/1996 17 Bell 123.0 650.501.1876 4000

33 5 britney.everett@sqltutorial.org 193.0 Britney BritneyEverett 3/3/1997 17 Everett 123.0 650.501.2876 3900

34 1 jennifer.whalen@sqltutorial.org 200.0 Jennifer JenniferWhalen 9/17/1987 3 Whalen 101.0 515.123.4444 4400

35 2 michael.hartstein@sqltutorial.org 201.0 Michael MichaelHartstein 2/17/1996 10 Hartstein 100.0 515.123.5555 13000

36 5 sarah.bell@sqltutorial.org NaN Sarah SarahBell 2/4/1996 17 Bell 123.0 650.501.1876 4000

37 2 pat.fay@sqltutorial.org 202.0 Pat PatFay 8/17/1997 11 Fay 201.0 603.123.6666 6000

38 4 susan.mavris@sqltutorial.org 203.0 Susan SusanMavris 6/7/1994 8 Mavris 101.0 515.123.7777 6500

39 7 hermann.baer@sqltutorial.org 204.0 Hermann HermannBaer 6/7/1994 12 Baer 101.0 515.123.8888 10000

40 11 shelley.higgins@sqltutorial.org 205.0 Shelley ShelleyHiggins 6/7/1994 2 Higgins 101.0 515.123.8080 12000

41 11 william.gietz@sqltutorial.org 206.0 William WilliamGietz 6/7/1994 1 Gietz 205.0 515.123.8181 8300

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 16/20


6/7/22, 4:30 PM shruti gupta 2101730019

In [38]:
a=df['salary'].quantile(0.75)

b=df['salary'].quantile(0.25)

c=a+1.5*(a-b)

df[df['salary']<c]

Out[38]: department_id email employee_id first_name full_name hire_date job_id last_name manager_id phone_number salary

3 6 alexander.hunold@sqltutorial.org 103.0 Alexander AlexanderHunold 1/3/1990 9 Hunold 102.0 590.423.4567 9000

4 6 bruce.ernst@sqltutorial.org 104.0 Bruce BruceErnst 5/21/1991 9 Ernst 103.0 590.423.4568 6000

5 6 david.austin@sqltutorial.org 105.0 David DavidAustin 6/25/1997 9 Austin 103.0 590.423.4569 4800

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 17/20


6/7/22, 4:30 PM shruti gupta 2101730019

department_id email employee_id first_name full_name hire_date job_id last_name manager_id phone_number salary

6 6 valli.pataballa@sqltutorial.org 106.0 Valli ValliPataballa 2/5/1998 9 Pataballa 103.0 590.423.4560 4800

7 6 diana.lorentz@sqltutorial.org 107.0 Diana DianaLorentz 2/7/1999 9 Lorentz 103.0 590.423.5567 4200

8 10 nancy.greenberg@sqltutorial.org 108.0 Nancy NancyGreenberg 8/17/1994 7 Greenberg 101.0 515.124.4569 12000

9 10 daniel.faviet@sqltutorial.org 109.0 Daniel DanielFaviet 8/16/1994 6 Faviet 108.0 515.124.4169 9000

10 10 john.chen@sqltutorial.org 110.0 John JohnChen 9/28/1997 6 Chen 108.0 515.124.4269 8200

11 10 ismael.sciarra@sqltutorial.org 111.0 Ismael IsmaelSciarra 9/30/1997 6 Sciarra 108.0 515.124.4369 7700

jose Jose Jose


12 10 112.0 3/7/1998 6 Urman 108.0 515.124.4469 7800
manuel.urman@sqltutorial.org Manuel ManuelUrman

13 10 luis.popp@sqltutorial.org 113.0 Luis LuisPopp 12/7/1999 6 Popp 108.0 515.124.4567 6900

14 3 den.raphaely@sqltutorial.org 114.0 Den DenRaphaely 12/7/1994 14 Raphaely 100.0 515.127.4561 11000

15 3 alexander.khoo@sqltutorial.org 115.0 Alexander AlexanderKhoo 5/18/1995 13 Khoo 114.0 515.127.4562 3100

16 3 shelli.baida@sqltutorial.org 116.0 Shelli ShelliBaida 12/24/1997 13 Baida 114.0 515.127.4563 2900

17 3 sigal.tobias@sqltutorial.org 117.0 Sigal SigalTobias 7/24/1997 13 Tobias 114.0 515.127.4564 2800

18 3 guy.himuro@sqltutorial.org 118.0 Guy GuyHimuro 11/15/1998 13 Himuro 114.0 515.127.4565 2600

19 3 karen.colmenares@sqltutorial.org 119.0 Karen KarenColmenares 8/10/1999 13 Colmenares 114.0 515.127.4566 2500

20 5 matthew.weiss@sqltutorial.org 120.0 Matthew MatthewWeiss 7/18/1996 19 Weiss 100.0 650.123.1234 8000

21 5 adam.fripp@sqltutorial.org 121.0 Adam AdamFripp 4/10/1997 19 Fripp 100.0 650.123.2234 8200

22 3 alexander.khoo@sqltutorial.org 115.0 Alexander AlexanderKhoo 5/18/1995 13 Khoo 114.0 515.127.4562 3100

23 5 payam.kaufling@sqltutorial.org 122.0 Payam PayamKaufling 5/1/1995 19 Kaufling 100.0 650.123.3234 7900

24 5 shanta.vollman@sqltutorial.org 123.0 Shanta ShantaVollman 10/10/1997 19 Vollman 100.0 650.123.4234 6500

25 5 irene.mikkilineni@sqltutorial.org 126.0 Irene IreneMikkilineni 9/28/1998 18 Mikkilineni 120.0 650.124.1224 2700

26 8 john.russell@sqltutorial.org 145.0 John JohnRussell 10/1/1996 15 Russell 100.0 NaN 14000

27 8 karen.partners@sqltutorial.org 146.0 Karen KarenPartners 1/5/1997 15 Partners 100.0 NaN 13500

28 8 jonathon.taylor@sqltutorial.org 176.0 Jonathon JonathonTaylor 3/24/1998 16 Taylor 100.0 NaN 8600

29 8 jack.livingston@sqltutorial.org 177.0 Jack JackLivingston 4/23/1998 16 Livingston 100.0 NaN 8400

30 8 kimberely.grant@sqltutorial.org 178.0 Kimberely KimberelyGrant 5/24/1999 16 Grant 100.0 NaN 7000

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 18/20


6/7/22, 4:30 PM shruti gupta 2101730019

department_id email employee_id first_name full_name hire_date job_id last_name manager_id phone_number salary

31 8 charles.johnson@sqltutorial.org 179.0 Charles CharlesJohnson 1/4/2000 16 Johnson 100.0 NaN 6200

32 5 sarah.bell@sqltutorial.org 192.0 Sarah SarahBell 2/4/1996 17 Bell 123.0 650.501.1876 4000

33 5 britney.everett@sqltutorial.org 193.0 Britney BritneyEverett 3/3/1997 17 Everett 123.0 650.501.2876 3900

34 1 jennifer.whalen@sqltutorial.org 200.0 Jennifer JenniferWhalen 9/17/1987 3 Whalen 101.0 515.123.4444 4400

35 2 michael.hartstein@sqltutorial.org 201.0 Michael MichaelHartstein 2/17/1996 10 Hartstein 100.0 515.123.5555 13000

36 5 sarah.bell@sqltutorial.org NaN Sarah SarahBell 2/4/1996 17 Bell 123.0 650.501.1876 4000

37 2 pat.fay@sqltutorial.org 202.0 Pat PatFay 8/17/1997 11 Fay 201.0 603.123.6666 6000

38 4 susan.mavris@sqltutorial.org 203.0 Susan SusanMavris 6/7/1994 8 Mavris 101.0 515.123.7777 6500

39 7 hermann.baer@sqltutorial.org 204.0 Hermann HermannBaer 6/7/1994 12 Baer 101.0 515.123.8888 10000

40 11 shelley.higgins@sqltutorial.org 205.0 Shelley ShelleyHiggins 6/7/1994 2 Higgins 101.0 515.123.8080 12000

41 11 william.gietz@sqltutorial.org 206.0 William WilliamGietz 6/7/1994 1 Gietz 205.0 515.123.8181 8300

In [39]:
df[(df['salary']==df['salary'].max())|(df['salary']==df['salary'].min())]

Out[39]: department_id email employee_id first_name full_name hire_date job_id last_name manager_id phone_number salary

0 9 steven.king@sqltutorial.org 100.0 Steven StevenKing 6/17/1987 4 King NaN 515.123.4567 24000

19 3 karen.colmenares@sqltutorial.org 119.0 Karen KarenColmenares 8/10/1999 13 Colmenares 114.0 515.127.4566 2500

In [40]:
sns.barplot(data=df,x='department_id')

<AxesSubplot:xlabel='department_id'>
Out[40]:

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 19/20


6/7/22, 4:30 PM shruti gupta 2101730019

In [ ]:

file:///C:/Users/shrut/Downloads/shruti gupta 2101730019 (1).html 20/20

You might also like