Polymorphism in SQL database tables?

前端 未结 7 1186
悲&欢浪女
悲&欢浪女 2020-11-27 02:39

I currently have multiple tables in my database which consist of the same \'basic fields\' like:

name character varying(100),
description text,
url character         


        
7条回答
  •  情歌与酒
    2020-11-27 03:10

    Using the disjoint subtype approach suggested by Bill Karwin, how would you do INSERTs and UPDATEs without having to do it in two steps?

    Getting data, I can introduce a View that joins and selects based on specific media_type but AFAIK I cant update or insert into that view because it affects multiple tables (I am talking MS SQL Server here). Can this be done without doing two operations - and without a stored procedure, natually.

    Thanks

提交回复
热议问题