This is my first post here. Thanks for having me!
I have two questions for a table I'm building into my mysql database.
Question 1: I have a need to input an artist name and the result/select be a distinct twitter handle. How might I build this query as efficiently as possible based on an optimal solution for Q2 (Preferably in one line).
Question 2: Based on the requirement above how should I build my table 'twitter' into the database. Below is a start, but happy to discuss best practice.
Simplified Example: Input = 'Beatle'. Desired output '@beatleMe'
table: songs (note artist is not distinct) ID ARTIST SONG 1 Mike J Beat It 2 Beatle Yellow Sub 3 Beatle Lucy Diamond table: twitter (note artist is distinct) ID ARTIST HANDLE 1 Mike J @mikeJ 2 Beatle @beatleMe
I'm from an excel background, so I think in terms of lookups. But I know I can get more out of my database with foreign keys, joins etc (if they are relevant here I'm not 100%). So am keen to learn.
The song table will be maintained most regularly, so it would be good to have the artist columns mirrored/linked is that possible?