All Questions
Tagged with statistics sql
260
questions
0
votes
1
answer
88
views
Is there a simplified SQL query to return the number and percentage of missing values of a table ? (BigQuery)
The BigQuery earthquake public dataset has 47 columns most of each have missing values. I need an output showing a summary with column_name, total_entries, non_missing_entries & percentage_missing ...
0
votes
0
answers
33
views
problem with using SQL CTE function inside prestashop
I have a problem with using WITH function (CTE) in prestashop 1.7.6.9 to make additional features in stats.
My original PHP code (works fine):
$this->query = 'SELECT SQL_CALC_FOUND_ROWS p.reference,...
0
votes
2
answers
385
views
Best way to calculate mean from database with too many outliers (0s) in price variable
At my job, I was asked to calculate the mean for prices in specific articles from the company's database. Issue is that many values in database are 0, so simply calculating the mean may pull the ...
0
votes
0
answers
126
views
Clickhouse aggregate page view user flow by sessions
The clickhouse database table looks somewhat like this:
| Timestamp | SessionId | PagePath | ReferrerPath | ... |
My desired outcome would be something along these lines in order to visualize the page ...
0
votes
1
answer
166
views
Is there an easier way to work with SQL data in a Pandas DataFrame?
Suppose I am working with a large database showing details on books from an entire library. I want to get various statistics of the collection. For example, in this code, I am defining a method to get ...
0
votes
1
answer
82
views
Error with Named Arguments when programming Odbc
I'm writing a Stata program that will, hopefully, simplify my queries to a database. I wrote a really simple program that uses the `SQL_Syntax' named argument to add SQL code; however, every time I ...
-2
votes
2
answers
52
views
Combining two SELECT resultant tables
Background: I have a number of sources that reference a relationship. I have calculated the percentage of the sources in which any particular relationship is found (since multiple sources sometimes ...
0
votes
0
answers
15
views
Reducing a resultant table to only values that are less than 10% [duplicate]
I am trying to get a metric of my database of 'relationships' that are found in less than 10% of 'sources'. I have successfully created a table that has every relationship, as well as the ...
0
votes
0
answers
24
views
I'm trying to get the same result from a Union and a Join for Babe Ruth's Career WAR
I have two tables of baseball data. One has batter WAR and the other pitching WAR. I can get the result I'm looking for (in this case Babe Ruth's pitching and batting WAR) in the Union statement but ...
2
votes
1
answer
32
views
Segmenting customers by email opening days preference?
I have a dataset like this that shows for thousands of our customers, their email opens data by day of week. We are trying to segment our customers by certain preferences / patterns that we can find ...
1
vote
1
answer
2k
views
Determine median and quartiles using columnar data in Snowflake
I am looking for a way to calculate the median, first and third quartiles from a data set based on certain parameters. I also would like to use these values for future coding.
Here is what the data ...
0
votes
2
answers
88
views
How to calculate the Z-Score for a specific dimension in SQL?
Good afternoon! I am trying to write a query using SQL in Teradata to show me the Z - score for each year in my data. I thought this should be a pretty simple problem, but I keep getting unexpected ...
0
votes
0
answers
30
views
Is there a way to query usage statistics in one go?
SQL flavor: PostgreSQL
Data table (tpm_data)
(Actual table uses JSONB fields and those have the from, to fields, however it is not relevant to the question)
Table represent a user usage of some kind (...
0
votes
0
answers
66
views
How to copy CSV to TABLE if CSV contains too many columns to pre-create table? (Postgress)
I want to copy a U.S. Census CSV to a table, however, the CSV header contains well over 200+ columns. How can I tell Postgress SQL to create a table from the CSV using the header as column names?
0
votes
1
answer
35
views
How to replace a no with a word using SQL or Excel in a database or csv file
I have csv file where no represent a word for example there is one column name casualty class in which no's are 1,2,3 i have to replace 1 with fatal, 2 with serious, and 3 with slight. And there are ...