CCS Global Tech
TKIL Interview Questions and Answers
Q1. Write q query to fetch the details of employees who are in the same department
Query to fetch details of employees in the same department
Use SELECT statement to fetch employee details
Use JOIN to join employee and department tables
Use WHERE clause to filter employees in the same department
Q2. What is difference between delete and truncate command in SQL?
Delete command removes rows one by one while truncate command removes all rows at once.
Delete is a DML command while truncate is a DDL command.
Delete can be rolled back while truncate cannot be rolled back.
Delete command fires triggers for each row deleted, while truncate does not.
Delete command is slower as it maintains logs for each row deleted, while truncate is faster as it does not maintain logs.
Delete command can have a WHERE clause to specify which rows to delete, whil...read more
Q3. What's the difference between where and having clause
WHERE clause filters rows before grouping, 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 before GROUP BY clause
HAVING clause is used after GROUP BY clause
WHERE clause cannot contain aggregate functions
HAVING clause can contain aggregate functions
Example: SELECT department, AVG(salary) FROM employees WHERE age > 30 GROUP BY department HAVING AVG...read more
Q4. How to delete duplicate records in a table?
Use SQL query with GROUP BY and HAVING clause to delete duplicate records in a table.
Identify the columns that define a duplicate record
Write a SQL query to select the duplicate records using GROUP BY and HAVING clause
Delete the duplicate records using DELETE statement with the identified criteria
Q5. What is oops and what are its advantages
OOPs is a programming paradigm that uses objects to represent real-world entities and provides encapsulation, inheritance, and polymorphism.
Encapsulation: Hides the implementation details of an object from the outside world
Inheritance: Allows creating a new class from an existing class
Polymorphism: Allows objects of different classes to be treated as if they are of the same class
Advantages: Reusability, Modularity, Flexibility, Maintainability
Example: A car can be represented...read more
Q6. How to join two table with inner join?
To join two tables with inner join, use the JOIN keyword along with the ON clause to specify the join condition.
Use the JOIN keyword to combine rows from two tables based on a related column between them
Specify the join condition using the ON keyword followed by the columns to join on
Example: SELECT * FROM table1 INNER JOIN table2 ON table1.column = table2.column
Q7. Different types of joins
Different types of joins are Inner Join, Left Join, Right Join, and Full Outer Join.
Inner Join returns only the matching rows from both tables.
Left Join returns all the rows from the left table and matching rows from the right table.
Right Join returns all the rows from the right table and matching rows from the left table.
Full Outer Join returns all the rows from both tables, including non-matching rows.
Interview Process at TKIL
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month