MI0034 Answer
-
Upload
prashant-baranpurkar -
Category
Documents
-
view
225 -
download
0
Transcript of MI0034 Answer
-
8/13/2019 MI0034 Answer
1/24
Name Usha Prashant Baranpurkar Roll No 511217998 Subject Database Management SystemSubject Code MI0034
Center Code 02798Course MBA 3rd Semester
Q1.Define Data Model & discuss the categories of Data Models? What is the difference between logical dataIndependence & Physical Data Independence?
Ans: A database model is a theory or specification describing how a database is structured and used. Several such models
like Hierarchical model, Network model, Relational model etc., have been suggested.
Data Model, Schemas and Instances:
Data Model It is a set of Concepts for viewing a set of data in a structured way.
This can be easily understood by professionals and non-technical users.
It can explain the way in which the organization uses and manages the
information.
Concepts used in a
Data Model
Entity
An entity is something that has a distinct, separate existence, though it need not
be of a material existence.
E.g. - Employee.
Attribute
It is the property that describes an entity
It is a characteristic or property of an object, such as weight, size, or color
Relationship
Describes the relationship between two or more entities
Schemas The description of the data base means defining the names, data type, size of a
column in a table and database [actual data in the table] itself.
The description of a database is called the database schema [or the Meta data].
Description of a database is specified during database design and is not
-
8/13/2019 MI0034 Answer
2/24
frequently changed.
Roll No.
Name
Semester
Branch
Instances The collection of data stored in the database at a particular moment is a
database instance or database state or snapshot.
These changes very frequently due to addition, deletion and modification.
Roll No.
Name
Semester
Branch
1
Rajesh Prabhu
ii
E & C
Data independence is defined as the ability to modify a schema definition in one level without affecting a schema definition
in a higher level.
Physical data independence Logical data independence
This is the ability to modify the physicalscheme without causing application programs
to be rewritten. Modifications at this level are
usually to improve performance.
This is the ability to modify the conceptualscheme without causing application programs
to be rewritten. This is usually done when the
logical structure of database is altered. Logical
data independence is harder to achieve, as the
application programs are usually heavily
dependent on the logical structure of the data.
An analogy is made to abstract data types in
-
8/13/2019 MI0034 Answer
3/24
programming languages.
Q2. What is a B+Trees? Describe the structure of both internal and leaf nodes of a B+Tree?
Ans: Indexes are used to speed up the retrieval of records.
Indexes can be created using one or more columns, providing the basis for both rapid random lookups and efficient
ordering of access to records.
The disk space required to store the index is typically less than the storage of the table (since indexes usually contain only
the key-fields according to which the table is to be arranged, and exclude all the other details in the table).
Index file consists of two fields, the first field contains the value and second field contains the list of pointers to address
values in the disk block
Searching an index is much faster than searching the table because the index is sorted and its rows are very small.
Index access structure is usually defined on a single field of a file, called an indexing field.
B + Tree Index Files
The main disadvantage of the index-sequential file organization is that performance degrades as the file grows. A B +-tree
index takes the form of a balanced tree in which every path from the root of the tree to a leaf of the tree is of the same
length.
In a B- tree every value of the search field appears once at some level in the tree, along with a data pointer [may be in
internal nodes also]. In a B+-tree, data pointers [address of a particular search value] are stored only at the leaf nodes of the
tree; hence, the structure of leaf nodes differs from the structure of internal nodes. The leaf nodes have an entry for every
value of the search field, along with a data pointer to the record.
A B+ tree is a multilevel index, but it has got different a structure. A typical node of the B+ tree contains upto n-1 search key
values such as k1,k2.n-1 and n pointers p1,p2..pn. The search key values within a node are kept in sorted order, ki < kj.
The number of pointers in a node is called the fan out of the node.
The structure of a non-leaf node is the same as leaf nodes, except that all pointers are pointers to tree nodes.
Each internal node is of the form >p1, k1,p2,k2.pq-1, kq-1, pq>
The root node has at least 2 tree pointers.
Each leaf node is of the form
-
8/13/2019 MI0034 Answer
4/24
each pri is a data pointer, and pnext points to the next leaf node of the B+ tree
All leaf nodes are at the same level.
Consider an example, assume that we wish to insert a record in a B+ tree of order n=3 and pleaf=2, first we observe that
root is the only node in the tree, so it is also a leaf node. As soon as more than one level is created, the tree is divided into
internal nodes and leaf nodes. Notice that every value must exist at the leaf level, because all the data pointers are at the
leaf level. However, only some values exist in internal nodes to guide the search. Notice also that every value appearing in
an internal node also appears in the sub tree as the rightmost value.
Say for example, to insert 12, the node is split into two nodes.
The figure shows the two leaf nodes that result from inserting 12. An existing node contains 7 and 8 and remaining value 12
in a new node. The first J = [((P leaf + 1)1/2)] = 3/2 = 2 entries in the original node are kept there and the remaining entries
are moved to a new leaf node. The J th search value is replicated in the parent internal node, and an extra pointer to the new
node is created in the parent. If the parent internal node is full, it must be split. This splitting can propagate all the way up
to create a new root node.
-
8/13/2019 MI0034 Answer
5/24
Figure 4.5: An example of insertion in a B + tree with p=3 and Pleaf=2
Q3. Describe Projection operation, Set theoretic operation & join operation?
Ans: Projection operation is used to select only few columns from a table. the mathematical symbol p()
Here, is a list of attributes from the relation r hence the degree (number of columns) of the result is equal to
the number of attributes specified in the attribute list.
Eg 1. Select the name and salary of all the employees.
pNAME. SALARY (EMPLOYEE).
This query selected only name and salary attributes from relation EMPLOYEE
Eg. 2. Select names and addresses of all employees working for department 10.
-
8/13/2019 MI0034 Answer
6/24
pNAME, ADDRESS (DNO=10(EMPLOYEE)
Set theoretic operations:
These are used to merge the elements of two sets in various ways, including union, intersection and difference. Three of
these operations require the table to be union compatible. The two relations are said to require the table to be union
compatible. The two relations are said to be union compatible if the following conditions are satisfied.
1. The two relation/tables (say R & S) that have the same number of columns (have the same degree)
2. Each column of the first relation/table must be either the same data type as the corresponding column of the second
relation/table(s).
Relations R & S
Intersection (?):
The intersection operation selects the common tuples from the two relations.
The result of the operation R?S is
Union ( ):
The result of this operation denoted by RS, is a relation that includes all tuples that are either in R or in S or in both.
Duplicate tuples will not appear in the output.
-
8/13/2019 MI0034 Answer
7/24
Difference ( ):
The result of the difference consists of all tuples in R but not in S
Cartesian products (X):
The Cartesian product or cross-product is a binary operation that is used to combine two relations. Assuming R & S as
relations with n and m attributes respectively, the Cartesian products R x S can be written as,
R (A1, A2..An) x S (B1, B2.Bn)
The result of the above set operation is
Q (A1, A2..An, B1, B2.Bn)
Total number of columns in Q: degree (Q) = n + m
Total number of tuples in Q: count (Q) = Number of tuples in R* Number of tuples in S
Cartesian product of R and S can be written as,
The relation R has 2 columns and 3 tuples. The relation S has 2 columns and 3 tuples. So the Cartesian product has 4
columns (2+2) and 6 tuples
(3 x 2).
-
8/13/2019 MI0034 Answer
8/24
The Cartesian product operation applied by itself is generally meaningless. It is useful only when followed by selection and
projection operations.
Renaming r (rho):
This operation is used to rename the relations or attributes. The symbol r(rho) is used to denote the rename operator. In
some situations, it is better to break down a complex query into two or more simple querys. We must rename the relations
that hold the intermediate result relations. It improves the readability and facilitates better understanding.
The syntax is as follows:
Rename to
Here S is new new relation and R is
original relation.
6.4.4 The Join Operation
Join ( ): The capability of retrieving data from multiple tables using a single SQL statement is one of the most powerful and
useful features of RDBMS. It is the availability of join operation. We know that one table may not give all the information
about a particular entity.
The join operation, denoted by is used to combine two relations to retrieve useful information. A join operation matches
data from two or more tables; based on the values of one or more columns in each table, it allows us to process more than
one table at a time.
For e.g.: The employee table gives only the department id's, if we want to know the department name, then we have to get
the information by joining employee table and dept. table.
In join, only combinations of tuples satisfying the join condition appear in the result.
The general form of a Join operation is
RS
-
8/13/2019 MI0034 Answer
9/24
For example by joining employee and department relations, we can get the name of the department in which the employee
is working (department name exists in department table).
Select emp_no, ename, dept.dname from emp.dept
Where emp.deptno = dept.dept_no and
emp_no = &emp_no.
Emp_dept
-
8/13/2019 MI0034 Answer
10/24
Here, the joining is done over the attribute DNumber of Department relation and DNum of Project relation. In fact, DNum
of Project is a foreign key which references DNumber of Department. Generally, in a natural join, the joining attribute is
implicitly considered. Suppose the two relations have no attribute(s) in common, is simply the cross product of
these two relations. Joining can be done between any set of attributes and need not be always with respect to the primary
key and foreign key combinations.
The expected size of the join result divided by maximum size i.e. leads to a relation called join selectively.
Outer join:
It returns both matching and non matching rows. It differs from the inner join, in that the rows in one table having no
matching rows in the other table will also appear in the results table, with nulls in the other attribute position, instead of
being ignored as in the case with the inner join. It outputs rows even if they do not satisfy the join condition; the outer join
operator is used with the table having n matching rows.
-
8/13/2019 MI0034 Answer
11/24
In the above example even though there is no matching row with B name, all workers are listed along with age and skill. If
there is no match, simply get an empty skill column. The outer join can be used when we want to keep all the tuples in R or
in S; those in both relations, whether or not they have matching tuples in the other relation.
Left outer join: It is denoted by . The left outer join operation keeps every tuple in the first or left relation R in relation
. If no matching tuple is found in S in the join, result is filled with null values.
Right outer join: It is denoted by , and keeps every tuple in the second or right relation S in the result of R
Full outer join: It is denoted by and keeps all tuples in both the left and right relations and when no matching tuples
are found, filled with null values as needed.
Division
A division operation (denoted by ) is useful for a special kind of query; occasionally it may be used to solve certain kind of
problems.
Consider the relations P (P) and Q (Q) as shown in the figure. The result of dividing P by Q is the relation R and it has two
tuples. For each tuple in R, its product with the tuples of Q must be in P. In our example (a 1, b 1) must both be tuples in P: the
same is true for (a 5, b 1) and (a 5, b 2)
Examples of the division operations R = P + Q:
-
8/13/2019 MI0034 Answer
12/24
For e.g.: To retrieve the names of employees who work on all the projects that 'John Smith' works on.
1. Retrieve the list of project numbers that John Smith works on the intermediate relation SMITH_PNOS:
2. create a relation that includes a tuple < PNO,ESSN> whenever the employee whose social security number is ESSN works
on the project whose number is PNO in the intermediate relation SSN_PNOS.
SSN_PNOS < ESSN.PNO(WORKS_ON)
3. Apply the DIVISION operation to the two relations which gives the desired employees social security numbers.
TABLES
Notice here that 123,453 appear in SSN_PNOS in combination with all two tuples in SMITH_PNOS; that is why they appear
in the resulting relation SSNS.
Q 4. Discuss Multi Table Queries?
Ans:
SIMPLE EQUI-JOINS:
When two tables are joined together we must follow these guidelines:
Table names in the FROM clause are separated by commas.
-
8/13/2019 MI0034 Answer
13/24
Use appropriate joining condition. This means that the foreign key of table 1 will be made equal to the primary key of table
2. This column acts as the joining attribute. For example, dno of employee table and dno of department will be involved in
the joining condition of WHERE clause.
EXAMPLE-1: This example demonstrates the equijoin and the purpose is to display the employee names and the
department names for which they work.
SELECT NAME, DNAME
FROM Employee, Department
WHERE employe.Dno = department.Dno;
OUTPUT:
NAME DNAME
Prasad Accounts
Reena Accounts
Deepak Admin
Venkat Accounts
Pooja Research
EXAMPLE 2:
Let us now try to display only employees working for Accounts department.
SELECT Name, salary, Dname
FROM Employee, department
WHERE (Emplyee.DNO = Department.DNO)
AND (Dname = 'Accounts');
OUT PUT:
NAME SALARY DNAME
Prasad 32000 Accounts
Reena 8000 Accounts
Venkat 30000 Accounts
SELF JOIN and TABLE ALIASES:
-
8/13/2019 MI0034 Answer
14/24
The self-join is one where you involve the same table in the join. This is illustrated in the following example. This technique
is used fully to solve many queries.
To find the employee who earns more than venkat
SELECT e1.name, e1.salary
FROM Employee e1, Employee e2
WHERE (e1.salary > e2.salary) AND (e2.name = 'venkat')
OUT PUT:
NAME SALARY
Prasad 32000
OUTER JOINS:
Outer joins are used to display rows that do not meet the join condition. For left outer join use a plus sign (+) to left
condition and for right outer join use the plus sign to the right condition. The syntax for left and right outer joins is given
below:
Left outer join
SELECT table1.col, table2.col
FROM table1 t1, table2 t2
WHERE t1.col (+) = t2.col;
Notice that the plus sign cannot be placed on both sides of the condition.
EXAMPLE 1: This example demonstrates the right outer join by retaining the right side table (department) tuples and giving
null values for the tuples that do not match the left side table (employee).
SELECT Name, Dname
FROM Employee E, Department D
WHERE E.Name(+) =D.Dname;
OUTPUT::
NAME DNAME
Accounts
Admin
-
8/13/2019 MI0034 Answer
15/24
EXAMPLE 2: This is same as ex.1, but the only difference is that it is a left outer join. So all the left table (employee) rows are
kept, and if no match occurs with the right side table (department) a null is shown.
SELECT Name, Dnaem
FROM Employee E, Department D
WHERE E.Name = D.Dname(+);
OUT PUT:
NAME DNAME
Deepak
Venkat
Pooja
Prasad
Reena
Q 5. Discuss Transaction Processing Concept? 10.2 Describe properties of Transactions?
Ans: Transaction management is the ability of a database management system to manage the various transactions that
occur within the system. Transaction is a set of program statements or collections of operations that form a single logical
unit of work. A database management system should ensure that the transactions are executed properly, either the entire
transaction should execute or none of the operations should have been executed. This is also called atomic cooperation.
The DBMS should execute this task or transaction in total to avoid inconsistency.
Transaction Processing Concepts
Definition: A transaction is an atomic unit comprised of one or more SQL statements. A transaction begins with the first
executable statement and ends when it is committed or rolled back.
Single User V/S Multi User systems: A DBMS is used if at most one user at a time can use the system. It is multi-user if
many users can use the system and have access to the DB concurrently. For e.g.: An air line reservation system is used by
100's of travel agency and clerks concurrently.
Multiple users can access databases and use computer systems simultaneously. Because of the concept of
multiprogramming, this system executes some commands from one process than suspend that process, and executes some
command from the next process. Therefore it is inter leaved.
In a single user system one can execute at most one process at a time.
Interleaved concurrency of operators A and B
-
8/13/2019 MI0034 Answer
16/24
operators A and B
Figure 10.1: Interleaved concurrency versus parallel execution
The Read and Write operations and DBMS Buffers:
A transaction is a logical unit of database processing that includes one or more database access operations (insertion,
delete etc). Only retrieving of data is called read only transaction.
The basic database access operations are
1) Read-item It reads a database item named 'x' into a program variable.2) Write-item writes the value of the program variable x into the database.
Read-item (x) includes the following steps:
1. Find the address of the disk block that contains item 'x'.
2. Copy that disk block into a bugger in main memory.
3. Copy item x from the buffer to the program variable x.
Executing the write-item (x) includes the following steps.
1. Find the address of the disk block that contains item (x).
2. Copy that disk block into a buffer in main memory.
3. Copy item x from the program variable into its current location in the buffer
4. Store the updated block from the buffer back to disk.
-
8/13/2019 MI0034 Answer
17/24
a. b.
T1 T2
Read_item (X) Read_item(X);
X=X-N' X:=X+M
Write_item(X); Write_item(X)
Read_item(Y)
Y=Y+N;
Write_item(Y)
Concurrent control: The data in the database must perform their transactions concurrently without violation the ACID
(Atomicity, Consistency, Integrity and Durability) properties of a database. It takes place during the progression of anactivity. It involves the regulation of ongoing activities that are part of transformation process to ensure that they conform
to organizational standards. Concurrency control solves the major issues involved with allowing multiple people
simultaneous access to shared entities, and their object representations...
Why concurrency control is needed: In a multiuser database, transactions submitted by the various users may execute
concurrently and may update the same data. Concurrently executing transactions must be guaranteed to produce the same
effect as serial execution of transactions [one by one]. Several problems can occur when concurrent transactions execute in
an uncontrolled manner, therefore the primary concern of a multiuser database includes how to control data concurrency
and consistency.
Data concurrency: Access to data concurrently (simultaneously) used by many users must be co-ordinates.
Data consistency: A user always sees a consistent (accurate) view of all data committed by other transactions as of that
time and all changes made by the user up to that time. Several problems can occur when concurrent transactions execute in
an uncontrolled manner.
For e.g.: Airline reservation database in which a record is stored for each flight. Each record includes the number of
reserved seats on that flight. Fig..a shows a Transaction "T1" that transfers N reservations from one flight, whose number of
reserved seats is 'x', to another flight whose number of reserved seats is 'y'. Fig.b shows a transaction T2 that reserves m
seats on the first flight. We now discuss the types of problems we may encounter when these two transactions run
concurrently.
1. The lost update problem: Suppose transactions T1 and T2 are submitted at the same time, when these two transactions
are executed concurrently as shown in fig. a, then the final value of x is incorrect. Because T2 reads the value of x before T1
changes it in the database, and hence the updated value resulting from T1 is lost. For e.g.: x=80 at the start (80 reservation
at the beginning), n=5 (T1 transfers 5 seat reservation from the flight x to y), and m=4 (T2 reserves 4 seats on x), the final
-
8/13/2019 MI0034 Answer
18/24
result should be x=79 but due to interleaving of operations x=84, because updating T1 that removed the 5 seats from x was
lost.
2. Dirty read problem: This problem occurs when one transaction updates a database item and then the transaction fails for
some reason. The updated item is accessed by another transaction before it is changed back to its original value.
For e.g.: T1 updates item x and then fails before completion, so the system must change x back to original value. Before it
can do so, however, transaction T2 reads the temporary value of x, which will not be recorded permanently in the database,
because of the failure of T1. The value of item x that is read by T2 is called Dirty Data, because it has been created by a
transaction that has not been completed and committed yet. Hence this problem is also known as the temporary update
problem.
3. Incorrect Summary Problem: If one transaction is calculating an aggregate summary function on a number of records,
while other transactions are updating some of these records, the aggregate function may calculate some values before they
are updated and others after they are updated.
For ex: Transaction T3 is calculating the total no. of reservations on all the flights, meanwhile transaction T1 is executing.
The T3 reads the values of x after n seats have been subtracted from it, but reads the value of y before those n seats have
been added to it.
-
8/13/2019 MI0034 Answer
19/24
Why is recovery needed?
A major responsibility of the data base administrator is to prepare for the possibility of hardware, software, network and
system failure. It is usually desirable to recover the databases and return to normal operation as quickly as possible.
Recovery should proceed in such a manner to protect the database and users from unnecessary problems.
Whenever a transaction is submitted to a DBMS for execution, the system is responsible for making sure that either.
1. All the operations in the transactions are completed successfully and their effects are recorded permanently in the DB or
2. The transaction has no effect on the DB; this may happen if a transaction fails after executing some of it's operations, but
before executing all of them.
Types of failures:
1. A computer failure (System Crash):
Hardware, software, network error occurs in the computer system during transaction
2. Transaction or system error:
Some operation in the transaction may cause it to fail, such as integer overflow or division by 'Zero' etc.
3. Local errors or exception conditions detected by the transaction:
During transaction execution, certain conditions may occur that perform cancellation of the transaction. For ex. Data for the
transaction my not be found.
4. Concurrency control enforcement:
The concurrency control method may decide to abort the transactions, to be restarted later, because several transactions
are in a state of deadlock.
5. Disk failure:
-
8/13/2019 MI0034 Answer
20/24
Some disk blocks may lose their data because of read or write malfunctions
6. Physical problems and catastrophes:
This refers to a list of problems that includes power or air conditioning failure, fire, theft, overwriting disks etc.
Transaction states and additional operations: A transaction is an atomic unit of work that is entirely completed or not doneat all. For recovery purpose the system needs to keep track of when the transaction starts, terminates, commits or aborts.
Hence the recovery manager keeps track of the following operations.
1. Begin transaction: This marks the beginning of transaction execution,
2. Read/Write: These specify read/write operation execution.
3. End transaction: This specifies that the read and write transaction operations have ended, and marks the end of the
transaction execution. At this point it maybe necessary to check whether the changes can be permanently applied to the DB
or aborted.
4. Commit transaction: This signals a successful end of the transaction, so that any changes executed by the transaction can
be committed to the DB.
5. Roll Back: This signals that the transactions has ended unsuccessfully, so that any changes that the transaction may have
applied to the database must be undone.
Fig. 10.2: State transition diagram illustrating the states for transaction execution
Figure 10.2 shows a state transition diagram that describes how a transaction moves through its execution states. A
transaction goes into an active state immediately after it starts execution, where it can issue Read and Write operations.
When the transaction ends, it moves to the partially committed state. At this point some recovery protocols need to ensure
that there is no system failure. Once this check is successful, the transaction is said to have reached its commit point and
enters the committed state.
However, a transaction can go to the failed state if one of the checks fails or if the transaction is aborted during its active
state. The transaction may then have to be rolled back to undo the effect of its Write operations on the database. The
terminated state corresponds to the transaction leaving the system or end of the transaction.
-
8/13/2019 MI0034 Answer
21/24
Desirable Properties of Transactions
To ensure data integrity, the database management system should maintain the following transaction properties. These are
often called the ACID properties.
1. Atomicity: A transaction is an atomic unit of processing. It is either performed in its entirety (completely) or not
performed at all.
2. Consistency: The basic idea behind ensuring atomicity is as follows. The database system keeps back of the old values of
any data on which a transaction performs a write, and if the transaction does not complete its execution, the old values are
restored to make it appear as though the transaction was never executed.
For Ex: Let Ti be a transaction that transfers 850 from account A to account B. This transaction can be defined as
Ti ; read(A)
A :=A-50;
Writ (A);
Read(B);
B:=B+50;
Write (B).
Suppose that before execution of transactions Ti the values of accounts A and B are Rs.1000 and Rs.2000 respectively. Now
suppose that, during the execution of transaction Ti, a failure has occurred after write(A) operation, that prevents Ti fromcompleting its execution successfully. But before the write of B operation was executed values of A and B in database are
Rs.950 and`Rs.2000. We have lost Rs.50 which is executed in a sequential fashion.
3. Durability : Once a transaction changes the database and the changes are committed, these changes must never be lost
because of subsequent failures. The users need not worry about the incomplete transactions. Partially executed
transactions can be rolled back to the original state, ensuring durability is the responsibility of the recovery management
component of the DBMS.
Q 6. Describe the advantage of Distributed database? What is Client/server Model? Discuss briefly the security andInternet violation?
Ans: In a centralized database system, all system components such as data, DBMS software, storage devices reside at a
single computer or site, where as in distributed database system data is spread over one or more computer connected by a
network.
Distributed database is thus a set of databases stored on multiple computers but it appears to a user as a single database.
The data on several computers can be simultaneously accessed and modified (data from local and remote databases) using
-
8/13/2019 MI0034 Answer
22/24
a network. Each database server in the DDB is controlled by its local DBMS, and each cooperates to maintain the
consistency of the global database.
As a general goal, distributed computing systems divide a big, unmanageable problem into smaller pieces and solve it
efficiently in a coordinated manner.
Advantages of Distributed Databases
1. Increased reliability and availability: Reliability is broadly defined as the probability that a system is running at a certain
time point, whereas reliability is defined as the system that is continuously available during a time interval. When the data
and DBMS software are distributed over several sites, one site may fail while other sites continue to operate. Only the data
and software that exist at the failed site cannot be accessed. In a centralized system, failure at a single site makes the whole
system unavailable to all users.
2. Improved performance: Large database is divided into smaller databases by keeping the necessary data where it is
needed most. Data localization reduces the contention for CPU and I/O services, and simultaneously reduces access delays
involved in wide area network. When a large database is distributed over multiple sites, smaller databases exist at each site.
As a result, local queries and transactions accessing data at a single site have better performance because of the smaller
local databases. To improve parallel query processing a single large transaction is divided into a number of smaller
transactions and executes multiple transactions at different sites.
3. Data sharing: Data can be accessed by users at other remote sites through the distributed database management system
(DDBMS) Software.
Client-Server Model
The Client-Server model is basic to distributed systems; it allows clients to make requests that are routed to the appropriate
server in the form of transactions. The client-server model consists of three parts.
1. Client The client is the machine (workstation or pc) running the front and applications. It interacts with a user through the
keyboard, display and mouse. The client has no direct data access responsibilities. The client machine provides front-end
application software for accessing the data on the server. The clients initiates transactions, the server processes the
transactions.
Interaction between client and server might be processed as follows during processing of an SQL query.
1. The client passes a user query and decomposes it into a number of independent site queries. Each site query is sent to
the appropriate server site.
2. Each server processes the local query and sends the resulting relation to the client site.
3. The client site combines the results of the queries to produce the result of the originally submitted query.
-
8/13/2019 MI0034 Answer
23/24
So the server is called database processor or back end machine, where as the client is called application processor or front
end machine.
Another function controlled by the client is that of ensuring consistency of replicated copies of a data item by using
distributed concurrency control techniques. The client must also ensure the atomicity of global transactions by performing
global recovery when certain sites fail. It provides distribution transparency, which is the client hides the details of datadistribution from the user.
1. Server The server is the machine that runs the DMS software. It is referred to as back end. The server processes SQL and
other query statements received from client applications. It can have large disk capacity and fast processors.
2. Network The network enables remote data access through client server and server-to-server communication.
Each computer in a network is a node, acts as a client, a server, or both, depending on the situation.
Advantages:
Client applications are not dependent on physical location of the data. If the data is moved or distributed to other database
servers, the application continues to function with little or no modification.
It provides multi-tasking and shared memory facilities; as a result they can deliver the highest possible degree of
concurrency and data integrity.
In networked environment, shared data is stored on the servers, rather than on all computers in the system. This makes it
easier and more efficient to manage concurrent access. Inexpensive, low-end client work stations can access the remote
data of the server effectively.
Security and Integrity Violations
Misuse of database can be categorized as being either intentional or accidental.
Accidental loss of data consistency:
1. System crashes during transaction processing
2. Due to multi-users accessing the database.
3. Distribution of data over several computers.
Intentional loss of data may be due to reading, writing or destruction of data by unauthorized users.
Database security usually protects data by several techniques .
Certain portion [selected columns] of a database is available only to those persons who are authorized to access it. This
ensures that the confidentiality of data is maintained.
-
8/13/2019 MI0034 Answer
24/24
For e.g.: In large organizations, where different users may use the same database, sensitive information such as employees
salaries should be kept confidential from most of the other users.
To protect database we must take security measures at several levels. Network security is also important as database
security.
Security within the operating system is implemented by providing a password for the user accounts. It Protects data in
primary memory by avoiding direct access to the data.