Get Paid to Train AI Robots With Hub.xyz: Complete 2026 Guide Hub.xyz is a platform where people can earn money by recording real-world tasks using their phone. These recordings help AI and robotics companies train their models. Approved tasks can earn money depending on availability and quality approval. 👉 Start Earning With Hub.xyz Free Key Takeaways Record everyday activities using your smartphone AI companies use this data to improve robotics and machine learning No expensive equipment required Earnings depend on available tasks and approval rate Free signup process What Is Hub.xyz? Hub.xyz is part of the growing AI training data industry. Modern AI systems and robots need huge amounts of real-world examples to understand human actions. Platforms like Hub.xyz collect this type of data through contributors. Users complete recording tasks, submit them for review, and receive payment for approved work according to platform rules. How Does H...
SQL Practice Questions and Interview Examples
This guide provides hands-on SQL exercises and interview-style questions using real-world dataset formats. Perfect for students, job seekers, and data enthusiasts.
Sample Dataset: Employees Table
+----+--------+-----------+------------+---------+
| ID | Name | Dept | Salary | Joining |
+----+--------+-----------+------------+---------+
| 1 | Alice | HR | 50000 | 2019-05 |
| 2 | Bob | IT | 75000 | 2020-01 |
| 3 | Carol | Finance | 68000 | 2018-09 |
| 4 | Dave | IT | 80000 | 2021-03 |
| 5 | Eve | Finance | 70000 | 2020-07 |
+----+--------+-----------+------------+---------+
1. Basic Practice Questions
Q1. Select all employees in the IT department
SELECT * FROM employees WHERE dept = 'IT';
Q2. Find total salary paid to the Finance department
SELECT SUM(salary) FROM employees WHERE dept = 'Finance';
Q3. Count employees who joined after 2019
SELECT COUNT(*) FROM employees WHERE joining > '2019-12-31';
Q4. List employee names ordered by salary descending
SELECT name FROM employees ORDER BY salary DESC;
Q5. Find average salary by department
SELECT dept, AVG(salary) AS avg_salary FROM employees GROUP BY dept;
2. Intermediate SQL Exercises
Q6. Display the highest-paid employee in each department
SELECT dept, name, salary
FROM employees e
WHERE salary = (
SELECT MAX(salary)
FROM employees
WHERE dept = e.dept
);
Q7. Retrieve employees whose name starts with 'A'
SELECT * FROM employees WHERE name LIKE 'A%';
Q8. Add a new employee
INSERT INTO employees (ID, Name, Dept, Salary, Joining)
VALUES (6, 'Frank', 'HR', 55000, '2023-02');
Q9. Update salary of Bob by 10%
UPDATE employees
SET salary = salary * 1.10
WHERE name = 'Bob';
Q10. Delete employees from the HR department
DELETE FROM employees WHERE dept = 'HR';
3. Interview-Style SQL Questions
Q11. What is the difference between WHERE and HAVING?
WHERE filters rows before grouping; HAVING filters after aggregation.
Q12. Retrieve departments having more than 1 employee
SELECT dept, COUNT(*) AS emp_count
FROM employees
GROUP BY dept
HAVING COUNT(*) > 1;
Q13. Write a query to rank employees by salary in each department
SELECT name, dept, salary,
RANK() OVER (PARTITION BY dept ORDER BY salary DESC) AS rank
FROM employees;
Q14. Explain use of JOIN in multi-table queries?
JOIN is used to combine rows from multiple tables based on related columns (e.g., foreign keys).
Q15. What is the purpose of indexing?
Indexes speed up data retrieval by reducing the number of rows scanned.
Also Read:
Final Tips
- Practice regularly using mock datasets.
- Use platforms like LeetCode, Hackerrank, or SQLZoo for timed challenges.
- Understand logic, not just syntax.
For more tutorials, visit Sabbir93s SQL Series.
Comments
Post a Comment