Add office photos
Employer?
Claim Account for FREE

Quosphere InfoSolutions

2.3
based on 21 Reviews
Filter interviews by

Celebal Interview Questions and Answers

Updated 5 Feb 2024

Q1. What are views, functions, stored procedures

Ans.

Views, functions, and stored procedures are database objects used to manipulate and retrieve data.

  • Views are virtual tables that display data from one or more tables in a specific way.

  • Functions are reusable code blocks that perform a specific task and return a value.

  • Stored procedures are precompiled SQL statements that can be executed with parameters.

  • All three objects can improve performance and simplify complex queries.

  • Examples include creating a view to display only certain ...read more

Add your answer

Q2. Write a query to get salary based on tenure of employees

Ans.

Query to retrieve salary based on employee tenure

  • Use the DATEDIFF function to calculate the tenure of each employee

  • Join the employee and salary tables on the employee ID

  • Filter the results based on the tenure of the employee

  • Select the employee name and salary

Add your answer

Q3. Difference between where and having clause

Ans.

WHERE clause filters rows before grouping and HAVING clause filters groups after grouping.

  • WHERE clause is used to filter rows based on a condition

  • HAVING clause is used to filter groups based on a condition

  • WHERE clause is used with SELECT, UPDATE, DELETE statements

  • HAVING clause is used with GROUP BY clause

  • WHERE clause is executed before GROUP BY clause

  • HAVING clause is executed after GROUP BY clause

Add your answer

Q4. Write a query to get manager commission based on employee commission

Ans.

Query to calculate manager commission based on employee commission

  • Join the employee and manager tables on the manager ID

  • Calculate the total commission earned by each employee

  • Calculate the total commission earned by all employees under each manager

  • Calculate the manager commission as a percentage of the total employee commission

  • Return the manager name and commission amount

Add your answer
Discover Celebal interview dos and don'ts from real experiences

Q5. What are triggers

Ans.

Triggers are database objects that automatically execute in response to certain events or changes in data.

  • Triggers can be used to enforce business rules and data integrity

  • They can be used to audit changes to data

  • Triggers can be used to replicate data to other systems

  • Examples of events that can trigger a trigger include INSERT, UPDATE, and DELETE statements

Add your answer

Q6. Delete duplicate rows

Ans.

To delete duplicate rows, use the DISTINCT keyword or GROUP BY clause.

  • Use the DISTINCT keyword to select unique rows from a table.

  • Use the GROUP BY clause to group rows with the same values together.

  • Use the HAVING clause to filter out groups with more than one row.

  • Use the DELETE statement with a subquery to delete duplicate rows.

  • Example: DELETE FROM table_name WHERE id NOT IN (SELECT MIN(id) FROM table_name GROUP BY column_name);

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter