besanttechnologies Flashcards
What are Schema Objects?
Schema objects are tables, views, sequences, synonyms, indexes,databases triggers, procedures, functions, packages.
What is a Table?
The table is collection inforamation.A table is the basic of rows and columns.data’s are stored rows and columns.
What is a View?
A View is a virtual table.Not a physical table.
representation of one or more tables
Every view has a query attached to it.
What is an Index?
What is an Index?
What is a Data file?
A database’s data files contain all the database data. The data of logical database structures is tables and indexes is physically stored in the data files allocated for a database.
What is the difference between UNIQUE or PRIMARY KEY Constraint?
A column defined as PRIMARY KEY can contain unique values
same as UNIQUE but UNIQUE can contain NULLs while a column defined as PRIMARY KEY cannot contain NULLs.
What is PL/SQL ?
PL/SQL is a programming language. SQL and procedural programming language constructs such as named blocks,iterations, conditional branching..
What is the basic structure of PL/SQL ?
PL/SQL uses block structure as its basic two structure. Anonymous blocks or nested blocks can be used in PL/SQL.
What is the difference between %ROWTYPE and TYPE RECORD ?
%ROWTYPE is its accept multiple data type.to be used whenever query returns an entire row of a table or view.
TYPE RECORD is accept single data type.to be used whenever query returns columns of different table or views and variables.
What is a cursor ? Why cursor is required ?
Cursor is a named private sql area from where information can be passed and executed or accessed. Cursors are required to process rows individually for queries returning multiple rows.
Explain the two types of cursors ?
Implicit cursors
Explicit cursors.
For loop cursors.
PL/SQL uses Implicit cursors for queries.
User defined cursors are called explicit cursors.
User using Cursors in for loop the Cursor called for loop Cursor.
What is Raise_application_error ?
Raise_application_error is a procedure of package DBMS_STANDARD. that allows to user_defined error or error code and error messages from stored sub program or database trigger.
What is the difference between a PROCEDURE and FUNCTION ?
A PROCEDURE may return one or more values or may not return at all.
A FUNCTION must returns a value using the return statement.
What is Overloading of procedures ?
The same procedure name is repeated with parameters of different datatypes and parameters in different positions, varying number of parameters is called overloading of procedures.
What is a package ? What are the advantages of package ?
database object that groups logically related procedures.
The advantages of packages are modularity, easier application design, information hiding, reusability and better performance
What is difference between TRUNCATE and DELETE?
Truncate is Dml Statements. Cannot be rolled back. Delete allows the filtered deletion.
Deleted records can be rolled back or committed.
What is a join? Explain the different types of joins?
Join is a query,retrieves data from related columns or rows from multiple tables.
Self join – Joining the table with itself
Equi Join – Joining two tables by equating two common columns
Non Equi Join – Joining two tables based on conditions other than equating two common columns
Outer Join – Joining two tables in such a way that query can also retrieve rows that do not have the corresponding join value in the other table.
What is a Subquery?
Subquery is a query embedded with another Query
Outer Query based on the Inner Query
What is correlated sub-query?
Correlated sub-query is a sub-query, which has reference to the main query.
Difference between SUBSTR and INSTR?
INSTR(string1, string2 [,n,[m]])
its find the position of the string
SUBSTR(string1, n, m)
SUBSTR returns a character string of size m in string 1, starting from nth position of string1.
Explain UNION, MINUS, UNION ALL, INTERSECT?
INTERSECT returns all commmon rows selected by both queries.
MINUS returns all distinct rows selected by the first query but not by the second.
UNION returns all unique rows selected by either query.
UNION ALL returns all rows selected by either query, included all duplicates.
What are the Usages of SAVEPOINTS?
SAVEPOINTS are Transaction control Language.
its used to subdivide a transaction into smaller parts. It enables rolling back part of a transaction.
Maximums of five save points are allowed.
What is ROWID?
ROWID is a pseudo column attached to each row of a table.
It is 18 characters long, blockno. Rownumber.filenumber are the components of ROWID.
What is PRIMARY KEY, UNIQUE KEY, FOREIGN KEY?
PRIMARY KEY is a column or a combination of columns of a table which cab be used to uniquely identify a row of the table. PRIMARY KEY cannot be null.
UNIQUE KEY is a column or a combination of columns of a table, which can be used to identify a row of the table uniquely. UNIQUE KEY can be null.
FOREIGN KEY is a column or a combination of column which is the primary key or unique key of the referenced table. FOREIGN KEY can be null.
What is ON DELETE CASCADE?
ORACLE maintains referential integrity by automatically removing dependent foreign key values if a referenced primary or unique key value is removed.
What is difference between CHAR and VARCHAR2? What is maximum SIZE allowed for each type?
CHAR pads spaces to the maximum length. VARCHAR2 does not pad blank spaces.
For CHAR it is 255 and 2000 for VARCHAR2.
How to store the results of a query into a file?
The results of a query can be stored into a file by spooling into a file.
Eg. SPOOL filename.
Which two statements about subqueries are true? (Choose two.)
A. A single row subquery can retrieve data from only one table.
B. A SQL query statement cannot display data from table B that is referred to in its subquery,
unless table B is included in the main query’s FROM clause.
C. A SQL query statement can display data from table B that is referred to in its subquery,without including table B in its own FROM clause.
D. A single row subquery can retrieve data from more than one table.
E. A single row subquery cannot be used in a condition where the LIKE operator is used for comparison.
F. A multiple-row subquery cannot be used in a condition where the LIKE operator is used for comparison.
Which three functions can be used to manipulate character, number, or date column values? (Choose three.)
A. CONCAT B. ROUND C. TRUNC D. RPAD E. INSTR
Which statement about a table is true?
A. A table can have up to 10,000 columns.
B. The size of a table does NOT need to be specified.
C. A table CANNOT be created while users are using the
database.
D. The structure of a table CANNOT be modified while the table is online.
What will be returned from SIGN(ABS(NVL(-32,0)))?
A. 1 B. 32 C. 1 D. 0 E. NULL
Which functions could you use to strip leading characters from a character string. Select two.
A. LTRIM B. SUBSTR C. RTRIM D. INSTR E. MOD
All the operators are used in single row subquery except one
a) Between … and
b) < >
c) =
d) in
All the commands executes in iSQLplus except one
a) Column
b) Compute
c) define
d) Accept
Ascript file which will be executed automatically in iSQLPlus is
a) afiedt.buf
b) login.sql
c) both a and b
d) none of the above.
A command in iSQL plus is used to give the status of old and new value of variable
a) set feedback
b) set verify
c) set confirm
d) none of the above
All commands are used to save the changes of the transaction except one
a) Commit
b) exitting from sqlplus
c) DDL command
d) savepoint
e) none of the above
A Clause which is used in joining two tables other than equality operator is
a) join
b) on
c) in
d) using
A Clause which is the pseudocolumn used to know the current value of the sequence
a) nextval
b) current_val
c) currval
d) none of the above