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

18
votes
5answers
1k views

What good reasons are there to capitalise SQL keywords?

There seem to be a lot of developers who write their SQL by capitalising the keywords: SELECT column FROM table INNER JOIN table ON condition WHERE condition GROUP BY clause HAVING ...
4
votes
2answers
787 views

SQL Query helper/builder? [closed]

We have a flex based front end, that talks via JDBC to some databases. Part of the GUI has some forms that let the users construct Queries in SQL to pull back records from the database. However, we ...
47
votes
14answers
3k views

Is SQL important if I know ORM frameworks well? [closed]

I don't have any serious experience in SQL and I even hate to write SQL instead of LINQ. I am happy enough with ORMs. From the employers and sector view point, is it important to know SQL? Do I have ...
-1
votes
1answer
1k views

How to begin writing a relational SQL database [closed]

I was wondering about how databases like MySQL and SQLite are developed to run as quickly and as well as they do. I'm looking for answers to questions like: How is SQL token-ized? Do you build an ...
4
votes
6answers
941 views

How can I improve upon this “pattern”?

I have a series of method calls that all share similar qualities. The basic layout is public void CallDataBase() { Utility sqlHelper = new Utility(); StringBuilder query = new ...
4
votes
5answers
3k views

SSIS: How long does it usually take to bring a new hire up to speed? [closed]

I’m a self-taught SQL developer that has worked for small to mid-sized companies. Most of my experience has been writing SQL statements for reporting, data scrubs, and never in a formalized IT ...
2
votes
2answers
935 views

Database for storing books by grouping, their pages, and the table of contents

I'm looking for a better way to deal with the design I have here, I'm not confident it's really suitable. To give this some context, lets say we have a bunch of groups, one group could be "SQL", and ...
12
votes
3answers
692 views

Is reliance on parametrized queries the only way to protect against SQL injection?

All I have seen on SQL injection attacks seems to suggest that parametrized queries, particularly ones in stored procedures, are the only way to protect against such attacks. While I was working (back ...
1
vote
2answers
711 views

SQL injection attacks, how do I test and secure coldfusion queiries?

I'm running Coldfusion 8 and SQL server 2008. I've been building serveral forms that insert data into the database from external users, we have a custom built security module built by the guy who ...
7
votes
1answer
776 views

How to document an algorithm properly with sample data?

I am wondering what should an algorithm documentation contain? Can't locate a proper guideline to follow. I have in mind to include summary of the algorithm description of the algorithm flowcharts ...
14
votes
5answers
1k views

Why is filesystem preferred for logs instead of RDBMS?

Question should be clear from its title. For example Apache saves its access and error logs in files instead of RDBMS no matter on how large or small scale it is being utilized. For RDMS we just have ...
3
votes
1answer
261 views

Equality between arity and degree concepts in relational theory

I've been reading the book "SQL and Relational Theory: How to Write Accurate SQL Code" by C. J. Date. I have no formal background in CS, much less relational theory. Combined with the fact English is ...
61
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
558 views

UML to portray SQL objects

I am delving into the science of UML. The tool I am using is ArgoUML. I feel very confident portraying OO designs through this tool. But what still vexes me is the incorporation of the database. ...
36
votes
11answers
2k views

Why don't relational databases support returning information in a nested format?

Suppose I'm building a blog that I want to have posts and comments. So I create two tables, a 'posts' table with an autoincrementing integer 'id' column, and a 'comments' table that has a foreign key ...
3
votes
8answers
8k views

Learning Java in a couple of days and preparing interview presentation [closed]

I know its not possible to 'know' or 'learn' Java fully in a couple of days but I really need some help on this guys. I have just graduated from university with a degree in computer science. The ...
4
votes
3answers
690 views

Is LinqPad site quote “Tired of querying in antiquated SQL?” accurate?

I was struck by the heading Tired of querying in antiquated SQL? on http://www.linqpad.net/. I am a N-Tier application developer and learnt my trade in a company that worked with a lot of data, ...
12
votes
11answers
12k views

Why is prefixing column names considered bad practice?

According to a popular SO post is it considered a bad practice to prefix table names. At my company every column is prefixed by a table name. This is difficult for me to read. I'm not sure the ...
2
votes
1answer
446 views

Active Record library with support for both SQL and NoSQL?

I'm looking for a PHP Active Record library that supports both SQL and NoSQL drivers (mongodb in particular). It doesn't matter if it actually has the NoSQL driver, I can write it myself, as long as ...
1
vote
2answers
685 views

If you're a .NET developer, does getting the Microsoft Certified Master SQL Server 2008 cert make sense? [duplicate]

So I've been working at a job for the past year as a .NET developer/DBA. The job is my first DBA job. Traditionally, I'm a .NET developer and have about 5 years experience in it. Does it make sense ...
5
votes
4answers
5k views

Why SQL numeric precision is specified as the number of digits?

I understand that this might be a loaded question. For example, in Sql Server 2008, doing DECLARE @someNum NUMERIC(10); means that the range of the variable will be limited by 10 digits. In other ...
4
votes
6answers
130 views

Arguments for storing binary asociations in a single field vs. in a mapping table?

When do you draw the line between relational tables, and fields holding multiple values of a particular type. Let me illustrate in an example below where a PokeMaster can be associated to multiple ...
6
votes
3answers
484 views

Types of databases

I read that there exists three main types of databases * Transactional (Client-Server database// OLTP database) * Decision support system (DSS) (Data warehouse database // Data mart // Reporting ...
2
votes
2answers
695 views

Most commonly used free-of-charge linux and SQL distributions

I'm looking to reduce the initial costs of starting a business. As much as I like Windows Server 2008 and SQL Server 2008, I think their per-processor sale model is very expensive. Plus, if the ...
8
votes
3answers
455 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
228 views

Is this a worthwhile course to take? [closed]

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 ...
17
votes
8answers
6k 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
257 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
190 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
1k 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
438 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
928 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
350 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
2k 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
781 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
122 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
624 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
892 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
617 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
16k 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
440 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 ...
10
votes
9answers
4k 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
423 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" ...