Skip to content
Advertisement

What’s wrong with my SQL query?

I need a quick look at my SQL query. It’s already given me a headache. Comparing some advice I have gotten, I could not figure out the proper format for my SQL. This is my code: Thanks in advance! EDIT: Currently I have this as the form: This is the insert query: Seems to submit the entry, but not the

Force index use in Oracle

I encountered this question in an interview and had no clue how to answer: There is a table which has a index on a column, and you query: The query takes too long, and you find out that the index is not being used. If you think the performance of the query will be better using the index, how could

Displaying the constraints in a table

Hello I am trying to display the constraints in one of my tables but for some reason I get the message no rows selected. Noted below is the table I have created. This is the code I am using to show my constraints. I am a rookie so I want to make sure I understand what is wrong. I have

sort the “rollup” in group by

I found that the “with rollup” option used with group by is very useful. But it does not behave with “order by” clause. Is there any way to order by the way I want as well as calculate the sub-totals? …

MAX on columns generated by SUM and GROUP BY

I’m trying to get the MAX on a column which is generated dynamically using the SUM statement. The SUM statement is used together with the ‘GROUP by’ syntax. This is the original query, however it needs to be modified to work with grouping, sums and of course MAX. As you can see SUM is adding all the values inside video_plays

Advertisement