Filtrar y recuperar en SQL

Guía SQL para filtrar y recuperar solicitudes elegibles uniendo Applications, Users y Application_Details. Aplica edad mínima (nacidos antes de 2000-01-01), envío = 2023-07-21 y verificación documental (certificado de nacimiento y licencia).

19 ago 2025 • 2 min read • Q2BSTUDIO Team

Inteligencia-Artificial-

Filtering and Retrieving in SQL

Resumen del caso

Disponemos de tres conjuntos de datos llamados Applications, Users y Application_Details. El objetivo es identificar las solicitudes que califican para aprobación según tres reglas: edad minima 25 años nacidos antes del 1 de enero de 2000, fecha de envio en o antes del 21 de julio de 2023, y verificacion documental que exige certificado de nacimiento y licencia de conducir ambos presentes.

Explicación paso a paso

Paso 1 SELECT. Seleccionamos las columnas que queremos mostrar en el resultado final: el nombre del solicitante, su correo electronico y la fecha de envio de la solicitud.

Paso 2 FROM y JOIN. La tabla principal es Applications. Unimos Users por user_id para obtener nombre y email. Unimos Application_Details por application_id para obtener la fecha de envio. Las uniones son INNER JOIN para asegurarnos de que exista informacion en todas las tablas.

Paso 3 WHERE. Aplicamos los filtros de elegibilidad: A.dob menor que 2000-01-01 para cumplir la condicion de edad, D.submitted_date menor o igual que 2023-07-21 para la entrega oportuna, y TRIM(A.birth_certificate) igual a Y y TRIM(A.driving_license) igual a Y para la verificacion documental. TRIM ayuda a eliminar espacios accidentales en los campos de documento.

Paso 4 ORDER BY. Ordenamos por fecha de envio ascendente para que las solicitudes mas antiguas elegibles aparezcan primero.

Consulta de ejemplo en SQL

SELECT U.name, U.email, D.submitted_date FROM Applications AS A INNER JOIN Users AS U ON A.user_id = U.user_id INNER JOIN Application_Details AS D ON A.application_id = D.application_id WHERE A.dob < 2000-01-01 AND D.submitted_date <= 2023-07-21 AND TRIM(A.birth_certificate) = Y AND TRIM(A.driving_license) = Y ORDER BY D.submitted_date ASC

Resultados finales aprobados

De acuerdo con las reglas y los datos proporcionados, las solicitudes aprobadas son las siguientes

Aarav Sharma, aarav.s@example.com, 2023-05-18

Ananya Gupta, ananya.g@example.com, 2023-07-21

Sobre Q2BSTUDIO

Q2BSTUDIO es una empresa de desarrollo de software especializada en aplicaciones a medida y software a medida. Ofrecemos soluciones de inteligencia artificial e ia para empresas, desarrollamos agentes IA personalizados, implementamos estrategias de ciberseguridad y proporcionamos servicios cloud aws y azure. Ademas trabajamos con servicios inteligencia de negocio y herramientas como power bi para convertir datos en decisiones accionables. Nuestro equipo integra experiencia en aplicaciones a medida, inteligencia artificial, ciberseguridad, servicios cloud aws y azure, servicios inteligencia de negocio, agentes IA y power bi para ofrecer soluciones seguras, escalables y orientadas a negocio.

Si necesitas que preparemos un listado exportable, una consulta optimizada para tu base de datos o una pipeline que automatice la validacion de documentos y la toma de decisiones con modelos de inteligencia artificial, Q2BSTUDIO puede ayudarte.

A BREAK?

Play for a moment before you go

OUR SERVICES

How we can help you

Artificial intelligence

AI agents, chatbots, and intelligent assistants that automate tasks and serve your customers 24/7 to improve the efficiency of your business.

More info

Software Development

Web, mobile, and desktop applications, intranets, e-commerce, SaaS, and management platforms designed for your company's specific needs.

More info

Cloud services

Migration, infrastructure, managed hosting, high availability, and security on Microsoft Azure and Amazon Web Services to help your business scale without limits.

More info

Cybersecurity and pentesting

Security audits, penetration testing and protection of applications, data and infrastructure on-premise and cloud, with ethical hacking and regulatory compliance.

More info

Business Intelligence

Dashboards and data analysis with Power BI: we integrate your sources, design dashboards and KPIs and turn your data into decisions.

More info

Process automation

We automate repetitive tasks and connect your applications with n8n, Power Automate, Make, and RPA, eliminating manual work and increasing productivity.

More info

Training for Companies

We train your teams in technology with criteria: web development, databases, Git, best practices and security, automation with n8n, artificial intelligence for companies and creation of AI solutions with Azure AI Foundry.

More info

Code Auditing

We audit the code that you, your team or an AI create: we tell you what is good and what to improve, we secure it and make it ready for production, web or app.

More info

AI Image Generation

We create for you the images that your business needs with artificial intelligence: product, networks, advertising, illustration and avatars. You tell us what you want and we deliver it ready to use.

More info

AI Video Generation

We create videos with artificial intelligence for you: promotional, networking, virtual presenters, dubbing and animations. You tell us the idea and we will deliver it assembled and ready to publish.

More info

AI Conversational Avatars

We create conversational avatars with AI – digital humans with a face and voice – that serve your customers and teams with the knowledge of your company, on your website, interactive monitors, WhatsApp or Teams.

More info

Online Marketing and AI

Google Ads, Meta Ads, LinkedIn Ads and AI Engine Positioning (GEO/AEO): we attract customers and make your brand appear where they search for you, also on ChatGPT, Gemini and Perplexity.

More info

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.

Live Chat