Anda di halaman 1dari 3

Class : II year CSE

Date : 18-08-2016

ASAN MEMORIAL COLLEGE OF ENGINEERING AND TECHNOLOGY


Department of Computer Science and Engineering
INTERNAL ASSESSMENT TEST II
CS 6302-DATABASE MANAGEMENT SYSTEMS
ANSWER KEY
Duration : 90 Minutes
Max Marks : 50

PART A (2 x 9 = 18)
1.

2.

3.

4.

5.

What is the use of group by clause?


Group by clause is used to apply aggregate functions to a set of tuples. The attributes given in the group
by clause are used to form groups. Tuples with the same value on all attributes in the group by clause are
placed in one group.
What is called query processing? List out the steps in it.
Query processing refers to the range of activities involved in extracting data from a database. The basic
steps are:
Parsing and translation
Optimization
Evaluation
Define Evaluation primitive and Query evaluation plan?
A relational algebra operation annotated with instructions on how to evaluate is called an evaluation
primitive.
A sequence of primitive operations that can be used to evaluate a query is a query evaluation plan or a
query execution plan.
What are all the three clauses of SQL structure?
The basic structure of SQL expression consists of three clauses: select, from and where
The SELECT clause corresponds to the project operator of the relational algebra to list the attributes
desired in the result of a query.
The FROM clause corresponds to the Cartesian product operation of the relational algebra to list the
relations in the evaluation of the expression.
The WHERE clause corresponds the selection predicate of the relational algebra. It consist of the
predicate involving attributes of the relations that appear in the from clause.
A SQL query is of the form:
SELECT A1,A2,A3An FROM r1,r2,r3rm WHERE P;
where:
Ai = represents an attribute
ri = represents relation
P = predicate
List the categories of SQL commands
Data Definition Language(DDL)
- Creates, changes and removes a table structure
- CREATE, ALTER, DROP, RENAME, TRUNCATE
Data Manipulation Language(DML)
- Inserts new rows, changes existing rows and removing unwanted rows
- INSERT, UPDATE, DELETE
Transaction Control Language(TCL)
- Manages and changes logical transactions
- COMMIT, SAVE POINT, ROLLBACK
Data Control language(DCL)
- Gives and removes rights to database objects
- GRANT, REVOKE
6. Define database objects and give some examples.

7.

8.

A database object is any defined object in a database that is used to store or reference data. Some
examples of database objects include tables, views, clusters, sequences, indexes and synonyms.
Define SQL.
SQL is a standard common set used to communicate with the relational database
management systems. All tasks related to relational data management-creating tables, querying, modifying,
and granting access to users, and so on can be done using SQL.
What are the different data types supported by SQL
Character
Small int
Date
Varchar
Real,double
Time
precision
Numeric
Time stamp
Float
Integer

9.

Define Trigger.
A trigger is a statement that the system executes automatically as a side effect of a modification to
the database. Triggers are useful mechanism for altering humans for starting certain tasks automatically
when certain conditions are met.
PART B (2 X 16 = 32)
10 a) Explain the following with examples
i). DDL
CREATE: syntax, example
ALTER: syntax, example
DROP : syntax, example
RENAME : syntax, example
TRUNCATE: syntax, example
ii). DML
SELECT: syntax, example
INSERT: syntax, example
UPDATE: syntax, example
DELETE: syntax, example
10 b) Explain the following
i). Triggers
Definition, features
Syntax
Example
ii). Procedures and functions
Definition
Syntax
Examples
11 a) Explain about
i) Embedded SQL
Definition, features, Advantages
Example
Static vs Dynamic SQL
ii) Aggregate Functions

Definition
AVG, SUM, MAX, MIN, COUNT,
Examples

11 b) Give a detailed description about Query processing and optimization. Explain the cost estimation of query
optimization.
Query Processing Definition
Diagram
Query Optimization
Example
Cost estimation of query optimization

Anda mungkin juga menyukai