Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!
Filter by
Sorted by
Tagged with
Filter by Employee ID
-2 votes
0 answers
39 views

Question from LeetCode SQL #602 using MySQL https://leetcode.com/problems/friend-requests-ii-who-has-the-most-friends/?envType=problem-list-v2&envId=m8baczxh My code: # Write your MySQL query ...
0 votes
3 answers
117 views

I have a MySQL table with about 5 million rows: CREATE TABLE orders ( id BIGINT PRIMARY KEY, customer_id BIGINT NOT NULL, status VARCHAR(20) NOT NULL, created_at DATETIME NOT NULL, ...
Best practices
1 vote
6 replies
160 views

Here is the example of a table: DROP TABLE IF EXISTS members CASCADE; CREATE TABLE members ( id SERIAL NOT NULL, creation_date TIMESTAMPTZ DEFAULT NOW() NOT NULL, update_date ...
Best practices
1 vote
2 replies
115 views

What are the best practices that saved you time when you started Data science / Data analysis for the first time? I want to learn for the first time and don't know how to start and what are the first ...
0 votes
1 answer
135 views

The first table I have stores fixed prices on product codes SellPriceRule and I show the query I have to get the list I want. The problem is for certain customers - using 1 as an example 7000192 - the ...
0 votes
1 answer
164 views

I have the following query: SELECT MAX(F.Surname + ', ' + F.First_Name) AS Female, ISNULL(MAX(M.Surname + ', ' + M.First_Name),'') AS Male, MAX(CP.Comp_Date) AS Comp_Date, H....
-9 votes
0 answers
155 views

I am working on project where a user needs to be able to extract a monthly usage of item(s). The setup for item association is as followed (I'll only mention relevant information): The user can create ...
Advice
1 vote
4 replies
158 views

In SQL Server, I have table myTable with fields patientID, orderID, and orderDesc. patients can have multiple orders with individually variable descriptions. I’m requested to write a query to select ...
Advice
0 votes
6 replies
140 views

Can I get any advice on how to optimize the naming for the months in the following code: (The date convention with the database is 'YYYY-MM-DD') Select strftime('%Y-%m', order_date) AS month, COUNT(...
-11 votes
0 answers
142 views

create table Movies ( movie varchar(100), genre varchar(100) ) create table Actors ( actorName varchar(100), movie varchar(100) ) create table Users ( userName varchar(...
Advice
0 votes
4 replies
129 views

Problem details: I'm working with a weather dataset in BigQuery and trying to calculate the average temperature for a specific date range. The temperature column contains numeric values, but my AVG() ...
Advice
0 votes
3 replies
120 views

I have the start and end times, along with other columns on the dataset. I want to know what SQL function to use to find the duration of the intervals. Some rows in the dataset have start and end ...
Best practices
0 votes
6 replies
130 views

I have a SQL table like this Id A B 1 value1 null 1 null value2 Is there a nice way to make a select query returning Id A B 1 value1 value2 Of course, I have many more rows lines and many more columns ...
Advice
1 vote
7 replies
157 views

Products: ProductID ProductName 1 Product1 2 Product2 Tags: TagID TagName 1 Tag1 2 Tag2 ProductTags (Bridge table between Products and Tags): ProductID TagID 1 2 1 2 ProductVariants: VariantID ...
1 vote
2 answers
191 views

For a non-admin user, with 'Select' permissions on a 'View', they are able to count the number of rows and display all the contents of a SQL 'View': select * from dbo.BackupInfoView; select count(*) ...

15 30 50 per page
1
2 3 4 5
44922