构建一套新的数据库应用系统,分析该系统解决的问题:
- users(userID(用户名字ID), userName(用户名字),)
- songs(songID(歌曲ID), artistID(作者ID), rating(播放率))
- Playlists(播放列表)(playlistID(播放列表ID), userID(用户ID), title(歌曲标题))
- Songsplaylists(歌曲列表)(songID(歌曲ID), playlistID(播放列表ID), play_no(歌曲编号))
先感受一波日落
- Table users contains data about users of some imaginary cloud-based media player.
- Table songs lists all songs currently available on the cloud.
- Table playlists contains information about playlists created by users, and
- table songsplaylists keeps information about which songs are included in the playlists.
- Attribute play_no is the number of the song in the playlist as specified by the user.
多表连接
创建users表
创建songs表
创建playlists表(播放列表)
创建songsplaylists表(歌曲列表)
01,最受欢迎的那首歌曲的歌名
02,最喜欢播放最受欢迎的那首歌的用户名字
03,播放列表中那些歌曲被播放过
04,查询姓名中包含an的靓仔,他们喜欢听的歌