Structured Query Language (SQL) is a language for managing data in relational database management systems. This tag is for general SQL programming questions; it is not for Microsoft SQL Server (for this, use the sql-server tag), nor does it refer to specific dialects of SQL on its own.

learn more… | top users | synonyms

-1
votes
1answer
1k views

How to use PostgreSQL on AWS - Ubuntu 11.10 [closed]

I'm extremely new to cloud-computing, Linux, and PostgreSQL, so if this is a stupid question, I apologize. I've managed to create an m1.large instance running Ubuntu 11.10, connect via Putty SSH, and ...
0
votes
0answers
111 views

Benchmarking ORM associations

I am trying to benchmark two cases of self referential many to many as described in datamapper associations. Both cases consist of an Item clss, which may require many other items. In both cases, I ...
0
votes
5answers
321 views

Is comparing an OO compiler to a SQL compiler/optimizer valid?

I'm now doing a lot of SQL development at my new job where as before I was doing Object Oriented desktop app stuff. I keep running across very large scripts (thousands of lines) and wanting to ...
-1
votes
1answer
468 views

keeping connection open all time in sql

I have developed a Windows application in c# in which multiple users can add some numbers and their name and can view the data entered. The problem that I have is that the sever is on my laptop and ...
0
votes
2answers
188 views

Visual C++, CMap object save to blob column

I have a MFC CMap object, each object stores 160K~ entries of long data. I need to store it on Oracle SQL. We decided to save it as a blob. Since we do not want to make additional table, we also ...
2
votes
3answers
598 views

How To Start Programming [closed]

I have taken a programming course 2 years ago but I haven't worked in programming since then. I recently found a programmer job, but there is no programming team so for me to gain valuable experience ...
1
vote
3answers
3k views

Storing Attendance Data in database

So i have to store daily attendance of employees of my organisation from my application . The part where I need some help is, the efficient way to store attendance data. After some research and brain ...
2
votes
8answers
5k views

Is executing SQL through a WebService a really bad idea?

Typically when creating a simple tool or something that has to use a database, I go through the fairly long process of first creating a webservice that connects to a database then creating methods on ...
5
votes
3answers
574 views

Should we have a database independent SQL like query language in Django?

Note : I know we have Django ORM already that keeps things database independent and converts to the database specific SQL queries. Once things starts getting complicated it is preferred to write raw ...
5
votes
4answers
486 views

Designing a Database Application with OOP

