Skip to content
Advertisement

Tag: database

Find missing rows between three related tables

I have three tables: Person Dates Absence I need to find all of the person_id’s in the Person table and the date’s from the Dates table who have not booked any absence matching the following criteria: Dates.date_type = ‘PUBLIC_HOLIDAY’ Absence.absence_type = ‘HOLIDAY’ Basically, I need to find the people and the dates which are public holidays they have not booked

Convert this SQL into eloquent ORM

I want to convert the following sql statement into eloquent: I did this as like below: The problem is that it is converting to the same sql but showing error. The error is shown below: * order_number, order_id, sum(quantity) as qty, sum(price) as pr from orders right join order_details on orders.id = order_details.order_id group by order_number) * The tables are:

Best technology for building race simulation application

I am trying to do something new, something I have never done before. I am looking for advice or point me into right direction how to choose technology. I am trying to build race simulation app that will have thousands of iot devices streaming data into central platform. While I understand that I can use some sort of IOT hub

CS50 Pset 7 13.sql, I can’t solve it, nested sqlite3 database

DataBase movies.db tables directors (movie_id, person_id) movies (id, title, year) people (id, name, birth) ratings (movie_id, rating, votes) stars (movie_id, person_id) you can download the database. Question I’m new in programming, so I decided, to begin with, CS50 Harvard course here is the problem and the test solution: In 13.sql, write a SQL query to list the names of all

Group by not getting the expected results in mysql

I have the next query: That is working perfectly and returning 9 rows: I want to group the results by boat type and get the number of boats per type. However, when I do: I´m getting: but according to the first query, I´m expecting What am I missing? Answer I suspect that you want: That is: move the DISTINCT within

using condition for Group_Concat

I want to find all ids of which group_concat only contains ‘a’. Here is simplified table from mine. ╔════╦══════════════╦ ║ id ║ group_concat ║ ╠════╬══════════════╬ ║ 1 ║ a,b,b ║ ║ 2 ║ a …

Advertisement