Download CT 1 (RDM-16-17)Model Answer Paper

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Microsoft Jet Database Engine wikipedia , lookup

Database wikipedia , lookup

Clusterpoint wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Functional Database Model wikipedia , lookup

Relational model wikipedia , lookup

Database model wikipedia , lookup

Transcript
Model Answerer Paper for RDM (17332)- Class Test-I
Q.1 Attempt any TWO.
Academic year:-2016-17
08 Marks
a) What is data warehousing and data mining?
(Definition of data Warehousing - 1 Mark, data mining - 1 Mark, Diagrams - 2 Mark)
Ans:
Data Warehousing: - A data warehouse is a repository of information gathered from
multiple sources, stored under a unified schema, at a single site. Once gathered, data are
stored for long time, permitting access to historical data. Data warehouses provide the
user a single consolidated interface to data, making decision support queries easier to
write. Moreover, by accessing information for decision support from a data warehouse,
the decision makers ensure that online transaction-processing systems are not affected by
decision support workload.
Data Mining: - Data mining is the exploration and analysis of large quantities of data in
order to discover valid, novel, potentially useful and ultimately understandable patterns in
data. It is known as ―Knowledge Discovery in Databases‖. When the data is stored in
large quantities in data warehouse, it is necessary to dig the data from the ware house that
is useful and required for further use. For data mining, different software tools are used to
analyze, filter and transfer the data from the data warehouses.
b) Explain the overall structure of DBMS.
Ans:
(Explanation of any four components 1 mark each )
Components of DBMS structure are classified in 3 categories as:
1. Query processor: • Embedded DML pre compiler: It converts DML statements
embedded in application program to normal procedural calls in host language. • DML
Compiler: It translates DML statements of high level language into low level instruction
that a query evaluation engine understands. • DDL interpreter: It interprets DDL
statements and records them in a set of tables containing metadata. • Query evaluation
Engine: It executes low level instructions generated by DML compiler and DDL
interpreter.
2. Storage Manager Components: • Transaction manager: It ensures that the database
remains in consistent state despite of the system failure and that concurrent transaction
execution proceeds without conflicting. • File Manager: It manages the allocation of
space on disk storage and data structures used to represent information stored on disk. •
Buffer Manager: It is responsible for fetching data from disk storage into main memory
and deciding what data to cache memory.
3. Disk storage: • Data files: It stores the database. • Data Dictionary: It stores metadata
that hold particular values. • Indices: Provide fast access to data items that hold particular
values. Statistical data: It stores statistical information about the data in the database. This
information is used by query processor to select efficient ways to execute query.
c) Compare different Data models?
(Compare any two 1 mark for one difference)
A Database model defines the logical design of data. The model describes the relationships
between different parts of the data. Historically, in database design, three models are commonly
used. They are,

Hierarchical Model

Network Model

Relational Model
Hierarchical Model
In this model each entity has only one parent but can have several children. At the top of
hierarchy there is only one entity which is called Root.
Network Model
In the network model, entities are organized in a graph, in which some entities can be accessed
through several path
Relational Model
In this model, data is organized in two-dimensional tables called relations. The tables or relation
are related to each other.
Q.2 Attempt any TWO.
08 Marks
a) Explain following terms with suitable examples:
1.Simple attribute
2.Composite attribute
3.Multivalued attribute
Ans:(Definition of Attribute - 1 Mark, Simple attribute - 1 Mark, Composite attribute - 1
Mark, Multivalued attribute – 1 Mark)
Attributes
Entities are represented by means of their properties, called attributes. All attributes have
values. For example, a student entity may have name, class, and age as attributes.
There exists a domain or range of values that can be assigned to attributes. For example, a
student's name cannot be a numeric value. It has to be alphabetic. A student's age cannot be
negative, etc.
Types of Attributes

Simple attribute − Simple attributes are atomic values, which cannot be divided further.
For example, a student's phone number is an atomic value of 10 digits.

Composite attribute − Composite attributes are made of more than one simple attribute.
For example, a student's complete name may have first_name and last_name.

Derived attribute − Derived attributes are the attributes that do not exist in the physical
database, but their values are derived from other attributes present in the database. For
example, average_salary in a department should not be saved directly in the database,
instead it can be derived. For another example, age can be derived from data_of_birth.

Single-value attribute − Single-value attributes contain single value. For example −
Social_Security_Number.

