بتاريخ: 13 سبتمبر 200421 سنة comment_12585 كيف يمكنني ان اربط مفتاح اساسي في جدول بمفتاح اساسي في جدول آخر علما ان المفتاح الهدف جزء من مفتاحين اساسيين في جدول واحد ؟ تقديم بلاغ
بتاريخ: 19 سبتمبر 200421 سنة comment_12889 لعلك تقصد مفتاح أساسي يتكون من حقل واحد مع مفتاح يتكون من حقلين ، هذا لا يمكن لأن من شروط العلاقات تساوي عدد الحقول و نوعها و ترتيبها ... تم تعديل 19 سبتمبر 200421 سنة بواسطة oss تقديم بلاغ
بتاريخ: 8 يناير 200521 سنة comment_23341 يمكن الربط باستخدام The FOREIGN KEY Constraint وهذا شرح مختصر عنه - Creates a primary key for the table; only one primary key is allowed for each table - Designates a column or combination of columns as a foreign key - Establishes a relationship between the primary or unique key in the same table or between tables - Is defined at either the table or column constraint level - Must match an existing value in the parent table or be NULL - Examples : ... dept_no NUMBER(7) CONSTRAINT fk_deptno REFERENCES s_dept(id) ON DELETE CASCADE); ... dept_no NUMBER(7),…. CONSTRAINT fk_deptno FOREIGN KEY (dept_no) REFERENCES s_dept(id) ); ... areaco NUMBER (4),phoneno NUMBER(7),…. CONSTRAINT fk_areaco_phoneno FOREIGN KEY(areaco,phoneno) REFERENCES customers (areaco, phoneno) );ON DELETE CASCADEAllows deletion in the parent table and deletion of the dependent rows in the child table. تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.