如何编写代码以在创建关系后将数据插入数据库 [英] how to write the code to insert the data to database after creating the relationship

查看:78
本文介绍了如何编写代码以在创建关系后将数据插入数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

i想知道在我们在数据库中创建外键时如何编写插入查询

hello,
i wanted to know how to write the insert query when we have created the foreign key in the database

推荐答案

INSERT 查询应该具有该表的外键列的有效值,您要插入一行。



否则它会给你外键约束冲突错误。
The INSERT query should have a valid value for the Foreign Key column of that Table, where you are inserting a row.

Otherwise it will give you foreign key constraint conflict error.


这篇关于如何编写代码以在创建关系后将数据插入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