الانتقال إلى المحتوى

رسالة خطاء


teto_t

Recommended Posts

create table departments(dept_id number(4) constraint d_id praimary key,
dept_name varchar2(30) constraint d_name not null,
manager_id number(4) ,
loc_id number(3) constraint  d_locid foreign key 
references locations(loc_id));




create table locations(loc_id number(3) constraint location_id primary key,
adrres varchar2(30) constraint add_nn not null);

رابط هذا التعليق
شارك

create table departments(dept_id number(4) constraint d_id primary key,
dept_name varchar2(30) constraint d_name not null,
manager_id number(4) ,
loc_id number(3)constraint d_locid
REFERENCES locations(loc_id) )


راجع الماتريل فقط ستجد هنا بعض الاخطاء البسيطة
الخطأ في الجدول الاول والثاني صحيح

تم تعديل بواسطة mustafagamiel
رابط هذا التعليق
شارك

create table departments(dept_id number(4) constraint d_id praimary key,
dept_name varchar2(30) constraint d_name not null,
manager_id number(4) ,
loc_id number(3) constraint  d_locid foreign key 
references locations(loc_id));




create table locations(loc_id number(3) constraint location_id primary key,
adrres varchar2(30) constraint add_nn not null);




اخي العزيز انتا عامل في الجدول الاول References للجدول لسى مش موجود وهو locations

ثانيا خذها نصيحة من اخوك دائما انشاء الجداول ثم اكتب القيود احسن واوضح يعني هيك .

create table locations (
loc_id number(3),
adrres varchar2(30) not null);
alter table locations
add constraint locations_pk primary key(loc_id )
);



وبعدين الجدول الثاني

create table departments(
dept_id number(4),
dept_name varchar2(30) not null,
manager_id number(4) ,
loc_id number(3) 
);
alter table departments
add constraint departments_pk primary key(dept_id );
alter table departments
add constraint departments_Fk foriegn key(loc_id )
refernces  locations (loc_id );



إن شاء الله اكون وصلت الفكرة

رابط هذا التعليق
شارك

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   تمت استعادة المحتوى السابق الخاص بك.   مسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

جاري التحميل
×
×
  • أضف...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية