Agile Softech
10+ Vivo Interview Questions and Answers
Q1. 13.How we can eliminate duplicates without using distinct command
To eliminate duplicates without using the distinct command in PL/SQL, we can use the GROUP BY clause.
Use the GROUP BY clause to group the data by the columns that you want to eliminate duplicates from.
Select the columns you want to display in the result set.
Aggregate functions like COUNT, SUM, AVG, etc. can be used to perform calculations on the grouped data.
The GROUP BY clause ensures that only unique combinations of the grouped columns are returned.
Q2. 3.what is joins and its types what is the use and what is natural join with example
Joins are used to combine rows from two or more tables based on related columns. There are different types of joins.
Types of joins: inner join, left join, right join, full outer join, cross join
Joins are used to retrieve data from multiple tables based on a related column
Natural join is a type of join that automatically matches columns with the same name in both tables
Example: SELECT * FROM employees NATURAL JOIN departments;
Q3. 2.how to recover the data(Tables) in oracle or how to export the tables in file
To recover data in Oracle, you can use the flashback feature or export tables using the Data Pump utility.
To recover data using flashback, you can use the FLASHBACK TABLE statement to restore a table to a previous state.
To export tables, you can use the Data Pump utility with the EXPDP command to export tables to a file.
You can also use the SQL Developer tool to export tables as SQL insert statements or CSV files.
Q4. 9.What is view and its type what is complex view with example
A view is a virtual table created from one or more tables. It can be used to simplify complex queries and provide a customized view of data.
A view is a stored query that can be treated as a table
Types of views include simple views, complex views, and materialized views
A complex view is a view that involves multiple tables or subqueries
Complex views can be used to combine data from different tables or apply complex calculations
Example of a complex view: CREATE VIEW employee_de...read more
Q5. 10.What is indexing what is the role of indexing in database
Indexing is a technique used in databases to improve the performance of queries by creating a data structure that allows for faster data retrieval.
Indexing creates a separate data structure that contains a subset of the data in the database, organized in a way that allows for efficient searching and retrieval.
Indexes are created on one or more columns of a table and can be used to quickly locate data based on the values in those columns.
By using indexes, database systems can ...read more
Q6. 8.Write a command of copy the structure only not data of the table
To copy the structure of a table without copying the data, you can use the CREATE TABLE AS SELECT statement.
Use the CREATE TABLE AS SELECT statement to create a new table with the same structure as the original table.
Specify the columns and their data types in the SELECT statement, but exclude the actual data from the original table.
Example: CREATE TABLE new_table AS SELECT * FROM original_table WHERE 1=0;
Q7. 1.What is Trigger,procedure,cursor differentiate with example
A trigger is a PL/SQL block that is automatically executed in response to a specific event. A procedure is a named PL/SQL block that performs a specific task. A cursor is a database object used to retrieve data from a result set.
A trigger is used to automatically execute a set of SQL statements when a specific event occurs, such as inserting, updating, or deleting data from a table.
A procedure is a reusable block of code that can be called multiple times to perform a specific...read more
Q8. 12.Write a query to display employee records having same salary
The query displays employee records with the same salary.
Use the GROUP BY clause to group the records by salary.
Use the HAVING clause to filter the groups with more than one employee.
Select the necessary columns to display the employee records.
Q9. 4.Differentiate Foreign key,primary key and unique key
Foreign key, primary key, and unique key are all constraints used in database tables to enforce data integrity.
Primary key is a column or a set of columns that uniquely identifies each row in a table.
Foreign key is a column or a set of columns in one table that refers to the primary key in another table.
Unique key ensures that the values in a column or a set of columns are unique across all the rows in a table.
Q10. 14.Replace Only Third Character with *
The PLSQL code snippet to replace only the third character with * in a given string.
Use the SUBSTR function to extract the first two characters of the string.
Concatenate the extracted characters with '*' and the remaining characters starting from the fourth position using the SUBSTR function.
Assign the modified string back to the original variable.
Q11. 5.6.Difference between delete,drop and truncate
Delete, drop, and truncate are SQL commands used to remove data from a table, but they differ in their functionality.
DELETE is used to remove specific rows from a table based on a condition.
DROP is used to remove an entire table from the database.
TRUNCATE is used to remove all rows from a table, but keeps the structure intact.
DELETE and TRUNCATE can be rolled back, but DROP cannot.
DELETE triggers the delete trigger, while TRUNCATE and DROP do not.
Q12. 11.Difference between Procedure and Function
Procedures and functions are both PL/SQL program units, but they have some differences.
Procedures do not return a value, while functions do.
Procedures can have OUT parameters to pass values back to the caller, while functions cannot.
Functions can be used in SQL queries, while procedures cannot.
Functions must return a value, while procedures do not have to.
Functions can be called directly in PL/SQL code, while procedures need to be called using the CALL statement.
Q13. 7.Display Top 5 salary
The query to display the top 5 salaries in PL/SQL.
Use the SELECT statement to retrieve the salaries from the table.
Order the salaries in descending order using the ORDER BY clause.
Limit the result to the top 5 rows using the FETCH FIRST clause.
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month