I’ve small doubt about update code block which has been written by someone before and now I’ll be using it in my Java program. Is it possible to update a column first, then commit and afterwards use …
Python 3-x Select a column and a row from a CSV table using SQL-like conditions
Here’s a CSV file kidsList.csv, comma-delimited, the first row is a header. The first column Id is unique so you can use this as a primary key. Id,Name,Age A1,Alice,6 A2,Becca,5 B1,Cindy,7 Now I …
Adding hyphen in a column in sql table
I need help understanding how to add a hyphen to a column where the values are as follows, 8601881, 9700800,2170 The hyphen is supposed to be just before the last digit. There are multiple such …
Defining number of decimals in teradata column during Select statement
In teradata proc sql in SAS Enterprise guide environment, I am trying to create a column by multiplying two fields, but I have been having overflow issue. How do I specify the number of decimals in …
How to fix pandas to_sql append not appending one item out of 2000?
I have a CSV file with 2000 rows and 3 columns of type Int, String, and String respectively. I’m trying to write a program that creates a table and appends my CSV file rowsxcolumns into the table. It …
Search for and reverse engineer foreign key relationships in DB without foreign keys defined
I’ve inherited a really old database with about 100 tables. I know there are foreign key relationships by looking through tables, but I’ve also determined that there are no relationships actually …
SQL: Select rows that contains at least two items and one other item
I need to verify that a list of information given to me contains the information that has at least two items – engine (starts with either ‘E’ or ‘PE’) – and one another item – chief unit (starts with …
How to change or swap value in relation with one column?
Assume I have a table with two column x and y without any index or primary key fig:1.0 as shown bellow: I want to change the values of y like: x1 = y2 x2 = y1 x3 = y4 x4 = y3 x5 = y6 x6 = y5 …
Large SQL table delete all duplicates
I have a database table with 33265902 (thirty-three million two hundred sixty-five thousand nine hundred two) records in it. Much of this is made up of duplicates. It is causing me issues as any …
Storing an array of unknown length
I’m letting my users add number inputs in a HTML form and filling them with values. The form is serialized on submit and sent to a PHP file that inserts the data into a MySQL database with PDO. The …