Need to get my head around this,
If I have 2 tables say, one called students and one called courses.
Now in the students table I have colums
1st name
Surname
Email
StudentIdcode(unique containing letters and numbers)
And in the courses on I have
Title
Tutor
Room
To make this a relational database I need to create primary keys?
Could in the students one I use the studentIDcode as the primary key as all instances will be unique, but it contains letters as well as numbers, in a book I have read it recommends that all primary keys are set to numbers.
Or would it be better to create a new coloum and call it studentId and set it to auto increment.
Like in the courses table I would create a new coloum called courseId and set that to auto increment?
To link these 2 tables I would then put the primary key of the students table in as a foreign key I the course table? Would I have to do the reverse to?
TIA
If I have 2 tables say, one called students and one called courses.
Now in the students table I have colums
1st name
Surname
StudentIdcode(unique containing letters and numbers)
And in the courses on I have
Title
Tutor
Room
To make this a relational database I need to create primary keys?
Could in the students one I use the studentIDcode as the primary key as all instances will be unique, but it contains letters as well as numbers, in a book I have read it recommends that all primary keys are set to numbers.
Or would it be better to create a new coloum and call it studentId and set it to auto increment.
Like in the courses table I would create a new coloum called courseId and set that to auto increment?
To link these 2 tables I would then put the primary key of the students table in as a foreign key I the course table? Would I have to do the reverse to?
TIA