besanttechnologies Flashcards
(98 cards)
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.