推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
spark
V2EX  ›  Python

请教: 电影-职业-人, 这种表要怎样设计?

  •  
  •   spark · Jan 30, 2013 · 3696 views
    This topic created in 4994 days ago, the information mentioned may be changed or developed.
    最好是用sqlalchemy写出来, 我是新手, 对sql还不熟

    每个电影包含多个职业(导演、演员、制片...);
    每个职业又包含多个人(演员:昆汀、杰米·福克斯...);
    每个人在职业中又有重合 (演员:昆汀; 导演:昆汀, 制片:昆廷...)

    我目前考虑是如下: 但是不知道在数据库中三个表这样关联是不是正确, 怎样才更合理呢?
    Film(电影)、Role(职业)、People(人)
    film_role(关联表):
    film_id,
    role_id,
    people_id
    2 replies  •  1970-01-01 08:00:00 +08:00
    plucury
        1
    plucury  
       Jan 30, 2013   ❤️ 1
    可不可以说,某人(people)再某电影(film)中担任某角色(role)
    所以三个表
    Film
    People
    film-id + people-id + role
    不知是否满足楼主要求
    sivacohan
        2
    sivacohan  
       Jan 30, 2013 via Android
    你需要的是一个标签系统。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   753 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 20:59 · PVG 04:59 · LAX 13:59 · JFK 16:59
    ♥ Do have faith in what you're doing.