Skip to content

Instantly share code, notes, and snippets.

@enigmatikme
Last active October 4, 2018 22:31
Show Gist options
  • Save enigmatikme/214a5fc17f7a60234cff17711c073beb to your computer and use it in GitHub Desktop.
Save enigmatikme/214a5fc17f7a60234cff17711c073beb to your computer and use it in GitHub Desktop.
-- Postgres
-- Read
select * from popularsongs.artists, popularsongs.albums, popularsongs.songs where artists.id = 9999999 and albums."artistID"= artists.id and songs."artistID"=artists.id;
-- Insert
INSERT INTO "popularsongs"."albums"("artistID", "name", "imageUrl", "yearPublished") VALUES(1000001, 'John Doe', 'wwww.clonethis.com', 1999) RETURNING "artistID", "name", "imageUrl", "yearPublished";
-- Cassandra
-- Read
select * from songsdata where id=999999;
-- Insert
INSERT INTO songsdata (id, artistName, albumArtistID, albumName, imageUrl, yearPublished, songArtistID, songName, streams, length, popularity, inLibrary)
VALUES (10000001, 'John Doe', 999, 'Jojo', 'wwww,thisisit.com', 1990, 90, 'hello', 903849803, 200, 9303939, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment