Skip to content

Tag: sql

What is an unbounded query?

Is an unbounded query a query without a WHERE param = value statement? Apologies for the simplicity of this one. Answer An unbounded query is one where the search criteria is not particularly specific, and is thus likely to return a very large result set. A query without a WHERE clause would certainly fall in…

Oracle join query

There are three tables in my db: ITEM_MASTER, PRICE_MASTER and COMP_MASTER. ITEM_MASTER STORE_CODE ITEM_CODE ITEM_DESC 011 914004 desccc PRICE_MASTER STORE_CODE ITEM_CODE COMP_CODE …

Indexes and multi column primary keys

In a MySQL database I have a table with the following primary key In my application I will also frequently be selecting on item by itself and less frequently on only invoice. I’m assuming I would benefit from indexes on these columns. MySQL does not complain when I define the following: But I don’…

Group by date range on weeks/months interval

I’m using MySQL and I have the following table: I want to be able to generate reports like this, where periods are done in the last 4 weeks: or in the last 3 months: Any ideas how to make select queries that can generate the equivalent date range and clicks count? Answer