CREATE TABLE {{ study_prefix }}{{ table_prefix }}search_rules_descriptions AS
SELECT
    e.tty1,
    e.rela,
    e.tty2,
    e.rule,
    e.include,
    u1.tty_str AS tty1_str,
    u2.tty_str AS tty2_str
FROM
    umls.tty_description AS u1,
    umls.tty_description AS u2,
    {{ study_prefix }}{{ table_prefix }}search_rules AS e
WHERE
    u1.tty = e.tty1
    AND u2.tty = e.tty2
