1,623 reputation
311
bio website none
location United Kingdom
age 42
visits member for 1 year, 7 months
seen May 20 at 13:49
stats profile views 145
.NET SQL.

Apr
22
accepted Meaning of 'SET' in error message 'Null value is eliminated by an aggregate or other SET operation'
Mar
19
awarded  Popular Question
Oct
12
awarded  Yearling
Sep
8
awarded  Necromancer
May
31
awarded  Nice Question
May
1
answered How do you ensure accuracy of your query
May
1
comment How do you ensure accuracy of your query
I don't think this approach is very useful. Say the results of the query is equivalent to ROW ( 2, 1, 1 ) -- either both rows violate one constraint each or one row violates both constraints but you can't say which is the case. And you know that once you tell someone there are two failures across two failure modes the next task will be, show me the bad data!
Apr
30
comment Advice on choosing a really fast DBMS
"choosing a really fast database" -- From the Stackoverflow 'database' tag wiki: The term 'database' should not be confused with Database Management System (DBMS). A database is an organized collection of data. A DBMS is the system software used to create and manage databases and provide users and applications with access to the database. A database is to a DBMS as a document is to a Word Processor.
Apr
19
comment What Is The Point of a Primary Key?
@ypercube: the other straw man is privately published books (answer: apply for an ISBN retrospectively). OK now so not only is it not unique but it's nullable too?! Or do you store the antique books in a separate table and find a new trusted source for identifiers e.g. codes used by the Antiquarian Booksellers'Association of America?
Apr
19
comment What Is The Point of a Primary Key?
@TRiG: if you have found two books with the same ISBN then then it has probably already been resolved by the trusted source (and the version on your copy of the book is now wrong) otherwise report it and they will resolve it. It's their job and that's why we have a trusted source!
Apr
18
comment Performance difference for COALESCE versus ISNULL?
"ISNULL seems easier to read since it seems more clear what it's doing" -- really? I find the name counter-unintuitive: I would expect it to return a Boolean indicating whether an expression resolved to null or unknown. The name COALESCE is merely unintuitive ;)
Apr
17
answered What are the design alternatives when having multiple “type” tables
Apr
16
comment Subqueries' aliases same as main queries' aliases
Simple example: SELECT * FROM ( SELECT c FROM T ) AS T2; -- no joins, no correlation yet the SQL standard requires that the derived table be assigned a range variable (T2 in this case).
Apr
16
comment Subqueries' aliases same as main queries' aliases
I'm not sure I understand your question. Perhaps I should make it clear that I was specifically responding to your comment, "The correlated subquery does not have an alias as it does not participate in a join as such." My response was supposed to convey the point that the rules regarding range variables (what the SQL standard calls 'correlation names' and you call 'aliases') are not directly related to their participation (or otherwise) in joins.
Apr
16
comment Confusion in BCNF
"As the various tutorials say, you probably don't need it" -- I've seen tutorials take the opposite view i.e. if BCNF fixes 3NF (your words) then we no longer need 3NF.
Apr
16
comment What's the point of WHERE 1=2 for SELECT INTO table query
Replica? No data, no constraints, no indexes, ... that's like buying a replica of a painting and discovering it is merely a blank canvas of the same dimensions of the original ;)
Apr
16
comment Subqueries' aliases same as main queries' aliases
The subquery in the first query is a derived table and standard SQL requires it to always be given a name: there is no logical reason for this requirement but SQL Server has implemented it anyway, though in the particular example you have chosen a name is indeed required. The subquery in the second query is not a derived table, hence why it does not require a name (the fact it is a correlated subquery is immaterial).
Apr
13
comment In SQL, is it composite or compound keys?
"In ER modelling the term "compound key" also has a more specific meaning" -- Sounds convincing :) But do you have a citation?
Apr
13
comment What does NVL stand for?
"There is a story here, but I don't remember the names of the X3H2 [SQL standard] Committee members involved. We came up with this function because everyone had an NVL() or IFNULL() or something in their product and we wanted a standard syntax for it. Someone else generalized it to a list, but nobody coudl come up with a name we all liked... someone pulled out a Thesaurus and started looking for a single word that nobody would use for a table name, column name or other function and that was not used in any existing product. You know who the winner was now [i.e. COALESCE]" -- Joe Celko.
Apr
13
comment What does NVL stand for?
Do you have a citation for this or are you merely guessing?