Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions and SQL file for easy import into MySQL #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,38 @@ This repository contains a variety of datasources used by Socratica in our YouTu

Below are the datasources along with the Playlist / Video that uses the data.

earthquake.csv:
earthquakes.csv:
- SQL / SELECT (Part 1)

## To import into MySQL:

1. Import the file earthquakes.sql into adminer/phpmyadmin/ any other GUI that you use.

### OR
1. Create a database called earthquake:
```
CREATE DATABASE earthquake
```
2. Create a table called earthquakes with the relevant columns

```
CREATE TABLE `earthquakes` (
`earthquake_id` int(11) NOT NULL,
`occurred_on` datetime NOT NULL,
`latitude` double NOT NULL,
`longitude` double NOT NULL,
`depth` double NOT NULL,
`magnitude` double NOT NULL,
`calculation_method` varchar(512) NOT NULL,
`network_id` varchar(512) NOT NULL,
`place` varchar(512) NOT NULL,
`cause` varchar(512) NOT NULL
)
```

3. Run the following command:

```
mysqlimport --ignore-lines=1 --fields-terminated-by=, --fields-optionally-enclosed-by=\" --local -u root -p
earthquake earthquakes.csv
```
File renamed without changes.
Loading