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

Please Help Me To Do My Triggrs Homework


yara2005

Recommended Posts

please help me to do my TRIGGRS homework

When a student tries to register for a course, it is possible that the course is already full, in which case the student should be put in the waiting list for that course. When a student unregisters, it might be that some student is in the waiting list, and should then be registered for the course instead. Such things are typically handled via triggers. You should write two triggers that:
1. when a student tries to register for a course that is full, that student is added to the waiting list for the course.
2. when a student unregisters from a course (and was previously registered and not only in the waiting list), the first student (if any) in the waiting list should be registered for the course instead. Hint: write the triggers on the view you created for registrations instead of on the tables themselves.


i wrote all database schema,
--------------------------------------------
Department(dept_name, dept_abriv)
Programme(prog_name, prog_abriv)
Host(dept_name, prog_name)
pept_name --> Department.dept_name
prog_name --> Programme.prog_name

Branch(prog_name, bran_name)
prog_name --> Programm.prog_name

Recommend(prog_name, course_code)
prog_name --> Programme.prog_name
course_code --> Course.course_code
Mandatory(prog_name, course_code)
prog_name --> Programme.prog_name
course_code --> Course.course_code
Advice(prog_name, course_code)
prog_name --> Branch.(prog_name)
course_code --> Course.course_code
Compulsory(prog_name, course_code)
prog_name --> Branch.(prog_name)
course_code --> Course.course_code

Student(stu_id, prog_name, stu_name)
prog_name --> Branch.(prog_name)

Givenby(dept_name, course_code)
dept_name --> Department.dept_name
course_code --> Course.course_code

Course(course_code, course_name, credit)

Prerequistes(necessary, required)
necessary --> Course.course_code
required --> Course.course_code

classify(classification, course_code)
classification --> CourseCatogary.classification
course_code --> Course.course_code

Restrict_course(course_code, count_id)
course_code --> Course.course_code

Control(course_code, stu_id)
course_code --> Course.course_code

Graduate(course_code, stu_id, grade)
course_code --> Course.course_code
stu_id -->Student.stu_id

Register(course_code, stu_id, reg_date, priority_id)
course_code --> Course.course_code
stu_id -->Student.stu_id








Functional Dependencies:

dept_name -->dept_abriv
dept_name --> course_code
prog_name --> prog_abriv
prog_name --> bran_name
course_code --> course_name, credit
course_code --> classification
course_code --> prerequisite
student_id --> stu_name

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

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

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

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

×   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.

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

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

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