Tag: oracle

Deferrable Constraints in SQL Server

Do any versions of SQL Server support deferrable constraints (DC)? Since about version 8.0, Oracle has supported deferrable constraints – constraints that are only evaluated when you commit a statement group, not when you insert or update individual tables. Deferrable constraints differ from just disabling/enabling constraints, in that the constraints are still active – they […]

Mutiplication aggregate operator in SQL

In SQL there are aggregation operators, like AVG, SUM, COUNT. Why doesn’t it have an operator for multiplication? “MUL” or something. I was wondering, does it exist for Oracle, MSSQL, MySQL ? If not is there a workaround that would give this behaviour?

How do I Create a Comma-Separated List using a SQL Query?

I have 3 tables called: Applications (id, name) Resources (id, name) ApplicationsResources (id, app_id, resource_id) I want to show on a GUI a table of all resource names. In one cell in each row I would like to list out all of the applications (comma separated) of that resource. So the question is, what is […]

The order of a SQL Select statement without Order By clause

As I know, from the relational database theory, a select statement without an order by clause should be considered has not particular order. But actually in SQL Server and Oracle (I’ve tested on those 2 platforms), if I query from a table without an order by clause multiple times, I always get the results in […]

How do I decide when to use right joins/left joins or inner joins Or how to determine which table is on which side?

I know the usage of joins, but sometimes I come across such a situation when I am not able to decide which join will be suitable, a left or right. Here is the query where I am stuck. SELECT count(ImageId) as [IndividualRemaining], userMaster.empName AS ID#, CONVERT(DATETIME, folderDetails.folderName, 101) AS FolderDate, batchDetails.batchName AS Batch#, Client=@ClientName, TotalInloaded […]

Is there a combination of “LIKE” and “IN” in SQL?

In SQL I (sadly) often have to use “LIKE” conditions due to databases that violate nearly every rule of normalization. I can’t change that right now. But that’s irrelevant to the question. Further, I often use conditions like WHERE something in (1,1,2,3,5,8,13,21) for better readability and flexibility of my SQL statements. Is there any possible […]

Oracle: is there a tool to trace queries, like Profiler for sql server?

i work with sql server, but i must migrate to an application with Oracle DB. for trace my application queries, in Sql Server i use wonderful Profiler tool. is there something of equivalent for Oracle?

Can a foreign key be NULL and/or duplicate?

Please clarify two things for me: Can a Foreign key be NULL? Can a Foreign key be duplicate? As fair as I know, NULL shouldn’t be used in foreign keys, but in some application of mine I’m able to input NULL in both Oracle and SQL Server, and I don’t know why.

SQL Case Statement Syntax?

What is the complete and correct syntax for the SQL Case statement?

SQL – How to store and navigate hierarchies?

What are the ways that you use to model and retrieve hierarchical info in a database?

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.