Hexaware Technologies
10+ Social Cults Interview Questions and Answers
Q1. SQL Query to find such records which never ever contains flag 0 in critical column p1 1-1-21 1 p1 2-3-21 0 p2 3-2-21 0 p3 1-5-21 1 p3 1-5-21 1 p4 14-21 1
The SQL query to find records that never contain flag 0 in the critical column.
Use the NOT EXISTS operator to check if there are no records with flag 0 for each distinct value in the critical column.
Write a subquery to select distinct values from the critical column.
Join the main table with the subquery using the critical column.
Filter the result by checking if there are no records with flag 0 for each distinct value in the critical column.
Q2. How to do validation between two integers Source 12345 2122434 54534535 5345353455 target 0000012345 0002122434 0054534535 5345353455
To validate between two integers, compare each corresponding digit and check if they are equal.
Convert both integers to strings
Pad the source integer with leading zeros to match the length of the target integer
Compare each digit of the source and target integers
If any digit is not equal, the validation fails
Q3. Suppose we have following column what will be output for inner join col1 col2 1 1 1 null null null 1 1 1 blank blank blank
The output for inner join will be the rows where both col1 and col2 have non-null values.
Inner join returns only the matching rows from both tables.
In this case, the output will be the rows with non-null values in both col1 and col2.
Rows with null or blank values in either col1 or col2 will be excluded from the output.
Q4. What is the difference between set & join?
Set and join are operations used in database management systems.
Set is used to perform mathematical set operations like union, intersection, and difference on two or more sets.
Join is used to combine rows from two or more tables based on a related column between them.
Set operations do not require a common column, while join operations do.
Set operations return a result set with unique values, while join operations return a result set with combined values.
Examples: UNION, INTER...read more
Q5. 1 2 3 . . . 100 we want 100 at first row & rest below it
The question is asking to rearrange the numbers so that 100 is at the first row and the rest are below it.
Create an array of strings to store the numbers
Assign the value '100' to the first element of the array
Use a loop to assign the numbers 1 to 99 to the remaining elements of the array
Q6. Query to fetch only numbers from alphanumeric data from a table.
Use regular expressions to extract numbers from alphanumeric data in a table.
Use the REGEXP_REPLACE function in SQL to replace all non-numeric characters with an empty string.
For example, SELECT REGEXP_REPLACE(column_name, '[^0-9]', '') FROM table_name;
This will return only the numbers from the alphanumeric data in the specified column.
Q7. Query to fetch data greater than average, min and max salary.
Query to fetch data greater than average, min and max salary.
Calculate average, min, and max salary first
Use a SELECT statement with WHERE clause to filter data greater than average, min, and max salary
Q8. What is Scalar function with example.
Scalar function is a function that returns a single value based on input parameters.
Scalar functions are used in SQL to perform calculations on input values and return a single result.
They can be used in SELECT statements, WHERE clauses, and other SQL queries.
An example of a scalar function is the ABS() function, which returns the absolute value of a number.
Q9. Query to fetch 5th highest salary
Use SQL query with ORDER BY and LIMIT to fetch 5th highest salary.
Use ORDER BY clause to sort salaries in descending order
Use LIMIT 1 OFFSET 4 to fetch the 5th highest salary
Q10. What is normalization
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity.
Normalization involves breaking down data into smaller, more manageable parts.
It helps in reducing data redundancy by storing data in a structured manner.
Normalization ensures data integrity by avoiding anomalies like insertion, update, and deletion anomalies.
There are different normal forms such as 1NF, 2NF, 3NF, BCNF, and 4NF.
For example, in a database table, instea...read more
Q11. Common validation in etl testing
Common validation techniques in ETL testing include data completeness, data accuracy, data transformation, and data quality checks.
Data completeness validation ensures that all expected data is loaded into the target system.
Data accuracy validation involves verifying that the data is correctly transformed and loaded without any errors.
Data transformation validation checks if the data is transformed according to the business rules and requirements.
Data quality checks involve v...read more
Interview Process at Social Cults
Top ETL Tester Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month