Users Pricing

forum

Home Forums Struggling with SQL Query – MindStick

Struggling with SQL Query

adhyaa khare 1394 21 May 2023

Hello everyone,

I am trying to solve an SQL query problem but I am having difficulty. I am trying to write a query that returns a list of employees who have worked in at least one department for more than 8 years.

The database consists of two tables:

Employee Table

Name | Age | Department

John | 30 | Marketing

Sara | 32 | Finance

Alice | 25 | HR

Employee History Table

Name | Department | Years of Experience

John | Marketing | 5

John | HR | 1

Sara | Finance | 8

Alice | HR | 10

I am trying to write a query to return the names of the employees and the departments they have worked in for more than 8 years, but I am having difficulty coming up with the correct syntax. Any help would be greatly appreciated!

Thank you.


2 Answers

Aryan Kumar 23 May 2023 Accepted Answer
ICSM Computer 21 May 2023 Accepted Answer
Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md