Sie sind auf Seite 1von 7

Assighnment No:-

CAP200
Managing Database
Submitted to: Submitted by:
Respected Ankur Singh
Gargi Sharma mam Roll no:-
Re3801a29
Reg no:-
10800943

CAP200 Managing Database

Homework1
Part A

Q1. Properties satisfied by a transaction for a transfer of funds from one bank account to
another. Evaluate.
Ans 1
DBMS basically consist of these this which helps in transaction for
transfer of fund from one bank to another bank.They are
explained as follows:-

 Data redundancy and inconsistency


• Same information may be duplicated in several places.
• All copies may not be updated properly.
 Difficulty in accessing data
• May have to write a new application program to satisfy an
unusual request.
• Could generate this data manually, but a long job...
 Data isolation
• Data in different files.
• Data in different formats.
• Difficult to write new application programs.
 Multiple users
• Want concurrency for faster response time.
• Need protection for concurrent updates.
 Security problems
• Every user of the system should be able to access only the data
they are permitted to see.
• Difficult to enforce this with application programs.
Q2. Design a small application on student management system for the purpose of
enquiry; we will use any database system to store persistent data.
Ans2
Create table student (id varchar(10),name varchar(10),course
varchar(10));
Insert into student (‘1’,’Ankur’,’Bca’);
Insert into student (‘2’,’Ankur Singh’,’Bca’);
Insert into student (‘3’,’Ammy’,’Bca’);
Insert into student (‘4’,’Ankush’,’Bca’);
Select * from student

Q3. We have a problem that would arise if the responsibilities were not discharged.
For this problem list five responsibilities of a database management system.

Ans 3
1:-Database Administration(responsibility)

This is one of the important responsibility that the DBMS should take
care of

It includes “Monitor and fine tune DBMS software”, Conduct system-


level administration, Define database availability requirements,
Establish database change management procedures, Construct
customer databases, Create and maintain database objects, Maintain
database dictionaries, Document physical database implementation,
Load data into the database, Provide customer with access rights to
define new

database users, Define new database users , Perform capacity


planning, Delete obsolete backup and log files etc

Problem arise:-As you can see that this are main administrative task
and failure of which result in the whole system crash down therefore
this responsibility are must.

2:- Software Acquisition

This responsibility includes Provide contract and licensing


administration for DBMS software, Submit service request for DBMS
Problem arise:-As failure of this responsibility failure result in the
conflict of license. and all services failed.

3:- Software Administration

This responsibility includes Liaison between customer and vendor for


technical DBMS issues, Maintain DBMS software/configurations, Keep
statistics current by running necessary utilities ,

Problem arises This responsibility result in fixing the fixes and failure
result in crashes

4:- Security

This function of this responsibility includes Provide security


Infrastructure, Define and administer database security
requirements,Problem arises Failure of this function include the
hacking attack as the database responsibility are failed in this areas.

5:- Back-up and Recovery Services

It include the following responsibility Provide database


backup/recovery services Provide off-site tape storage services
Provide optional operational recovery services Problem arise due to
this responsibility is that if the system fails and database corrupt there
is no way to handle this. as dbms failed to handle this responsibility.

Part B

Q4. Give at least two reasons why database system support data manipulation
using a declarative query language such as SQL, instead of just providing a
library of C or C++ functions to carry out data manipulation.

Ans 4

First of all the c and c++ both uses the sql in built function and if the
question ask about the difference between traditional file and
database.

1:-Ease of access(open specification)


The sql dml statement are easy to handle in even complex problem.
And all data are fetched in single multidimensional array there fore it
is easy to catch up later execution.

As compare to the c/c++ it often has my sqli library function like

My_init() Initialize global variables, and thread handler in thread-safe


programs mysql_affected_rows() Returns the number of rows
changed/deleted/inserted by the last UPDATE, DELETE, or INSERT
query

But if we don’t have this function then the the possibilities limits as
there are extra large procedure and typical handler even for small
query therefore sql prefers.

2:-Global accessibility

As we know that sql dml today are embedded in every part of the
webapplication and language we have same rule in any language for
these therefore we need this.

We can acess it in php,c/c++/java/xml/.net etc there fore ont the


other hand the c/c++ alone cant have these global accessibility.

Q5. Consider a table Customer (cid PK, cname, city, rating)


Write SQL queries to compute the average rating using AVG(rating); the sum of
the ratings using SUM(rating); and the number of ratings using COUNT(*).
If you divide the sum computed above by the count, would the result be same as
AVG? Justify your answer.

Ans 5
a)
CREATE TABLE Customer(cid varchar(10),cname VARCHAR(50),city
VARCHAR(50),rating varchar(10));
INSERT INTO Customer (‘1’,'Ankur','Punjab','10.1');
INSERT INTO Customer (‘2’,'Ankush','Punjab','9.1');
SELECT AVG (rating) FROM Customer
SELECT SUM (rating) FROM Customer
SELECT COUNT (rating) FROM Customer
b)
The result using SUM and COUNT would be smaller than the result
using AVERAGE if there are tuples with rating = NULL. This is because
all the aggregate operators, except for COUNT, ignore NULL values. So
the first approach would compute the average over all tuples while
the second approach would compute the average over all tuples with
non-NULL rating values. However, if the aggregation is done on the
age field, the answers using both approaches would be the same
since the age field does not take NULL values.

Q6. Adopting database administration concepts can improve an organization’s


effectiveness, since a focal point is established for the responsibility, the
management, and the control of the total data resources. Give some of the
advantages to management of having a strong database administration function.
Ans 6

• Defining the Schema

The DBA defines the schema which contains the structure of the data
in the application. .The dba responsible for definig of scheme how
data is presented to the users.

• Liaising with Users

The dba responsible for interacting with the users and understanding
users demand.

• Defining Security & Integrity Checks

The DBA is responsible for integrity and security and responsible how
data are protected from others users and duplicity

• Defining Backup / Recovery Procedures

The DBA is also responsible for back up and recovery of the data .it
includes where to store the data. how to store the data .which part of
data to be backup .and when to take back up.

• Monitoring Performance

it only for guidence

Das könnte Ihnen auch gefallen