AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Mysql join two tables11/11/2023 SELECT p.product_id, p.product_name FROM products p LEFT OUTER JOIN transaction t ON p.product_id = t.product_id WHERE t.transaction_id IS NULL 4. SELECT p.product_id, p.product_name, total_amount FROM products p JOIN ( SELECT product_id, SUM(transaction_amount) AS total_amount FROM transaction GROUP BY product_id ORDER BY total_amount DESC ) t ON p.product_id = t.product_id WHERE ROWNUM = 1 3. SELECT * FROM ( SELECT transaction_id, customer_id, transaction_date, product_id, transaction_amount, ROW_NUMBER() OVER (ORDER BY transaction_date DESC) AS rn FROM transaction WHERE customer_id = 1 –(let 1) and transaction_date >= TRUNC(SYSDATE, ‘MM’) – 30 ) WHERE rn <= 10 order by transaction_id,customer_id 2. Or, you can also jump to our below two sections on SQL query interview questions for freshers and experienced professionals.ġ. Write a query to find the 3rd highest salary from a table without top or limit keyword.Write an SQL query to fetch only odd rows from the table. Write an SQL query to fetch duplicate records from EmployeeDetails.Write an SQL query to fetch all the Employees who are also managers.Fetch employee names and salaries even if the salary value is not present for the employee.Write an SQL query to fetch a project-wise count of employees.Fetch all employees from EmployeeDetails who have a salary record in EmployeeSalary.SQL query to fetch all the Employees from EmployeeDetails who joined in the Year 2020.SQL query to fetch all the employees who are not working on any project.
0 Comments
Read More
Leave a Reply. |