Comments (4)
I've used DB Browser for SQLite to export the database.
The exported files look as
Album.json
[
{
"AlbumId": "1",
"ArtistId": "1",
"Title": "For Those About To Rock We Salute You"
},
{
"AlbumId": "2",
"ArtistId": "2",
"Title": "Balls to the Wall"
},
... truncated
Artist.json
[
{
"ArtistId": "1",
"Name": "AC/DC"
},
{
"ArtistId": "2",
"Name": "Accept"
},
... truncated
(the other files are omitted)
A simple usage example:
import pandas as pd
from tabulate import tabulate
with open('data/Album.json', 'r') as f:
album_json = f.read()
with open('data/Artist.json', 'r') as f:
artist_json = f.read()
album_df = pd.read_json(album_json)
artist_df = pd.read_json(artist_json)
# - merge the two DataFrames on column 'ArtistId'
# - drop the columns 'AlbumId', 'ArtistId'
merged_df = pd.merge(artist_df, album_df, on='ArtistId') \
.drop(columns=['AlbumId', 'ArtistId'], axis=1)
# set the column labels
merged_df.columns = ['Artist', 'Album']
print(tabulate(merged_df, headers='keys', showindex=False))
output
Artist Album
-------------------- -------------------------------------
AC/DC For Those About To Rock We Salute You
AC/DC Let There Be Rock
Accept Balls to the Wall
Accept Restless and Wild
Aerosmith Big Ones
... truncated
from chinook-database.
To expand a little on the work of @pangoro24, here's both the data and the database schema as JSON:
https://github.com/marko-knoebl/chinook-database-json/tree/master/src
from chinook-database.
Just as reference, I extracted them and saved the json and txt files here>
https://github.com/pangoro24/chinook-refit/tree/master/backend/files
from chinook-database.
You can now find the JSON file that is used to generate all the chinook database SQL scripts in the Releases page assets.
https://github.com/lerocha/chinook-database/releases
Thank you!
from chinook-database.
Related Issues (16)
- Database diagrams HOT 1
- latest source code link not working and detailed schema
- Visual Studio 2019 Community Edition build fail HOT 2
- Chinook_PostgreSql.sql:237: ERROR: invalid byte sequence for encoding "UTF8": 0xf4 0x6e 0x69 0x6f HOT 2
- Tranform All Templates in Visual Studio Code HOT 1
- Unacceptable song name for publicly available database HOT 2
- redmine migration HOT 1
- Script creates database but never exits HOT 1
- Oracle errors in Express Edition 21 HOT 2
- Move build artifacts from repository to "Releases" HOT 2
- Visual Studio 2017 Problem HOT 1
- Oracle installation via Chinook_Oracle.sql in detail steps as its given for Sqlite HOT 2
- using Chinook DB on mac HOT 1
- Repeated playlists
- Don't use double quotations in PostreSQL HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chinook-database.