You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
select bacteria_name from Bacteria; -- select only bacteria_name column
2. Select all samples collected in the year 2019
select*from Sample where year_of_collection =2019; -- select all columns from Sample table
3. Select all genes associated with 'Escherichia coli'
select Gene.*from Gene -- select all columns from Gene tablejoin Bacteria onGene.bacteria_id=Bacteria.bacteria_id-- join Gene table with Bacteria tablewhereBacteria.bacteria_name='Escherichia coli'; -- filter by bacteria name
4. Select all sequencing methods used
select distinct sequencing_method from Sequencing; -- select distinct sequencing methods from Sequencing table
5. Select all antibiotic resistances for 'Staphylococcus aureus'
select AntibioticResistance.*from AntibioticResistance -- select all columns from AntibioticResistance tablejoin Bacteria onAntibioticResistance.bacteria_id=Bacteria.bacteria_id-- join AntibioticResistance table with Bacteria tablewhereBacteria.bacteria_name='Staphylococcus aureus'; -- filter by bacteria name
6. Select all plasmids with high copy number
select*from Plasmid where plasmid_copy_number ='high'; -- select all columns from Plasmid table
7. Select all proteins with length greater than 500 amino acids
select*from Protein where protein_length >500; -- select all columns from Protein table
8. Select all pathways related to 'DNA replication'
select*from Pathway where pathway_name ='DNA replication'; -- select all columns from Pathway table
9. Select all bacteria collected from 'USA'
select Bacteria.*from Bacteria -- select all columns from Bacteria tablejoin Sample onBacteria.bacteria_id=Sample.bacteria_id-- join Bacteria table with Sample tablewhereSample.country='USA'; -- filter by country
10. Select all bacteria with genome size greater than 5,000,000 base pairs
select Bacteria.*from Bacteria -- select all columns from Bacteria tablejoin Sequencing onBacteria.bacteria_id=Sequencing.bacteria_id-- join Bacteria table with Sequencing tablewhereSequencing.genome_size>5000000; -- filter by genome size
11. Select all samples of type 'clinical'
select*from Sample where sample_type ='clinical'; -- select all columns from Sample table
12. Select all genes with accession ID starting with 'NC_00'
select*from Gene where accession_id like'NC_00%'; -- select all columns from Gene table
13. Select all proteins with unknown function
select*from Protein where protein_function ='unknown'; -- select all columns from Protein table
14. Select all bacteria with resistance to 'ampicillin'
select Bacteria.*from Bacteria -- select all columns from Bacteria tablejoin AntibioticResistance onBacteria.bacteria_id=AntibioticResistance.bacteria_id-- join Bacteria table with AntibioticResistance tablewhereAntibioticResistance.antibiotic_name='ampicillin'; -- filter by antibiotic name
15. Select all samples from 'human' host
select*from Sample where host ='human'; -- select all columns from Sample table
16. Select all sequencing records published in 2019
select*from Sequencing where year_of_publication =2019; -- select all columns from Sequencing table
17. Select all plasmids with size less than 3000 base pairs
select*from Plasmid where plasmid_size <3000; -- select all columns from Plasmid table
18. Select all pathways with description containing 'synthesis'
select*from Pathway where pathway_description like'%synthesis%'; -- select all columns from Pathway table
19. Select all bacteria with at least one associated gene
20. Select all samples from 'clinical' type collected in 'USA'
select*from Sample where sample_type ='clinical'and country ='USA'; -- select all columns from Sample table
21. Select all bacteria names and their associated gene names
selectBacteria.bacteria_name, Gene.gene_namefrom Bacteria -- select bacteria_name column from Bacteria tablejoin Gene onBacteria.bacteria_id=Gene.bacteria_id; -- join Bacteria table with Gene table
22. Select all samples collected from 'human' host in the year 2020
select*from Sample where host ='human'and year_of_collection =2020; -- select all columns from Sample table
23. Select all sequencing records with 'high' genome quality and 'complete' genome completeness
select*from Sequencing where genome_quality ='high'and genome_comepleteness ='complete'; -- select all columns from Sequencing table
24. Select all antibiotic resistances with minimum inhibitory concentration greater than 16
select*from AntibioticResistance where minimum_inhibitory_concentration >16; -- select all columns from AntibioticResistance table
25. Select all plasmids associated with 'Escherichia coli'
select Plasmid.*from Plasmid -- select all columns from Plasmid tablejoin Bacteria onPlasmid.bacteria_id=Bacteria.bacteria_id-- join Plasmid table with Bacteria tablewhereBacteria.bacteria_name='Escherichia coli'; -- filter by bacteria name
26. Select all proteins associated with 'Staphylococcus aureus'
select Protein.*from Protein -- select all columns from Protein tablejoin Bacteria onProtein.bacteria_id=Bacteria.bacteria_id-- join Protein table with Bacteria tablewhereBacteria.bacteria_name='Staphylococcus aureus'; -- filter by bacteria name
27. Select all pathways associated with 'Bacillus subtilis'
select Pathway.*from Pathway -- select all columns from Pathway tablejoin Bacteria onPathway.bacteria_id=Bacteria.bacteria_id-- join Pathway table with Bacteria tablewhereBacteria.bacteria_name='Bacillus subtilis'; -- filter by bacteria name
28. Select all bacteria names and their associated sequencing methods
selectBacteria.bacteria_name, Sequencing.sequencing_methodfrom Bacteria -- select bacteria_name column from Bacteria tablejoin Sequencing onBacteria.bacteria_id=Sequencing.bacteria_id; -- join Bacteria table with Sequencing table
29. Select all samples collected from 'soil' source
select*from Sample where source ='soil'; -- select all columns from Sample table
30. Select all genes with resistance to 'methicillin'
select Gene.*from Gene -- select all columns from Gene tablejoin AntibioticResistance onGene.resistance_id=AntibioticResistance.resistance_id-- join Gene table with AntibioticResistance tablewhereAntibioticResistance.antibiotic_name='methicillin'; -- filter by antibiotic name
31. Select all proteins with length less than 500 amino acids
select*from Protein where protein_length <500; -- select all columns from Protein table
32. Select all bacteria names and their associated plasmid names
selectBacteria.bacteria_name, Plasmid.plasmid_namefrom Bacteria -- select bacteria_name column from Bacteria tablejoin Plasmid onBacteria.bacteria_id=Plasmid.bacteria_id; -- join Bacteria table with Plasmid table
33. Select all samples collected in 'UK' or 'France'
select*from Sample where country in ('UK', 'France'); -- select all columns from Sample table
34. Select all genes associated with 'Bacillus subtilis' and their accession IDs
selectGene.gene_name, Gene.accession_idfrom Gene -- select gene_name and accession_id columns from Gene tablejoin Bacteria onGene.bacteria_id=Bacteria.bacteria_id-- join Gene table with Bacteria tablewhereBacteria.bacteria_name='Bacillus subtilis'; -- filter by bacteria name
35. Select all sequencing records with 'medium' genome quality
select*from Sequencing where genome_quality ='medium'; -- select all columns from Sequencing table
36. Select all antibiotic resistances with resistance mechanism 'beta-lactamase'
select*from AntibioticResistance where resistance_mechanism ='beta-lactamase'; -- select all columns from AntibioticResistance table
37. Select all plasmids with 'medium' copy number and size greater than 2000 base pairs
select*from Plasmid where plasmid_copy_number ='medium'and plasmid_size >2000; -- select all columns from Plasmid table
38. Select all proteins with function containing 'synthesis'
select*from Protein where protein_function like'%synthesis%'; -- select all columns from Protein table
39. Select all pathways associated with 'Pseudomonas aeruginosa'
select Pathway.*from Pathway -- select all columns from Pathway tablejoin Bacteria onPathway.bacteria_id=Bacteria.bacteria_id-- join Pathway table with Bacteria tablewhereBacteria.bacteria_name='Pseudomonas aeruginosa'; -- filter by bacteria name
40. Select all bacteria names and their associated antibiotic names
selectBacteria.bacteria_name, AntibioticResistance.antibiotic_namefrom Bacteria -- select bacteria_name column from Bacteria tablejoin AntibioticResistance onBacteria.bacteria_id=AntibioticResistance.bacteria_id; -- join Bacteria table with AntibioticResistance table
41. Select all samples collected from 'plant' host
select*from Sample where host ='plant'; -- select all columns from Sample table
42. Select the average genome size for each sequencing method
select sequencing_method, avg(genome_size) as average_genome_size from Sequencing
group by sequencing_method;
43. Select the number of antibiotic resistances for each bacteria
selectBacteria.bacteria_name, count(AntibioticResistance.resistance_id) as resistance_count from Bacteria
left join AntibioticResistance onBacteria.bacteria_id=AntibioticResistance.bacteria_idgroup byBacteria.bacteria_name;
44. Select the top 3 bacteria with the highest number of associated genes
selectBacteria.bacteria_name, count(Gene.gene_id) as gene_count from Bacteria
join Gene onBacteria.bacteria_id=Gene.bacteria_idgroup byBacteria.bacteria_nameorder by gene_count desclimit3;
45. Select the bacteria with the highest minimum inhibitory concentration for 'ampicillin'
selectBacteria.bacteria_name, max(AntibioticResistance.minimum_inhibitory_concentration) as max_mic from Bacteria
join AntibioticResistance onBacteria.bacteria_id=AntibioticResistance.bacteria_idwhereAntibioticResistance.antibiotic_name='ampicillin'group byBacteria.bacteria_nameorder by max_mic desclimit1;
46. Select the total number of samples collected each year
select year_of_collection, count(sample_id) as total_samples from Sample
group by year_of_collection;
47. Select the bacteria with the most diverse sample sources
selectBacteria.bacteria_name, count(distinct Sample.source) as source_count from Bacteria
join Sample onBacteria.bacteria_id=Sample.bacteria_idgroup byBacteria.bacteria_nameorder by source_count desc;
48. Select the average protein length for each bacteria
selectBacteria.bacteria_name, avg(Protein.protein_length) as average_protein_length from Bacteria
join Protein onBacteria.bacteria_id=Protein.bacteria_idgroup byBacteria.bacteria_name;
49. Select the bacteria with the highest number of associated pathways
selectBacteria.bacteria_name, count(Pathway.pathway_id) as pathway_count from Bacteria
join Pathway onBacteria.bacteria_id=Pathway.bacteria_idgroup byBacteria.bacteria_nameorder by pathway_count desclimit1;
50. Select the bacteria with the highest genome quality and completeness
51. Select the bacteria with the most antibiotic resistances
selectBacteria.bacteria_name, count(AntibioticResistance.resistance_id) as resistance_count from Bacteria
join AntibioticResistance onBacteria.bacteria_id=AntibioticResistance.bacteria_idgroup byBacteria.bacteria_nameorder by resistance_count desclimit1;
52. Select the bacteria with the longest average protein length
selectBacteria.bacteria_name, avg(Protein.protein_length) as average_protein_length from Bacteria
join Protein onBacteria.bacteria_id=Protein.bacteria_idgroup byBacteria.bacteria_nameorder by average_protein_length desclimit1;
53. Select the bacteria with the highest number of clinical samples
selectBacteria.bacteria_name, count(Sample.sample_id) as clinical_sample_count from Bacteria
join Sample onBacteria.bacteria_id=Sample.bacteria_idwhereSample.sample_type='clinical'group byBacteria.bacteria_nameorder by clinical_sample_count desclimit1;
54. Select the bacteria with the most diverse antibiotic resistance mechanisms
selectBacteria.bacteria_name, count(distinct AntibioticResistance.resistance_mechanism) as mechanism_count from Bacteria
join AntibioticResistance onBacteria.bacteria_id=AntibioticResistance.bacteria_idgroup byBacteria.bacteria_nameorder by mechanism_count desclimit1;
55. Select the bacteria with the highest number of associated plasmids
selectBacteria.bacteria_name, count(Plasmid.plasmid_id) as plasmid_count from Bacteria
join Plasmid onBacteria.bacteria_id=Plasmid.bacteria_idgroup byBacteria.bacteria_nameorder by plasmid_count desclimit1;
56. Select the bacteria with the highest number of associated proteins
selectBacteria.bacteria_name, count(Protein.protein_id) as protein_count from Bacteria
join Protein onBacteria.bacteria_id=Protein.bacteria_idgroup byBacteria.bacteria_nameorder by protein_count desclimit1;
57. Select the bacteria with the highest number of associated genes with 'NC_' accession IDs
selectBacteria.bacteria_name, count(Gene.gene_id) as gene_count from Bacteria
join Gene onBacteria.bacteria_id=Gene.bacteria_idwhereGene.accession_idlike'NC_%'group byBacteria.bacteria_nameorder by gene_count desclimit1;
58. Select the bacteria with the highest number of associated sequencing records
selectBacteria.bacteria_name, count(Sequencing.sequencing_id) as sequencing_count from Bacteria
join Sequencing onBacteria.bacteria_id=Sequencing.bacteria_idgroup byBacteria.bacteria_nameorder by sequencing_count desclimit1;
59. Select the bacteria with the highest number of associated pathways containing 'biosynthesis'
selectBacteria.bacteria_name, count(Pathway.pathway_id) as pathway_count from Bacteria
join Pathway onBacteria.bacteria_id=Pathway.bacteria_idwherePathway.pathway_descriptionlike'%biosynthesis%'group byBacteria.bacteria_nameorder by pathway_count desclimit1;
60. Select the bacteria with the highest number of associated samples from 'human' host
selectBacteria.bacteria_name, count(Sample.sample_id) as sample_count from Bacteria
join Sample onBacteria.bacteria_id=Sample.bacteria_idwhereSample.host='human'group byBacteria.bacteria_nameorder by sample_count desclimit1;
61. Select all bacteria names and their associated gene names and accession IDs