1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Relational Algebra

Discussion in 'Databases' started by justin-0312, Jun 13, 2016.

  1. #1
    Hi, I need some help with relational algebra.

    The schema for this database is as follows: (note that primary keys are shown underlined, foreign keys in bold).
    STUDENT (StudentNo, FamilyName, FirstName, StudentAddress, StudentEmail)
    TUTORIAL (TutorialNo, DayAndTime, Lab)
    TUTOR (StaffNo, TutorName, TutorEmail)
    CLASS (StaffNo, TutorialNo)
    ATTENDS (StudentNo, TutorialNo)

    How do I get the relational algebra for the below 2 questions as it's too complex for me:
    1. List the student number of any students who have signed up to attend both the Monday 4.30 and Monday 5.30 tutorial.
    2. List the student number of any students who have signed up to attend any or all of the Wednesday tutorials (they are at 9.30, 10.30 and 11.30)

    I have tried the below question and need some advice if it is correctly done.
    3. List all the students who aren’t in any tutorial yet.
    STUDENT * STUDENT.StudentNo = ATTENDS.StudentNo ATTENDS →T1
    π StudentNo, concat(FamilyName, FirstName), StudentEmail (σ TutorialNo=NULL (T1))
     
    justin-0312, Jun 13, 2016 IP