Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
100 views

This is an idea of how my table looks - no country language translatedName 1 c1 en test1EN1 1 c1 l1 testL1 2 c2 en test1EN2 2 c2 l2 testL2 This is how the data might look like where a country can have ...
Avani Agrawal Nath's user avatar
1 vote
1 answer
67 views

I have an Employees table with the following structure: ID Name ManagerID Salary 1 Alice NULL 90000 2 Bob 1 80000 3 Charlie 1 85000 4 David 2 75000 5 Eve 2 70000 6 Frank 3 72000 I need a single SQL ...
Safwaa Samin's user avatar
4 votes
2 answers
102 views

I have a case where I have a list of pairs, each with two numerical values. I want to find the subset of these elements containing only those pairs that are not exceeded by both elements of another (...
teepee's user avatar
  • 2,724
1 vote
1 answer
38 views

I want to write a query that returns names and their best friends name from the table below: Example FRIEND Table: FriendID Name BestFriendID 1 Abby 2 Bob 3 3 Carl 2 Expected Output: Name Bestfriend ...
ConsistentToast's user avatar
2 votes
3 answers
126 views

Data Definition I have a status table like so, attributes not relevant to the question are omitted: id created value 1 2024-06-24T13:01:00 error 2 2024-06-24T13:02:00 ok 3 2024-06-24T13:03:00 warning ...
nouser2013's user avatar
-1 votes
1 answer
38 views

Sample data AIID NIC Status Remarks ID AddedBy ADT 28 9595 ON THE WAY NO 8 0 2024-06-06 16:02:33 27 9595 ABSENT NO 8 0 2024-05-20 16:02:33 26 573 VISITED NO 10 0 2024-05-09 15:31:55 25 573 ON THE WAY ...
RITZ's user avatar
  • 1
0 votes
1 answer
159 views

I was going through my course material for the SQL class that I am taking and it mentioned that in order to make programs run faster and run in one pass using joins verses a subquery. It stated that ...
ImpossibleInc's user avatar
-1 votes
1 answer
53 views

edit: I have a db table with two columns: id and dep, that lists all department names. is it possible to run a query (either self join or subquery) that returns the dep column twice (dep1 and dep2). ...
user1469's user avatar
  • 109
0 votes
1 answer
137 views

I want to make my end node send join requests to the gateway continuously. My goal is to send join requests continuously until the end node connected to the gateway, and if the connection is broken ...
Mr._Nileshkumar_Solanki's user avatar
-1 votes
1 answer
86 views

Is there a quick and simple way in SQL to accomplish this, I have drawn up a long way to prevent this, by doing a "nested" self reference. Is there a simpler way? Issue: When you are ...
Austin Dady's user avatar
-2 votes
1 answer
89 views

I have a task to get the common students who have taken the exam in the current month (November 2023) and must have taken at least one attempt in last 12 months as well. So the look back period is of ...
Jaideep's user avatar
  • 15
0 votes
4 answers
77 views

I have a table with two columns. First one is an autoincrement ID column, second one is a datetime column where next data should be in future to the previous. I need to select values where it is not ...
Іван Крічфолуші's user avatar
0 votes
4 answers
85 views

Suppose, we've a table named college. In this table we've the following columns: College ID, College name, State and Established in. Now I want to find the names only of those colleges where the ...
MD Junaiedur Rahman 's user avatar
0 votes
2 answers
81 views

CREATE TABLE accounts ( "id" INTEGER, "parent_account" INTEGER, "merchant_type" VARCHAR(8), "name" VARCHAR(32) ); INSERT INTO accounts ("id"...
Yogyakartas's user avatar
0 votes
1 answer
49 views

I am learning SQl on microsoft learn. During an exercise Microsoft provided a datamodel. On the bottom Right there is a line with a key pointing to itself. What does that mean?
Kees Lasser's user avatar
0 votes
1 answer
76 views

How can I make a query that aggregates data from entities and their children down to the lowest level? I have two tables. The first is tblEntity, a self-join table with entity and parent entity ...
jason's user avatar
  • 1
0 votes
1 answer
543 views

I have purchases, which may (or may not) have an associated sub-purchase, which i've modelled with a self-join as: class Purchase < ApplicationRecord has_one :sub_purchase, class_name: 'Purchase',...
Dan SimBed's user avatar
0 votes
1 answer
76 views

For my Employee class, I have the following self-joinig associations: class Employee < ApplicationRecord belongs_to :replaces_employee, class_name: "Employee", optional: true has_one ...
nmadoug's user avatar
  • 47
1 vote
1 answer
61 views

Let's assume the following dataframe: library(dplyr) dat <- tibble( Structure = c("A", "B", "X", "A-X", "B-X", "C-X", "A-Y"...
Schmuddi's user avatar
  • 2,106
-3 votes
1 answer
212 views

I have a table formatted as such age height name 15 180 george 16 192 phil 20 148 lily 17 187 george 19 196 phil 24 147 lily 19 190 george 20 199 phil 22 148 lily 21 190 george 27 197 phil 60 138 lily ...
AlbinoRhino's user avatar
-1 votes
1 answer
63 views

select * from ( select * from ( select *, unnest(product_ids) as product_id from orders ) t1 inner join ( select *, unnest(product_ids) as product_id_1 from orders ) t2 on t1....
Георгий Мальцев's user avatar
0 votes
1 answer
76 views

I have the entity Event which will have 1 or more EventDay(s), that will represent a contignous time period in a given day. e.g. Event A has 2 EventDays: EventDay 1 - date: 10.10.2000; startingAt: 10:...
Mar's user avatar
  • 187
0 votes
0 answers
53 views

I want to fetch records from a table. I have 2 records for each invoice in a table and I want to join them so that I can show 1 record. The situation is something like this: I have 2 invoice records ...
Shahreyar Butt's user avatar
-1 votes
1 answer
67 views

So, I want to show which employees (names) have subordinates and how many subordinates they have (I was using self-join). It works fine if I use count and group by looking at the "manager_id"...
user14474247's user avatar
-2 votes
1 answer
85 views

I'm using SQL Server with a table about video game sales from the years (1977-2020). The query below is what I've been using to solve the problem: finding the #1 game with the highest sales for each ...
Nickolas Jaramillo's user avatar

1
2 3 4 5
26