clear markdown compare help donate or buy diddy dollings comments/suggestions/bugs a leap of faith? bible365
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 582683 fiddles created (13282 in the last week).

CREATE TABLE PartyType ( PartyTypeCode CHAR(1) NOT NULL, Name CHAR(30) NOT NULL, CONSTRAINT PartyType_PK PRIMARY KEY (PartyTypeCode), CONSTRAINT PartyType_AK UNIQUE (Name) ); CREATE TABLE Party ( PartyId INT NOT NULL, PartyTypeCode CHAR(1) NOT NULL, CreatedDateTime TIMESTAMP NOT NULL, Etcetera CHAR(30) NOT NULL, CONSTRAINT Party_PK PRIMARY KEY (PartyId), CONSTRAINT PartyToPartyType_FK FOREIGN KEY (PartyTypeCode) REFERENCES PartyType (PartyTypeCode) ); CREATE TABLE UserProfile ( UserId INT NOT NULL, UserName CHAR(30) NOT NULL, FirstName CHAR(30) NOT NULL, LastName CHAR(30) NOT NULL, GenderCode CHAR(3) NOT NULL, BirthDate DATE NOT NULL, CONSTRAINT UserProfile_PK PRIMARY KEY (UserId), CONSTRAINT UserProfile_AK1 UNIQUE ( FirstName, LastName, GenderCode, BirthDate ), CONSTRAINT UserProfile_AK2 UNIQUE (UserName), CONSTRAINT UserProfileToParty_FK FOREIGN KEY (UserId) REFERENCES Party (PartyId) ); CREATE TABLE MyGroup ( GroupId INT NOT NULL, Title CHAR(30) NOT NULL, CONSTRAINT Group_PK PRIMARY KEY (GroupId), CONSTRAINT Group_AK UNIQUE (Title), CONSTRAINT GroupToParty_FK FOREIGN KEY (GroupId) REFERENCES Party (PartyId) ); CREATE TABLE Playlist ( PlaylistId INT NOT NULL, OwnerId INT NOT NULL, Title CHAR(30) NOT NULL, CreatedDateTime TIMESTAMP NOT NULL, CONSTRAINT Playlist_PK PRIMARY KEY (PlaylistId), CONSTRAINT Playlist_AK UNIQUE (Title), CONSTRAINT PartyToParty_FK FOREIGN KEY (OwnerId) REFERENCES Party (PartyId) ); CREATE TABLE GroupMember ( MemberId INT NOT NULL, GroupId INT NOT NULL, IsOwner BOOLEAN NOT NULL, JoinedDateTime TIMESTAMP NOT NULL, CONSTRAINT GroupMember_PK PRIMARY KEY (MemberId, GroupId), CONSTRAINT GroupMemberToUserProfile_FK FOREIGN KEY (MemberId) REFERENCES UserProfile (UserId), CONSTRAINT GroupMemberToMyGroup_FK FOREIGN KEY (GroupId) REFERENCES MyGroup (GroupId) );
 hidden batch(es)