I'm trying to define tables for logical design in database course and I only need to write headers of columns, but the problem is that depending on whether one or multiple columns are primary keys or foreign keys, there must be one or multiple regular or dashed lines under headers.
(It doesn't matter if the table is defined with a 1xN table (like the first picture) or in one regular line (like the second picture). Only the underline(s) is important.
I'm familiar with the \underline command and basic tables in Tex, but I don't know how multiple lines can be drawn under multiple words. For example, if we have three headers a, b and c, and there is a line under a, b and another under b, c, I can's see how \underline can be used.
Any help would be appreciated.