I am not able to get a clear complete understanding regarding the role of transactions in databases. I know operations clubbed in a transactions will be executed together and then either committed or …
Tag: sql
Query to obtain the maximum primary key ID of a table for each unique value of the customerID column in the same table
I’m trying to run a query that takes obtains the maximum QuestionnaireId value for each unique value in column VendorId. So for example from this table: QuestionnaireId VendorId 1 …
How to compare column values in SQL grouped by one column?
I am practicing SQL from a cars database and I have the following CAR table/view and I need to select the brand which sells more cars than engines/motorcycles. This means that I have to select the …
Use select statement as the limit to the outer select statement
Looking to get the top half of a table, I set a select statement that returns an integer as the limit to the outer select statement and got a syntax error. I checked and ran the select statements …
Open form from listbox selection
I’m trying to open a form with a SQL condition set up from items selected in a listbox. I keep getting an error Syntax error in query expression. Which I don’t understand because if I create a new …
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 …
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 …