本文介绍了SQL音乐播放列表数据库设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,关于如何为带有歌曲和播放列表的数据库构建表.我最初的想法是创建一个播放列表标题和ID的表,然后创建一个播放列表歌曲表,该表保存歌曲的唯一ID及其所属的播放列表.

I had a question about how to structure my tables for a database with songs and playlists. My initial thought was to create a table of playlists titles and id's and then a playlists songs table that holds the songs unique id and the playlist in which it belongs to.

另一个计划是为每个创建的播放列表创建一个新表,并将歌曲信息存储在该播放列表的每个表内.问题是,这是一个好方法还是出于某些原因而导致创建这些新表会降低性能?感谢您的帮助!

The other plan was to create a new table for each playlist that gets created and store the song information inside each table for the playlist. The question is, would this be a good approach or is there some reason that creating these new tables would be bad for performance or any other reason? Thanks for the help!

推荐答案

这样的事情怎么样?

歌曲:

id title length artist_id

艺术家:

id name

播放列表:

id title user_id 

播放列表_歌曲:

playlist_id song_id

用户:

id name email 

这篇关于SQL音乐播放列表数据库设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 07:54