Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

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
0 votes
1 answer
59 views

Why does PowerBI take longer to load data than PowerQuery takes to load preview?

I have a stored procedure in SQL Server and when I open PowerQuery, I can get a preview of the whole table in a minute or two. But once I click 'Apply and Close', it will take AGES to load and finally ...
0 votes
1 answer
476 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 : ...
0 votes
0 answers
16 views

how to eal with a column name having comma space or and

I am taking the Coursera assignments on SQL and came across to a question where one of the tables has a column with this name: Elementary, Middle, or High School I do not know how to deal with this ...
0 votes
1 answer
12 views

lookup tables with multiple (possibly partly empty key columns) - prefer specific match over general one

Assume I have a table with samples: ID sample type origin project_l1 project_l2 project_l3 ... 1 DNA Blood p1 p1.1 p1.1.1 p1... 2 DNA Blood p1 p1.1 p1.1.2 p1... 3 DNA Blood p1 p1.1 4 DNA Blood p1 ...
1 vote
1 answer
81 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 ...
1 vote
1 answer
5k 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 ...
0 votes
0 answers
13 views

What is system prompt in fine tuning of GPT3.5 for natural language to sql queries

What exactly is a system prompt while finetuning GPT3.5 or a language model in general? How can I build system prompt for the task of converting natural language to SQL queries
0 votes
1 answer
29 views

Customer Lifetime expectancy

I'm trying to compute Customer Lifetime Expectancy based on a table of subscriptions, that have 3 columns : user_id, user_subscription_start, user_subscription_end ...
1 vote
0 answers
43 views

Designing a data science workflow for a small company

I work at a company with eight employees, and was recently hired as a data/business analyst. The company uses an in-house software to manage online retail sales. There is a huge amount of data ...
0 votes
1 answer
20 views

Hassle-free platform for a small data science team?

our team of 4 data scientists has been exploring options to automate our ETL, data storage and model updates and are looking for a hassle-free platform that can help with this. We've had several ...
147 votes
13 answers
98k views

Why do people prefer Pandas to SQL?

I've been using SQL since 1996, so I may be biased. I've used MySQL and SQLite 3 extensively, but have also used Microsoft SQL Server and Oracle. The vast majority of the operations I've seen done ...
0 votes
0 answers
206 views

How to get a SQL sequence value with sqlalchemy?

I would like to use a SELECT NEXT VALUE FOR to get a value from a sequence in Microsoft SQL Server. It does not look like I can simply use ...
0 votes
1 answer
1k views

SQL BigQuery function to return the previous non null value

I have the following table where some of the values are null and I would like to fill them with the previous non-null values. LAG function helps but if there are more than one null value in a row, it ...
0 votes
0 answers
17 views

Formal terminology: metafeatures then groupby (GROUP BY) operation

In ML training and other analytics I often combine features to produce a 'metafeature' and then perform a 'groupby' (pandas) or 'GROUP BY' (SQL) query. What is the technical term for this operation? ...
1 vote
0 answers
20 views

How to find own way in data field? [closed]

I need help finding my path in the data field. I just completed my MSc in Big Data at university. During my studies, I gained approximately Junior level Python and SQL programming skills, worked with ...
0 votes
1 answer
23 views

How to programmatically manipulate SQL strings

As part of a hubby project I am working on, I need to be able to take SQL strings supplied by users, and then run it. But before running it, i will like to do some manipulations to the SQL. For ...
0 votes
1 answer
30 views

Reduce dimension (Words) for recommender

I have made a related document finder natively in SQL Server. Currently I use the word as dimensions. Based on that i calculate the cosinus simularty to figure out related article. At the moment the ...
0 votes
1 answer
35 views

Why two different series of SQL queries which do the same thing just in a different order have a different number of rows in their outputs?

I am working on a group project for the US Forest Service to create a dashboard on the US's arial firefighting operations and resources. This part is focused on creating a single data table for the ...
0 votes
0 answers
116 views

When using sqldf for join in python, is there a format to be followed for column names inside sql query?

I'm trying to use sqldf to do a left join on python. Here's my code: ...
1 vote
1 answer
161 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), ...
0 votes
1 answer
24 views

How do I get a big-picture feel for my database?

Background: I was just granted access to my company's SQL Server (MS SQL 2019 via Azure Data Studio). As I have not yet been assigned any specific projects I want start digging. I've asked my DBA to ...
5 votes
1 answer
11k views

Python & Pandas : TypeError: to_sql() got an unexpected keyword argument 'flavor'

I want to store JSON Data into MySQL Database using Python. I used dataframe of pandas. I found that ...
0 votes
1 answer
51 views

Missing statement in the below MYSQL query

I have 3 tables with columns likes- ...
0 votes
2 answers
137 views

SQL, count total users' first order for each region, each day

I have a table called orders. Link for the table here: table I want to get the total users' first order in each region, each day. First, I tried to get the first order for each unique user by doing ...
1 vote
1 answer
157 views

Convert This Sql Query into Python pandas Code [closed]

Can help me to solve it with python pandas i don't need any help from python libraries i need code of python Thx so much more for helping me
1 vote
0 answers
42 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 ...
0 votes
0 answers
1k 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 ...
1 vote
2 answers
77 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 "...
4 votes
4 answers
5k views

What is the best way to read SQL dataset in to Tensorflow?

What is the best way to read SQL database in to Tensorflow? Currently, I am using Postgres on server and developed DL algorithm on Tensorflow using Jupyter Lab. How can I import data into Jupyter Lab ...
5 votes
1 answer
387 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 ...
0 votes
1 answer
28 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 ...
0 votes
1 answer
31 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 ...
1 vote
0 answers
11 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 ...
20 votes
5 answers
17k views

Do modern R and/or Python libraries make SQL obsolete?

I work in an office where SQL Server is the backbone of everything we do, from data processing to cleaning to munging. My colleague specializes in writing complex functions and stored procedures to ...
0 votes
0 answers
104 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 ...
1 vote
1 answer
1k 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 ...
26 votes
5 answers
36k views

Natural Language to SQL query

I have been working on developing a system "Converting Natural Language to SQL Query". I have read the answers from the similar questions, but was not able to get the information that I was looking ...
1 vote
1 answer
209 views

SQL and JSON database - R

I have a database (PostgresSQL) which looks like this: ...
0 votes
0 answers
336 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 ...
2 votes
1 answer
52 views

Analyze additions and subtractions to/from a data set

I have a data set in the following form: ...
2 votes
1 answer
3k 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 ...
1 vote
0 answers
1k views

Calculating correlation and covariance in MySQL

I am new to data science taking my first course in Data analysis. I am trying to figure out where to start with a problem solving the correlation and covariance with my sql. ...
0 votes
1 answer
37 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=>
1 vote
2 answers
101 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 ...
0 votes
0 answers
122 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 ...
1 vote
0 answers
124 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 ...
2 votes
1 answer
52 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 ...
1 vote
1 answer
47 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 ...
4 votes
2 answers
8k views

Mean across every several rows in pandas

I have a table of features and labels where each row has a time stamp. Labels are categorical. They go in a batch where one label repeats several times. Batches with the same label do not have a ...
1 vote
0 answers
31 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 ...