Question: I need to generate 5 random DNA sequences that are each about 20 bases and the table below is what it is supposed to look

I need to generate 5 random DNA sequences that are each about 20 bases and the table below is what it is supposed to look like. I have the following query but it only generates one DNA sequence and I am not sure how to get 5 rows of DNA sequences.

with t1 as (select chr(65) as s union select chr(67) union select chr(71) union select chr(84) ) , t2 as ( select s, row_number() over() as rn from t1) , t3 as ( select generate_series(1,$1) as i,round(random() * 4 + 0.5) as rn ) , t4 as ( select t2.s from t2 join t3 on (t2.rn=t3.rn))

Table 84: 5 records g dna

1 ACGGCTTATCGAACTGCGTC

2 TCAGGAATAGCCAAAGACCC

3 TTATGGTATCTAGGCTCTGG

4 GTTCGTTTACACGGTTTGAG

5 GCGGGGCATGGCACGATATA

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!