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

8
votes
3answers
432 views

How do you handle constantly changing database dimensions?

For the last two months or so I have been looking for solutions or practices to handle release management within databases. I'm looking for what people view as the best process for handling this. We ...
0
votes
4answers
227 views

Is this a worthwhile course to take?

I currently don't have any qualifications in any form of web development (except an A-Level in ICT). I started working for a web development company 4 years ago and have finally been given the chance ...
14
votes
8answers
5k views

Using JOIN keyword or not

The following SQL queries are the same: SELECT column1, column2 FROM table1, table2 WHERE table1.id = table2.id; SELECT column1, column2 FROM table1 JOIN table2 ON table1.id = table2.id; And ...
5
votes
6answers
3k views

Proper syntax formatting for SQL? [duplicate]

Is there are a widely accepted standard for formatting SQL queries? I've never been given any guidance as to the "typical" or "standard" way of doing it. I've seen three styles in the wild, and ...
4
votes
3answers
251 views

How about multiple bits performance in common databases?

If there are 20 bit columns (non-null boolean), is it better to explicitly hold them in an integer type (int32)? Or, will the underlying database merge them in a single integer? I'm using PostgreSQL, ...
20
votes
6answers
1k views

Does the advent of the SSD have any implication for database optimization?

Today I was browsing through a book on SQL Server optimization and it seemed that a certain amount of the ideas were based on a linear model of storage. As SSDs have a completely different storage ...
0
votes
3answers
1k views

SQL problems and answers book for a functioning SQL programmer

It was pointed out to me yesterday that I need to get a book on SQL and learn about it properly. That is probably a fair assessment; I'm a functioning SQL programmer who can in general extract from ...
3
votes
3answers
188 views

At what point should one consider using sql databases?

As the size of my data and the structures I use to hold it get larger and more complex, I start to wonder if I should learn to use sql databases. In the past, instead of unique tables, I would do ...
2
votes
2answers
2k views

SQL Auto Formatting and Auto Capatilize in Vim

I'd like to use vim for writing SQL queries, but I haven't figured out yet how to get two key features that I use all the time in programs like SQL Yog. I usually just start up an instance of Yog in ...
9
votes
6answers
996 views

What kind of Web development projects benefit from using ORM?

I'll start by saying that I've done 95% of my database work using SQL. Recently, I did some investigation of various ORMs, such as NHibernate and Doctrine. I can see the advantages of not needing to ...
16
votes
4answers
428 views

Database abstraction — is it being overdone?

After being exposed to numerous database abstraction layers, I'm starting to wonder what the point is of every library inventing their own different paradigm to access data. Picking up a new DAL feels ...
11
votes
7answers
919 views

How can I get programmers to stop writing code vulnerable to SQL injection?

Sometimes you get busy and delegate small tasks to junior programmers. But if you don't pay close enough attention you find yourself with this kind of code in production: class DivtoggleController ...
3
votes
6answers
341 views

Find material for improvement of my SQL ability [closed]

I need lots of training in SQL coding in MS SQL server The following part that is needed to be improved is: script T SQL Procedure Function Problem: Where can I get material to improve my ...
8
votes
3answers
1k views

Storing n-gram data

(hopefully I landed on the right stack exchange site) I was hoping to brainstorm a little bit on the subject of storing n-gram data. In my project, I am trying to solve linguistic problems where I ...
4
votes
4answers
723 views

What are the arguments for/against Code Generation?

I'm in a position where we've got some brittle code that constructs SQL-like queries via text concatenation with parameters for inputs. The data source that it queries is fast and scalable but lacking ...
1
vote
2answers
121 views

Book on Access and SQL [closed]

My little brother is a CPA but in his new job he is required to use access to pull his own data. He has grown frustrated with the limitations of the canned reports that he has access to. However he ...
5
votes
1answer
593 views

OpenID implementation - PHP, Javascript, MySQL

I've started doing some research on the technologies that I will need for my website. I'm trying to implement a really simple website with OpenID user registration. The website will store a block of ...
6
votes
6answers
854 views

Is the “One Description Table to rule them all” approch good?

Long ago, I worked (as a client) with a software which use a centralized table for it's codified element. Here, as far as I remember, how the table look like : Table_Name (PK) Field_Name (PK) Code ...
2
votes
4answers
2k views

Should I be learning Linq, Direct SQL Commands (in .net), EF or other? [closed]

Basically, I have a very good knowledge of plain old SQL coming from Classic ASP programming. Over the past couple of months, I have been learning C# and today was my first full day at MVC 3 (Razor) ...
1
vote
1answer
561 views

DB Schema for ACL involving 3 subdomains

I am trying to design a database schema for a web app which has 3 subdomains: a) internal employees b) clients c) contractors. The users will be able to communicate with each other to some degree, ...
5
votes
9answers
13k views

Are certification courses worth it? [duplicate]

I'm planning on getting certification in Database Development for SQL Server (MSTC - 70-433). I'm a junior level report writer at a new job and the company is offering to pay the majority, if not all, ...
1
vote
2answers
422 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 ...
9
votes
9answers
3k views

Foreign key restrictions -> yes or no?

