Problems displaying this newsletter? View online.
SQL Server Central
Featured Contents
Question of the Day
The Voice of the DBA
 

Nobody Forgot Math With Calculators

That was a catchy subject in an email I recently received that said: "Nobody forgot how to do maths when calculators showed up", with the email talking about how the AI panic isn't appropriate and that I could interview someone who thinks the AI panic is overblown. The email postulated that publishing an interview would help executives (and many of us) learn to be comfortable with AI.

Have we forgotten math? I was a bit of a math whiz, as was my wife. We both studied through secondary school and then multiple years of calculus in college. We both can quickly estimate costs, hold numbers in our heads, and have a good handle on how finances work.

I'd say I haven't forgotten how to do math, but I'm worse at it. Lots of simple calculations are harder for me, and honestly, I reach for my mobile and a calculator quite often. I am definitely worse at math, though the concepts remain strong with me from years of applying them for purchases, financing, and more. Every fall I struggle to go simple math like 16 / 7 when I'm computing passing scores for volleyball players. It takes me a few weeks to internalize what ratios produce 1.3 v 1.7. I see other coaches just relying on apps and have no idea how to look at a score of 17 over 4 attempts and give a result in the heat of the moment. To be fair, I've moved to an app to make this easier, but mostly to track scores over time easily.

What if you didn't spend years working on math, learning the basic concepts before spending time with a calculator? Would you be worse at math? I think you might. In fact, you probably are worse at math.

Will we be worse at software development with years of AI writing code (and tests), with us just directing agents in the direction we need for a quick app to capture data? Will we understand what structures work well, or will we assume we can keep asking the AI to improve performance and things will be fine? Or just assume the AI has done the best job it can?

I honestly don't know. I've read a few science fiction books that speculated the state of software leveled off after AI was introduced, mostly because too few people were innovating and the models couldn't produce innovative new test data. Models stagnated in their development, as did most of software engineering.

If that happened, I think we'd be fine. There's lots of amazing software out there, and we could rewrite a lot of legacy systems, adding new capabilities with the peak of software architecture and engineering we have now, and most organizations would be fine. Not innovating doesn't mean we can't produce better software for users. It just might mean we level out on performance.

However, I don't think that will happen, though I do think the pace of innovation will slow as more people play with AI and less people research new areas and ideas. Or maybe AI will be of great assistance to those who still do look to push the envelope in their fields.

No matter what, it's going to be a wild next decade.

Steve Jones - SSC Editor

Join the debate, and respond to today's editorial on the forums

 
 Featured Contents
SQLServerCentral Article

Detecting Outliers in Power BI using Z-Score

Dinesh Asanka from SQLServerCentral

Learn how to use the z-score calculation in Power BI to detect anomalies in your data.

External Article

Why disaster recovery takes longer than your RTO (9 hidden causes)

Additional Articles from SimpleTalk

Recovery Time Objective (RTO) is the maximum downtime you'll accept. Learn why real recovery runs longer

Blog Post

From the SQL Server Central Blogs - SQL Server Linux Container Images Got Smaller: Image Size and Startup Time Across Cumulative Updates

aen from Anthony Nocentino Blog

This week I was at PASS Data Community Summit in Seattle, and I attended a session called “An Inside Look at How Microsoft Builds SQL Features, by Bob Ward,...

Blog Post

From the SQL Server Central Blogs - Using AI to Build Semantic Models, Ontologies, and Fabric Data Agents

James Serra from James Serra's Blog

