SQL and PLSQL Q&A - 1.3
SQL and PLSQL Q&A - 1.3
Self introductions
• I am Peddappa basically i am from anantapur (Andhrapradesh)
• Totally i have 2 years 4 months experience as a PLSQL developer
• Previously i worked with Nextgen healthcare there i worked on clinical trails related
project
• IQVIA end clients do clinical trails on human beings at different different locations
• We do work on data imports & exports on the same data as per the client requirement
• we need to export the clinical trails result status .
• If they are testing one drug on 1000 members out of 1000 members how many
members feeling better or if they get any Adverse events like cold,fever,headache we
need to export this type of data.
• By using UTL file packages we do import & export the data., for each and every task
they do create jira ticket.
• So we need to work as per the requirement, as a database developer I written
procedures, Functions, packages and SQL statements , views, etc.
Self introduction
• I am Anitha basically i am from anantapur (Andhrapradesh)
• Totally i have 3 years 2months experience as a PLSQL developer.
• I worked with Alti source in Bangalore.
• There I worked on real estate related project.
• We worked as a offshore team for Tango
• It is proving end to end services to their end clients on lease and rent payments.
• Based on client requirement we need to export and import the data from .txt or .csv files.
• IF we take example as a KFC, subway stores they may have 30000 + stores all over the
world., to pay rent and lease they can use tango product.
• Like that Tango has 150 + clients.
DELETE TRUNCATE
1. Delete is a DML command. 1. Truncate is a DDL
2. We can delete all rows as command.
well as specific rows. 2. Truncate will delete all
3. Rollback will work after rows in a single run. Can’t
Delete. delete specific rows.
4. It is slower than Truncate. 3. Rollback won’t work after
Truncate.
4. It’s faster than Delete.
Difference B/W char and varchar2
Char Varchar2
• It is used to store character • It is used to store character
string of fixed length. string of variable length.
• It has a max size of 2000 • It has a max size of 4000
bytes. bytes.
• It is static data type • It is a dynamic data type.
• It can lead to memory • It manages memory
wastage. efficiently.
Difference B/W date and Timestamp
Date TimeStamp
• It will returns date and time • It will returns date and time
along with microseconds.
Difference B/W substr and instr
Substr Instr
• It will return the set of • It will return the position
characters from a given number of a given
string. character.
• Ex:select • Ex:select
substr('welcome',1,3) from instr('welcome','e',1,1) from
dual; dual;
Cursor
cursor is a buffer area used to process multiple records in PLSQL
block
Procedure Function
1. It may or may not return a 1. Always it will return a
value. value.
2. In procedures we can 2. We can’t perform DML
perform DML’s statements in Functions.
3. We can execute by using 3 3. We can execute by using 4
execution methods. execution methods.
4. We can’t call procedures in 4. We can call functions in
select statement. select statement
5. Exec procedure_name;
Difference B/W union and union all
Union Unionall
• It will sort the result. • It won’t sort the result.
• It won't displays duplicate • It displays duplicate values.
values.
• SELECT * FROM
(SELECT employee_id , first_name , salary ,
RANK() OVER (ORDER BY salary DESC ) AS rnk
FROM kia_emp1)
WHERE rnk <= 5;
Difference b/w %type and %rowtype
%type %rowtype
• It is used to refer data type • It is used to refer data type
of a column in a table of a row in a table