Skip to content

tanjiya/SQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

SQL

# The dataset:

120 years of Olympic history

# DBMS:

I am using PostgreSQL. For interface: pgAdmin. If you want to use something else, download your favourite one.

# Loading data into PostgreSQL:

Extract the data. We will get two file and the data will be in CSV format. So, we have to import the data into our database. The step to follow:

Step 1: Create a database named olympic or any of your choice.

Step 2: As, the downloaded dataset contains two file.. so, we need to create two table to load the data. For creating table wither we can create table manually of simply can use query. I have used query to create table. Here is the query:

CREATE TABLE IF NOT EXISTS OLYMPICS_HISTORY (

id INT,

name VARCHAR,

sex VARCHAR,

age VARCHAR,

height VARCHAR,

weight VARCHAR,

team VARCHAR,

noc VARCHAR,

games VARCHAR,

year INT,

season VARCHAR,

city VARCHAR,

sport VARCHAR,

event VARCHAR,

medal VARCHAR

);

CREATE TABLE IF NOT EXISTS OLYMPICS_HISTORY_NOC_REGIONS (

noc VARCHAR,

region VARCHAR,

notes VARCHAR

);

Step 3: Import the data

To import the data, right click on the table where we want to load data and choose Import/Export. Choose the file, file extension, set headers on, and set escape to "". As we have double quoted data or simply modify the data manually.

Step 4: It's done. Check if the data has loaded correctly or not: select * from OLYMPICS_HISTORY; select * from OLYMPICS_HISTORY_NOC_REGIONS;

# Question and answer:

I have added question and answer into separate file. Please check the file section.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published