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

๐Ÿ˜”๐Ÿ˜”๐Ÿ˜”๐Ÿ˜”๐Ÿ˜”๐Ÿ˜”๐Ÿ˜”๐Ÿ˜”๐Ÿ˜”๐Ÿ˜”๐Ÿ˜”๐Ÿ˜”๐Ÿ˜”๐Ÿ˜”๐Ÿ˜”๐Ÿ˜”

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

  • slashfear
    slashfear
    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
    Hey king I have a serious doubt are these your assignment works?


    -Arvind
  • king99
    king99
    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
    Hey king sorry I thought it was your assignment man, I will be here to solve your query any time.....๐Ÿ˜€

You are reading an archived discussion.

Related Posts

why the insulated wires used in homes or elsewhere are twisted with each other and are not parallel...........
Two cylinders are press fitted together to form a composite closed cylinder .The outter cylinder is made of steel E=200Gpa,poissions ratio=0.29 and yeild strength 1990mpa and inner cylinder is brittle...
Hello Crazy Engineers,this is Manu from Bangalore. My passion is automobiles[Motorcycles] and am actively involved in most of the biking forums.Found CE when i was goggling. Name: Manu bhat Engineering...
[video=youtube;JOumVHrHDEM]https://www.youtube.com/watch?v=JOumVHrHDEM&feature=player_embedded[/video] It's pretty simple. Open that web file into Google Docs Viewer and then hit Ctrl + P to print it as a PDF. ๐Ÿ˜€
I just read it on a blog and I think this is a good debate topic.๐Ÿ˜’ CEans, do you believe that modern technology destroyed the soul of humanity?? why or...