DataBeat
Infogain Interview Questions and Answers
Q1. A village population increased by 20% in which 15% increased in male and 50% in female. Whose contribution is More?
50% increase in female population contributed more to the overall population increase in the village.
Calculate the actual increase in male and female population separately.
Compare the percentage increase in male and female population.
The group with the higher percentage increase contributed more to the overall population increase.
Q2. What is primary key and foreign key
Primary key uniquely identifies each record in a table, while foreign key establishes a link between two tables.
Primary key ensures each record is unique
Foreign key establishes a relationship between tables
Primary key can be a single column or a combination of columns
Foreign key references the primary key of another table
Q3. What we consider for creating table
When creating a table, factors to consider include data types, column names, primary keys, relationships, and constraints.
Consider the data types for each column (e.g. integer, text, date)
Choose appropriate column names that are descriptive and easy to understand
Define primary keys to uniquely identify each row
Establish relationships between tables using foreign keys
Set constraints to enforce data integrity (e.g. unique, not null)
Q4. Difference between where and having
WHERE is used to filter rows before grouping, HAVING is used to filter groups after grouping.
WHERE is used with SELECT statement to filter rows based on a condition
HAVING is used with GROUP BY statement to filter groups based on a condition
WHERE is applied before grouping, HAVING is applied after grouping
Example: SELECT * FROM table_name WHERE column_name = 'value'
Example: SELECT column_name, COUNT(*) FROM table_name GROUP BY column_name HAVING COUNT(*) > 1
Q5. Difference between delete and truncate
Delete removes rows one by one, while truncate 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 triggers delete triggers, while truncate does not trigger any triggers
Delete is slower than truncate for large tables
Example: DELETE FROM table_name WHERE condition;
Example: TRUNCATE TABLE table_name;
Q6. Explain about joins?
Joins are used in databases to combine rows from two or more tables based on a related column between them.
Joins are used to retrieve data from multiple tables in a single query.
Common types of joins include inner join, left join, right join, and full outer join.
Inner join returns only the matching rows between the tables.
Left join returns all rows from the left table and the matching rows from the right table.
Right join returns all rows from the right table and the matching ...read more
More about working at DataBeat
Interview Process at Infogain
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month