Code Monkey home page Code Monkey logo

sql's Introduction

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.

sql's People

Contributors

tanjiya avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.