Skip to content

SQLite: Selecting multiple counts from one column

I am running a query with SQLite and am relatively new to this. Glance of my dataset: I want group the results by Col A and then show 3 more columns (mild, moderate, high) and their counts — Here is what I’m looking for: I know how I can select just one of the columns (say, mild), but not sure

MySQL Group by with named columns from grouped data

I’m writing an application to record 10 pin bowling game results. I’ve done the submission bit but I’m stuck on displaying the results. Here is the structure: In the example above I am assuming each person played 3 games, however any number of games could be played. How can I get the data in…

Group by issues with multiple columns

I am having trouble making a query work. I am selecting 5 columns, using 3 to filter and 1 to count: I keep getting an error that the other columns have to be grouped by or aggregated. I’m trying to get the total students per class per professor. I’m only selecting the other columns so I can filte…

SQL Use column value in another column

What I’m trying to do is best described as mad-libs within SQL where there is one column that acts like a “template” that will end with all the values from the other columns inserted into the correct position. An example of what a sample table might look like is below. The final query should…