untypical problem



That problem comes from biosciences, here I present a simpler version.

The story is about beads.

* A single necklace is composed of a couple of strings with beads,
appx. 3-10 strings in one necklace
* A single string of beads is composed of several hundreds of beads of
different shapes and colours
* Beads in each string are ordered, strings in a given necklace are
ordered
* Beads can have many properties, eg. colour spots (number of the spots
and their colours can vary)

I have a SQL database for all my 20 000 neckaces, containing about 100
000 strings and 30 000 000 beads. My common queries are:
- which necklace have at least 1 string with no more than 200 yellow
beads
- which beads are green and cubic-like and have at least 5 brown spots

And here is the QUESTION:
Is it possible to ask my database a question concerning the order of
beads in a string? For example I'd like to ask about any combination
like regular expression:
RBY..R*RRR
which means redbead, then blue bead, then yellow, then any two beads
(meta sign >.<), then red again, then any number of any beads followed
by three red beads. Of course I need to use anny properties stored in
the database, not only the colours of beads (shape, number of spots,
colours of spots, etc.).

I can rebulit my database from scratch and adjust its structure, I am
just asking if it is possible with SQL

Thanks in advance
Dominik

.



Relevant Pages

  • Re: Friendly Question about Evolution
    ... No, cells don't write novels, send text messages or write "Dear Penthouse" letters, but they do communicate in a variety of ways. ... Give that string to someone and tell them to reproduce the string, replacing any beads of one colour they don't like with a bead identical to the adjacent one. ...
    (talk.origins)
  • Re: Did the Neanderthals have nets?
    ... in Africa (I think he ties reductions in robusticity with changes in our ... "It is true that the evidence for the first use of string technology goes ... Isn't there current variation in gracility? ... cache of beads made of ostrich eggshell, blanks, and shell fragments. ...
    (sci.anthropology.paleo)
  • Re: Another stringing question!!
    ... Soft Flex is more like Tiger Tail, it's stiffer, and you just string ... beads without a needle, use crimps to attach clasps. ... I like the Soft Touch ...
    (rec.crafts.beads)
  • Re: Did the Neanderthals have nets?
    ... a clear idea what plants were used in early string production, ... in Africa (I think he ties reductions in robusticity with changes in our ... Archaeological Science, Stanley Ambrose of the University of Illinois, ... cache of beads made of ostrich eggshell, blanks, and shell fragments. ...
    (sci.anthropology.paleo)
  • Re: Trapper / Gatherer culture?
    ... "The 75,000-year-old beads were found in the Blombos Cave on the southern ... string beads so it would be the size of the holes that mattered. ... guess you would be able to argue which came first - thin but strong string ...
    (sci.anthropology.paleo)