(This is the third post in a three-part series on how AI is changing the way we build solutions in Microsoft Fabric. The first post explored how the new...

SQL Server 2025 Unveiled: The AI-Ready Enterprise Database with Microsoft Fabric Integration

SQL Server 2025 Unveiled: The AI-Ready Enterprise Database with Microsoft Fabric Integration

Site Owners from SQLServerCentral

With built-in AI for application development and advanced analytics powered by Microsoft Fabric, SQL Server 2025 empowers you to innovate—securely and confidently. This book shows you how.

 

 Question of the Day

Today's question (by Steve Jones - SSC Editor):

 

Missing Returns

I have a few tables in my SQL 2025 database:
CREATE TABLE [dbo].[Customer]
(
[CustomerID] [int] NOT NULL,
[CustomerName] [varchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[AddressKey] [int] NULL,
[CustomerStatus] [int] NULL,
[CustomerContact] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ContactEmail] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PreferredName] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Customer] ADD CONSTRAINT [CustomerPK] PRIMARY KEY CLUSTERED ([CustomerID]) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Orders]
(
[OrderID] [int] NOT NULL,
[CustomerID] [int] NOT NULL,
[ProductID] [int] NOT NULL,
[OrderDate] [date] NOT NULL,
[Quantity] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Orders] ADD CONSTRAINT [PK__Orders__C3905BAFE0146D59] PRIMARY KEY CLUSTERED ([OrderID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Orders] ADD CONSTRAINT [FK_Orders_Customers] FOREIGN KEY ([CustomerID]) REFERENCES [dbo].[Customers] ([CustomerID])
GO
ALTER TABLE [dbo].[Orders] ADD CONSTRAINT [FK_Orders_Products] FOREIGN KEY ([ProductID]) REFERENCES [dbo].[Products] ([ProductID])
GO
CREATE TABLE dbo.CustomerReturn
( EntryID INT NOT NULL CONSTRAINT CustomerReturnPK PRIMARY KEY
, CustomerID INT
, ReturnDate DATETIME
, OrderID INT NOT NULL
)
GO
There are multiple rows in all these tables. I am trying to find how many customers have never returned anything, and I run this:
SELECT count(*)
FROM dbo.Customer
WHERE CustomerID NOT IN
      (
          SELECT CustomerID FROM dbo.CustomerReturn
      );
I get zero rows, but I know there are customers who have not returned anything. What is wrong?

Think you know the answer? Click here, and find out if you are right.

 

 

 Yesterday's Question of the Day (by Steve Jones - SSC Editor)

Finding the Black Friday Sales Ranking

We are tracking sales for Black Friday today. We have these aggregate values:

CREATE TABLE dbo.BlackFridaySales
(
    Product NVARCHAR(50) NOT NULL PRIMARY KEY,
    Units   INT          NOT NULL
);

INSERT INTO dbo.BlackFridaySales (Product, Units)
VALUES (N'55" TV',          900),
       (N'Air Fryer',       500),
       (N'Noise-Cancel Headphones', 500),
       (N'Robot Vacuum',    300);

I'm trying to get a ranking of the sales that would return 1, 2, 2, 3 for the product levels. Which query does this?

Answer: SELECT Product, Units,DENSE_RANK() OVER (ORDER BY Units DESC) AS SalesRank FROM BlackFridaySales;

Explanation: The answer is C, with DENSE RANK().

  • ROW_NUMBER() returns sequential numbers - 1, 2, 3, 4
  • RANK() returns a spread list - 1, 2, 2, 4
  • DENSE_RANK() compresses things - 1, 2, 2, 3
  • NTILE() returns 1, 1, 2, 3

Ref: DENSE_RANK() - https://learn.microsoft.com/en-us/sql/t-sql/functions/dense-rank-transact-sql?view=sql-server-ver17

Discuss this question and answer on the forums

 

 

 

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.


SQL Server 2017 - Administration
Weird problem altering logins with sysadmin account - Has anyone ever seen this before? I have sysadmin permission on a server. I tried to run code to revoke connect to a login (REVOKE CONNECT TO [MyDomain\WindowsSecurityGroup];), which failed with this error: Msg 15151, Level 16, State 1, Line 5 Cannot find the user 'MyDomain\WindowsSecurityGroup', because it does not exist or you do not […]
Anything that is NOT about SQL!
Life hack that has worked well for me - I wrote about this several years ago but will contribute again a life hack that has helped me.  It comes to mind again as I have just had to have a new pair of glasses made again because they did not follow my prescription.  Many of us spend many hours looking at computer displays, in […]
Editorials
Data Lost in the Cloud - Comments posted to this topic are about the item Data Lost in the Cloud
Pay for Performance - Comments posted to this topic are about the item Pay for Performance
People Matter - Comments posted to this topic are about the item People Matter
Helping an English Student with R - Comments posted to this topic are about the item Helping an English Student with R
Article Discussions by Author
Switching Schema II - Comments posted to this topic are about the item Switching Schema II
A Practical Approach to Automating SQL Server Email Notifications - Comments posted to this topic are about the item A Practical Approach to Automating SQL Server Email Notifications
Server-level Roles - Comments posted to this topic are about the item Server-level Roles
Tracking Inserted, Updated, and Deleted Rows with SQL Server OUTPUT - Comments posted to this topic are about the item Tracking Inserted, Updated, and Deleted Rows with SQL Server OUTPUT
Adding Bits I - Comments posted to this topic are about the item Adding Bits I
Implementing System-Versioned Temporal Tables in SQL Server: A Practical Guide - Comments posted to this topic are about the item Implementing System-Versioned Temporal Tables in SQL Server: A Practical Guide
Switching Schemas I - Comments posted to this topic are about the item Switching Schemas I
Enforcing Unique Customer Emails When Duplicates Already Exist - Comments posted to this topic are about the item Enforcing Unique Customer Emails When Duplicates Already Exist
SQL Server 2022 - Development
Trying to make this faster using not exists - Hi I have this query that is slow during the 'not in' part of the statement: LEFT JOIN dbo.benefitplan BP ON BP.benefitplan_id = ci.benefitplan_id LEFT JOIN dbo.benefitplan_type pt ON pt.benefitplan_type_id = BP.benefitplan_type_id WHERE k.BatchSeq BETWEEN '1' AND '1000000' AND ci.claim_procedure_id NOT IN (35381320,35381310,35381304,35381305,35381311,35381306,35345478,35381307,35381293,35381308,35392585, 35392587,35381298,35381321,35345407,35381324,35392582,35381326,35381299,35381325,35381295,35381323,35345410,35381297, 35336186,35381314,35345409,35381319,35392584,35336187,35336218,35336217,35381312,35381294,35381303,35381296,35381318, 35381300,35381327,35381315,35381317,35336185,35381309,35381322,35392586,35381313,35345408,35392583,35345477,35381316) where k.BatchSeq BETWEEN '1' AND '1000000' So I thought […]
 

 

RSS FeedTwitter

This email has been sent to {email}. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com. This newsletter was sent to you because you signed up at SQLServerCentral.com.
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
webmaster@sqlservercentral.com

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -