Question:- What is the Syntax to Disable a Trigger?
Answer:- ALTER TRIGGER TRIGGER_NAME DISABLE;
Question:- How to Display the Highest Salary from an Employee Table?
Answer:- Use the following code to display the highest salary from an employee table: Select max(sal) from emp;
Question:- Which Command is used for Deleting a Package?
Answer:- The command used for deleting a package is DROP PACKAGE
Question:- How to Display the Second Highest Salary from an Employee Table?
Answer:- Select max(sal) from emp where sal not in ( select max(sal) from emp
Question:- How can you view the User-defined Functions and Procedures in PL/SQL?
Answer:- The table USER SOURCE is used to store user-defined functions and procedures. To examine them, the function and procedure names should be specified in uppercase (in select command). The following command is used to inspect the source code of a user-defined function or method: Select text from user_source where name=’PROCEDURE_NAME’;
Question:- In PL/SQL, what is the Purpose of the DBMS_OUTPUT Package?
Answer:- The PL/SQL output is shown on the screen using the DMS_OUTPUT package. get_line, put_Line, new_line, and many more are found in DBMS_OUTPUT. The put_line procedure, which is a part of the DBMS_OUPUT package, is used to display the information in the line.
Question:- How can you Execute a Stored Procedure?
Answer:- There are two steps to execute a stored procedure: Use the EXECUTE keyword. The EXEC keyword can also be used. Call the name of the procedure from a PL/SQL block. Syntax EXECUTE procedure_name; Or Exec procedure_name;
Question:- What are the differences between ANY and ALL operators?
Answer:- ALL Operator: Value is compared to every value returned by the subquery using the ALL operator. • > ALL denotes greater than the maximum • < ALL denotes less than the minimum • <> ALL is the same as NOT IN condition ANY Operator: Value is compared to each value returned by the subquery using the ANY operator. SOME is a synonym for ANY operator. • ANY denotes something more than the bare minimum • < ANY denotes a value lower than the maximum • = ANY is the same as the IN operator
Question:- How to Create a Function?
Answer:- The syntax to create a CREATE function is below: CREATE function_name RETURN return_datatype {IS | AS} DECLARE VARIABLE DATATYPE; BEGIN function_body END function_name;
Question:- How can you Switch from an Init.ora File to Spfile?
Answer:- One can switch from Init.ora file to Spfile by creating a spfile from the pfile command.
Question:- What is a Subquery? What are Its Types?
Answer:- A subquery is a query within another query. The outer query is known as the main query and the inner query is called the subquery. A subquery is executed first, and the result of the subquery is passed to the main query. There are two types of subqueries: • Correlated • Non-correlated
Question:- How to find the number of rows in a DB2 table?
Answer:- To find the number of rows in a DB2 table, the user has to use SELECT COUNT (*) on the DB2 query.
Question:- How can the duplicate values be eliminated from DB2 SELECT?
Answer:- To eliminate the duplicate values from DB2 SELECT, the user has to use SELECT DISTINCT in the DB2 query.
Question:- What is Aggregate?
Answer:- ‘Aggregate’ functions are built-in mathematical tools that are used in the DB2 SELECT clause.
