I'm working with a SQL database (still fairly new to it) and have attempted to create the "one-to-either" or sub-table supertable relationship. I'm using C# and LINQ-to-Entities. 

As a common example I have 3 tables.

Person:
PersonId, Age, p1, p2, ..., pn

Student:
PersonId, Grade, GPA, s1, s2, ...., sn

Teacher:
PersonId, PrimarySubject, YearsAtSchool, IsCoach, ....


What I want to be able to do is query based on Person, and then get the relevant subtype data as well. I have the relevatn TypeId table to ensure the relationships. 

Say if I queried a Person and they were a student, then I would like to get:

QueriedResult
PersonId, Age, p1, ..., pn, Grade, GPA, s1, ..., Sn 


Unfortunately, it is not feasibe to do select new {p.PersonID, etc} as there are too many subtables and too many elements in my case.

Whenever I use my code I get an IEnumerable of two seperate tables. The sample code I provide does return nulls when there is no associated student, and a table in the second column if the person is a student.

var query = (from p in Persons.AsEnumerable()
join s in Students on p.PersonId equals s.PersonId
select new {p, s});


I've heard alot of talk about 'flattening' though all the suggested methods seem to require p &amp; s to be of the same table type.

Thanks,


Question: Can I change my loan term from 60 to 36 months?
Answer: Just call your credit union and ask if they will let you refinance at the lower rate. If they won't, then just increase your payment every month so that your car is paid off early (in 36 months instead of 60). You won't get the lower rate, but since your loan will be paid early, you'll be saving interest anyway.