Skip to content

Tag: sql

how does a SQL query work?

How does a SQL query work? How does it get compiled? Is the from clause compiled first to see if the table exists? How does it actually retrieve data from the database? How and in what format are the tables stored in a database? I am using phpmyadmin, is there any way I can peek into the files where data

How does contains() in PL-SQL work?

Have a lot of unnecessary results using contains() method in my query. Don’t tell me to use like or something else. It is hardcoded and couldn’t be changed. Answer Contains is used on text fields that have a ‘CONTEXT Index’, which indexes a text field for searching. The standard usage …

Using group by on multiple columns

I understand the point of GROUP BY x. But how does GROUP BY x, y work, and what does it mean? Answer Group By X means put all those with the same value for X in the one group. Group By X, Y means put all those with the same values for both X and Y in the one group.

practicing WHERE and HAVING in SQL

here is the schema: alt text http://img30.imageshack.us/img30/3324/123vk.jpg here is the question: Point out the battles in which at least three ships from the same country took part. here is my …

How to find unused tables in SQL Server

Is there a way of finding out when the data was last entered into a table? I’m trying to find obsolete tables within my database and would like to know if there is a simple script(s) that I can run? Answer You could try check the results of querying the sys.dm_db_index_usage_stats Dynamic Management Vie…