Questions tagged [sql]

SQL (Structured Query Language) is a special-purpose programming language designed for managing data held in a relational database management system (RDBMS).

Filter by
Sorted by
Tagged with
0
votes
0answers
5 views

Spatial Indexes [closed]

I have created two indexes one that stores 50 states and and that has 3.6 million geonames. I have noticed that the time it takes for my search queries to run gets faster when I use index that has a ...
2
votes
1answer
62 views

Machine Learning with Aggregated Frequency Data as Training

I am trying to build a Deep Learning model in which I have the following structure user feature binary_label 1 100 0 2 200 1 3 140 0 ... ... ... 6000000 188 1 But the problem is that when I try ...
1
vote
1answer
36 views

Approximate binomial dist in sql

What is the best way of approximating a binomial distribution, given I have the following functions available: normal_cdf ...
0
votes
0answers
18 views

Calculating expired vouchers, given a fixed window

Problem: I have time series data for vouchers being earned and redeemed. Vouchers only last for a 3 day fixed window including the day they were earnt eg. a voucher earnt on 1st Jan would be active ...
0
votes
0answers
16 views

Finding thresholds to optimize score sum for multiple variables

This problem involves finding value thresholds for 2 variables to optimize the highest score sum. I have a data table, with 3 columns. x, y, score. With over 1 million of rows. x y score 3.0 1.0 -5 ...
0
votes
0answers
93 views

How does LOESS work in STL Decomposition Algorithm?

I am trying to write a SQL program to calculate STL Decomposition of monthly time series data. In going through the algorithm in the original paper, inner loop step 2 has the detrended series grouped ...
1
vote
0answers
83 views

Single SQL query for case-control matching [closed]

I am running a case-control study for which I wish to choose 5 controls for each case, stratifying by age, sex, and date of measurement. Each case or control has a unique serial number and the ...
1
vote
0answers
16 views

How do we create a query in MS Access that gives us the cumulative difference? [closed]

I tried using this query: Running Total: CDbl(DSum("[Cost_Replacement]","Cost of Replacement","[RR_Pipe_ID]<=" & [RR_Pipe_ID] & "")) This above query ...
0
votes
1answer
36 views

SQL over Big data for datascience [closed]

I just started to learn data science, i am not able to decide if i should go with SQL or Big Data, which one would be more helpful for a data scientist. if anyone would help me to understand this then ...
1
vote
1answer
72 views

Newbie Data Analyst Questions

I have recently applied to a Job by a startup that wants to higher a data analyst. I have been going through the rounds and it seems like they want to hire me for the position. I have recently ...
4
votes
1answer
81 views

Electoral college simulation using SQL Server

As I'm sure will be apparent to most here, I'm not a statistician or a programmer, but one of my hobbies is politics. I've created a (very simple) USA electoral college simulation, seen below. The ...
0
votes
3answers
46 views

Guessing the gender of someone submitting a multiple choice questionnaire

If I have 100 people fill out a multiple choice questionnaire (containing 10 questions with 5 answer choices for each question) and the respondent writes their gender on their questionnaire, what is ...
1
vote
1answer
47 views

Weekly sales for different start dates automate report

I’m trying to develop a report with customer sales behaviour each time a new product is Launched. The columns in the report would be : sales in time t (the time product was launched ) , sales in time ...
1
vote
0answers
2k views

How to aggregate multiple Z-scores

Is there a way to aggregate multiple Z-scores to get a single Z-score that corresponds to the probability that no null hypotheses are rejected? Backstory: We have a tool that has some error E that ...
1
vote
2answers
4k views

Removing Double quote and adding Single Quote for string in R [closed]

I have a list which has to pass one of it's elements to a SQL Server Query, While in R list elements will be in double quotes, SQL Server will not accept double quotes in a query as pattern. So I need ...
1
vote
1answer
593 views

Comparing distribution of sample proportions to population proportion

I'm trying to find out whether there is a statistical method for comparing a distribution of sample proportions to a distribution of population proportions. For example if I have only two groups, A ...
1
vote
3answers
1k views

how to predict sales of an item changes based on a discount given to another item?

I am developing a system where the management of the supermarket can make decisions on past sales data. There I mainly want to focus on how to predict sales of an item changes based on a discount ...
1
vote
2answers
729 views

Ensemble model of simple univariate linear regression models

Calculating univariate linear regression and correlation is simple in SQL. It can be done like so: ...
1
vote
0answers
151 views

What algorithm could be used to recommend wine given past ratings [closed]

Description: given a user's history of 'likes', I would like to predict what product should I recommend to the user, based on past likes (content based). The idea is very similar to Pandora, except ...
0
votes
1answer
429 views

