Today I found out you can have a primary key using two columns (tsql). The PK must be unique but both columns do not (the combo must be unique).
I thought that was v
Your thinking is good. I use multi-field primary keys frequently, simply because it makes my database design more logical, managable and readable. You can think of multi-field primary keys like having a unique name. For example:
Multi-Field Primary Keys:
(First ,Middle, Last)
Example Values:
('Michael', 'A.', 'Kline')
There can be many people with the 'First' name 'Michael' and/or the 'Middle' name 'A.' and/or the'Last' name 'Kline', but as far as your database is concerned, there can only be ONE 'Michael A. Kline'.
Usually, a multi-field primary key is a combination of other primary keys from other tables and the record contents describe content relavant to the specific key values. For example:
Table #1: Student Records (KEY: student_id)
Table #2: Course Records (KEY: course_id)
Table #3: Student Grades (KEY: student_id, course_id)
Hope this helps.