Commit dd2e6dc8 authored by Merlijn Wajer's avatar Merlijn Wajer
Browse files

Add old query research from 2019

parent 9f7737b2
-- DWWI metadata:
-- artists [
-- names
-- ]
--
-- country
-- cover_url
-- date
-- description
-- groupid
-- id
-- label-info [
-- "catalog-number":
-- "label-name":
-- ]
-- number_of_tracks
-- title
--
-- tracks [
-- duration
-- position
-- title
-- artists [
-- names
-- ]
-- ]
-- Queries over the following:
-- [X] artists [ ]
-- [X] country
-- [ ] cover_url
-- [X] date
-- [X] description
-- [X] groupid
-- [X] id
-- [X] label-info [ ]
-- [X] number_of_tracks
-- [X] title
-- [X] tracks [ ]
SELECT id,
master_id AS groupid,
title,
country,
barcode AS XXX_barcode,
released AS date,
notes AS description
FROM release
WHERE id in (
SELECT release_id
FROM releases_labels
WHERE catno ILIKE '%ms%2177%' and label ILIKE '%reprise%');
-- Alternatively, use this query if searching on title/artist
SELECT id,
master_id AS groupid,
title,
country,
barcode AS XXX_barcode,
released AS date,
notes AS description
FROM release
WHERE title ILIKE '%Covered In Nails: A Tribute To Nine Inch Nails%';
SELECT release.id as id,
release.master_id AS groupid,
release.title as title,
release.country as country,
release.barcode AS XXX_barcode,
release.released AS date,
release.notes AS description
FROM release
INNER JOIN releases_artists ON release.id = releases_artists.release_id
WHERE releases_artists.artist_name ILIKE '%Nine Inch Nails%';
-- Get label info back (kinda lame, searched for it already, can optimise this)
SELECT catno AS "catalog-number",
label as "label-name"
FROM releases_labels
WHERE release_id = 6908701;
-- artists for release (will just be 'Various') for multiple?
SELECT artist_name
FROM releases_artists
WHERE release_id = 6908701;
-- TODO: Also use this table? releases_extraartists
SELECT artist_name
FROM releases_artists
-- Maybe also add role='Written-By' eventually
-- XXX: Audio the roles we filter on ATM
WHERE role='Featuring' AND
release_id = 6908701;
-- trackno for release
SELECT COUNT(*) AS number_of_tracks
FROM track
WHERE release_id = 6908701;
-- Basic track info
SELECT position, duration, title, trackno, track_id
FROM track
WHERE release_id = 6908701;
-- If tracks have various artists, then this exists, otherwise empty set (merge
-- in python/go code with above query)
SELECT track.track_id AS XXX_trackid,
tracks_artists.artist_name AS artist,
track.position AS position,
track.duration AS duration,
track.title AS title
FROM track
INNER JOIN tracks_artists ON track.track_id = tracks_artists.track_id
WHERE track.release_id = 224256;
-- XXX EXAMPLE DATA that can be used for testing
-- Multiple artists, one per track
WHERE catno ILIKE '%NNA051%' and label ILIKE '%nna%';
WHERE catno ILIKE '%CBS%80837%' and label ILIKE '%CBS%';
-- Multiple artists, multiple per track
SELECT id, master_id
FROM release
WHERE title ILIKE '%Covered In Nails: A Tribute To Nine Inch Nails%';
--https://img.discogs.com/xJ3loWlqodxdVEFMItQmBAomVcY=/fit-in/600x605/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-6908701-1486693360-1552.jpeg.jpg
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment