Tagged Questions

Structured Query Language (SQL) is a language for querying databases. Questions should include code examples and table structure, and include a tag for the DBMS implementation (e.g. MySQL, PostgreSQL, Oracle, MS SQL Server) being used. If your question relates to a specific DBMS (uses specific ...

Helllo guys,
I'm using Java to assemble a query string in execution time that's supposed to execute on the database as a prepared statement. Since I don't know beforehand the number of parameters in ...

First off, sorry for the vague/ludicrous title question. Basically, as a pet project to develop my programming skills, I want to try and write a utility that will enable somebody to write SQL queries ...

I'm a little confused here. I'm testing some data quality issues in a DW, I need to know if the LOAN_SID in one table matches the other table. I was using this query but I'm not sure if I'm correct, ...

So since the title is a bit vague.
Bassicly I have XAMPP installed latest version. I am able to run the apache on there. However when I try it on a portable version which I need for an application. It ...

I'm currently designing a billing app that can be used for a consultant to bill their customers. I currently have 3 tables in mysql for this the database to store information. The tables are activity, ...

I have 2 fields in my SQL table. One has 5 digits (ex: 12345) and the 2nd field has 2 digits (ex: 99) and I need to know if there is a way to take the LAST digit from the first field and push it to ...

I'm trying to create a table using SQL view. It suppose to add a column to each row in questions table that will have an integer value of answers given to that question. This is what I have so far:
...

While doing a query with multiples tables and multiples variables in a Sybase SQL query, the results weren't what i was expecting.
My table is not complete and is not supposed to be, most of it can ...

So I have two tables in Oracle. Table A is the master table and Table B is data retrieved from a contractor. They both have the same general structure. In the end, I would like to INSERT INTO TABLE ...

I was given an ER diagram and I'm working on writing SQL queries for it.
There's a table that has 'Country code*' and 'Industry code*' where * represents 'numeric code form'.
What is that exactly, Is ...

I am having a semantic like "There cannot exist two persons who live in the same state but one person earns less salary ands has higher tax rate at the same time "
My question is, can we convert such ...

I am following an online course on databases. However, I really don't know what the next step is and how I can answer this question. Can anyone please help?
This is what I have so far.
SELECT P.name
...

I have a very long CASE statement and it makes the query very long. Is there an alternative way? Does the long CASE statement impact the performance? I see people are recommending COALESCE but I'm not ...

I am using SQL in MS Access and need to compare 2 values in a row to determine the result of a 3rd field.
The "Yearmove" field does not have a value in all cases. Here is the test code I am running
...

Scenario: I need to convert an existing query using (+) outer join syntax to ANSI syntax.
Reason: One of the JOINS requires an OR operand, which is not allowed with the (+) operator, but is allowed ...

I've got a function that takes three number arguments and returns a value calculated from those three numbers. Now in another stored procedure I call try to write out each value like this:
CREATE OR ...