Show HN: I implemented a neural network in SQL

TL;DR

A programmer has successfully implemented a neural network using only SQL commands, showcasing a novel approach to integrating AI directly within databases. This development could impact how AI models are deployed and accessed in data systems.

A developer has publicly shared that they have implemented a functioning neural network entirely within SQL commands, marking a significant technical achievement. This effort demonstrates the potential for running AI models directly inside database systems, which could influence future data processing and AI deployment strategies.

The developer, known on Show HN as sharing their project, described how they constructed a neural network from scratch using only SQL queries. This includes defining layers, weights, and activation functions within the constraints of SQL syntax. The implementation was showcased as a proof of concept, illustrating that complex machine learning models can be built without relying on external libraries or languages like Python or C++.

While the project is still in experimental stages, the developer claims that the neural network can perform basic classification tasks. The implementation leverages SQL’s capabilities for data manipulation, combined with recursive queries and stored procedures to simulate neural network operations. The developer emphasized that this approach aims to explore the boundaries of SQL’s computational potential, not necessarily replace existing ML frameworks.

At a glance
reportWhen: announced recently, within the last two…
The developmentA developer shared on Show HN that they built a neural network entirely in SQL, challenging traditional boundaries between databases and machine learning.

Implications for Data Processing and AI Deployment

This development matters because it challenges the assumption that neural networks and machine learning require specialized frameworks and programming languages. By demonstrating that a neural network can be built and run within SQL, it opens new avenues for integrating AI directly into database systems, potentially reducing data transfer overhead and simplifying deployment pipelines. If scalable, this approach could enable real-time AI inference within database queries, streamlining workflows for data-driven applications.

The Wireless Networking Starter Kit

The Wireless Networking Starter Kit

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background on AI and Databases Integration Efforts

Traditionally, machine learning models are developed using languages like Python, with frameworks such as TensorFlow or PyTorch, and then deployed separately from databases. Recent efforts have explored in-database analytics, but implementing neural networks directly in SQL remains rare and largely experimental. The developer’s project builds on this trend, showcasing a novel method that could influence future research and development in this area.

Two weeks prior to the project sharing, the developer was overseeing a GSoC intern working on a database library called Xarray-SQL, which included features like `to_dataset()`. This context highlights ongoing efforts to expand SQL’s capabilities for data science tasks, although the neural network implementation is an independent achievement.

“Building a neural network in SQL is a proof of concept that pushes the boundaries of what’s possible within relational databases.”

— the developer on Show HN

SQL: Learn SQL (using MySQL) in One Day and Learn It Well. SQL for Beginners with Hands-on Project. (Learn Coding Fast with Hands-On Project)

SQL: Learn SQL (using MySQL) in One Day and Learn It Well. SQL for Beginners with Hands-on Project. (Learn Coding Fast with Hands-On Project)

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Limitations and Scalability of SQL-Based Neural Networks

It remains unclear how well this SQL-based neural network performs compared to traditional implementations, especially at scale. The project is currently a proof of concept, and questions about efficiency, accuracy, and practical deployment are still unanswered. It is also uncertain whether this approach can be extended to complex models or larger datasets without significant modifications.

Mastering MCP: The New Era of AI Integration: How to Connect LLMs (Claude, ChatGPT) to Your Databases, APIs, and Local Files to Build Autonomous Agents ... Python (AI Engineering & Local LLMs Book 2)

Mastering MCP: The New Era of AI Integration: How to Connect LLMs (Claude, ChatGPT) to Your Databases, APIs, and Local Files to Build Autonomous Agents … Python (AI Engineering & Local LLMs Book 2)

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Next Steps for Development and Validation

The developer plans to further refine the implementation, evaluate its performance on more complex tasks, and explore scalability. Community feedback and peer review are expected to determine whether this approach could influence future database and AI integration efforts. Additional experiments may focus on optimizing SQL queries and leveraging database-specific features for better performance.

Relational Database Design and Implementation: Clearly Explained

Relational Database Design and Implementation: Clearly Explained

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

Why would someone implement a neural network in SQL?

To explore the boundaries of SQL’s computational capabilities and investigate the possibility of integrating AI directly into database systems, potentially reducing data transfer and simplifying deployment.

Is this approach practical for real-world AI applications?

Currently, it is experimental and not suitable for large-scale or production use. Its main value lies in research and demonstrating the potential of SQL for AI tasks.

Could this method replace traditional machine learning frameworks?

Unlikely in the near term, but it could complement existing tools by enabling certain AI functions to run directly within databases, especially for small-scale or embedded applications.

What are the main challenges of implementing neural networks in SQL?

Performance limitations, difficulty scaling to complex models, and the need for extensive query optimization are key challenges that currently restrict practical use.

Will this inspire further research in database-based AI?

Yes, this project could motivate further experimentation and innovation in integrating AI models within relational databases and other data systems.

Source: hn

You May Also Like

Q3 2026 SaaS Earnings Pre-Brief: The Litmus Test for the Agentic-Disruption Thesis

Preliminary analysis of Q3 2026 SaaS earnings highlights ongoing market revaluation of agentic AI models and consumption-based SaaS, signaling a potential shift in industry economics.

Order A Burned CD Of Your Own Public GitHub Repo

A new service allows users to order a burned CD of their public GitHub repositories, blending digital code with physical media for collectors and developers.

Waves, Not a Wall: Inside DeepMind’s Map From AGI to Superintelligence

DeepMind researchers released a detailed framework outlining pathways from artificial general intelligence to superintelligence, highlighting key challenges and future directions.

The Enforcement Countdown: 89 Days Until the EU AI Act’s GPAI Penalty Phase Begins

The EU AI Act’s enforcement powers for GPAI providers activate in 89 days, allowing fines up to €35M or 7% of turnover. Major companies face compliance deadlines.