I often develop SQL database applications using Linq, and my methodology is to build model classes to represent each table, and each table that needs inserting or updating gets a Save() method (which ...
3
votes
2answers
465 views

Forced to write Stored Procedures

Can you think of some reasons that the management force the developers to write and call Stored Procedures instead of inline SQL statements directly? Even a very simple CRUD statement, writing a ...
6
votes
4answers
19k views

Best practice to query data from MS SQL Server in C Sharp?

What is the best way to query data from a MS SQL Server in C Sharp? I know that it is not good practice to have an SQL query in the code. Is the best way to create a stored procedure and call it ...
7
votes
4answers
2k views

Best C# database communication technique

A few days ago, I read an answer stating that writing queries within your c# code are long gone. I'm not sure what the specific person meant with the comment but, it got me thinking. At the company ...
1
vote
1answer
742 views

How can I implement a database TableView like thing in C++?

How can I implement a TableView like thing in C++? I want to emulating a tiny relation database like thing in C++. I have data tables, and I want to transform it somehow, so I need a TableView like ...
11
votes
4answers
883 views

TDD with SQL and data manipulation functions

While I'm a professional programmer, I've never been formally trained in software engineering. As I'm frequently visiting here and SO, I've noticed a trend for writing unit tests whenever possible ...
1
vote
5answers
4k views

Externalising SQL Queries in Java

What are the advantages and disadvantages of externalising SQL queries in Java (or similar general-purpose object-oriented programming language. Externalizing means storing all SQL in a separate ...
4
votes
2answers
318 views

Proper Data Structure for Commentable Comments

Been struggling with this on an architectural level. I have an object which can be commented on, let's call it a Post. Every post has a unique ID. Now I want to comment on that Post, and I can use ...
9
votes
6answers
558 views

Software solution from the 2000's, should I attempt to patch or remake the whole thing?

I was sent out to discuss a system that a certain company is currently using and what should be done with it. The company manufactures various carton displays. This system was developed to keep track ...
5
votes
5answers
349 views

Alternatives for comparing data from different databases

I have two huge tables on separate databases. One of them has the information of all the SMS that passed through the company's servers while the other one has the information of the actual billing of ...
4
votes
3answers
623 views

Appropriate use of SQL CLR

We have some back end processes that runs* on our sql server (SQL Server), they involve processing claims. This requires both data manipulation (biz logic) and data read/write to tables. The biz ...
2
votes
1answer
607 views

Best way to remove list items from an existing record

Ok more of a conceptual question here: Say I have an existing record of type Meeting. When I go to edit the meeting I have a listbox with all current meeting participants, and one with all employees. ...
6
votes
3answers
5k views

Why is SQL's BETWEEN inclusive?

Semi-open intervals ([a,b), where xbelongs to the interval iff a <= x < b) are pretty common on programming, as they have many convenient properties. Can anyone offer a rationale that explains ...
2
votes
2answers
178 views

Better way to search for text in two columns

Here is the scenario. I am making a custom blogging software for my site. I am implementing a search feature. It's not very sophisticated - basically it just takes the search phrase entered and runs ...
3
votes
1answer
473 views

How would one build a relational database on a key-value store, a-la Berkeley DB's SQL interface?

I've been checking out Berkeley DB and was impressed to find that it supported a SQL interface that is "nearly identical" to SQLite. ...
5
votes
9answers
804 views

If I only know TSQL can I call myself programmer?

I am dealing with MS SQL since from version 2000 even before that, I think that I am pretty good in writing TSQLs and general database designs . Can I consider myself as programer ? I know that TSQL ...
1
vote
1answer
298 views

Implementing Bulk Update feature and its trade offs

The feature to implement is to allow a user to select items and apply data update in bulk. It is very similar to JIRA's ability to bulk update a list of selected issues. In my case: I iterate over ...
3
votes
2answers
216 views

Having 2 Initialize Paragraphs in 1 COBOL program

I am designing a COBOL program that does 2 things. 1 reads specific rows from a table, and inserts a new row based on the original. 2 reads different rows from the same table, and updates those rows. ...
1
vote
2answers
110 views

Cataloging events, projects and tasks: Is SQL appropriate?

I have this idea for a database: it would hold everything I "need to remember", and allow future coding projects to access the information. These future projects include a day-planner and historical ...
1
vote
3answers
388 views

Is an API in C++ a better alternative to computing directly in SQL?

I need to perform large amounts of computations on data storerd in a busy Microsoft SQL server. Would it be faster if I retrieve the data from the server, perform the computations locally in C++, and ...
1
vote
2answers
1k views

Designing complex query builders in java/jpa/hibernate

I need to build complex sql queries programatically, based on large filter conditions. For example, below are few sample/hypothitical filter conditions, based on which i need to fetch users Country: ...
0
votes
3answers
360 views

Does connection pooling work fine to execute 60 DB queries to load a page?

We use Linq2Sql in an ASP.NET application. Unfortunately the eager-loading in Linq2Sql isn't as powerful as in Entity Framework, so a lot of the data has to be lazy loaded as needed. Taking ...
4
votes
1answer
388 views

What is Rainbow (not the CMS)

I was reading this excellent blog article regarding speeding up the badge page and in the last comment the author waffles (a.k.a Sam Saffron) mentions these tools: dapper and a bunch of custom ...
0
votes
1answer
936 views

Database Driven Web Application, C# Front-End and F# Back-End meaning

Hi I am an intern working with ASP.NET. My current task is to make a website which will incorporate some jquery viewing features. This project seems to me will be primarily dealing with reading data ...
0
votes
3answers
1k views

Is this overkill? Using MDX queries and cubes instead of SQL stored procedures

I am new to Microsoft's SQL Server Analysis Services Cubes and MDX queries. Where I work we have a daily sales table in SQL Server 2005 that already contains an aggregate of sale information per ...
2
votes
1answer
499 views

Which would be a better way to load data via ajax

I am using google maps and returning html/lat/long from my MySQL database Currently A user picks a business category e.g; "Video Production". an ajax call is sent to a CodeIgniter controller the ...
1
vote
2answers
460 views

SQL language drawbacks, The Third Manifesto

Sometime ago I read about SQL language drawbacks (the basic language specification, not vendor specific), and one of the drawbacks was that the language does not allow to create a set of tuples that ...
0
votes
2answers
297 views

Will TSQL become useless because of new ORMs? [closed]

By introducing LINQ to SQL, I found myself and my .NET developer colleagues gradually moving from TSQL to C# to create queries on the database. Entity Framework made that shift almost permanent. Now ...
2
votes
5answers
3k views

SQL Strings vs. Conditional SQL Statements

Is there an advantage to piecemealing sql strings together vs conditional sql statements in SQL Server itself? I have only about 10 months of SQL experience, so I could be speaking out of pure ...
1
vote
1answer
4k views

how to compare two large sets of data using PL/SQL?

I have two different tables in two separate databases with around 1.5 million records each. (BTW: im working on oracle databases) The objective is to check if every record present in table A is ...
4
votes
3answers
333 views

Rule of thumb for field sizes

What VARCHAR sizes should be used for first and last names, phone numbers (preferably international), email adresses, urls, dictionary words and file names? Edit: Zapped the introductory phrase to ...
21
votes
7answers
2k views

Why SQL is not so widespread in large desktop applications?

As a software developer, I've worked on projects ranging from tiny home-made apps to medium-size enterprise applications. In nearly every project I used a database or regretted choosing not to use it ...
2
votes
1answer
4k views

Automatically adding data from JSON to SQL

I'm really new to this sort of stuff; my background is in C# mainly. Could anyone point me in the right direction? I need to set a script to automatically parse some JSON into an SQL database ...
3
votes
4answers
187 views

What's the utility of encouraging users to learn SQL and possibly the ability to execute it?

Facing a situation where I can't possibly get all the features that are requested into each version of the LOB I support, I've evolved a number SQL query templates that users have and send to me, ...
62
votes
16answers
5k views

Co-worker renamed all of my queries [closed]

I don't know if I should be very irritated or what. I single handedly built over 300 queries for a large database, and developed a naming convention so I could find them later. No one else in my ...
2
votes
2answers
325 views

Where should SQL/DB Queries be encapsulated in a software system?

I frequently write small applications (either web based or otherwise) that require heavy database usage. i've attempted various ways of handling where to put the actual sql queries (sort of ad-hoc ORM ...
1
vote
2answers
549 views

SQL DB design to support user feeds (in application like facebook)

I have a social network server with a MySql DB. I want to show the users feeds like done in Facebook. Example - UserX now Friend with userY, userX did like on postX etc. Currently I have table: C1 : ...
1
vote
2answers
418 views

SQL Server DBA - How to get a good one!

I'm a lone developer. I am currently developing an application which is seeing me get way way way out of my depth when it comes to SQL DBA'ing, and have come to realise that I should hire a DBA to ...
52
votes
6answers
3k views

Why the Select is before the From in a SQL Query? [closed]

This is something that bothered me a lot at school. 5 years ago, when I learned SQL, I always wondered why we specify first the fields we want and then where we want them from. According to my idea, ...
3
votes
7answers
4k views

What is the best approach for database design with lots of columns?

I am writing a query based financial application. It lets the user to write complicated equations (much like WHERE part of an SQL query) and find companies matching those criteria. For the above, I ...
0
votes
4answers
206 views

Is it possible (or desirable, if not) to make an database engine organize the order of sql statements to maintain the referential integrity?

Today at work I found the following situation: We had two tables, A and B, with B having a foreign key linked to the primary key of A. On our application, we got two main situations that created ...