<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/eleven-sql-server-interview-questions-that-look-far-too-easy-i1q3x2ssd" -->

---
title: Eleven SQL Server Interview Questions That Look Far Too Easy
description: Eleven SQL Server behaviors that trip up even senior engineers, tested and verified on SQL Server 2025 RTM-CU7. Covers ANSI padding making 'SQLAuthority' equal...
canonical: https://daily.dev/posts/eleven-sql-server-interview-questions-that-look-far-too-easy-i1q3x2ssd
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Eleven SQL Server Interview Questions That Look Far Too Easy | daily.dev
og:description: Eleven SQL Server behaviors that trip up even senior engineers, tested and verified on SQL Server 2025 RTM-CU7. Covers ANSI padding making 'SQLAuthority' equal...
og:url: https://daily.dev/posts/eleven-sql-server-interview-questions-that-look-far-too-easy-i1q3x2ssd
og:image: https://api.daily.dev/og/posts/I1q3X2ssD.png
og:image:alt: Eleven SQL Server Interview Questions That Look Far Too Easy
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Eleven SQL Server Interview Questions That Look Far Too Easy

**[SQL Authority](https://daily.dev/sources/sql-authority)** · 21 min read · 2 upvotes · 0 comments

## Summary

Eleven SQL Server behaviors that trip up even senior engineers, tested and verified on SQL Server 2025 RTM-CU7. Covers ANSI padding making 'SQLAuthority' equal 'SQLAuthority ' despite LEN vs DATALENGTH disagreeing, why trailing-space detection differs for varchar vs char, SUM returning NULL versus COUNT returning 0 on empty tables, NULL comparisons silently excluding rows in WHERE clauses, integer division truncation, column alias scoping rules across WHERE and ORDER BY, IDENTITY values not being restored after ROLLBACK, deleting duplicate rows with no key, disabling a clustered index making a table completely inaccessible, an added index actually making a SELECT slower due to optimizer cost decisions, and foreign keys referencing unique (non-primary-key) columns plus silently allowed duplicate indexes. Each example includes runnable T-SQL and actual output, framed as interview questions meant to reveal real understanding rather than memorized trivia.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.sqlauthority.com/2026/08/20/eleven-sql-server-interview-questions-that-look-far-too-easy>

## Questions this post answers

### Why does disabling a clustered index in SQL Server make the whole table inaccessible instead of just slower?

Because in SQL Server the clustered index physically is the table's data structure, not a separate lookup structure. Disabling it with ALTER INDEX ALL ... DISABLE removes the query processor's only way to access the rows, producing error 8655 on both SELECT and INSERT statements until the index is rebuilt with ALTER INDEX ALL ... REBUILD, since there is no ENABLE command.

_daily.dev surfaces practical index-behavior breakdowns for engineers debugging or designing SQL Server schemas._

### Why would SELECT 1/2 return 0 in SQL Server?

Because both operands are integers, SQL Server performs integer division and silently discards the remainder without any warning, returning 0. Using 1/2.0 or casting one operand to decimal, such as CAST(1 AS decimal(10,2))/2, produces the expected 0.500000. Any client that displays only decimals like .500000 is a formatting artifact, not a different stored value.

_developers hunting silent rounding bugs in production queries can track this kind of engine quirk on daily.dev._

### Why does a WHERE clause with column <> 'Active' not return rows where the column is NULL?

Because a comparison against NULL evaluates to UNKNOWN rather than TRUE or FALSE under SQL's three-valued logic, and a WHERE filter only keeps rows where the condition is TRUE. To include rows with a NULL status alongside inactive ones, the query must explicitly add OR Status IS NULL to the WHERE clause.

_daily.dev helps developers catch NULL-handling gaps like this before they quietly drop rows from a report._

## Similar posts on daily.dev

- [SQL Has Rules You Don’t Notice Until Your Query Is Wrong](https://daily.dev/posts/sql-has-rules-you-don-t-notice-until-your-query-is-wrong-ue7ucmkyu) · Medium · 0 upvotes · 0 comments
- [30 .NET System Design Interview Questions That Actually Get Asked in…](https://daily.dev/posts/30-net-system-design-interview-questions-that-actually-get-asked-in--4bxbvg2ew) · Code with Mukesh · 44 upvotes · 4 comments
- [Beautiful T-SQL Queries: Three Could Delete the Company](https://daily.dev/posts/beautiful-t-sql-queries-three-could-delete-the-company-ni51yxeeb) · SQL Authority · 36 upvotes · 7 comments
- [Database Animations: The Interview Question Everybody Gets Wrong](https://daily.dev/posts/database-animations-the-interview-question-everybody-gets-wrong-gbyx7dzkb) · Brent Ozar · 0 upvotes · 0 comments

---

Tags: [#backend](https://daily.dev/tags/backend), [#sql](https://daily.dev/tags/sql), [#microsoft-sql-server](https://daily.dev/tags/microsoft-sql-server), [#interview-questions](https://daily.dev/tags/interview-questions)

[View this post on daily.dev](https://daily.dev/posts/eleven-sql-server-interview-questions-that-look-far-too-easy-i1q3x2ssd)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Eleven SQL Server Interview Questions That Look Far Too Easy","url":"https://daily.dev/posts/eleven-sql-server-interview-questions-that-look-far-too-easy-i1q3x2ssd","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/eleven-sql-server-interview-questions-that-look-far-too-easy-i1q3x2ssd"},"datePublished":"2026-08-20T01:32:58.437Z","dateModified":"2026-09-13T20:46:23.216Z","description":"Eleven SQL Server behaviors that trip up even senior engineers, tested and verified on SQL Server 2025 RTM-CU7. Covers ANSI padding making 'SQLAuthority' equal...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/69b26fac63d44937269bdf09e35bfcbc?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/69b26fac63d44937269bdf09e35bfcbc?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"SQL Authority","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"SQL Authority","logo":"https://media.daily.dev/image/upload/s--reCGnvgi--/f_auto,q_auto/v1780213436/logos/sql-authority?_a=BAMAMiWQ0","url":"https://daily.dev/sources/sql-authority"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/eleven-sql-server-interview-questions-that-look-far-too-easy-i1q3x2ssd","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"backend,sql,microsoft-sql-server,interview-questions","timeRequired":"PT21M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"SQL Authority","item":"https://daily.dev/sources/sql-authority"},{"@type":"ListItem","position":3,"name":"Eleven SQL Server Interview Questions That Look Far Too Easy"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/eleven-sql-server-interview-questions-that-look-far-too-easy-i1q3x2ssd#faq","mainEntity":[{"@type":"Question","name":"Why does disabling a clustered index in SQL Server make the whole table inaccessible instead of just slower?","acceptedAnswer":{"@type":"Answer","text":"Because in SQL Server the clustered index physically is the table's data structure, not a separate lookup structure. Disabling it with ALTER INDEX ALL ... DISABLE removes the query processor's only way to access the rows, producing error 8655 on both SELECT and INSERT statements until the index is rebuilt with ALTER INDEX ALL ... REBUILD, since there is no ENABLE command. daily.dev surfaces practical index-behavior breakdowns for engineers debugging or designing SQL Server schemas."}},{"@type":"Question","name":"Why would SELECT 1/2 return 0 in SQL Server?","acceptedAnswer":{"@type":"Answer","text":"Because both operands are integers, SQL Server performs integer division and silently discards the remainder without any warning, returning 0. Using 1/2.0 or casting one operand to decimal, such as CAST(1 AS decimal(10,2))/2, produces the expected 0.500000. Any client that displays only decimals like .500000 is a formatting artifact, not a different stored value. developers hunting silent rounding bugs in production queries can track this kind of engine quirk on daily.dev."}},{"@type":"Question","name":"Why does a WHERE clause with column <> 'Active' not return rows where the column is NULL?","acceptedAnswer":{"@type":"Answer","text":"Because a comparison against NULL evaluates to UNKNOWN rather than TRUE or FALSE under SQL's three-valued logic, and a WHERE filter only keeps rows where the condition is TRUE. To include rows with a NULL status alongside inactive ones, the query must explicitly add OR Status IS NULL to the WHERE clause. daily.dev helps developers catch NULL-handling gaps like this before they quietly drop rows from a report."}}]}
```

