用户个人 View/Database

Personal View/Database for users

我正在使用 asp.net mvc5 开发电影数据库,作为用户,您应该能够 select 电影,以获得您已经看过的电影的个人列表。我的问题是我是新手,我不知道什么是开始意识到这种事情的最佳方式。 我苦苦挣扎的主要事情是我必须为每个用户拥有一个自己的数据库,对吗?如果是,我该如何从这里开始?

非常感谢提前提示!

将数据库视为 Excel 文件。您只需要一个 Excel 文件(数据库)。将 "sheet1" 重命名为 "movies"(在数据库中创建 table)并将所有电影写入此 sheet。再创建一个sheet,命名为"users",在这个sheet上写上所有用户。创建第三个 sheet,将其命名为 "watched" 并在第一列中写入第二个 sheet 的用户行号和第一个 sheet 的电影行号。

好了 - 一个包含三个 table 的数据库:

movies (id, name)

1 Matrix

2 Avatar

3 Serenity

-

users (id, name)

1 Max

2 Kevin

-

watched(id, userid, moovieid)

1 1 2 //it means I watched Avatar

2 1 3 //it means I watched Serenity

3 2 1 //it means you watched Matrix