foreign-keys

    0熱度

    1回答

    親愛的實體專家和其他人, 我有以下實體, 基類個人: public abstract class Individual { [Key] public int IndividualID { get; set; } ... other properties } 瑜珈: [Table("Yogis")] public class Yo

    4熱度

    1回答

    我有一個表引用城市表與一個名爲cityId的鍵。 我取使用此查詢從它的數據: SELECT t.ID, city.areaId FROM transp t LEFT JOIN city ON city.ID = t.cityId; 這樣,原樣返回表,與空的city.areaId如果cityId爲null。 但是,當我將函數添加到使用city.areaId的where子句時,即使函數始終爲tr

    0熱度

    1回答

    以下CREATE TABLE不起作用: CREATE TABLE IF NOT EXISTS `transacciones`.`jos_trans_sector` ( `id_sector` INT NOT NULL, `nombre` VARCHAR(45) NULL DEFAULT NULL, PRIMARY KEY (`id_sector`), CONS

    0熱度

    1回答

    我有以下SQL腳本: use restaurant; set foreign_key_checks=0; create table rtable_schedule( id int(11) not null, rdate date not null, start_hour tinyint, start_min tinyint, end_hour t

    0熱度

    2回答

    我在做SQL中的任務,我試圖在引用表的total表上添加一個外鍵。 我的代碼: CREATE TABLE DONUTS ( DonutID integer not null unique, Donut_name varchar(35) not null, Description varchar(35) not null, Donut_Qty integer not null, Donut_

    0熱度

    1回答

    我對laravel很陌生,並且已經建立了幾個模型和視圖等。無論如何,我正在嘗試做的是,我有一個用戶模型和一個團隊模型。字段'id'是用戶team_id的外鍵。 用戶可以加入任何球隊和他加入的球隊,其ID將存儲在用戶的'team_id'中。 我打算這樣做,使用team_id字段從團隊模型中獲取數據,如團隊名稱並將其顯示在刀片​​視圖中。 這裏是我的用戶模型代碼: protected $fillab

    0熱度

    1回答

    加入我有兩個簡單的表: 名稱: +----+-------------+ | id | Name | +----+-------------+ | 1 | John Smith | | 2 | Joe Doe | +----+-------------+ 關係: +----+----------+---------+ | id | ParentID | ChildID | +

    0熱度

    2回答

    我不是很喜歡數據庫,我有以下問題。我正在使用MySQL。 我有2個表如下: 1)傳輸表: CREATE TABLE transfers ( id BigInt NOT NULL AUTO_INCREMENT, processed Char(1) NOT NULL, providerpid VarChar(16) NOT NULL, recipientpid

    0熱度

    1回答

    from django.db import models from django.contrib.auth.models import User class Paper(models.Model): title = models.CharField(max_length=255, null=False) abstract = models.TextField(null=

    0熱度

    1回答

    我已經創建了這樣一個測試場景: 我有三張表,即父親,孩子,食物。 父表具有主自動增量鍵和名稱列。 子表具有主自動增量鍵和名稱列。 食物有一列我想要一個外鍵和一列食物名稱。 father ----------- id name 1 kevin 2 adam child ----------- id father_id name 1 1 fred 2 1 john