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 );
إن شاء الله اكون وصلت الفكرة
اللهم أغفر للمسلمين والمسلمات والمؤمينين والمؤمينات ألاحياء منهم وألاموات الى يوم الدين
موضوع قرأتة فأعجبني
http://www.shbab1.com/2minutes.htm
اذا عجبك موضوع من مواضيعي..لا تقل لي شكراً
و لكن أدعو لي (في ظهر الغيب) بالآتي
اللهم اغفر له ما تقدم من ذنبه و ما تأخر..اللهم احسن خاتمته
اللهم اغفر لوالديه و ارحمهما و ادخلهما جناتك برحمتك يا أرحم الراحمين و لكم بالمثل ان شاء الله
ارجو من الله ان يكون ما انقله لكم من ضمن حسناتى

لا تأســــفنَّ عـلى غــــــدرِ الزمــانِ لطالــمـا
رقصـــــــت على جثــــثِ الأســــــــودِ كلابا
لا تحسبن برقصـــــها تعلوا على أســــيادها
تبقى الأســــودُ أسوداً والكـــــلابُ كِــــــلابا
عذراً أقصانا على تخاذلنا
عذراً حلب على تخاذلنا
عذراً بورما على تخاذلنا