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
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 ...
Gleb's user avatar
  • 11
1 vote
0 answers
41 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 ...
EngrStudent's user avatar
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 ...
Jenny's user avatar
  • 11
1 vote
2 answers
81 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 ...
PlatinumMaths's user avatar
1 vote
0 answers
120 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 ...
Juan Esteban de la Calle's user avatar
1 vote
0 answers
6 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 ...
solora's user avatar
  • 11
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 ...
WackyTaco636's user avatar
1 vote
0 answers
27 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 ...
Monolithguy's user avatar
1 vote
0 answers
24 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. ...
Praveenkumar Beedanal's user avatar
1 vote
0 answers
93 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 ...
Juan Esteban de la Calle's user avatar
1 vote
0 answers
242 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 ...
Jonathan Rolfsen's user avatar
1 vote
0 answers
18 views

Qualitative prediction based off data containing mixed qualitative and quantitative values? [closed]

I'm trying to find a way to predict an integer value based off of an item's prior sale history and am inquiring for a starting point on how to approach this. The factors are as follows (Data Type in ...
A.Ana's user avatar
  • 11
1 vote
0 answers
966 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. ...
Chris Kehl's user avatar
1 vote
0 answers
691 views

How to pass database name as parameter to sql statement in python? [closed]

I have several SQL statements (update, delete, insert,...) in my Python code and all of them ...
Shahrzad Amoozegar's user avatar
1 vote
0 answers
167 views

Python-SQL database [closed]

There are two SQL databases in which one database contains user data and other database contains service data. Firstly, I am connecting the databases and fetching it on python.Based on the user data, ...
Sheetal's user avatar
  • 53
1 vote
1 answer
1k views

Is there an analog to SQL's STRING_AGG (or FOR XML PATH) function in Python?

Asked this in SE but maybe this is too data-oriented so trying to post it here. I am trying to find the analog to the SQL function STRING_AGG so that I can concatenate across columns and rows of a ...
San990's user avatar
  • 13
1 vote
1 answer
1k views

Most Efficient Post Processing with Python and Pandas

This question is about best practices for working in Pandas dataframes. Speed, ease of use, and memory consumed could all impact any answers you might have. I start by pulling a data set into a ...
thesimplevoodoo's user avatar
1 vote
0 answers
18 views

Run queries against results of previously cached queries [closed]

I'm trying to find a tool or workflow that would allow a team to analysis data in multiple steps, where intermediate results are cached. (I'll assume that the raw data is in a relational database and ...
Jan's user avatar
  • 111
1 vote
1 answer
190 views

mysql could not recieve table from Citespace [closed]

I created was database through commands (see lower) ...
Valerii's user avatar
  • 11
0 votes
2 answers
63 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 ...
hyvel's user avatar
  • 23
0 votes
1 answer
36 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 ...
Hun Cho's user avatar
  • 23
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 ...
Marlen's user avatar
  • 157
0 votes
1 answer
22 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 ...
Hogan Marhoefer's user avatar
0 votes
1 answer
33 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=>
Nikhil Ghadi's user avatar
0 votes
1 answer
14 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: ...
ColRow's user avatar
  • 53
0 votes
1 answer
56 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 ...
Nathalie's user avatar
  • 147
0 votes
1 answer
380 views

How to use features when predicting aggregation?

Let's say I have to predict the total monthly sales of a store. I have the data in the following format: I don't think I can use this data directly for predicting the sales for a month, as in it's ...
Ali's user avatar
  • 101
0 votes
1 answer
141 views

How do I write a SQL (or dwSQL) query across these two different datasets?

I'm having a little fun and I'd love to know how to write a SQL or dwSQL query across these two datasets of Trumps tweets and Facebook posts. Here are the datasets: Trump Facebook Posts https://data....
bgadoci's user avatar
  • 109
0 votes
3 answers
144 views

Data manipulation in SQL

I need to write a SQL query where I need the data for the year 2014 from May-Dec and complete data (Jan-Dec) of the year 2015. Can anyone help me with this query?
pinky's user avatar
  • 151
0 votes
0 answers
7 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 ...
Rotten_Cabbagges's user avatar
0 votes
0 answers
23 views

SQL projects to do for a beginner [closed]

hey Guys i've just started learning sql, i've just finished a youtube course about sql and how to code, and i was wondering where can i find projects to do, so i can improve my skills
Hamza Zouhair's user avatar
0 votes
0 answers
71 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 ...
Thomas Arildsen's user avatar
0 votes
1 answer
463 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 ...
Nata's user avatar
  • 3
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? ...
M__'s user avatar
  • 208
0 votes
1 answer
20 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 ...
dade's user avatar
  • 101
0 votes
1 answer
29 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 ...
ozz's user avatar
  • 1
0 votes
0 answers
93 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: ...
Deep_S's user avatar
  • 1
0 votes
1 answer
41 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 ...
PowerBIUser's user avatar
0 votes
1 answer
41 views

Missing statement in the below MYSQL query

I have 3 tables with columns likes- ...
Abhishek's user avatar
  • 1,959
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 ...
Sabrin's user avatar
  • 26
0 votes
1 answer
27 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 ...
GGT's user avatar
  • 115
0 votes
1 answer
30 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 ...
dodo postman's user avatar
0 votes
0 answers
97 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 ...
Greg's user avatar
  • 101
0 votes
0 answers
261 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 ...
user1884295's user avatar
0 votes
1 answer
74 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 ...
Ryan's user avatar
  • 21
0 votes
0 answers
105 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 ...
Sai Chandra's user avatar
0 votes
1 answer
436 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 : ...
ColRow's user avatar
  • 53
0 votes
1 answer
5k 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 (...
Dipankar Nalui's user avatar
0 votes
1 answer
397 views

What algorithms can be used to derive matching rules between known matches in datasets?

Lets say I have two datasets with different column names except for a unique ID key Table 1 CSV ...
Einhandler's user avatar
-1 votes
1 answer
96 views

Sql satament sql server [closed]

I want to know how to display those statement ( what the correct statement for them Display the name of the school that contain the maximum number of students For each school, display the number of ...
Amon 1994's user avatar