Multi-value attribute − Multi-value attributes may contain more than one values. For
example, a person can have more than one phone number, email_address, etc.
b) Explain any four integrity constraints.
Ans:
(1 Mark for each constraint )
Integrity constraints: Not Null constraint, CHECK constraint, Primary Key constraint,
Unique Constraint, Referential Integrity Constraint
1. Not Null: By default all columns in tables allows null values. When a NOT NULL
constraint is enforced on column or set of columns it will not allow null values.
Syntax: CREATE TABLE TABLE_NAME (COLUMN_NAME DATA_TYPE (Size),
COLUMN_NAME DATA_TYPE (SIZE) NOT NULL);
Example: SQL>CREATE TABLE STUDENT (ROLL_NO NUMBER(5), NAME
VARCHAR2(20) NOT NULL);
2. CHECK: The constraint defines a condition that each row must satisfy. A single
column can have multiple check condition.
Syntax:CREATE TABLE TABLE_NAME (COLUMN_NAME DATA_TYPE,
COLUMN_NAME DATA_TYPE CONSTRAINT CONSTRAINT_NAME CHECK
);
Example: SQL> CREATE TABLE EMP (ID NUMBER(5), NAME
VARCHAR2(10), SAL NUMBER(10) CONSTRINT CHK_SAL CHECK
(SAL>15000));
3. Primary Key constraint:
It is use to avoid redundant/duplicate value entry within the row of specified column
in table. It restricts null values too.
Syntax: CREATE TABLE TABLE_NAME (COLUMN_NAME DATA_TYPE,
COLUMN_NAME DATA_TYPE CONSTRAINT CONSTRAINT_NAME
PRIMARY KEY);
Example: SQL> CREATE TABLE EMP (ID NUMBER (5) CONSTRAINT ID_PK
PRIMARY KEY, NAME VARCHAR2 (10), SAL NUMBER (10));
4. Unique Constraint:
The UNIQUE constraint uniquely identifies each record in a database table. The
UNIQUE and PRIMARY KEY constraints both provide a guarantee for uniqueness
for a column or set of columns. It allows null value.
Syntax:
CREATE TABLE TABLE_NAME (COLUMN_NAME DATA_TYPE,
COLUMN_NAME DATA_TYPE CONSTRAINT CONSTRAINT_NAME
UNIQUE);
Example: CREATE TABLE PERSONS (P_ID NUMBER CONSTRAINT P_UK
UNIQUE, FIRSTNAME VARCHAR (20), CITY VARCHAR (20));
5. Referential Integrity Constraint:
It is a relational database concept in which multiple tables share a relationship based
on the data stored in the tables, and that relationship must remain consistent. A value
of foreign key is derived from primary key which is defined in parent table.
Syntax:
CREATE TABLE TABLE_NAME (COLUMN_NAME DATA_TYPE,
COLUMN_NAME DATA_TYPE CONSTRAINT CONSTRAINT_NAME
REFERENCES PARENT_TABLE_NAME (PARENT_TABLE_COL_NAME ON
DELETE CASCADE, COLUMN_NAME DATA_TYPE);
Example: CREATE TABLE DEPARTMENT (EMP_ID NUMBER(5)
REFERENCES EMP(EMP_ID), DNO NUMBER(3));
c) Draw E-R diagram for Library Management System.
Q.3 Attempt any THREE.
09
Marks
a) What is data independence? Explain its types?
(Definition of data independence - 1 Mark, list of types - 1 Mark, definition of each type 1 Mark each)
Ans: Data Independence: It is the ability to modify a schema in one level without
affecting schema in another level.
There are two types of data independence:
1) Logical data independence
2) Physical data independence.
- Logical data independence: It is the ability to change conceptual schema without
affecting external schema or application programs.
-Physical data independence: It is the ability to change internal schema without affecting
conceptual or external schema
b) Define normalization. And list its Normal Forms?
Ans:(Definition of Normalization - 2 Marks, list -1 Mark)
Normalization is a process of organizing the data in database to avoid data redundancy,
insertion anomaly, update anomaly & deletion anomaly. Let’s discuss about anomalies
first then we will discuss normal forms with examples.
Here are the most commonly used normal forms:

First normal form(1NF)

Second normal form(2NF)

Third normal form(3NF)

Boyce & Codd normal form (BCNF)
c) List and explain any three functions of Database Administrator.
Ans:
Function of database administrator
1. Schema Definition:-The Database Administrator creates the database schema by
executing DDL statements. Schema includes the logical structure of database table
(Relation) like data types of attributes, length of attributes, integrity constraints etc.
2. Storage structure and access method definition:- The DBA creates appropriate
storage structures and access methods by writing a set of definitions which is translated
by data storage and DDL compiler.
3. Schema and physical organization modification:- DBA writes set of definitions to
modify the database schema or description of physical storage organization.
4. Granting authorization for data access: - The DBA provides different access rights
to the users according to their level. Ordinary users might have highly restricted access to
data, while you go up in the hierarchy to the administrator, you will get more access
rights. Integrity constraints specifications: Integrity constraints are written by DBA and
they are stored in a special file which is accessed by database manager while updating
data.
5. Routine Maintenance: - some of the routine maintenance activities of a DBA is given
below. (i) Taking backup of database periodically (ii) Ensuring enough disk space is
available all the time. (iii) Monitoring jobs running on the database. (iv)Ensure that
performance is not degraded by some expensive task submitted by some users.
6. Integrity- constraint specification: -Integrity constraints are written by DBA and they
are stored in a special file, which is accessed by database manager, while updating the
data.
d) Find all borrowers name and address for those who have issued a book on “14/08/1995”
using relational calculus? Refer following relations
1)
User (br_name, br_Address, Card_no)
2)
Borrow (Acc_no, Card_no, DOI)
Ans:S= { t | Ǝ u Ɛ user ( t[br_name]=u[br_name] ^
t[br_address]=u[br_address] ^
Ǝ w Ɛ borrow (u[Card_no]=w[Card_no] ^ w[DOI]=’’14/08/1995’’) )}