Skip to main content

Posts

Showing posts from April, 2024

Difference between Delete and Truncate in oracle sql plsql interview question and answer for fresher,intermediate and experienced.

 " Most important question asked in oracle sql plsql interview" Introduction: Delete and Truncate is used to remove the data from the relational table. SQL developer have to decide where to use these both concepts. By understanding the concept, it is useful for handling the data. Well analysis of all the rows to be deleted before using truncate command. Difference: Delete Truncate It is a Data Manipulation Language command. It is a Data Definition Language command. Syntax: Delete from tablename where condition; Delete from tablename; Syntax: Truncate table tablename; Delete command is slower than truncate. Truncate command is faster. Delete contain the where clause. Truncate don’t contain the where clause. It is used to remove or delete the specified row or tuple from the table using where clause. In absence of where clause, it i

Difference Between Primary Key and Unique Key in oracle sql plsql interview question and answer.

 "T his is an excepted question in an SQL Developer interview. " Introduction: Key play an important role in data integrity and an efficient access to the records in the relational databases. It is used to prevent the data from being duplicated. It maintains the reliable relationship between the tables. There are several types of keys which are below listed: Primary Key Candidate Key Super Key Foreign Key Unique Key Alternate Key Primary Key: It is applied on the columns of the table which helps in identifying each row or tuple uniquely. It enforces integrity constraint on the table. Only one primary key is applied in a table. It does not accept any null and duplicate values. It does not accept null and duplicate values. It's value is rarely changed in a table. Primary key in one table can acts as foreign key in another table. Let us understand the concept with the help of student table example. create table student (roll_no int not null,sname varchar2(15),dept_name varch

Difference between Simple and Composite Index in oracle sql plsql interview question and answer.

 " Infosys interview question has been asked. " DIFFERENCE: SIMPLE INDEX COMPOSITE INDEX If the index is created only one field of the table is called as simple index. If the index is created more than one field of the table is called as composite index. Only one entry is created in the simple index. Multiple entries are created in the composite index. It is also called as single column index. It is also called as multiple column index. It is composed of single columns. It is composed of multiple columns. Data which is accessed by the single variable. Data which is accessed by the multiple variables. Syntax: create index index_name on table_name(column_name); Syntax: create index index_name on table_name(column_name1,column_name2); Example: create index si on emp(empno); Example

Difference between clustered and Non-Clustered Indexes in Oracle Sql PLSQL Interview Question and Answer.

  "It is an important question which is asked in an interview as indexing topic." INTRODUCTION: In the SQL server, primary key constraint automatically builds the clustered index on the column. There will be only one clustered index per table. It is used to sort the data of the table alphabetically as like dictionary structure. Single table can contain multiple non-clustered indexes. It collects the data and record at one place simultaneously. CLUSTERED INDEX: It is the kind of the special type of index which reorders the ways that the records of data of the table are physically stored to match with an index. Whenever the primary key constraint is created on the table, database engine by auto creates the clustered index. View or data are sorted based on the key and values. It stores the data permanently on the disk. It is created only when both the below conditions are satisfied: Moved data or file in the secondary memory should be sequential and properly sorted fashion. Key

Difference between correlated and non correlated subquery in oracle sql plsql interview question.

 "It is the accepted question in oracle SQL and plsql interview question." INTRODUCTION: Subqueries can be classified into the two parts i.e. Correlated and non-correlated subquery. In both mention subquery, there is the combination of outer and inner query. Same select statement are used for both the sub-queries. Execution of the sub query can include from and where clause, group by, having and order by clause. It contains the select statement inside the another select statement. It is used with the update and delete statements. Correlated subquery is also called as the simple subquery. Not frequently, both subqueries type is providing the same results. Subquery is also called as the nested query. SQL query is divided into two parts i.e. inner subquery and outer subquery. Outer query is called as the parent query. Inner query is called as the child query. Subqueries can be defined as the query which is nested in the other query. Subquery can be used to update the database by

Difference view and Materialized view in Oracle SQL PLSQL Interview Question and Answer.

 " This is excepted question in oracle interview. It is asked in oracle technical support,PLSQL developer, SQL Analyst and SQL developer. " INTRODUCTION: View and Materialized view are called as the database object or the named query. View is the virtual table which stores the select statement from the base table by execution of the sql query at the runtime. View Query is running for the view definition. In the case of the materialized view, the data from the base table is loaded in the temporary or physical memory location by which the materialized view gets refreshed and all the dependent tables on the materialized view are also get updated after refresh operation. Materialized views are used in lakhs lines of code. In the data lake, tables are dependent on the master table to get updated where more than lakhs line of codes, today every reporting is based on this, in that case materialized view are used and preferred on the master tables. An activity of materialized view wi