TL;DR

A developer has shared a project where they implemented a neural network entirely within SQL. This showcases the potential for advanced AI computations directly in databases, sparking discussions on database capabilities and AI integration.

A developer has publicly shared a project where they implemented a neural network entirely in SQL. This development demonstrates the possibility of running machine learning models directly within relational databases, challenging traditional approaches that rely on specialized frameworks and hardware. The project, posted on Hacker News, aims to showcase how SQL’s expressive power can be extended to support AI computations, sparking interest among database and AI communities.

The project was shared in a Show HN post by a developer who detailed how they constructed a neural network using only SQL queries. The implementation includes core neural network components such as input layers, weights, biases, activation functions, and backpropagation, all expressed through SQL statements. The developer claims this approach allows neural network training and inference within a standard relational database environment, without external machine learning libraries.

While the post provides code snippets and explanations, it is not a full production-ready system but rather a proof of concept. The developer emphasizes that this demonstrates SQL’s potential for complex data manipulations and computations, extending its traditional role beyond data retrieval and management. Experts have noted that this approach could open new avenues for integrating AI directly into data storage systems, potentially reducing data movement and latency.

At a glance
reportWhen: announced March 2024
The developmentA developer posted a Show HN about creating a neural network solely using SQL queries, highlighting a novel approach to AI in databases.

Implications for Database and AI Integration

This development highlights the possibility of running neural network computations within relational databases, which could streamline AI workflows by reducing the need for data transfer between systems. It suggests that databases could evolve to support more complex analytics and machine learning tasks natively, potentially simplifying deployment and improving performance for data-driven applications. However, the project remains a proof of concept, and scalability or efficiency concerns are yet to be addressed.

Neural network detection of resource-intensive database queries: Development of methods and algorithms for clustering database queries based on self-organizing Kohonen maps

Neural network detection of resource-intensive database queries: Development of methods and algorithms for clustering database queries based on self-organizing Kohonen maps

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background on AI in Databases

Traditionally, machine learning models are trained and run using specialized frameworks like TensorFlow or PyTorch, often outside of databases. Recent efforts have explored integrating AI into database systems through extensions or external APIs. The idea of implementing neural networks directly in SQL is novel, as SQL is primarily designed for data management rather than complex numerical computations. This project builds on ongoing discussions about leveraging SQL’s expressive power for advanced analytics, including recent experiments in in-database machine learning.

Two weeks prior to the posting, the developer was in Greece overseeing a project related to their database library, Xarray-SQL, suggesting ongoing interest in pushing the boundaries of database capabilities. The project also coincides with broader industry trends toward in-database AI, aiming to minimize data movement and latency in data pipelines.

“This is a proof of concept to show that neural networks can be expressed entirely in SQL, opening new possibilities for AI directly in databases.”

— the developer

Modern Fullstack Development with Database Systems: Management of Relational and Non-Relational Repositories Employing Object Relational Mapping Tools by Backend Focused Experts

Modern Fullstack Development with Database Systems: Management of Relational and Non-Relational Repositories Employing Object Relational Mapping Tools by Backend Focused Experts

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Limitations and Practicality of SQL Neural Networks

It remains unclear how scalable or efficient this SQL-based neural network implementation is. The project is primarily a proof of concept, and questions about training speed, model complexity, and resource consumption are still unanswered. Additionally, it is not yet confirmed whether this approach can match the performance of specialized machine learning frameworks in real-world applications.

Database Systems: Introduction to Databases and Data Warehouses, Edition 2.0

Database Systems: Introduction to Databases and Data Warehouses, Edition 2.0

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Future Directions for In-Database AI Development

Further research is expected to explore optimizing SQL-based neural networks for performance and scalability. Developers and researchers may experiment with integrating such implementations into existing database systems or developing dedicated extensions. Additionally, community feedback and peer review could lead to more refined in-database AI tools, potentially influencing future database architectures to natively support machine learning tasks.

SQL with AI: A Complete Beginner's Guide to SQL, Databases, Data Analysis, and AI-Powered Querying

SQL with AI: A Complete Beginner's Guide to SQL, Databases, Data Analysis, and AI-Powered Querying

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

Can a neural network built in SQL outperform traditional frameworks?

Currently, it is unlikely, as SQL implementations are mainly proof of concept and not optimized for large-scale training or inference. Performance comparisons are still to be established.

What are the advantages of implementing AI directly in SQL?

Potential benefits include reducing data movement, lowering latency, and simplifying data pipelines by integrating AI computations within the database environment.

Is this approach practical for real-world AI applications?

At this stage, it is primarily a proof of concept. Practical, scalable applications would require significant further development and optimization.

Could this lead to new features in database systems?

Yes, if further research demonstrates scalability and efficiency, future database systems might natively support machine learning models and neural network operations.

Source: hn

You May Also Like

Show HN: Pulpie – Models For Cleaning The Web

Pulpie, developed by Feyn, introduces Pareto optimal models to strip boilerplate from HTML, enhancing web data extraction. Details on capabilities and impact.

Build vs Buy a Prebuilt AI Workstation

Struggling to choose between building or buying your AI workstation? Discover the latest insights, real costs, and practical tips for 2026’s AI boom.

Customer service + BPO. The operational-scale displacement.

Approximately 8 million workers in India and the Philippines face operational-scale displacement due to AI integration in customer service and BPO sectors by 2030.

Undervolting Your GPU for Local Inference: Lower Heat, Same Tokens/sec

Undervolting your GPU via power limiting can significantly reduce heat and noise during inference workloads with minimal performance loss.