English 中文(简体)
参考表 表1
原标题:Referencing Table & Referenced Table

我不想理解关系和自然问题。

“MySQL

What does referencing table mean and what does referenced table mean? In the above example which one should be referenced and which one referencing? Lets say for the sake of argument that the settlements table is a child table (settlement cannot exist without a country). Should this child table be referencing or referenced?

I prefer not to open a new question for such a little question: What does that Mandatory checkbox mean? Does it mean that the settlements table is required or that country_id is required? Or maybe something else?

最佳回答

在邮政总局的文件中找到了很好的解释。

你们有我们多次使用的产品表:

CREATE TABLE products (
    product_no integer PRIMARY KEY,
    name text,
    price numeric
);

让我也假设,你们有一份储存这些产品的表格。 我们希望确保订单表只包含实际存在的产品订单。 因此,我们在参考产品表格的命令表中界定了外国的主要制约因素:

CREATE TABLE orders (
    order_id integer PRIMARY KEY,
    product_no integer REFERENCES products (product_no),
    quantity integer
);

现在不可能制定产品目录中未出现的任何条目。

www.un.org/Depts/DGACM/index_spanish.htm 我们说,在这种情况下,订单表是referencing<>em>,产品表是参引/em>。 同样,还有参考栏目。

问题回答

参考表格为括号。

参考表是儿童表。

笼罩在DDL,例如。

ALTER TABLE Settlements ADD
   FOREIGN KEY (country_id)
   REFERENCES Countries (id);

提及定居点的国家是指国家。

<><>>条码>(在国与国之间)

我假定强制性检查箱与关系无关。 这只是对实地的绝对限制。 但是,你应当就这一手册查阅MySQL Workbench的用户手册。

The Mandatory check box, if it seems to have no effect in generated SQL, has some effect on the graphic. If unchecked, you can see little circle at concerned relation line extremity (for Relationship notation crow s foot).

这意味着外国钥匙可能是无效的,即不是强制性的。

One country can have many settlements so the country table is the referenced table and the settlement table is the referencing table. I don t know about mandatory field.





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...