级联删除用例

发布于 2024-11-03 14:53:14 字数 87 浏览 1 评论 0原文

我对业务分析还很陌生。我必须编写显示两个(目前)级联删除(对于两个表)的要求,并且其余表将显式删除。

我需要一些关于如何编写级联删除要求的指导。

I am pretty new to Business Analysis. I have to write requirements that show both (for now) cascade delete (for two tables) and the rest of the tables will delete explicitly.

I need some guidance for how to write the requirements for cascade deletion.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

荒人说梦 2024-11-10 14:53:14
  • 删除父实体上的子实体
    删除。
  • 如果删除集合实体,则删除集合成员。

实际上,如果没有上下文,很难理解这项任务,而且它闻起来像大学/学院的作业(我们有一个与此非常相似的作业)。

  • Delete child entities on parent
    deletion.
  • Delete collection members if collection entity is deleted.

Actually it is hard to understand the task without context and also it smells like university/colledge homework (we had one very similar to this).

給妳壹絲溫柔 2024-11-10 14:53:14

使用 ON DELETE CASCADE 选项指定在父表中删除相应行时是否要删除子表中的行。如果您不指定级联删除,则数据库服务器的默认行为会阻止您删除表中的数据(如果其他表引用了该表)。

如果指定此选项,稍后当您删除父表中的行时,数据库服务器还会删除子表中与该行(外键)关联的任何行。级联删除功能的主要优点是它允许您减少执行删除操作所需的 SQL 语句的数量。

例如,all_candy 表包含 candy_num 列作为主键。 Hard_candy 表引用 candy_num 列作为外键。以下 CREATE TABLE 语句创建外键上带有级联删除选项的 Hard_candy 表:

CREATE TABLE all_candy 
   (candy_num SERIAL PRIMARY KEY,
    candy_maker CHAR(25));

CREATE TABLE hard_candy 
   (candy_num INT, 
    candy_flavor CHAR(20),
    FOREIGN KEY (candy_num) REFERENCES all_candy
    ON DELETE CASCADE)

由于为从属表指定了 ON DELETE CASCADE,因此当删除 all_candy 表的一行时,hard_candy 表的相应行也会被删除。已删除。有关从具有级联删除的表中删除行时的语法限制和锁定含义的信息,请参阅表具有级联删除时的注意事项。

来源: http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.sqls.doc/sqls292.htm

Use the ON DELETE CASCADE option to specify whether you want rows deleted in a child table when corresponding rows are deleted in the parent table. If you do not specify cascading deletes, the default behavior of the database server prevents you from deleting data in a table if other tables reference it.

If you specify this option, later when you delete a row in the parent table, the database server also deletes any rows associated with that row (foreign keys) in a child table. The principal advantage to the cascading-deletes feature is that it allows you to reduce the quantity of SQL statements you need to perform delete actions.

For example, the all_candy table contains the candy_num column as a primary key. The hard_candy table refers to the candy_num column as a foreign key. The following CREATE TABLE statement creates the hard_candy table with the cascading-delete option on the foreign key:

CREATE TABLE all_candy 
   (candy_num SERIAL PRIMARY KEY,
    candy_maker CHAR(25));

CREATE TABLE hard_candy 
   (candy_num INT, 
    candy_flavor CHAR(20),
    FOREIGN KEY (candy_num) REFERENCES all_candy
    ON DELETE CASCADE)

Because ON DELETE CASCADE is specified for the dependent table, when a row of the all_candy table is deleted, the corresponding rows of the hard_candy table are also deleted. For information about syntax restrictions and locking implications when you delete rows from tables that have cascading deletes, see Considerations When Tables Have Cascading Deletes.

Source: http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.sqls.doc/sqls292.htm

忆离笙 2024-11-10 14:53:14

您不编写功能用例 - 这就是为什么很难正确回答您的问题的原因 - 我们不知道与系统交互的参与者,当然我们对系统一无所知,所以我们无法告诉你如何写他们的互动的描述。
您应该首先编写用例,然后从中派生功能。

You don't write use cases for functionality - that is the reason why it is hard to properly answer your question - we don't know the actor who interacts with the system and of course we know nothing about the system, so we cannot tell you how to write description of their interactions.
You should write your use cases first and from them derive the functionality.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文