Automating SAS to calculate dates in various formats and store in macro variables

The background is I need to pull data from several sources and put it together, using SQL in SAS. And, I want to automate it as much as possible. So, for one, I want to have a small number of inputs ...
2
votes
0answers
199 views

Calculate value needed to reach target by the end of a year [closed]

I have a set of values (scores to a particular KPI), these are reported monthly. I need to calculate what I'd have to score every month from now until the end of the year to reach that target. I'm ...
2
votes
0answers
1k views

How can I (numerically) approximate the quantile in a beta distribution in SQL? [closed]

I wrote some code in SAS that among other things, used the BETAINV function (or BETA.INV as it's called in Microsoft Excel) to calculate the quantile in a beta distribution corresponding to a random ...
0
votes
1answer
929 views

How to apply an R prediction model to very big data from SQL database in parallel.

I dont need to load the entire dataset into memory. In fact I only need 1 row at a time to apply a trained model, get the predicted response and put that response somewhere, possibly back into another ...
1
vote
1answer
175 views

Automatically classifying user activity/sessions on a website?

I have a large body of records pertaining to user activity on a website. What I want to do is some sort of classification on each user as they navigate my website. Every algorithm I found so far uses ...
0
votes
1answer
1k views

Difference between prediction in R and SQL

I'm working on a prediction model for a continuous variable (amount of medicine injected) .I use R for modeling.My project flow is to multiply the prediction of a glm (logistic regression) model that ...
1
vote
0answers
1k views

generate frequency distribution from database

In a MySQL database there's a table with a single numeric value column. I want to plot the distribution of these values as a bar chart/histogram with the following ...
0
votes
1answer
777 views

How to translate R to SQL for a Cox Proportional Hazards model?

I have built a cox model in R using the coxph function in the survival package, and now I need to replicate the model in SQL for scoring. From my understanding, the model has the form described on ...
0
votes
1answer
116 views

Freeware similar to MS Access for SQL-less data mining, querying and reporting [closed]

I am looking for freeware similar to MS Access for data mining, querying and reporting without really writing SQL (which I know very well but sometimes I feel lazy and would rather just drag and drop)....
0
votes
1answer
34 views

Dealing with a variable amount of entries for a given attribute

I want to analyze a .csv file with the results of a customer survey. One of the questions is: "Tell us the top 3 reasons you chose us.". The answers are short paragraphs of text listing a ranging ...
2
votes
2answers
4k views

Split dataset randomly

I have a database with 500 records. I want to split these records to 75% and 25% *randomly*in order to use the different datasets for training and testing to machine learning algorithms. Does anyone ...
1
vote
1answer
234 views

When should I update a recommendation engine?

[I asked this on StackOverflow and was told it would be a better fit here] I am including a basic recommendation engine in a very small project for my final exam. I understand the code and the math ...
2
votes
2answers
2k views

Does anybody use star-schema databases to collect and organize their data?

I've been reading about the star schema (or dimensional) database structure, which puts all measurements main in 'facts' table, and all context for those measurements in 'dimension' table linked to ...
1
vote
0answers
109 views

A/B/C testing evaluation over time ans across groups

I'm needing to validate an inherited testing project correct use of confidence testing. Direct mail creatives are being evaluated at month end over a 90 day campaign cycle for several unique customer ...
1
vote
2answers
613 views

Grouping a "other" group with R and ggplot2

I'm trying to figure out, how to best deal with an "other" group or how to create one. I'm using R and ggplot2. Data As an example: I'm analyzing the german Bundestagswahl (general election, ...
1
vote
1answer
1k views

How can I determine which columns best correlate with target column in a SQL Server Table?

I have a table with a couple hundred columns and a few hundred thousand rows and want to determine which combination of 5-10 columns best correlate with a target column. I have SQL Server and Excel ...
18
votes
2answers
97k views

Calculating the 95th percentile: Comparing normal distribution, R Quantile, and Excel approaches

I was trying to compute the 95th percentile on the following dataset. I came across a few online references of doing it. Approach 1: Based on sample data The first one tells me to obtain the ...
4
votes
2answers
2k views

Conducting correlation and one way ANOVA using data from a PostgreSQL database

I am trying to discern the best way to calculate a correlation and perform a one-way ANOVA on data I am taking from a PostgreSQL database. What tools should I use? Can I do this using the SQL ...
7
votes
8answers
204k views

How do I group a list of numeric values into ranges?

I do have a big list of numeric values (including duplicates) and I do want to group them into ranges in order to see if how do they distribute. Let's say there are 1000 values ranging from 0 to 2....