Find Jobs
Hire Freelancers

SQL Recursive Logic

$10-30 USD

En curso
Publicado hace 12 días

$10-30 USD

Pagado a la entrega
Stepping Back Through Data I have a table of orders, lets say. I'm trying to find all the "Completed" orders, and then step back through other "Cancelled" orders for the same Customer, that were created within 72 hours. The trick is, I want to keep stepping back until I don't find anymore orders (the 72 hour window will now be based on the last order found). Also, the logic should stop if it finds another "Completed" order for the same customer. I've included a test table and data, as well as an expected output. CREATE TABLE #Order ( OrderID int, CustomerID int, OrderDate datetime, OrderStatus varchar(25) ) INSERT INTO #Order VALUES (1, 1, '02/15/2024 07:00 AM', 'Cancelled') INSERT INTO #Order VALUES (2, 1, '02/17/2024 07:22 AM', 'Cancelled') INSERT INTO #Order VALUES (3, 1, '02/19/2024 02:00 PM', 'Cancelled') INSERT INTO #Order VALUES (4, 1, '02/21/2024 08:00 AM', 'Completed') INSERT INTO #Order VALUES (5, 2, '02/12/2024 07:00 AM', 'Cancelled') INSERT INTO #Order VALUES (6, 2, '02/17/2024 07:22 AM', 'Cancelled') INSERT INTO #Order VALUES (7, 2, '02/19/2024 02:00 PM', 'Cancelled') INSERT INTO #Order VALUES (8, 2, '02/21/2024 08:00 AM', 'Completed') INSERT INTO #Order VALUES (9, 3, '02/12/2024 07:00 AM', 'Cancelled') INSERT INTO #Order VALUES (10, 3, '02/13/2024 08:00 AM', 'Completed') INSERT INTO #Order VALUES (11, 3, '02/14/2024 07:22 AM', 'Cancelled') INSERT INTO #Order VALUES (12, 3, '02/15/2024 02:00 PM', 'Cancelled') INSERT INTO #Order VALUES (13, 3, '02/16/2024 08:00 AM', 'Completed') INSERT INTO #Order VALUES (14, 4, '02/16/2024 08:00 AM', 'Completed') /* CustomerID CompletedOrderID FirstOrderID ---------- ---------------- ------------ 1 4 1 (Order 3 is within 72 hours of Order 4, Order 2 is within 72 hours of Order 3, Order 1 is within 72 hours of Order 2) 2 8 6 (Order 7 is within 72 hours of Order 8, Order 6 is within 72 hours of Order 7, Order 5 is greater than 72 hours from Order 6) 3 10 9 (Order 9 is within 72 hours of Order 10) 3 13 11 (Order 12 is within 72 hours of Order 13, Order 11 is within 72 hours of Order 12, Order 10 is Completed - So it doesn't qualify) 4 14 Null
ID del proyecto: 38093802

Información sobre el proyecto

14 propuestas
Proyecto remoto
Activo hace 12 días

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
Hi! First let me rephrase to check if I am on the proper page. 1) you want a list of completed orders 2) for each order you want to find a "chain" of cancelled orders for the same customer for which 2a) gap between two cancelled orders is no more than 72h 2b) there is no completed order for the same customer in between these orders. I assume the engine is MySQL. Is that correct? MySQL supports recursive CTEs and that is possible to implement such a query. I could take a look at it, it should be no more than 1 hr work. For my MySQL literacy - please kindly take a look at my profile reviews. Kind regards, Jakub
$25 USD en 1 día
5,0 (8 comentarios)
5,8
5,8
14 freelancers están ofertando un promedio de $24 USD por este trabajo
Avatar del usuario
Hi, as I can understand, you need an SQL that will do the logic you described. I could make such query or in a programming language if preferred. This should be quick. Looking forward to hearing from you!
$20 USD en 1 día
5,0 (27 comentarios)
5,0
5,0
Avatar del usuario
As a seasoned full-stack developer with extensive experience in Java and MySQL, I am particularly well-suited to tackle your SQL Recursive Logic project. Over the years, I have dealt with numerous complex data scenarios and consistently found effective solutions to navigate and manipulate such situations using complex SQL queries. Your project's challenge aligns perfectly with my skill set. Throughout my career, I have consistently integrated efficient database systems using various technologies like Oracle, PostgreSQL, and MySQL. This not only includes optimizing queries but also utilizing recursion in databases to ensure robust performance. Thus, I understand how to leverage recursion for the specific task you require - stepping back through data within a time frame efficiently. Furthermore, my talent for finding optimal solutions, focus on detail, and commitment to meeting deadlines will guarantee that your project is not only completed effectively but on time. My abilities have helped me foster a strong track record of understanding client needs and translating them into practical applications. So let's collaborate on this project! I will apply my best efforts to add significant value to your use cases.
$20 USD en 7 días
5,0 (7 comentarios)
5,0
5,0
Avatar del usuario
As an experienced IT strategist with a deep understanding of SQL and PHP, I believe I am the right fit for your SQL recursive logic project. My thorough knowledge of backend technologies combined with expertise in SQL will enable me to develop complex queries that solve your specific problem statement. Having reviewed your test data set and expected output, I understand the importance of accurately identifying "Cancelled" orders for the same customer within the 72-hour window till no more records match and a "Completed" order is found. With my skills in PHP, I can effectively leverage SQL functions to achieve this recursive task. Moreover, I am not only committed to delivering innovative solutions but also tailoring them to meet unique client requirements and exceeding expectations -- traits that will be an asset as we collaborate on this project. Don't let this critical phase hold you back any longer - let's knock it out of the park together!
$20 USD en 7 días
5,0 (9 comentarios)
3,8
3,8
Avatar del usuario
Dear Client. Our team of experts provides the best possible service to our clients. We offer a wide range of services, including ERP and Microsoft 365 solutions to help businesses streamline their operations and achieve their goals. We are always on the lookout for new ways to help you succeed Our Approach - Conduct a thorough review to identify and resolve the issues. - Utilize best practices and tools to deliver clean, maintainable code. - Communicate progress regularly to ensure your satisfaction. Timeline and Pricing: - We can complete the necessary fixes within the agreed timeframe at agreed cost. This includes thorough testing to confirm the issues have been resolved. We believe in building long-term relationships with our clients and providing them with the support they need to succeed. Whether you are looking to transform your business or simply need help with your technology needs, we're here to help. Our team of knowledgeable and experienced engineers will work with you to develop a custom solution that meets your needs. We can work with your current system or help you find a new one. No matter what type of business you have, we are sure to have a solution that will help streamline operations and cut costs while improving customer satisfaction.
$20 USD en 7 días
5,0 (4 comentarios)
3,6
3,6
Avatar del usuario
As an accomplished senior software engineer with 6 years of experience, I'm confident that I have the necessary skills to tackle your SQL Recursive Logic project. Though my primary expertise lies in web development with a focus on Fintech, I have a solid grasp of database management and queries which are vital for this task. My specialization in PHP parallelly allows me to handle SQL efficiently, ensuring optimal and elegant code for your specific needs. For example, in your given scenario, I can expertly use recursive logic to track back orders for a customer within a 72-hour period until there are no more "Cancelled" orders. Additionally, I'll include a stopping mechanism that halts the search if another "Completed" order is found for the same customer. Having constantly dealt with complex data structures during my programming tenure, I am confident that I can deliver an output exactly as you expect. My rigorous attention to detail coupled with the ability to think through problems critically will ensure an efficient execution of this project.
$20 USD en 5 días
5,0 (4 comentarios)
2,7
2,7
Avatar del usuario
Hello, Stephen S. I would like to grab this opportunity and work with you, I will provide you unlimited Revisions! & I will work until you get 100% satisfied. I have 5+ years of experience on PHP, Java, SQL, Software Architecture, MySQL Lets connect in chat so that We discuss further. Regards, Zain Irfan.
$30 USD en 7 días
5,0 (2 comentarios)
2,5
2,5
Avatar del usuario
Hello! I can start immediately and can complete about your Database Management project to your full satisfaction with 1hr. As an experienced Senior Full Stack developer who Mastered PHP, Database Management as like MySQL, MongoDB and PostgreSQL with over 9years of experience. I would like to grab this opportunity and will work till you get 100% satisfied with my work. Thank you.
$50 USD en 1 día
5,0 (4 comentarios)
2,5
2,5
Avatar del usuario
I read your words. Here is my opinion about your query: This kind of query is typically used in analyzing customer behavior patterns, particularly how frequently a customer cancels before finally completing an order. This can provide insights into customer satisfaction or indecision, potentially indicating issues with the product, pricing, or purchasing process that might need addressing. Knowing which customers are prone to cancelling can help in crafting targeted marketing strategies to improve customer retention and reduce cancellation rates. If you want, I'll send you SQL code right now. Besides, If you have some project related this logic, I wnat to work on this project. Thanks
$20 USD en 1 día
5,0 (2 comentarios)
1,4
1,4
Avatar del usuario
With my vast experience in SQL and MySQL, I'm the perfect candidate to tackle your project "SQL Recursive Logic, Stepping Back Through Data." I can efficiently retrieve all the "Cancelled" orders for a given customer within a 72-hour window from the most recent "Completed" order. My mastery of SQL queries will enable stepping back through data until no more relevant orders are found. Having worked with and analyzed large datasets, your test table and data will pose no challenge for me. I always approach projects with the mindset of finding precise solutions while also ensuring optimal performance. My extensive skills in Java, MySQL, PHP, and SQL mean that I'm well-equipped to handle every aspect of your project professionally. Furthermore, my specialization in eCommerce platforms, UX design, and optimization complements this project perfectly as it requires creating a reliable and efficient logic for data retrieval. You can be assured that I'll not only deliver an error-free, highly functional solution but also a user-friendly interface that promotes easy navigation. Allow me to bring my skills and expertise to serve you by giving me the privilege of working on your project.
$20 USD en 1 día
5,0 (1 comentario)
0,6
0,6
Avatar del usuario
Hello Dear Client. I am very interested in your job. I am a Full Stack Developer, I have 7+ years experiences for Ecommerce and Business Website Development. My main skills are React / Next, Redux, JavaScript, Typescript, JQuery/Prototype, Ajax for Frontend and Node.js Express for Backend. I am also familiar with Bootstrap, Material UI, React and Angular Material UI, SASS/SCSS, HTML/HTML5, and both SQL/NoSQL database like MySQL, Postgre and Mongo. I have a good understand for your job and I can implement your requirement without issue. The implementation is not problem. The issue is our best relationship and my honest. I will always try my best for you and I will complete the project before the deadline. If you agree my proposal, let us discuss over chat.
$20 USD en 7 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
Iam pretty confident that I can deliver this within specified time. I have an experiment in MySQL querying
$20 USD en 7 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED STATES
Roswell, United States
5,0
7
Forma de pago verificada
Miembro desde nov 28, 2011

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.