I would like to hear some”real life experience” suggestions if foreign key restrictions are good or bad thing to enforce in DB. I would kindly ask students/beginners to refrain from jumping and ...
1
vote
3answers
413 views

PHP ORM style of querying

Ok so I have made an ORM library for PHP. It uses syntax like so: *(assume that $business_locations is an array)* Business::type(Business:TYPE_AUTOMOTIVE)-> ...
13
votes
13answers
1k views

Do SQL Devs create SQL queries using SQL Query Designers?

I was just curious if SQL Devs write their code freehand or do they make use of the visual query designer to generate queries? In the majority of the cases, the query designer can create most of ...
4
votes
4answers
2k views

DBMS agnostic - What to name the COUNT column from a SQL Query

I have trouble naming the COUNT() column from SQL queries and will swap between various variants _Count [Count] (sql, or "count" or backticks for MySQL etc) C Cnt CountSomething (where "something" ...
7
votes
7answers
6k views

Getting started with C# and Databases

I want to start using Databases in my C# Applications, unfortunately there appears to be lots of different ways of going about this. Which is the 'best' way from a learning perspective? (IE: What is ...
5
votes
2answers
680 views

Dependency analysis from C# code through to database tables/columns [closed]

I'm looking for a tool to do system wide dependency analysis in C# code and SQL Server databases. It's looking like the only tool available that does this might be CAST (CAST software), which is ...
3
votes
5answers
1k views

Do you test your SQL/HQL/Criteria?

Do you test your SQL or SQL generated by your database framework? There are frameworks like DbUnit that allow you to create real in-memory database and execute real SQL. But its very hard to use(not ...
39
votes
11answers
34k views

SQL: empty string vs NULL value

I know this subject is a bit controversial and there are a lot of various articles/opinions floating around the internet. Unfortunatelly, most of them assume the person doesn't know what the ...
15
votes
7answers
1k views

How do you version/track changes to SQL tables?

When working in a team of developers, where everyone is making changes to local tables, and development tables, how do you keep all the changes in sync? A central log file where everyone keeps their ...
11
votes
17answers
2k views

Is there still a need for writing SQL?

With so many ORM tools for most modern languages, is there still a use case for writing and executing SQL in a program, in a language/environment that supports them? If so why? For clarity: I'm not ...
13
votes
3answers
2k views

Best way to organize SQL queries stored in your code ? (or should you?) [closed]

I am sure I am not the only one who gets frustrated when they see a page of code littered with SQL queries. The ActiveRecord and other ORM patterns help mitigate a good amount of SQL used in a ...
20
votes
4answers
3k views

How do you decide what kind of database to use?

I really dislike the name "NoSQL", because it isn't very descriptive. It tells me what the databases aren't where I'm more interested in what the databases are. I really think that this category ...
1
vote
1answer
385 views

Understanding Microsoft SQL certifications

I am royally confused about the certifications Microsoft has out for SQL server. From what I can gather from reading their site as well as others is there are various levels of tests (like in ...
9
votes
7answers
3k views

Code formatting SQL queries

Should I break SQL queries in different lines? For example in the project I am working on, we have a query that is taking 1600 columns! 1600 + tab chars. I wrote queries like this: "SELECT bla , ...
2
votes
2answers
98 views

Best way to store revision information for quick access to view or revert changes

What I am looking for is the most optimal solution for storing content revisions in an MSSQL database. We have an application that allows users to make changes to small HTML content blocks similar to ...
22
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 ...
20
votes
11answers
3k views

My coworker created a 96 columns SQL table

Here we are in 2010, software engineers with 4 or 5 years or experience, still designing tables with 96 fracking columns. I told him it's gonna be a nightmare. I showed him that we have to use ...
5
votes
9answers
811 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 ...
3
votes
2answers
330 views

Oracle Tutorial [closed]

I am a very experienced SQL Server developer who is being thrust into an Oracle heavy environment. I want very much to start being useful and productive and need to get up to speed. I can read the ...
4
votes
3answers
848 views

Production-safe SQL stored procedure debugging

We have an enormous number of nested SQL stored procedures, and a number of different ways of debugging them (varying from developer to developer). So far, our methods include: An optional @debug ...
11
votes
5answers
6k views

What are questions to test a programmers knowledge of SQL? [closed]

What are questions to test a programmers knowledge of SQL? What is the answer to the question? And what would a lack of an correct answer mean in terms of time likely to understand the concept(s) ...
17
votes
2answers
4k views

What's the history of the non-official pronunciation of SQL?

SQL is officially pronounced as /ˌɛskjuːˈɛl/ like "S-Q-L", as stated in Beaulieu, Alan (April 2009). Mary E. Treseler. ed. Learning SQL (2nd ed.). Sebastapol, CA, USA: O'Reilly. ISBN ...
18
votes
9answers
2k views

Should a primary key be immutable?

A recent question on stackoverflow provoked a discussion about the immutability of primary keys. I had thought that it was a kind of rule that primary keys should be immutable. If there is a chance ...
24
votes
8answers
4k views

Are NoSQL databases going to take the place of relational databases? Is SQL going away? [closed]

Does anyone have experience with NoSQL databases (CouchDB, MongoDB, Google's BigTable, Dynamo, Cassandra...)? What was it like? Was it actual production/on the job experience? What will happen to ...