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

  • تسجيل الدخول عبر الفيس بوك تسجيل الدخول عبر تويتر Log In with LinkedIn Log In with Google      تسجيل دخول    
  • إنشاء حساب

صورة
- - - - -

Please Help Me To Do My Triggrs Homework


لا توجد ردود على هذا الموضوع

#1 yara2005

yara2005

    عضو

  • الأعضــاء
  • 1 مشاركة

تاريخ المشاركة 04 December 2007 - 03:14 AM

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