adspace


First round
-------------------
- Procedure
- Packages
- Views
- Virtual tables
- Can we use dcl with in function?
- Joins and few scenarios
- Triggers and its type
- Pragma, type and its functionality
- How to create db link in oracle
- Materialized view
- How to find duplicate values from table?
- Cursor and its functionality
- Write a script to display friday and its date from a entire year.
- Exception Handling

Second round
------------------------
Gave a scenario like. Need to write a function to perform. When user try to change a password. It must not be last five password and a given password can be combination of characters, symbols, upper and lower case.

Answer Posted / Rupendra Bahadur Singh

[First Round]-n- Procedure: A procedure is a collection of PL/SQL statements that can be called by name.n- Packages: A package is a collection of related procedures, functions, and variables.n- Views: A view is a virtual table based on the result set of a SELECT statement.n- Virtual tables: A virtual table is a temporary table created in memory.n- Can we use dcl with in function? Yes, DCL (Data Control Language) statements can be used within PL/SQL functions to control access to database objects.n- Joins and few scenarios:n - INNER JOIN: Combines rows from two tables where the join condition is true.n - LEFT JOIN: Returns all rows from the left table and matching rows from the right table, if any.n - RIGHT JOIN: Returns all rows from the right table and matching rows from the left table, if any.n- Triggers and its type:n - DDL triggers: Activate when changes to database objects occurn - DML triggers: Activate when changes to data in a table occurn- Pragma, type and its functionality: PRAGMA is a directive that can be used to set various options for the Oracle Database compiler.n- How to create db link in oracle: To create a database link, use the CREATE DATABASE LINK statement.n- Materialized view:n - A materialized view is a precomputed and stored version of a query result that can be used to improve query performance.n- How to find duplicate values from table?: Use the DISTINCT keyword in a SELECT statement to eliminate duplicates, or use aggregate functions such as COUNT(*) or GROUP BY to count the number of occurrences of each value.n- Cursor and its functionality: A cursor is a server-side pointer to a set of rows in a database table.n- Write a script to display friday and its date from a entire year.: Here's a sample SQL script that displays Friday dates for an entire year:nn```sqlnSET SERVEROUTPUT ON;nDECLAREn my_date DATE; nBEGINn FOR i IN 1..365 LOOPn my_date := TO_DATE('01-JAN-' || TO_CHAR(i) || '+' || ((MOD(i,7)-1) * 7) || ' DAY');n IF EXTRACT(DAYOFWEEK FROM my_date) = 6 THENn DBMS_OUTPUT.PUT_LINE('Friday: ' || TO_CHAR(my_date, 'DD-MON-YYYY'));n END IF;n END LOOP;nEND;```

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is bcp? When does it used? : Sql dba

1065


Is primary key always clustered index?

1101


what is collation? : Sql dba

1239


Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me

2099


If a cursor is open, how can we find in a pl/sql block?

1251


how to use regular expression in pattern match conditions? : Sql dba

1122


What is the current version of postgresql?

1187


Can delete statement be rollbacked?

1064


Can we use distinct and group by together?

1145


Is inner join faster than left join?

1286


what are aggregate and scalar functions? : Sql dba

1141


Can we rollback truncate?

1082


Do we need to rebuild index after truncate?

1151


What is the best sql course?

1061


how to start mysql server? : Sql dba

1278