Operating System: COPE/Technical Test/Interview/Database Questions & Answers
Operating System: COPE/Technical Test/Interview/Database Questions & Answers
Fact tables and dimension tables. A fact table contains measurements while dimension tables will
contain data that will help describe the fact tables.
What is the difference among “dropping a table”, “truncating a table” and “deleting all records” from
a table.
Drop Table - will remove the existence of the table from the database along with its data and structure
and all the constraints. The table will be no longer available.
Truncate Table - will remove all the rows (only the rows) from a table. it will not delete the table. Its a
DDL statement that means the deleted rows cannot be reverted back by ROLLBACK statement;
Delete Table - is a DML statement which will delete rows from a table according to the matching criteria
mentions in the ‘where’ clause. And these rows can be reverted back by ‘ROLLBACK’ statement if
‘COMMIT’ is not fired.
What is SQL*Loader?
SQL*Loader is a bulk loader utility used for moving data from external files into the Oracle database.
One can load data into an Oracle database by using the sqlldr (sqlload on some platforms) utility.
A database link is an object in the local database that allows you to access objects on a remote database
or to mount a secondary database in read-only mode.
It is a table that maintains a record of modifications to the master table in a snapshot. It is stored in the
same database as master table and is only available for simple snapshots. It should be created before
creating snapshots.
In MyISAM static all the fields have fixed width. The Dynamic MyISAM table would include fields such as
TEXT, BLOB, etc. to accommodate the data types with various lengths. MyISAM Static would be easier to
restore in case of corruption, since even though you might lose some data, you know exactly where to
look for the beginning of the next record.
SQL *NET is ORACLE’s mechanism for interfacing with the communication protocols used by the
networks that facilitate distributed processing and distributed databases. It is used in Clint-Server and
Server-Server communications.
Time the references to occur when master tables are not in use. Peform the reference the manually
immdiately locking the master tables. We can join tables in snopshots by creating a complex snapshots
that will based on the master tables.
Two-phase commit is mechanism that guarantees a distributed transaction either commits on all
involved nodes or rolls back on all involved nodes to maintain data consistency across the global
distributed database. It has two phase, a Prepare Phase and a Commit Phase.
The related columns of the tables are called the cluster key. The cluster key is indexed using a cluster
index and its value is stored only once for multiple tables in the cluster.
What is a deadlock?
Two processes waiting to update the rows of a table which are locked by the other process then
deadlock arises. In a database environment this will often happen because of not issuing proper row
lock commands. Poor design of front-end application may cause this situation and the performance of
server will reduce drastically. These locks will be released automatically when a commit/rollback
operation performed or any one of this processes being killed externally.
A Read-Only transaction ensures that the results of each query executed in the transaction are
consistent with respect to the same point in time.
Define Transaction?
A Transaction is a logical unit of work that comprises one or more SQL statements executed by a single
user.
Choosing an executing plan based on the access paths available and the ranks of these access paths.
Considering available access paths and determining the most efficient execution plan based on statistics
in the data dictionary for the tables accessed by the statement and their associated clusters and indexes.
“Commit” makes permanent the changes resulting from all SQL statements in the transaction. The
changes made by the SQL statements of a transaction become visible to other user sessions transactions
that start only after transaction is committed.
Proactive Update:
The updates that are applied to database before it becomes effective in real world .
Retroactive Update:
The updates that are applied to database after it becomes effective in real world .
Simulatneous Update:
The updates that are applied to database at the same time when it becomes effective in real world
Cold Backup:
It is copying the three sets of files (database files, redo logs, and control file) when the instance is shut
down. This is a straight file copy, usually from the disk directly to tape. You must shut down the instance
to guarantee a consistent copy.
If a cold backup is performed, the only option available in the event of data file loss is restoring all the
files from the latest backup. All work performed on the database since the last backup is lost.
Hot Backup:
Some sites (such as worldwide airline reservations systems) cannot shut down the database while
making a backup copy of the files. The cold backup is not an available option.
So different means of backing up database must be used — the hot backup. Issue a SQL command to
indicate to Oracle, on a tablespace-by-tablespace basis, that the files of the tablespace are to backed up.
It is the program module, which tests for the satisfaction of integrity constraint and checks the authority
of user to access data.
The Oracle system processes, also known as Oracle background processes, provide functions for the
user processes—functions that would otherwise be done by the user processes themselves
Oracle database-wide system memory is known as the SGA, the system global area or shared global
area. The data and control structures in the SGA are shareable, and all the Oracle background processes
and user processes can use them.
The combination of the SGA and the Oracle background processes is known as an Oracle instance
Partial Key:
It is a set of attributes that can uniquely identify weak entities and that are related to same owner
entity. It is sometime called as Discriminator.
Alternate Key:
All Candidate Keys excluding the Primary Key are known as Alternate Keys.
Artificial Key:
If no obvious key, either stand alone or compound is available, then the last resort is to simply create a
key, by assigning a unique number to each record or occurrence. Then this is known as developing an
artificial key.
Compound Key:
If no single data element uniquely identifies occurrences within a construct, then combining multiple
elements to create a unique identifier for the construct is known as creating a compound key.
Natural Key:
When one of the data elements stored within a construct is utilized as the primary key, then it is called
the natural key.
A relation is said to be in DKNF if all constraints and dependencies that should hold on the the constraint
can be enforced by simply enforcing the domain constraint and key constraint on the relation.
<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->
How does Tuple-oriented relational calculus differ from domain-oriented relational calculus?
The tuple-oriented calculus uses a tuple variables i.e., variable whose only permitted values are tuples of
that relation. E.g. QUEL
The domain-oriented calculus has domain variables i.e., variables that range over the underlying
domains instead of over relation. E.g. ILL, DEDUCE.
What is System R?
System R was designed and developed over a period of 1974-79 at IBM San Jose Research Center. It is a
prototype and its purpose was to demonstrate that it is possible to build a Relational System that can be
used in a real life environment to solve real life problems, with performance at least comparable to that
of existing system.
Its two subsystems are
>Research Storage
>System Relational Data System.
DBMS
Ø Redundancy is controlled.
Ø Unauthorised access is restricted.
Ø Providing multiple user interfaces.
Ø Enforcing integrity constraints.
Ø Providing backup and recovery.
When a foreign key exists in a table, the foreign key’s table is sometimes referred to as a lookup table.
The DEPARTMENT table in our example is a lookup table for the EMPLOYEE table. The value of an
employee’s department can be looked up in the DEPARTMENT table.
ERASE removes an indicated Global variable & releases the memory associated with it
Using SQL TRACE. It is an utility that can monitor and report on database performance when one or
more queries are run against the database.
It is used to gather statistics when running the query (i.e) reports on CPU time spent on the query, the
total no. of rows processed and statistics related to parsing and cache performance.
PRE-QUERY fires ONLY ONCE during EXECUTE-QUERY or COUNT-QUERY processing, just before Oracle
Forms constructs and issues the SELECT statement to identify rows that match the query criteria.
POST-QUERY fires each time for records placed on the blocks list of records.
PL/SQL is the language used for both client-side Oracle forms applications and server-side database
triggers and stored procedures and there is a PL/SQl engine in both Oracle forms Runform and the
Oracle7 Server.
This means that you can take advantage of application patitioning to execute application code on either
the client or the server.
Application partitioning allows you to optimize performance and resource usage by storing and
executing procedures either locally or at the server, which makes the most sense for your particular
application and configuration.
In the DECLARATION part define a variable of type exception. In the excecution part call the exception
using RAISE exception_name. In the exception part handle the exception using WHEN exception_name
ROWID is the logical address of a row, and it is unique within the database.The ROWID is broken into
three sections: left,middle,, and right (corresponding to 00001F20,000C, AND 0001, just shown). The
numbering is in hexadecimal notation.
The left section is the block in the file, the middle is the row sequence number within the
block(numbering starts with 0, not 1), and the right is the file number within the database. Note that the
file numbers are uniquewithin the whole database. The tablespace they are in is not relevant to the
ROWID.
ROWID can be selected, or used in a where clause, but cannot be changed by an insert, update, or
delete. However it can changeif the table it is in is exported and imported.
A DATABASE TRIGGER is a stored procedure associated with a table that ORACLE7 automatically
executes on one or more specified events (BEFORE or AFTER an INSERT,UPDATE or DELETE) affecting the
table. Triggers can execute for the table as a whole or for each affected row in the table.
A PACKAGED PROCEDURE is a built-in PL/SQL procedure that is available in all forms. Each packaged
procedure executes a SQL*FORMS function, such as moving to a field or executing a query.
A SNAPSHOT is a means of creating a local copy of remote data. A snapshot can be used to replicate all
or part of a single table, or to replicate the result of a query against multiple tables. The refreshes of the
replicated data can be done automatically by the database ( at time intervals you specify ) or
manually.Snapshot Log is the table associated with the Master Table of the Snap shot.
What is a package ?
A PACKAGE is a PL/SQL object that groups PL/SQL types, variables, SQL cursors, exceptions,procedures,
and functions.Each package has a specification and a body. The specification shows the object you can
access when you use the package. The body fully defines all the objects and can contain additional
objects used only for the internal workings. You can change the body (for example, by adding
procedures to the packages) without invalidating any object that uses the package.
The DATA DICTIONARY is a comprehensive set of tables and views owned by the DBA users SYS and
SYSTEM, which activates when ORACLE is initially installed, and is a cental source of information for the
ORACLE RDBMS itself and for all users of ORACLE. The tables are automatically maintained by ORACLE,
and holds a set of views and tables containing information about the database objects, users, privileges,
events, and use.
What is index ?
INDEX is a general term for an ORACLE / SQL feature used primarily to speed execution an impose
UNIQUENESS upon certain data. INDEX provides a faster access method to one table’s data than doing a
UTL_FILE is a package that adds the ability to read and write to operating system files Procedures
associated with it are FCLOSE, FCLOSE_ALL and 5 procedures to output data to a file PUT, PUT_LINE,
NEW_LINE, PUTF, FFLUSH.PUT, FFLUSH.PUT_LINE,FFLUSH.NEW_LINE. Functions associated with it are
FOPEN, ISOPEN.
The variables declared in the procedure and which are passed, as arguments are called actual, the
parameters in the procedure declaration. Actual parameters contain the values that are passed to a
procedure and receive results. Formal parameters are the placeholders for the values of actual
parameters.
Functions are named PL/SQL blocks that return a value and can be called with arguments procedure a
named block that can be called with parameter. A procedure all is a PL/SQL statement by itself, while a
Function call is called as part of an expression.
In PL/SQL 2.2 cursor variables cannot be declared in a package.This is because the storage for a cursor
variable has to be allocated using Pro*C or OCI with version 2.2,the only means of passing a cursor
variable to a PL/SQL block is via bind variable or a procedure parameter.
Oracle does not allow a user to specifically locate tables, since that is a part of the function of the
RDBMS. However, for the purpose of increasing performance, oracle allows a developer to create a
CLUSTER. A CLUSTER provides a means for storing data from different tables together for faster
retrieval than if the table placement were left to the RDBMS.
Outer Join–Its a join condition used where you can query all the rows of one of the tables in the join
condition even though they don’t satisfy the join condition.
HAVING clause is used when you want to specify a condition for a group function and it is written after
GROUP BY clause
The WHERE clause is used when you want to specify a condition for columns, single row functions
except group functions and it is written before GROUP BY clause if it is used.
SQL*PLUS is a command line tool where as SQL and PL/SQL language interface and reporting tool. Its a
command line tool that allows user to type SQL commands to be executed directly against an Oracle
database. SQL is a language used to query the relational database(DML,DCL,DDL). SQL*PLUS commands
are used to format query result, Set options, Edit SQL commands and PL/SQL.
Temporary segments are created by ORACLE when a SQL statement needs a temporary work area
to complete execution. When the statement finishes execution, the temporary segment extents are
released to the system for future use.
A Database contains one or more Rollback Segments to temporarily store “undo” information.
Each Non-clustered table has a data segment. All of the table’s data is stored in the extents of its data
segment. Each Eluster has a data segment. The data of every table in the cluster is stored in the
cluster’s data segment
What is a Segment ?
What is an Extent ?
An Extent is a specific number of contiguous data blocks, obtained in a single allocation, used to store
a specific type of information.
Procedure Specification and Procedure Body. 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.e.g. DBMS_OUTPUT put_line
A navigable item is one that operators can navigate to with the keyboard during default navigation, or
that Oracle forms can navigate to by executing a navigational built-in procedure.
Base table Blocks,Control Blocks.A base table block is one that is associated with a specific
database table or view.A control block is a block that is not associated with a database table.
What is an Alert ?
An alert is window that appears in the middle of the screen overlaying a portion of the current display.
Pop-up windows are screen areas that overlay all or a portion of the display screen when a form is
running.
Post writes data in the form to the database but does not perform database commit
Commit permenently writes data in the form to the database.
It synchoronizes the terminal screen with the internal state of the form.
Post-field trigger fires whenever the control leaving from the filed.
Post-change trigger fires at the time of execute-query procedure invoked or filed validation status
changed.
On-validate-field trigger fires, when the field Validation status New or changed.
Post-field-trigger whenever the control leaving form the field, it will fire.
How many LONG columns are allowed in a table ? Is it possible to use LONG columns in WHERE clause
or ORDER BY ?
Only one LONG columns is allowed. It is not possible to use LONG column in WHERE or ORDER BY clause.
What is difference between CHAR and VARCHAR2? What is the maximum SIZE allowed for each type ?
CHAR pads blank spaces to the maximum length. VARCHAR2 does not pad blank spaces. For CHAR it is
255 and 2000 for VARCHAR2.
SAVEPOINTS are used to subdivide a transaction into smaller parts. It enables rolling back part of a
transaction. Maximum of five save points are allowed.
Maintaining data integrity through a set of rules that restrict the values of one or more columns of the
tables based on the values of primary key or unique key of the referenced table.
A flag to indicate whether the import should ignore errors encounter when issuing CREATE commands
The name of the file which log of the export will be written.
A flag to indicate whether a read consistent version of all the exported objects should be maintained.
A flag to indicate whether statistical information about the exported objects should be written to
export dump file.
For Incremental exports, the flag indirects whether a record will be stores data dictionary tables
recording the export.
Flag to indicate whether table rows should be exported. If ‘N’ only DDL statements for the databse
objects will be created.
A flag to indicate whether grants on databse objects will be exported or not. Value is ‘Y’ or ‘N’.
Flag to indicate whether export should compress fragmented segments into single extents.
A collection of conceptual tools for describing data, data relationships data semantics and constraints.
This data model is based on real world that consists of basic objects called entities and of relationship
among these objects. Entities are described in a database by a set of attributes.
What is an Entity?
Relationship type defines a set of associations or a relationship set among a given set of entity types.
A data base schema is specifies by a set of definitions expressed by a special language called DDL.
This language is to specify the internal schema. This language may specify the mapping between two
schemas.
The storage structures and access methods used by database system are specified by a set of definition
in a special type of DDL called data storage-definition language.
It translates DML statements in a query language into low-level instruction that the query evaluation
engine can understand.
What is Record-at-a-time?
The Low level or Procedural DML can specify and retrieve each record from a set of records. This
retrieve of a record is said to be Record-at-a-time.
It is an applied predicate calculus specifically tailored for relational databases proposed by E.F. Codd.
E.g. of languages based on it are DSL ALPHA, QUEL.
It is procedural query language. It consists of a set of operations that take one or two relations as input
and produce a new relation.
A Relation schema R is said to be 5NF if for every join dependency {R1, R2, …, Rn} that holds R, one the
following is true
Ri = R for some i.The join dependency is implied by the set of FD, over R in which the left side is key of R.
What is 4NF?
A relation schema R is said to be in 4NF if for every Multivalued dependency X Y that holds over R, one
of following is trueX is subset or equal to (or) XY = R.X is a super key.
A relation schema R is in BCNF if it is in 3NF and satisfies an additional constraint that for every FD X A,
X must be a candidate key.
What is 3NF?
A relation schema R is in 3NF if it is in 2NF and for every FD X A either of the following is true
X is a Super-key of R.
A is a prime attribute of R.
In other words, if every non prime attribute is non-transitively dependent on primary key.
What is 2NF?
A relation schema R is in 2NF if it is in 1NF and every non-prime attribute A in R is fully functionally
dependent on primary key.
The domain of attribute must include only atomic (simple, indivisible) values.
It guarantees that the spurious tuple generation does not occur with respect to relation schemas after
decomposition.
Once the DBMS informs the user that a transaction has successfully completed, its effects should persist
even if the system crashes before all its changes are reflected on disk. This property is called durability.
In distributed deadlock detection, the delay in propagating local information might cause the deadlock
detection algorithms to identify deadlocks that do not really exist. Such situations are called phantom
deadlocks and they lead to unnecessary aborts.
It is a database in which there are no programs or user access languages. It has no cross-file capabilities
but is user-friendly and provides user-interface management.
Are the resulting relations of PRODUCT and JOIN operation the same?
PRODUCT: Concatenation of every row in one relation with every row in another.
JOIN: Concatenation of rows from one relation and related rows from another.
The information in the data dictionary validates the existence of the objects, provides access to them,
and maps the actual physical storage location.
Which part of the RDBMS takes care of the data dictionary? How
Data dictionary is a set of tables and database objects that is stored in a special area of the database and
maintained exclusively by the kernel
I/O, Security, Language Processing, Process Control, Storage Management, Logging and Recovery,
Distribution Control, Transaction Control, Memory Management, Lock Management
There are three major sets of files on disk that compose a database. All the files are binary. these are:-
Database files
Control files
Redo logs
The most important of these are the database files where the actual data resides. The control files and
the redo logs support the functioning of the architecture itself.
All three sets of files must be present, open, and available to Oracle for any data on the database to be
useable. Without these files, you cannot access the database, and the database administrator might
have to recover some or all of the database using a backup, if there is one.
What are the four Oracle system processes that must always be up and running for the database to be
useable
The four Oracle system processes that must always be up and running for the database to be useable
include DBWR (Database Writer), LGWR (Log Writer), SMON (System Monitor), and PMON (Process
Monitor).
It is the program module, which tests for the satisfaction of integrity constraint and checks the authority
of user to access data.
It is a program module, which manages the allocation of space on disk storage and data structure used
to represent information stored on a disk.
It is a program module, which ensures that database, remains in a consistent state despite system
failures and concurrent transaction execution proceeds without conflicting.
It is a program module, which is responsible for fetching data from disk storage into main memory and
deciding what data to be cache in memory.
It is a program module that provides the interface between the low-level data stored in database,
application programs and queries submitted to the system.
It is the program module, which tests for the satisfaction of integrity constraint and checks the authority
of user to access data.
Proactive Update:The updates that are applied to database before it becomes effective in real world .
Retroactive Update:The updates that are applied to database after it becomes effective in real world.
Simulatneous Update:The updates that are applied to database at the same time when it becomes
effective in real world.
Minimal key is one which can identify each tuple of the given relation schema uniquely. For finding the
minimal key it is required to find the closure that is the set of all attributes that are dependent on any
given set of attributes under the given set of functional dependency.
Cold Backup: It is copying the three sets of files (database files, redo logs, and control file) when the
instance is shut down. This is a straight file copy, usually from the disk directly to tape. You must shut
down the instance to guarantee a consistent copy.
If a cold backup is performed, the only option available in the event of data file loss is restoring all the
files from the latest backup. All work performed on the database since the last backup is lost.
Hot Backup: Some sites (such as worldwide airline reservations systems) cannot shut down the database
while making a backup copy of the files. The cold backup is not an available option.
So different means of backing up database must be used — the hot backup. Issue a SQL command to
indicate to Oracle, on a tablespace-by-tablespace basis, that the files of the tablespace are to backed up.
The users can continue to make full use of the files, including making changes to the data. Once the user
has indicated that he/she wants to back up the tablespace files, he/she can use the operating system to
copy those files to the desired backup destination.
The database must be running in ARCHIVELOG mode for the hot backup option.
If a data loss failure does occur, the lost database files can be restored using the hot backup and the
online and offline redo logs created since the backup was done. The database is restored to the most
consistent state without any loss of committed transactions.
Procedures that are not part of a package are known as stand-alone because they independently
defined. A good example of a stand-alone procedure is one written in a SQL*Forms application. These
What are stored-procedures? And what are the advantages of using them.
Stored procedures are database objects that perform a user defined operation. A stored procedure can
have a set of compound SQL statements. A stored procedure executes the SQL commands and returns
the result to the client. Stored procedures are used to reduce network traffic.
Name two utilities that Oracle provides, which are use for backup and recovery.
Along with the RDBMS software, Oracle provides two utilities that you can use to back up and restore
the database. Theseutilities are Export and Import. The Export utility dumps the definitions and data for
the specified part of the database to an operating system binary file. The Import utility reads the file
produced by an export, recreates thedefinitions of objects, and inserts the dataIf Export and Import are
used as a means of backing up and recovering the database, all the changes made to the database
cannot be recovered since the export was performed. The best you can do isrecover the database to the
time when the export was last performed.
A database trigger is a PL/SQL block that can defined to automatically execute for insert, update, and
delete statements against a table. The trigger can e defined to execute once for the entire statement or
once for every row that is inserted, updated, or deleted. For any one table, there are twelve events for
which you can define database triggers. A database trigger can call database procedures that are also
written in PL/SQL.
What is Oracle Block? Can two Oracle Blocks have the same address?
Oracle “formats” the database files into a number of Oracle blocks when they are first created—making
it easier for the RDBMS software to manage the files and easier to read data into the memory areas.
The block size should be a multiple of the operating system block size. Regardless of the block size, the
entire block is not available for holding data; Oracle takes up some space to manage the contents of the
block. This block header has a minimum size, but it can grow.
These Oracle blocks are the smallest unit of storage. Increasing the Oracle block size can improve
performance, but it should be done only when the database is first created.
Each Oracle block is numbered sequentially for each database file starting at 1. Two blocks can have the
same block address if they are in different database files.
What is ROWID?
The ROWID is a unique database-wide physical address for every row on every table. Once assigned
(when the row is first inserted into the database), it never changes until the row is deleted or the table is
dropped.
Oracle database file number, which contains the block with the rows
Oracle block address, which contains the row
The row within the block (because each block can hold many rows)
The ROWID is used internally in indexes as a quick means of retrieving rows with a particular key value.
Application developers also use it in SQL statements as a quick way to access a row once they know the
ROWID
What are database files, control files and log files. How many of these files should a database have at
least? Why?
Database Files The database files hold the actual data and are typically the largest in size. Depending on
their sizes, the tables (and other objects) for all the user accounts can go in one database file—but that’s
not an ideal situation because it does not make the database structure very flexible for controlling
access to storage for different users, putting the database on different disk drives, or backing up and
restoring just part of the database.
You must have at least one database file but usually, more than one files are used. In terms of accessing
and using the data in the tables and other objects, the number (or location) of the files is immaterial.
The database files are fixed in size and never grow bigger than the size at which they were created
Control Files The control files and redo logs support the rest of the architecture. Any database must
have at least one control file, although you typically have more than one to guard against loss. The
control file records the name of the database, the date and time it was created, the location of the
database and redo logs, and the synchronization information to ensure that all three sets of files are
always in step. Every time you add a new database or redo log file to the database, the information is
recorded in the control files.
Redo Logs Any database must have at least two redo logs. These are the journals for the database; the
redo logs record all changes to the user objects or system objects. If any type of failure occurs, the
changes recorded in the redo logs can be used to bring the database to a consistent state without losing
any committed transactions. In the case of non-data loss failure, Oracle can apply the information in the
redo logs automatically without intervention from the DBA.
The redo log files are fixed in size and never grow dynamically from the size at which they were created.
The Oracle system processes, also known as Oracle background processes, provide functions for the
user processes—functions that would otherwise be done by the user processes themselves
Oracle database-wide system memory is known as the SGA, the system global area or shared global
area. The data and control structures in the SGA are shareable, and all the Oracle background processes
and user processes can use them.
Define SQL and state the differences between SQL and other conventional programming Languages
SQL is a nonprocedural language that is designed specifically for data access operations on normalized
relational database structures. The primary difference between SQL and other conventional
programming languages is that SQL statements specify what data operations should be performed
rather than how to perform them.
Two important pieces of RDBMS architecture are the kernel, which is the software, and the data
dictionary, which consists of the system-level data structures used by the kernel to manage the
database
You might think of an RDBMS as an operating system (or set of subsystems), designed specifically for
controlling data access; its primary functions are storing, retrieving, and securing data. An RDBMS
maintains its own list of authorized users and their associated privileges; manages memory caches and
paging; controls locking for concurrent resource usage; dispatches and schedules user requests; and
manages space usage within its table-space structures
Subqueries, or nested queries, are used to bring back a set of rows to be used by the parent query.
Depending on how the subquery is written, it can be executed once for the parent query or it can be
executed once for each row returned by the parent query. If the subquery is executed for each row of
the parent, this is called a correlated subquery.
A correlated subquery can be easily identified if it contains any references to the parent subquery
columns in its WHERE clause. Columns from the subquery cannot be referenced anywhere else in the
parent query. The following example demonstrates a non-correlated subquery.
What is a query?
A query with respect to DBMS relates to user commands that are used to interact with a data base. The
query language can be classified into data definition language and data manipulation language.
Network schema uses a graph data structure to organize records example for such a database
management system is CTCG while a hierarchical schema uses a tree data structure example for such a
system is IMS.
A Checkpoint is like a snapshot of the DBMS state. By taking checkpoints, the DBMS can reduce the
amount of work to be done during restart in the event of subsequent crashes.
Atomicity:Either all actions are carried out or none are. Users should not have to worry about the effect
of incomplete transactions. DBMS ensures this by undoing the actions of incomplete transactions.
Aggregation:A concept which is used to model a relationship between a collection of entities and
relationships. It is used when we need to express a relationship among relationships.
Once the DBMS informs the user that a transaction has successfully completed, its effects should persist
even if the system crashes before all its changes are reflected on disk. This property is called durability.
Join Dependency:A Join dependency is generalization of Multivalued dependency.A JD {R1, R2, …, Rn} is
said to hold over a relation R if R1, R2, R3, …, Rn is a lossless-join decomposition of R . There is no set of
sound and complete inference rules for JD.
Inclusion Dependency:An Inclusion Dependency is a statement of the form that some columns of a
relation are contained in other columns. A foreign key constraint is an example of inclusion dependency.
A RDBMS maintains a description of all the data that it contains, information about every relation and
index that it contains. This information is stored in a collection of relations maintained by the system
called metadata. It is also called data dictionary.
Indexing is a technique for determining how quickly specific data can be found.
Types: Binary search style indexingB-Tree indexingInverted list indexingMemory resident tableTable
indexing
Partial Key:It is a set of attributes that can uniquely identify weak entities and that are related to same
owner entity. It is sometime called as Discriminator.
Alternate Key:All Candidate Keys excluding the Primary Key are known as Alternate Keys.
Artificial Key:If no obvious key, either stand alone or compound is available, then the last resort is to
simply create a key, by assigning a unique number to each record or occurrence. Then this is known as
developing an artificial key.
Natural Key:When one of the data elements stored within a construct is utilized as the primary key,
then it is called the natural key.
Every dependency in F has a single attribute for its right hand side.
We cannot replace any dependency X A in F with a dependency Y A where Y is a proper subset of X
and still have a set of dependency that is equivalent to F.We cannot remove any dependency from F and
still have set of dependency that is equivalent to F.
A Functional dependency is denoted by X Y between two sets of attributes X and Y that are subsets of
R specifies a constraint on the possible tuple that can form a relation state r of R. The constraint is for
any two tuples t1 and t2 in r if t1[X] = t2[X] then they have t1[Y] = t2[Y]. This means the value of X
component of a tuple uniquely determines the value of component Y.
What is normalization?
It is a process of analysing the given relation schemas based on their Functional Dependencies (FDs) and
primary key to achieve the properties
Minimizing redundancy
Minimizing insertion, deletion and update anomalies.
The High level or Non-procedural DML can specify and retrieve many records in a single DML statement.
This retrieve of a record is said to be Set-at-a-time or Set-oriented.
The storage structures and access methods used by database system are specified by a set of definition
in a special type of DDL called data storage-definition language.
A relation Schema denoted by R(A1, A2, …, An) is made up of the relation name R and the list of
attributes Ai that it contains. A relation is defined as a set of tuples. Let r be the relation which contains
set tuples (t1, t2, t3, …, tn). Each tuple is an ordered list of n-values t=(v1,v2, …, vn).
This model is based on collection of objects. An object contains values stored in instance variables with
in the object. An object also contains bodies of code that operate on the object. These bodies of code
are called methods. Objects that contain same types of values and the same methods are grouped
together into classes.
A view may be thought of as a virtual table, that is, a table that does not really exist in its own right but
is instead derived from one or more underlying base table. In other words, there is no stored file that
direct represents the view instead a definition of view is stored in data dictionary.
Growth and restructuring of base tables is not reflected in views. Thus the view can insulate users from
the effects of restructuring and growth in the database. Hence accounts for logical data independence.
How is the data structure of System R different from the relational structure?
System R was designed and developed over a period of 1974-79 at IBM San Jose Research Center. It is a
prototype and its purpose was to demonstrate that it is possible to build a Relational System that can be
used in a real life environment to solve real life problems, with performance at least comparable to that
of existing system.
Its two subsystems are
. Research Storage
. System Relational Data System.
Physical level: The lowest level of abstraction describes how data are stored.
Logical level: The next higher level of abstraction, describes what data are stored in database and what
relationship among those data.
View level: The highest level of abstraction describes only part of entire database.
Data integrity.
Security Problems.
What is DBMS?
It is a collection of programs that enables user to create and maintain a database. In other words it is
general-purpose software that provides the users with the processes of defining, constructing and
manipulating the database for various applications.
What is database?
A database is a logically coherent collection of data with some inherent meaning, representing some
aspect of real world and which is designed, built and populated with data for a specific purpose.