mysql FOREIGN KEY constraint
Translation results:
UK [ˈfɔrin ki:] US [ˈfɔrɪn ki]
foreign keywords
mysql FOREIGN KEY constraintsyntax
Function:The FOREIGN KEY in one table points to the PRIMARY KEY in another table.
Description: FOREIGN KEY constraints are used to prevent actions that destroy connections between tables. The FOREIGN KEY constraint also prevents illegal data from being inserted into the foreign key column because it must be one of the values in the table it points to.
mysql FOREIGN KEY constraintexample
//在 "Orders" 表创建时为 "Id_P" 列创建 FOREIGN KEY CREATE TABLE Orders(Id_O int NOT NULL,OrderNo int NOT NULL,Id_P int,PRIMARY KEY (Id_O),FOREIGN KEY (Id_P) REFERENCES Persons(Id_P));
Popular Recommendations
- Lerna – The key of Monorepo Management
- TypeScript vs JavaScript: Key Differences for Developers
- Secure API Key Handling in Python Projects
- Bitcoin (BTC) Nears Resistance: Key Levels to Watch
- SOAP vs REST API: Understanding the Key Differences
- Dogecoin Faces Key Resistance at $0.10 Amid Market Anticipation