I am trying to update an Access table with the following code: strSelectRec = “SELECT * FROM EmployeeDemographics WHERE (LastName) = (‘” & strLast & “‘) AND (FirstName) = (‘” & strFirst &…
How does a SQL query transform the data?
I came across this question and was trying to understand how the answer given there is actually transforming the data. Input Table +———+——-+—————+ | user_id | State | …
How to write a query that gives the names of everyone who does not own a blue house?
Q. Write a query that gives the names of everyone who does not own a blue house. Here is my code: SELECT persons.name FROM persons JOIN houses ON (persons.id=houses.owner_id) WHERE houses.color<&…
MYSQL delete all rows, but the same query on select return only 3 rows
I can’t understand why the same query for select and delete have different behavior. I need to delete all rows except 5 newest rows. I know my solution for this task is no good, but my question is …
What happens when we add new records to a SQL table while the Azure Search Indexer is running
Say for example that I’ve got an Indexer running every day and it pulls down 2 million records from the SQL table every time it gets run. It takes around 30 min to finish off. During that time we keep …
When should I split my table for faster lookup?
I have a Postgres table with 500k rows that are only read (a lot, by multiple users). I was wondering if splitting the database in two by, let’s say “date of birth” of the rows, would be more …
Does the concatenation of NULL + ‘something’ always yield NULL? Why?
I want to apply an OUTER APPLY computation on every row of a set. This computation concatenates a number of string fields into one but sometimes theses fields are null or filled with empty strings. …
Explain what means to join same table twice
I was preparing for exam and I have this exercise that I don’t understand I have table of Clients that have ClientID, and also I have table of Transactions that have Foreign Key referenced to Clients,…
SQL – Column string characters has to be greater than 25
When creating a table, can you put a constraint check on a column to check that the string value has to be greater than 25 characters? I know it can be done on numeric, but having difficulty to do it …
Calculate number of rows with having clause
I have 3 tables what I’m trying to achieve is to calculate exact number of rows for two kinds of queries. The first one must count number of accounts which has exactly only one row in accounts_extra …