We can start with
This table has a broken leg.
The complete subject is "this table", the complete verb is "has", and the complete direct object is "a broken leg". We can also identify the keywords of each phrase. The simple subject is "table", the simple verb is "has", and the simple direct object is "leg".
Assuming we can identify the subject of that statement, we should be able to find the subject of this question:
Which has a broken leg?
The direct object is still "a broken leg". The verb is still "has". The only thing that has changed is the subject. The subject, both complete and simple, is now "which".
That's true when we use the clause as an independent question, and it's still true when we use the clause as an adjectival subordinate:
The table which has a broken leg is Sam's.
This is a complex sentence. It has a clause inside another clause. The clause on the outside, called the matrix clause or main clause, has its own subject and verb.
In the matrix clause, the complete subject is "the table which has a broken leg". The simple subject is "table". The verb of the matrix clause, both complete and simple, is "is". The matrix clause also has a complement, which is "Sam's".
Even though we do it all the time, it doesn't make much sense to talk about the subject of a sentence. Sentences don't have subjects. Clauses have subjects. Sentences have clauses. We might say that "table" is the subject of the sentence, but we really mean that it's the simple subject of the main clause of the sentence.
The clause on the inside, called a subordinate clause or a dependent clause, still has its own subject and predicate. The word "which" is still the subject of its own clause, in exactly the same way that "which" is the subject of the question above.
The phrase "with a broken leg" doesn't have a subject or a predicate. It has the preposition "with" and the object "a broken leg". The simple object (if we care about that) is the noun "leg".