级联删除用例
我对业务分析还很陌生。我必须编写显示两个(目前)级联删除(对于两个表)的要求,并且其余表将显式删除。
我需要一些关于如何编写级联删除要求的指导。
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
删除。
实际上,如果没有上下文,很难理解这项任务,而且它闻起来像大学/学院的作业(我们有一个与此非常相似的作业)。
deletion.
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).
使用 ON DELETE CASCADE 选项指定在父表中删除相应行时是否要删除子表中的行。如果您不指定级联删除,则数据库服务器的默认行为会阻止您删除表中的数据(如果其他表引用了该表)。
如果指定此选项,稍后当您删除父表中的行时,数据库服务器还会删除子表中与该行(外键)关联的任何行。级联删除功能的主要优点是它允许您减少执行删除操作所需的 SQL 语句的数量。
例如,all_candy 表包含 candy_num 列作为主键。 Hard_candy 表引用 candy_num 列作为外键。以下 CREATE TABLE 语句创建外键上带有级联删除选项的 Hard_candy 表:
由于为从属表指定了 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:
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
您不编写功能用例 - 这就是为什么很难正确回答您的问题的原因 - 我们不知道与系统交互的参与者,当然我们对系统一无所知,所以我们无法告诉你如何写他们的互动的描述。
您应该首先编写用例,然后从中派生功能。
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.