Can a sentence only contain a noun and a relative clause?

Yes and no.

Strictly speaking, what your example contains aren't sentences. They're fragments. But does that make them ungrammatical? No.

Since people often don't speak in complete sentences, that likewise can be reflected in writing. Also, for writers, styling fragments as sentences isn't uncommon and can be a quite effective means to conveying an idea, just as long as the meaning is still clear to the reader.

Example 1:

"For sale: baby shoes, never worn"

The above is a famous short story written by Ernest Hemingway, famous for being the shortest story he, or probably anyone to that point, had ever written.

This six-word short story of Hemmingway's contains not one complete sentence, not even a period at the end. Despite that, it more than expresses a complete thought. It evokes an entire story: a tragic tale whose first words are an epilogue the reader has yet to fathom, that then flashes back to a story that starts with expectant hope for a child—a baby—coming to light, that climaxes with that hope crushed and unrealized by the loss of that baby, and that concludes back in those first words, in that epilogue that only now becomes clear and the reader only now fathoms, the tale not ending with the loss of a baby who would never wear those baby shoes but ending back at the very beginning with trying to now move on from losing that baby by letting those baby shoes go.

All that, and not a single complete sentence. Just six words.

Example 2:

"Last year. An awful year. The absolute worst."

That would be readily understood, yet despite it being written as three sentences, there isn't a verb to found anywhere in them. It could be written, "Last year— it was an awful year, the absolute worst." That would be a complete sentence. While it would convey the same information, it wouldn't do so with the same effect. It would lack the punch of the above.

Example 3:

"Your nose. Not your business. Your nose. Not your business."

The above is something Judge Judy says quite often. She puts a significant amount of space after saying, "Your nose," just letting it hang out there. Then she says, "Not your business." Then she repeats, "Your nose," putting emphasis on "nose," often even putting her finger on the side of her nose when she says "nose." Then, again after a long, dramatic pause, she swings her finger from her nose and shakes it high in the air in a fashion that means no as she reiterates, "Not your business," putting emphasis on "not."

Like in Example 2, you'll notice there isn't a verb to be found anywhere, so they're not complete sentences. Nevertheless, they convey a clear and complete meaning. Now, she could say, "You're sticking your nose into somebody else's business." That would be a complete sentence and would give the gist. She could even say it twice. It wouldn't come across with the same effect, though. Likewise, it wouldn't come across with the same effect in writing, either.

Example 4:

Shut. Your. Mouth.

The above breaks the sentence "Shut your mouth" into three fragments. When something is written this way, it represents when a speaker very seriously, sternly, or angrily says each word, but instead of yelling, the speaker says them at a normal volume, in a tone so even as to be or nearly be monotone, and puts a long pause between each word to convey their seriousness, anger, or sternness— or in lieu of long pauses, like in order to prevent being interrupted, the speaker sometimes punctuates each word by clapping their hands once as they say each word.

Now, one could write, "Shut your mouth." One could also instead write, "Shut your mouth!" However, like in the previous two examples above, while the gist would be the same, neither of those would come across with the same effect.

Caveat:

While such artistic license may be taken in writing, even often is, it's next-level. It's not for novices.

When teaching English to children and ESL students, we first teach them to write in complete sentences. We have them spend a significant amount of time practicing it. Complete sentences coalesce a complete thought every time, so it's the clearest path to effective communication.

Only after having mastered writing complete sentences to convey complete thoughts does one aptly move on to maybe employing such fragmented devices. That's because only then has one developed and honed the necessary skills to ensure that fragments or a fragment written, while technically not forming any complete sentence, nevertheless does convey a complete thought.