TL;DR

A developer has created a neural network using only SQL commands, showcasing a new method of integrating machine learning directly into database systems. This development highlights potential for in-database AI processing.

A developer has successfully built a neural network entirely within SQL, demonstrating that complex machine learning models can be implemented without traditional programming languages. This achievement challenges the conventional separation between databases and AI development, highlighting potential for in-database AI processing.

The project was shared on Show HN by an individual who detailed their implementation of a neural network using only SQL queries and functions. The developer emphasized that their approach does not rely on external libraries or languages, but leverages advanced SQL features such as recursive queries, window functions, and user-defined functions to simulate neural network operations.

While the implementation is primarily a proof of concept, it demonstrates that fundamental neural network computations—such as matrix multiplications, activation functions, and backpropagation—can be approximated within SQL. The developer noted that this method is not optimized for performance but serves as a demonstration of SQL’s expressive power for complex algorithms.

At a glance
reportWhen: announced two weeks ago, ongoing discus…
The developmentA developer shared a project where they implemented a neural network entirely within SQL, challenging traditional boundaries of machine learning frameworks.

Implications for In-Database AI and Data Processing

This development is significant because it suggests that machine learning models could be integrated directly into database systems, reducing data movement and latency. In scenarios where data resides in SQL databases, running models without exporting data could streamline workflows and improve efficiency. It also opens questions about the potential for other AI algorithms to be implemented within SQL, leveraging existing database infrastructure.

Topics in Data Science with Practical Examples

Topics in Data Science with Practical Examples

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Machine Learning and Database Integration

Traditionally, machine learning models are developed using specialized frameworks like TensorFlow or PyTorch outside of databases. Data is then exported or connected via APIs for inference. Recent efforts have explored in-database machine learning, but implementing neural networks directly in SQL remains rare. The developer’s project builds on this trend, pushing the boundaries of what can be achieved within relational databases.

Two weeks prior to the project sharing, the developer was in Corfu, Greece, overseeing a GSoC intern working on their database library, Xarray-SQL. The intern added features like `to_dataset()`, indicating ongoing development focus on expanding SQL capabilities for data analysis and processing.

“Building a neural network entirely in SQL is a proof of concept that demonstrates the expressive power of modern SQL features.”

— Developer (via Show HN post)

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 Book 5)

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 Book 5)

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Limitations and Practicality of SQL-Based Neural Networks

It is not yet clear how scalable or efficient this SQL implementation is for real-world applications. The project is primarily a proof of concept, and performance constraints likely limit its use outside experimental or educational contexts. Further testing and optimization are needed to evaluate its viability for production environments.

Additionally, it remains uncertain whether this approach can be extended to more complex neural networks or other machine learning models, or whether it can be integrated into existing database systems at scale.

SQL for the AI Era: The Complete Handbook for Intelligent Data Systems, Machine Learning Readiness, and Real-World Automation (Foundations of Software and Data Systems in the AI Era)

SQL for the AI Era: The Complete Handbook for Intelligent Data Systems, Machine Learning Readiness, and Real-World Automation (Foundations of Software and Data Systems in the AI Era)

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Future Directions for In-Database AI Development

The next steps involve testing the implementation’s performance and exploring ways to optimize SQL-based neural networks. Developers and researchers may investigate hybrid approaches, combining SQL with external machine learning frameworks, or further pushing SQL’s capabilities for AI tasks. Community discussions and peer reviews could also influence future developments in this area.

It is also possible that database vendors might explore native support for AI operations, inspired by projects like this, to facilitate in-database machine learning workflows.

Database Design and Relational Theory: Normal Forms and All That Jazz

Database Design and Relational Theory: Normal Forms and All That Jazz

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

Is this implementation practical for real-world use?

Currently, the implementation is primarily a proof of concept. Its practicality for production depends on further optimization and scalability testing.

How does building a neural network in SQL compare to traditional frameworks?

Traditional frameworks like TensorFlow or PyTorch are optimized for performance and flexibility, while SQL-based implementations are more experimental and limited in efficiency but demonstrate SQL’s expressive power.

Could this approach be used for large-scale machine learning tasks?

It is unlikely at this stage, as SQL implementations are not optimized for large-scale computations. The focus is on demonstrating feasibility rather than practical deployment.

What are the benefits of integrating AI directly into databases?

In-database AI could reduce data movement, lower latency, and streamline workflows by enabling models to run where data resides, but practical implementations are still in early stages.

Source: hn

You May Also Like

The AI Backlash Could Get Very Ugly

Rising opposition to AI is fueling protests, threats, and potential violence amid fears over job losses and societal disruption.

Single Digits: The April That Closed the Open-Weight Gap

In April 2026, the benchmark gap between open-weight and closed proprietary AI models narrowed to single digits, reshaping AI economics and strategy.

A Skill Is A Folder, Not A Prompt: What Anthropic Learned Running Hundreds Of Them

Anthropic reveals that Skills are folders containing instructions, scripts, and data—transforming how organizations deploy AI for consistent, scalable results.

Three Public Vulnerabilities. Chained.

A complex chain of three publicly documented vulnerabilities enabled a supply-chain attack on TanStack npm packages, exploiting known weaknesses in GitHub Actions workflows.