Primary key ,foreign key , Index(primary,secondary,clustering) !!!!!!

king99

king99

@king99-bh2V1z Oct 22, 2024
😔😔😔😔😔😔😔😔😔😔😔😔😔😔😔😔

I have following tables ,Please can any one suggest primary key and foreign key for the tables and suitable Index scheme to be used on attributes !!

Student(Studentno,studname,mode,)
Course(courseno,coursename,course decsp,....)
Module(Moduleno,modulename,moduledescp,....)
Courseregistration(courseno,studentno,year,status,....)
moduleregistration(moduleno,studno,year,status)

Table :Moduleregistration table depends on status field "sitting" and "resit"
Table :Course registration "status" field has 3 values depending upon whether student is "attending" course,"suspended" studies,"completed" course

So please suggest suitable primary and foreign keys for each table and which Index and which attribute I should select to Index (also mention type of index)

Database Experts thanks for the earlier reply related to Index but this question is very tricky and different than previous question in which clustering index was preferred, please explain why we use specific index than others as in last question(still on forum to be answered further in detail) that I put in forum it was very hard to understand why we did not consider secondary index or primary in the answer (ie what are their limitations) . Thanks!!

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • slashfear

    slashfear

    @slashfear-tSWzpz Apr 25, 2011

    Hey king,

    The relationship will be kinda of similar to the same what we discussed already in your previous question (bank database tables) but any way here is the relationship:

    studentno column from student table will be primary key
    courseno column from course table will be primary key
    moduleno column from module table will be primary key

    courseno column from courseregistration table will reffer to courseno column in course table, so forgien key
    studentno column from courseregistration table will reffer to studentno column in student table,so foriegn key
    studentno column from moduleregistration table will reffer to studentno column in student table, so forgien key
    moduleno column from moduleregistration table will reffer to moduleno column in the module table, so foriegn key



    -Arvind
  • slashfear

    slashfear

    @slashfear-tSWzpz Apr 25, 2011

    Hey king I have a serious doubt are these your assignment works?


    -Arvind
  • king99

    king99

    @king99-bh2V1z Apr 26, 2011

    Nopes , to be frank i got interested in database thing and while going through index thing poped out so I was looking at various scenarios, but this things makes the situation more confusing where I can ask for the help of database experts like you @slashfear , I am just trying to learn very basics which might be very easy for you but believe for beginners its appears more confusing , Thanks for replies , your replies indeed inspires to move forward in world of database !!
  • slashfear

    slashfear

    @slashfear-tSWzpz Apr 27, 2011

    Hey king sorry I thought it was your assignment man, I will be here to solve your query any time.....😀