音乐库MySQL数据库 [英] Music library MySQL database

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

问题描述

我需要一些帮助在MySQL中为音乐数据库建立一个表。我不确定如何在表中显示这些信息。

I need some help building a table(s) for a music database in MySQL. I am unsure on how to lay this information out in a table.

这里是我想要存储在数据库中的信息。

Here is the info I would like to be stored in the database.

Artist Name
Album Name
Release Date
Genre
Picture URL (album artwork)

Track Number
Trank Name
Track Playtime
Lyric (optional, But would like to have it someday)

etc.

基本上与组织数字音乐有关的任何事情。我是数据库的新手,我有一些想法。但是,如果我要学习,我也可以学习正确的做法。

Basically anything that has to do with organizing digital music. I'm new to databases and I have some ideas. But if I'm going to learn I might as well learn the right way of doing it.

任何关于如何设计我的表的想法将是真棒。

Any thoughts on how to design my table(s) would be awesome.

推荐答案

这样的东西很好。它指定艺术家,专辑(具有键入艺术家和类型),曲目(键入专辑)和类型的表。

Something like this would be good to start with. It specifies a table for artists, albums (with keys into artists and genres), tracks (keyed into albums), and genres.

Table artists
----
id (primary key),
name
description
years_active
otherinfo (whatever you need)

Table albums
----
id (primary key)
artistid (foreign key to artists table)
name,
releasedate
genreid (foreign key to genres table)
picture

Table tracks
----
id (primary key)
albumid (foreign key to albums table)
name
override_artist (overrides album artist if not null)
playtime
lyric
otherstuff as needed

Table genres
----
id (primary key)
name
description

这篇关于音乐库MySQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