Pandas HR database: Display all the records of REGIONS file
Pandas HR database Queries: Exercise-1 with Solution
Write a Pandas program to display all the records of REGIONS file.
Sample Solution :
Python Code :
import pandas as pd employees = pd.read_csv(r"EMPLOYEES.csv") departments = pd.read_csv(r"DEPARTMENTS.csv") job_history = pd.read_csv(r"JOB_HISTORY.csv") jobs = pd.read_csv(r"JOBS.csv") countries = pd.read_csv(r"COUNTRIES.csv") regions = pd.read_csv(r"REGIONS.csv") locations = pd.read_csv(r"LOCATIONS.csv") print("All the records from regions file:") print(regions)
All the records from regions file: REGION_ID REGION_NAME 0 1 Europe 1 2 Americas 2 3 Asia 3 4 Middle East and Africa
Equivalent SQL Syntax:
SELECT * FROM REGIONS;
Click to view the table contain:
Python Code Editor:
Structure of HR database :
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?
- New Content published on w3resource :
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework