Questions tagged [sql]

Structured Query Language (SQL) is a language for querying databases. Questions should include code examples, table structure, sample data, and a tag for the DBMS implementation (e.g. MySQL, PostgreSQL, Oracle, MS SQL Server, IBM DB2, etc.) being used.

Filter by
Sorted by
Tagged with
1 vote
0 answers
10 views

Moving a Neural Network to the SQL in R

tl;dr How do I use something like the tidypredict tool to move a neural network either textbook mlp, or deep, to SQL code? Background: This is an example that shows how to convert a linear model to ...
user avatar
0 votes
0 answers
7 views

SQL Code for Azure ML Studio

I have a csv file named 'bikebuyers' in which there is only one sheet named 'bibus'. In this sheet, there are 19 columns and 1001 rows. The last column is my dependent variable named 'Purchased Bike' ...
user avatar
  • 1
0 votes
0 answers
40 views

How to read a table from MySQL work bench in colab

I have referred to various articles on Stack Overflow and external sources but somehow am unable to get answer for this. I would like to read a table from MySQL workbench database into a dataframe in ...
user avatar
  • 26
0 votes
0 answers
11 views

Computing number of business days between start/end columns

I have two Dataframes facts: columns: data, start_date and end_date holidays: column: <...
user avatar
  • 101
0 votes
0 answers
11 views

Has anyone joined FHIR resources?

I have FHIR-formatted data (Fast Healthcare Interoperability Resources), that I've converted to CSV using the npm package ndjson-to-csv, and on first glance, this seems useable for ML experimentation, ...
user avatar
1 vote
2 answers
40 views

How to generate test set with no data-leakage using multiple columns

I am developing a fraud detection algorithm. Among other things, my dataset contains the phone number, email address and a few other fields that should uniquely identify a user (let's call them "...
user avatar
  • 121
5 votes
1 answer
218 views

Data engineering good and bad practice?

I'm a Data Analyst in a pretty big company and I'm having a really bad time with the data I'm being given. I spend about 70% of my time thinking about where to find the data and how to pull it instead ...
user avatar
  • 93
0 votes
1 answer
22 views

Applied and view jobs ratio

I have the following data set where the column "kind" can be V(view) or A(apply), how can I do the following things given a particular job id how many applicant Apply (A) to that particular ...
user avatar
  • 105
0 votes
1 answer
24 views

How to strategize model training with new data coming in every day?

I have a mysql database in which new records are added every day to raw data. This raw data is cleaned and a ML model is trained with it once a week. What should be the best strategy to capture new ...
user avatar
1 vote
0 answers
7 views

Join 2 columns from the same table into a new column but in seperate rows [closed]

I need to find customers that have multiple applications registered. I have done a self join and used "WITH" to make it run faster but i also had to use OUTER APPLY STRING_SPLIT function as ...
user avatar
  • 11
0 votes
0 answers
25 views

Develop a Scorecard Model with Orange 3.30

I'm a super fan user of Orange 3.30, actually I've beeing develop some Collection Strategys and some othe of CLI in my actuall work, and everything has been OK with all the decisions that I've being ...
user avatar
0 votes
0 answers
36 views

Using MySQL Common Table Expressions to solve the travelling salesman problem

The problem I'm trying to solve is very similar to the travelling salesman problem, where there are many paths between nodes in the database. I've tried to edit my example to fit into this well-known ...
user avatar
  • 101
0 votes
0 answers
33 views

Spark Dataframe APIs vs Spark SQL

I have a relatively complex query which runs against a database and contains multiple join statements, lead/lag functions, subquery, etc. These tables are available as individual files in my object ...
user avatar
0 votes
0 answers
93 views

Best way to store large amounts of time series data? Relational database (SQL) or NoSQL route. Also additional python/pandas question inside

so I'm working on a project and I'm sort of stuck as to how to store my data. I have a concept I want to propose but am unsure whether it is possible, if it is not I would appreciate any help ...
user avatar
0 votes
0 answers
29 views

SQL/Rails DISTINCT ON in Tableau

I have some practitioners in different states with different certifications setting availability (records with start and end dates), and I want to see the total availability grouped by states and ...
user avatar
0 votes
1 answer
41 views

Creating a complex featureset for regression modeling

I am currently working a on project that requires me to convert all of the categorical variables to continuous (or binary) variables to build a regression model. The problem is that I have more than ...
user avatar
  • 11
1 vote
2 answers
38 views

How can I create a table from an existing table in SQL but using cells from the old table as columns in the new table? [closed]

I have a table, and I want to create a new table such as the one below (from the table above) In SQL, I tried using the following commands. I am able to generate a table with only one column like ...
user avatar
0 votes
0 answers
56 views

Load data from SQL for Machine Learning

I have an SQL DB which has millions of records(10 years of data) and wanted to implement some ML Models. Most of the courses/tutorials explains using a local file or downloaded CSV. But in my case I ...
user avatar
1 vote
0 answers
56 views

Create an amortization table with SQL [closed]

I have a list of credits, let's assume they are only two for ease: Credit #1 and credit #2: One has 3 months of payments missing and the other has 6 months left of payments. It would like to obtain a ...
user avatar
1 vote
1 answer
33 views

Optimization technique for iterative distribution

Apologies if this does not fit the proper format for this site, as it is a somewhat general question. I have an application that sits on top of a SQL database, and need to handle a process which is ...
user avatar
  • 121
0 votes
1 answer
18 views

query category wise dara

I have stored the some products and there respective category in sql. Like this. Now I want fetch all product from table with respective category. output should be=>
user avatar
2 votes
1 answer
1k views

How to change data source names in Google Data Studio

Google Data Studio has connectors to MySQL, PostgreSQL, etc. but these connections will come with default names. Couldn't find out how to set the names for data sources in Google Data Studio. Is it ...
user avatar
  • 125
-1 votes
1 answer
46 views

Tools for a data science job [closed]

Could someone list out all the important tools and software required for a data science job? Example spark, tensorflow, SQL, tableau etc. It would be helpful if you could list the domain and then 2 ...
user avatar
  • 460
1 vote
0 answers
5 views

Hive Bring Table to Local Driver for Fast Debugging on CLI

I have a large Hive table on HDFS. Every time I query it, it runs a map reduce job which is slow. For debugging my code on CLI, I want a fast query. Is it possible to sample rows of the table and ...
user avatar
  • 11
1 vote
1 answer
333 views

Get the average time between first and 2nd call (postgresql)

I have the following data in table where I want to calculate the average time between 1st and 2nd call. I know how to get the average, but I have a though time to figure out how to subtract the 2nd ...
user avatar
  • 53
0 votes
1 answer
240 views

Running a query in R after establishing dbconnect

I do not seem to figure out what is wrong it the following statement. The connection to the DWH is established but the query statement in R seems not to work, with the following error : ...
user avatar
  • 53
1 vote
1 answer
207 views

Removing outliers with orders of magnitude differences

I have a dataset of virtual currency earn and spend events from a mobile game app. Unfortunately, people cheat in the game to get more currencies. These cheaters use different techniques so its quite ...
user avatar
0 votes
1 answer
12 views

Getting the earliest date (duplicates due to several call ids and agents)

I am trying to get the earliest call interaction, with only the agent that interacted at that call and the customer id. Using the following code, I still get duplicates: ...
user avatar
  • 53
7 votes
2 answers
357 views

How important is advanced SQL for data science?

Is advanced level SQL required to be competitive as a data scientist? Is it more important for a data analyst to be good in SQL? Is it enough to be able to extract data using simple SQL queries? I ...
user avatar
2 votes
1 answer
40 views

Storing and collecting data [closed]

I wanted to ask you which coding language I should use. I am pretty new to coding and could really use some help. As I mentioned above I want to create a survey and afterward store my results in a ...
user avatar
1 vote
1 answer
4k views

Passing tuples (key, value) into parameterized SQL query in Python

NOTE: I am new to this community, so please let me know if I can help you help me! I built a scraper in python that creates a tuple of (key, value). I would like to pass both key and value as ...
user avatar
1 vote
0 answers
23 views

Are there decisive leaders in programming with tabular data?

What are the most effective bread-and-butter in-memory open source tabular data frameworks today? I have been working with tabular data for years with an in-house solution that integrates with Excel ...
user avatar
1 vote
0 answers
14 views

Getting transportation turnover as null when i filtered by Product nature [closed]

I am pretty new to SQL. When i tried the following query i am getting sum as 0. Can somebody explain me the problem of the query. ...
user avatar
1 vote
0 answers
72 views

SQL Oracle - Excel's BETAINV function (Inverse cumulative function of a beta distribution) in SQL Oracle [closed]

Is there a function equal to Excel's BETAINV(probability,alpha,beta,[A],[B]) in Oracle SQL Developer? Or a similar one which I could use to return the inverse cumulative distribution function of a ...
user avatar
1 vote
1 answer
23 views

How to group by ID, and output without repeating IDs? [closed]

Input UserID Profile 101 apple 102 banana 103 pie 101 banana 102 pine 103 berry Output ...
user avatar
2 votes
1 answer
89 views

Format of data in SQL for machine learning

I am a beginner at Machine Learning and am starting out on a ML project. I have a large chunk of the source material and have started extracting the data from it to be stored in SQL (initial test with ...
user avatar
1 vote
1 answer
27 views

Scraping mixed elements and passing to SQL

I'm running webscrapes via python which are retrieving data from csv's hosted on the web. I'd like to pass the data into a MSSQL database. An issue I have is the mixed elements/data types in the csv....
user avatar
1 vote
1 answer
3k views

How to plot time series data from SQLite database

I am trying to plot time series data by accessing the SQLite database. I successfully connect the database by coding the below script,however, i couldn't figure out how to plot the time series data ...
user avatar
  • 2,267
1 vote
1 answer
185 views

SQL and JSON database - R

I have a database (PostgresSQL) which looks like this: ...
user avatar
  • 11
0 votes
1 answer
121 views

How to store subset of columns from a csv file?

I need to create a table in hive (or Impala) by reading from a csv file (named file.csv), ...
user avatar
1 vote
0 answers
191 views

Self Union All in Tableau Public for Sankey Diagram

I'm following this 2017 YouTube tutorial from which I hope to learn Sankey diagrams. At 2:28, he instructs us to select Convert to Custom SQL, after having opened ...
user avatar
0 votes
1 answer
50 views

How to execute a git project with different input data?

I would like to run this project and receive result from this project However I have problem to execute the step mailcorpus.json created by executing the sql script data/get_mail_corpus.sql on ...
user avatar
  • 147
0 votes
1 answer
34 views

CASE sentence for SQL query

I have a question abut MySQL I would like to handle a column with characters without changing the original DB. Below is the levels of the column named 'Maker'. 기아, 현대, BMW, VolksWagen, Porsche So ...
user avatar
  • 23
1 vote
1 answer
352 views

What should I master better for professional data science in economics and finance? [closed]

First, excuse me for the noob and long question which is probably doesn’t even belong to here, I know there are several question been answered like this out there, but I think this is going to be up-...
user avatar
4 votes
2 answers
1k views

How to deal with millions or rows of data for analysis/visualization purpose [closed]

I have data in 2 tables in Sql server. First table has around 10 million rows and 8 columns. Second table has 6 million rows and 60 columns. I want to import those tables into a Python notebook ...
user avatar
5 votes
1 answer
45 views

Data enrichment of geographical records

I have a user_data table with various fields, some of them are based on geography. I'd like to enrich the data with additional columns, like ...
user avatar
  • 438
4 votes
4 answers
86 views

How do Data Scientists integrate Predictive Modeling with SQL?

I've heard a lot about the importance of knowing SQL but how do you guys at the larger firms integrate your software for modeling/analysis with the server that holds the data? Do you simply access ...
user avatar
  • 141
2 votes
1 answer
45 views

Analyze additions and subtractions to/from a data set

I have a data set in the following form: ...
user avatar
  • 121
2 votes
2 answers
43 views

Find closest numbers approximately

I have a table like this; all columns are numeric: TableTest Col1 Col2 Col3 Col4 5 6 7 8 12 6 5 6 2 3.5 6 1 And I want to ...
user avatar
  • 53
0 votes
1 answer
4k views

Python & Pandas : (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'localhost' (timed out)")

I'm writing a Python Script to store JSON data into MySQL Database. I used pandas to store into MySQL Database. I used two different modules (...
user avatar
  • 155