**This question is something that a lot of people learning bioinformatics and new to DNA data analysis are struggling with:**

Lets say I have 20 tables with the same column headings. Each table represents a patient sample and each row represents a locus (site) which has mutated in that sample. Each site is uniquely identified by two columns together - chromosome number and base number (eg. 1 and 43535, 1 and 33456, 1 and 3454353). There are several columns which give different characteristics of each mutation including a column called Gene which gives the gene at that site.. Multiple sites can be mutated in a gene - meaning the Gene column can have the same value multiple times in one table.

I want to **query all these tables at the same time** by lets say Gene. I input a value from the Gene column and I want as output the names of all the tables (samples) in which the gene name is present in the Gene column and also the entire line(s) (preferably) for each sample so that I can compare the characteristics of the mutation in that gene across multiple samples on one output page.

I also want to input a number say 4 and want as output a list of genes which have mutated in at least 4 of 20 patients (list of genes whose names appear in the Gene column in atleast 4 of 20 tables).

What is the "easiest way" to do this? What is the "best way" assuming I want to make more flexible queries, besides these two?

I am a MD, do not have any particular software expertise but I am willing to put in the necessary time to build this query system. A few lines of code won't put me off..

Eg data:

```
Func    Gene    ExonicFunc                 Chr  Start       End        Ref  Obs
exonic  ACTRT2  nonsynonymous SNV           1   2939346     2939346     G   A
exonic  EIF4G3  nonsynonymous SNV           1   21226201    21226201    G   A
exonic  CSMD2   nonsynonymous SNV           1   34123714    34123714    C   T

```

This is just a third of the columns. Multiple columns were removed to fit the page size here...

Thank you.