Professional Documents
Culture Documents
DBMS
DBMS
DBMS
This set of Database Questions & Answers 4. The term attribute refers to a ___________
focuses on “Relational Database and Database of a table.
Schema” a) Record
b) Column
1. A relational database consists of a collection c) Tuple
of d) Key
a) Tables View Answer
b) Fields
c) Records Answer:b
d) Keys Explanation:Attribute is a specific domain in the
View Answer relation which has entries of all tuples.
Answer:c
Explanation:Select is used to view the tuples of Database Questions and
the relation with or without some constraints. Answers – SQL Basics and
8. The _______ operator takes the results of SQL Data Definition
two queries and returns only rows that appear
This set of Database Questions & Answers focuses c) View
on ” SQL Basics and SQL Data Definition” d) Integrity constraint
View Answer
1. Which one of the following is used to define the
structure of the relation ,deleting relations and Answer:a
relating schemas ? Explanation: Select operation just shows the
a) DML(Data Manipulation Langauge) required fields of the relation. So it forms a DML
b) DDL(Data Definition Langauge)
c) Query 5. The basic data type char(n) is a _____ length
d) Relational Schema character string and varchar(n) is _____ length
View Answer character.
a) Fixed, equal
Answer:b b) Equal, variable
Explanation: Data Definition language is the c) Fixed, variable
language which performs all the operation in d) Variable, equal
defining structure of relation. View Answer
Answer:d Answer:a
Explanation:Unknown values do not take null Explanation:None.
value but it is not known.
8. The phrase “greater than at least one” is
6. The ____ connective tests for set represented in SQL by _____.
membership, where the set is a collection of a) < all
values produced by a select clause. The ____ b) < some
connective tests for the absence of set c) > all
membership. d) > some
a) Or, in View Answer
b) Not in, in
c) In, not in Answer:d
d) In, or Explanation: >some takes atlest one value
View Answer above it .
10. How can you find rows that do not match 3. Which one of the following deletes all the
some specified condition? entries but keeps the structure of the relation .
a) EXISTS a) Delete from r where P;
b) Double use of NOT EXISTS b) Delete from instructor where dept name=
c) NOT EXISTS ’Finance’;
d) None of the mentioned is correct. c) Delete from instructor where salary between
View Answer 13000 and 15000;
d) Delete from instructor;
Answer:b View Answer
Explanation:None.
Answer:d
Explanation:Absence of condition deletes all
Database Questions and rows.
Answers – Modification of
Database 4. Which of the following is used to insert a
tuple from another relation .
This set of Database Questions & Answers a) Insert into course (course id, title, dept name,
focuses on “Modification of Database” credits)
values (’CS-437’, ’Database Systems’, ’Comp.
1. A Delete command operates on ______
Sci.’, 4);
relation.
b) Insert into instructor
a) One
select ID, name, dept name, 18000
b) Two
from student
c) Several
where dept name = ’Music’ and tot cred > 144;
d) Null
c) Insert into course values (’CS-437’, ’Database
View Answer
Systems’, ’Comp. Sci.’, 4);
Answer:a d) Not possible
Explanation:Delete can delete from only one View Answer
table at a time.
Answer:b
2. Delete from r where P; Explanation:Using select statement in insert will
The above command include rows which are the result of the
a) Deletes a particular tuple from the relation selection.
b) Deletes the relation
5. Which of the following deletes all tuples in
c) Clears all entries from the relation
the instructor relation for those instructors
d) All of the mentioned
associated with a department located in the
View Answer
Watson building which is in department
relation.
a) Delete from instructor b) Where
where dept_name in ‘Watson’; c) Case
b) Delete from department d) When
where building=’Watson’; View Answer
c) Delete from instructor
where dept_name in (select dept name Answer:c
from department Explanation:The case statements can add the
where building = ’Watson’); order of updating tuples.
d) Both a and c 9. Which of the following is the correct format
View Answer for case statements .
Answer:c a) Case
Explanation:The query must include when pred1 … result1
building=watson condition to filter the tuples. when pred2 … result2
...
6. Update instructor when predn … resultn
_____ salary= salary * 1.05; else result0
Fill in with correct keyword to update the end
instructor relation. b) Case
a) Where when pred1 then result1
b) Set when pred2 then result2
c) In ...
d) Select when predn then resultn
View Answer else result0
end
Answer:b c) Case
Explanation:Set is used to update the particular when pred1 then result1
value. when pred2 then result2
7. _________ are useful in SQL update ...
statements,where they can be used in the set when predn then resultn
clause. else result0
a) Multiple queries d) All of the mentioned
b) Sub queries View Answer
c) Update Answer:b
d) Scalar subqueries Explanation:None.
View Answer
10. Which of the following relation updates all
Answer:d instructors with salary over $100,000 receive a
Explanation:None. 3 percent raise, whereas all others receive a 5
8. The problem of ordering the update in percent raise.
multiple update is avoided using a) Update instructor
a) Set set salary = salary * 1.03
where salary > 100000; Answer:a
update instructor Explanation:On gives the condition for the join
set salary = salary * 1.05 expression.
where salary <= 100000;
b) Update instructor 2. Which of the join operations do not preserve
set salary = salary * 1.05 non matched tuples.
where salary < (select avg (salary) a) Left outer join
from instructor); b) Right outer join
c) Update instructor c) Inner join
set salary = case d) Natural join
when salary <= 100000 then salary * 1.05 View Answer
else salary * 1.03 Answer:c
end Explanation:INNER JOIN: Returns all rows when
d) Both a and c there is at least one match in BOTH tables.
View Answer
3. Select *
Answer:d from student join takes using (ID);
Explanation:The order of the two update The above query is equivalent to
statements is important. If we changed the a) Select *
order of the two statements, an instructor with from student inner join takes using (ID);
a salary just under $100,000 would receive an b) Select *
over 8 percent raise. SQL provides a case from student outer join takes using (ID);
construct that we can use to perform both the c) Select *
updates with a single update statement, from student left outer join takes using (ID);
avoiding the problem with the order of updates. d) Both a and b
View Answer
Database Questions and Answer:a
Answers – Join Expressions Explanation:Join can be replaced by inner join.
This set of Database Questions & Answers 4. What type of join is needed when you wish to
focuses on “Join Expressions” include rows that do not have matching values?
a) Equi-join
1. The____condition allows a general predicate
b) Natural join
over the relations being joined.
c) Outer join
a) On
d) All of the mentioned
b) Using
View Answer
c) Set
d) Where Answer:c
View Answer Explanation:An outer join does not require each
record in the two joined tables to have a
matching record..
5. How many tables may be included with a from the right table, and the matched rows
join? from the left table.
a) One
b) Two 9. The operation which is not considered a basic
c) Three operation of relational algebra is
d) All of the mentioned a) Join
View Answer b) Selection
c) Union
Answer:d d) Cross product
Explanation:Join can combine multiple tables. View Answer
Answer:b
Chemistry Painter 30000
Explanation:The values take null if there is no
constraint in the attribute else it is a Erroneous
Music Taylor 50000
statement.
Which of the following is used to create view 10. Create view faculty as
for these relations together? Select ID, name, dept name
a) Create view instructor_info as from instructor;
select ID, name, building Find the error in this query .
from instructor, department a) Instructor
where instructor.dept name= department.dept b) Select
name; c) View …as
b) Create view instructor_info d) None of the mentioned
select ID, name, building View Answer
from instructor, department;
c) Create view instructor_info as Answer:d
select ID, name, building Explanation:Syntax is – create view v as ;.
from instructor;
d) Create view instructor_info as Database Questions and
select ID, name, building
from department;
Answers – Transactions
View Answer This set of Database Questions & Answers
focuses on “Transactions”
Answer:a
Explanation:None. 1. A _________ consists of a sequence of query
and/or update statements.
a) Transaction
b) Commit d) No action
c) Rollback View Answer
d) Flashback
View Answer Answer:d
Explanation:Once a transaction has executed
Answer:a commit work, its effects can no longer be
Explanation:Transaction is a set of operation undone by rollback work.
until commit.
5. In case of any shut down during transaction
2. Which of the following makes the transaction before commit which of the following
permanent in the database ? statement is done automatically ?
a) View a) View
b) Commit b) Commit
c) Rollback c) Rollback
d) Flashback d) Flashback
View Answer View Answer
Answer:b Answer:c
Explanation:Commit work commits the current Explanation:Once a transaction has executed
transaction. commit work, its effects can no longer be
undone by rollback work.
3. In order to undo the work of transaction after
last commit which one should be used ? 6. In order to maintain the consistency during
a) View transactions database provides
b) Commit a) Commit
c) Rollback b) Atomic
d) Flashback c) Flashback
View Answer d) Retain
View Answer
Answer:c
Explanation:Rollback work causes the current Answer:b
transaction to be rolled back; that is, it undoes Explanation:By atomic , either all the effects of
all the updates performed by the SQL the transaction are reflected in the database, or
statements in the transaction. none are (after rollback).
Answer:a Answer:c
Explanation:A complete transaction always Explanation:SYNTAX – alter table table-name
commits. add constraint , where constraint can be any
constraint on the relation.
9. Which of the following is used to get back all
the transactions back after rollback ? 2. Which of the following is not a integrity
a) Commit constraint ?
b) Rollback a) Not null
c) Flashback b) Positive
d) Redo c) Unique
View Answer d) Check ‘predicate’
View Answer
Answer:c
Explanation:None. Answer:b
Explanation:Positive is a value and not a
10. ______ will undo all statements up to constraint.
commit?
a) Transaction 3. Create table Employee(Emp_id numeric not
b) Flashback null, Name varchar(20) , dept_name
c) Rollback varchar(20), Salary numeric
d) Abort unique(Emp_id,Name));
View Answer insert into Employee values(1002, Ross, CSE,
10000)
Answer:c insert into Employee
Explanation:Flashback will undo all the values(1006,Ted,Finance, );
statements and Abort will terminate the insert into Employee
operation. values(1002,Rita,Sales,20000);
What will be the result of the query?
Database Questions and a) All statements executed
b) Error in create statement
Answers – Integrity
c) Error in insert into Employee
Constraints values(1006,Ted,Finance, );
d) Error in insert into Employee 6. Create table course
values(1008,Ross,Sales,20000); (...
View Answer foreign key (dept name) references department
. . . );
Answer:d Which of the following is used to delete the
Explanation:The not null specification prohibits entries in the referenced table when the tuple is
the insertion of a null value for the attribute. deleted in course table?
The unique specification says that no two tuples a) Delete
in the relation can be equal on all the listed b) Delete cascade
attributes. c) Set null
4. Create table Manager(ID numeric,Name d) All of the mentioned
varchar(20),budget numeric,Details View Answer
varchar(30)); Answer:b
Inorder to ensure that the value of budget is Explanation:The delete “cascades” to the
non-negative which of the following should be course relation, deletes the tuple that refers to
used? the department that was deleted.
a) Check(budget>0)
b) Check(budget<0) 7. Domain constraints, functional dependency
c) Alter(budget>0) and referential integrity are special forms of
d) Alter(budget<0) _________.
View Answer a) Foreign key
b) Primary key
Answer:d c) Assertion
Explanation:A common use of the check clause d) Referential constraint
is to ensure that attribute values satisfy View Answer
specified conditions, in effect creating a
powerful type system. Answer:c
Explanation:An assertion is a predicate
5. Foreign key is the one in which the ________ expressing a condition we wish the database to
of one relation is referenced in another relation. always satisfy.
a) Foreign key
b) Primary key 8. Which of the following is the right syntax for
c) References assertion?
d) Check constraint a) Create assertion 'assertion-name' check
View Answer 'predicate';
b) Create assertion check 'predicate' 'assertion-
Answer:b name';
Explanation:The foreign-key declaration c) Create assertions 'predicates';
specifies that for each course tuple, the d) All of the mentioned
department name specified in the tuple must View Answer
exist in the department relation.
Answer:a b) yyyy/mm/dd
Explanation:None. c) dd/mm/yy
d) yy/dd/mm
9. Data integrity constraints are used to: View Answer
a) Control who is allowed access to the data
b) Ensure that duplicate records are not entered Answer:b
into the table Explanation:yyyy/mm/dd is the default format
c) Improve the quality of data entered for a in sql .
specific property (i.e., table column)
d) Prevent users from changing the values 2. An ________ on an attribute of a relation is a
stored in the table data structure that allows the database system
View Answer to find those tuples in the relation that have a
specified value for that attribute efficiently,
Answer:c without scanning through all the tuples of the
Explanation:None. relation.
a) Index
10. Which of the following can be addressed by b) Reference
enforcing a referential integrity constraint? c) Assertion
a) All phone numbers must include the area d) Timestamp
code View Answer
b) Certain fields are required (such as the email
address, or phone number) before the record is Answer:a
accepted Explanation:Index is the reference to the tuples
c) Information on the customer must be known in a relation.
before anything can be sold to that customer
d) When entering an order quantity, the user 3. Create index studentID_index on student(ID);
must input a number and not some text (i.e., 12 Here which one denotes the relation for which
rather than ‘a dozen’) index is created ?
View Answer a) StudentID_index
b) ID
Answer:c c) StudentID
Explanation:The information can be referred d) Student
and obtained . View Answer
Answer:d
Database Questions and Explanation:The statement creates an index
Answers – SQL Data Types named studentID index on the attribute ID of
and Schemas the relation student.
This set of Database Questions & Answers 4. Which of the following is used to store movie
focuses on “SQL Data Types and Schemas” and image files ?
a) Clob
1. Dates must be specified in the format b) Blob
a) mm/dd/yy c) Binary
d) Image c) Check(value >= 29000.00);
View Answer d) Check(value)
View Answer
Answer:b
Explanation:SQL therefore provides large-object Answer:c
data types for character data (clob) and binary Explanation:Check(value ‘condition’) is the
data (blob). The letters “lob” in these data types syntax.
stand for “Large OBject.” .
8. Which of the following closely resembles
5. The user defined data type can be created Create view ?
using a) Create table . . .like
a) Create datatype b) Create table . . . as
b) Create data c) With data
c) Create definetype d) Create view as
d) Create type View Answer
View Answer
Answer:b
Answer:d Explanation:The ‘create table . . . as’ statement
Explanation:The create type clause can be used closely resembles the create view statement
to define new types.Syntax : create type Dollars and both are defined by using queries.The main
as numeric(12,2) final; . difference is that the contents of the table are
set when the table is created, whereas the
6. Values of one type can be converted to contents of a view always reflect the current
another domain using which of the following ? query result.
a) Cast
b) Drop type 9. In contemporary databases the top level of
c) Alter type the hierarchy consists of ______, each of which
d) Convert can contain _____.
View Answer a) Catalogs, schemas
b) Schemas, catalogs
Answer:a c) Environment, schemas
Explanation: Example of cast :cast d) Schemas, Environment
(department.budget to numeric(12,2)). SQL View Answer
provides drop type and alter type clauses to
drop or modify types that have been created Answer:a
earlier. Explanation:None.
7. Create domain YearlySalary numeric(8,2) 10. Which of the following statements creates a
constraint salary value test __________; new table temp instructor that has the same
In order to ensure that an instructor’s salary schema as instructor.
domain allows only values greater than a a) create table temp_instructor;
specified value use: b) Create table temp_instructor like instructor;
a) Value>=30000.00 c) Create Table as temp_instructor;
b) Not null;
d) Create table like temp_instructor; 3. Which of the following is used to provide
View Answer privilege to only a particular attribute ?
a) Grant select on employee to Amit
Answer:b b) Grant update(budget) on department to Raj
Explanation:None. c) Grant update(budget,salary,Rate) on
department to Raj
Database Questions and d) Grant delete to Amit
View Answer
Answers – Authorizations
Answer:b
This set of Database Questions & Answers
Explanation:This grant statement gives user Raj
focuses on “Authorizations”
update authorization on the budget attribute of
1. The database administrator who authorizes the department relation.
all the new users, modifies database and takes
4. Which of the following statement is used to
grants privilege is
remove the privilege from the user Amir ?
a) Super user
a) Remove update on department from Amir
b) Administrator
b) Revoke update on employee from Amir
c) Operator of operating system
c) Delete select on department from Raj
d) All of the mentioned
d) Grant update on employee from Amir
View Answer
View Answer
Answer:d
Answer:b
Explanation:The authorizations provided by the
Explanation:revoke on from ;
administrator to the user is privilege.
5. Which of the following is used to provide
2. Which of the following is a basic form of
delete authorization to instructor ?
grant statement ?
a) Create role instructor ;
a) Grant ‘privilege list’
grant delete to instructor;
on ‘relation name or view name’
b) Create role instructor;
to ‘user/role list’;
grant select on takes
b) Grant ‘privilege list’
to instructor;
on ‘user/role list’
c) Create role instructor;
to ‘relation name or view name’;
grant delete on takes
c) Grant ‘privilege list’
to instructor;
to ‘user/role list’
d) All of the mentioned
d) Grant ‘privilege list’
View Answer
on ‘relation name or view name’
on ‘user/role list’; Answer:c
View Answer Explanation:The role is first created and the
authorization is given on relation takes to the
Answer:a
role.
Explanation:The privilege list allows the
granting of several privileges in one command .
6. Which of the following is true regarding views authorization is revoked .
? View Answer
a) The user who creates a view cannot be given
update authorization on a view without having Answer:c
update authorization on the relations used to Explanation:A user has an authorization if and
define the view. only if there is a path from the root of the
b) The user who creates a view cannot be given authorization graph down to the node
update authorization on a view without having representing the user.
update authorization on the relations used to 9. Which of the following is used to avoid
define the view. cascading of authorizations from the user ?
c) If a user creates a view on which no a) Granted by current role
authorization can be granted, the system will b) Revoke select on department from Amit,
allow the view creation request. Satoshi restrict;
d) A user who creates a view receives all c) Revoke grant option for select on department
privileges on that view. from Amit;
View Answer d) Revoke select on department from Amit,
Answer:c Satoshi cascade;
Explanation:A user who creates a view does not View Answer
necessarily receive all privileges on that view. Answer:b
7. If we wish to grant a privilege and to allow Explanation:The revoke statement may specify
the recipient to pass the privilege on to other restrict in order to prevent cascading
users, we append the __________ clause to the revocation.The keyword cascade can be used
appropriate grant command. instead of restrict to indicate that revocation
a) With grant should cascade.
b) Grant user 10. The granting and revoking of roles by the
c) Grant pass privelege user may cause some confusions when that
d) With grant option user role is revoked .To overcome the above
View Answer situation
Answer:d a) The privilege must be granted only by roles
Explanation:None. b) The privilege is granted by roles and users
c) The user role cannot be removed once given
8. In authorization graph if DBA provides d) By restricting the user access to the roles
authorization to u1 which inturn gives to u2 View Answer
which of the following is correct ?
a) If DBA revokes authorization from u1 then u2 Answer:a
authorization is also revoked . Explanation:The current role associated with a
b) If u1 revokes authorization from u2 then u2 session can be set by executing set role role
authorization is revoked . name. The specified role must have been
c) Both a and b granted to the user, else the set role statement
d) If u2 revokes authorization then u1 fails.
Database Questions and 3. DriverManager.getConnection(_______ ,
______ , ______)
Answers – Access SQL From What are the two parameters that are
a Programming Language included ?
a) URL or machine name where server runs,
This set of Database Questions & Answers
Password, User ID
focuses on “Accessing SQL From a Programming
b) URL or machine name where server runs,
Language”
User ID, Password
1. Which of the following is used to access the c) User ID, Password, URL or machine name
database server at time of executing the where server runs
program and get the data from the server d) Password, URL or machine name where
accordingly ? server runs, User ID
a) Embedded SQL View Answer
b) Dynamic SQL
Answer:b
c) SQL declarations
Explanation:The database must be opened first
d) SQL data analysis
in order to perform any operations for which
View Answer
this get connection method is used .
Answer:b
4. Which of the following invokes functions in
Explanation:Embedded SQL, the SQL statements
sql ?
are identified at compile time using a
a) Prepared Statements
preprocessor. The preprocessor submits the
b) Connection statement
SQL statements to the database system for
c) Callable statements
precompilation and optimization; then it
d) All of the mentioned
replaces the SQL statements in the application
View Answer
program with appropriate code and function
calls before invoking the programming-language 5. Which of the following function is used to
compiler. find the column count of the particular resultset
?
2. Which of the following header must be
a) getMetaData()
included in java program to establish database
b) Metadata()
connectivity using JDBC ?
c) getColumn()
a) Import java.sql.*;
d) get Count()
b) Import java.sql.odbc.jdbc.*;
View Answer
c) Import java.jdbc.*;
d) Import java.sql.jdbc.*; Answer:a
View Answer Explanation:The interface ResultSet
has a method, getMetaData(), that returns a
Answer:a
ResultSetMetaData object that contains
Explanation:The Java program must import
metadata about the result set.
java.sql.*, which contains the interface
ResultSetMetaData, in turn, has methods to
definitions for the functionality provided by
find metadata information, such as the number
JDBC.
of columns in the result, the name of a specified 9. The update statement can be executed in
column, or the type of a specified column. host language using
a) EXEC SQL update c;
6. Which of the following is a following b) EXEC SQL update c into :si, :sn;
statement is a prepared statements ? c) EXEC SQL
a) Insert into department values(?,?,?) update instructor
b) Insert into department values(x,x,x). set salary = salary + 100
c) SQLSetConnectOption(conn, SQL where current of c;
AUTOCOMMIT, 0) d) EXEC SQL update END-SQL
d) SQLTransact(conn, SQL ROLLBACK) View Answer
View Answer
Answer:c
Answer:a Explanation:The SQL can be terminated by ; to
Explanation:? is used as a placeholder whose terminate the sentence.
value can be provided later.
10. Which of the following is used to access
7. Which of the following is used as the large objects from a database ?
embedded SQL in COBOL ? a) setBlob()
a) EXEC SQL ; b) getBlob()
b) EXEC SQL END-EXEC c) getClob()
c) EXEC SQL d) All of the mentioned
d) EXEC SQL END EXEC; View Answer
View Answer
Answer:d
Answer:b Explanation:None.
Explanation:EXEC SQL ; is normally in C.
end Answer:d
Explanation:Create procedure dept count
Find the error in the the above statement . proc(in dept name varchar(20), out d count
a) Return type missing integer).Here in and out refers to input and
b) Dept_name is mismatched result of procedure.
c) Reference relation is not mentioned
d) All of the mentioned 4.
View Answer Create procedure dept_count proc(in dept
Answer:a name varchar(20),
Explanation:Return integer should be given out d count integer)
after create function for this particular
function . begin
2. For the function created in Question 1 ,which select count(*) into d count
of the following is a proper select statement ?
a) Select dept name, budget from instructor
from instructor where instructor.dept name= dept count
where dept count() > 12; proc.dept name
b) Select dept name, budget
from instructor end
where dept count(dept name) > 12;
Which of the following is used to call the
c) Select dept name, budget
procedure given above ?
where dept count(dept name) > 12;
a) Declare d_count integer;
d) Select dept name, budget
b) Declare d_count integer;
from instructor
call dept_count proc(’Physics’, d_count);
where dept count(budget) > 12;
c) Declare d_count integer;
View Answer
call dept_count proc(’Physics’);
Answer:b d) Declare d_count;
Explanation:The count of the dept_name must call dept_count proc(’Physics’, d_count);
be checked for the displaying from instructor View Answer
relation.
Answer:b
3. Which of he following is used to input the Explanation:Here the ‘Physics’ is in variable and
entry and give the result in a variable in a d_count is out variable.
procedure ?
5. The format for compound statement is
a) Put and get
a) Begin ……. end
b) Begin atomic……. end then statement or compound statement
c) Begin ……. repeat elif boolean expression
d) Both a and b then statement or compound statement
View Answer else statement or compound statement
end if
Answer:d d) If boolean expression
Explanation:A compound statement is of the then statement or compound statement
form begin . . . end, and it may contain multiple else
SQL statements between the begin and the statement or compound statement
end.A compound statement of the form begin else statement or compound statement
atomic . . . end ensures that all the statements end if
contained within it are executed as a single View Answer
transaction.
Answer:a
6. Repeat Explanation:The conditional statements
sequence of statements; supported by SQL include if-then-else
__________________ statements by using this syntax.elif and elsif are
end repeat not allowed.
Fill in the correct option :
a) While Condition 8. A stored procedure in SQL is a___________.
b) Until variable a) Block of functions
c) Until boolean expression b) Group of Transact-SQL statements compiled
d) Until 0 into a single execution plan.
View Answer c) Group of distinct SQL statements.
d) None of mentioned
Answer:c View Answer
Explanation:None.
Answer:b
7. Which of the following is the correct format Explanation:If it a atomic statement then the
for if statement ? statements are in single transaction.
a) If boolean expression
then statement or compound statement 9. Temporary stored procedures are stored in
elseif boolean expression _________ database.
then statement or compound statement a) Master
else statement or compound statement b) Model
end if c) User specific
b) If boolean expression d) Tempdb
then statement or compound statement View Answer
elsif boolean expression
then statement or compound statement Answer:d
else statement or compound statement Explanation:None.
end if 10. Declare out of classroom seats condition
c) If boolean expression declare exit handler for out of classroom seats
begin Answer:c
sequence of statements Explanation:The triggers run after an insert,
end update or delete on a table. They are not
The above statements are used for supported for views.
a) Calling procedures
b) Handling Exception 3. The CREATE TRIGGER statement is used to
c) Handling procedures create the trigger. THE _____ clause specifies
d) All of the mentioned the table name on which the trigger is to be
View Answer attached. The ______ specifies that this is an
AFTER INSERT trigger.
Answer:b a) for insert, on
Explanation:The SQL procedural language also b) On, for insert
supports the signaling of exception conditions, c) For, insert
and declaring of handlers that can handle the d) Both a and c
exception, as in this code. View Answer
Answer:b
Database Questions and Explanation:The triggers run after an insert,
Answers – Triggers update or delete on a table. They are not
supported for views.
This set of Database Questions & Answers
focuses on “Triggers” 4. What are the after triggers ?
a) Triggers generated after a particular
1. A __________ is a special kind of a store operation
procedure that executes in response to certain b) These triggers run after an insert, update or
action on the table like insertion, deletion or delete on a table
updation of data. c) These triggers run after an insert, views,
a) Procedures update or delete on a table
b) Triggers d) Both b and c
c) Functions View Answer
d) None of the mentioned
View Answer Answer:b
Explanation:AFTER TRIGGERS can be classified
Answer:b further into three types as: AFTER INSERT
Explanation:Triggers are automatically Trigger, AFTER UPDATE Trigger. ,AFTER DELETE
generated when a particular operation takes Trigger.
place.
5. The variables in the triggers are declared
2. Trigger are supported in using
a) Delete a) -
b) Update b) @
c) Views c) /
d) All of the mentioned
View Answer
d) /@ c) Ought to be
View Answer d) Always
View Answer
Answer:b
Explanation:Example : declare @empid int; Answer:a
where empid is the variable. Explanation:Triggers can be manipulated.
6. The default extension for an Oracle SQL*Plus 10. Which prefixes are available to Oracle
file is: triggers?
a) .txt a) : new only
b) .pls b) : old only
c) .ora c) Both :new and : old
d) .sql d) Neither :new nor : old
View Answer View Answer
Answer:d Answer:c
Explanation:Example :None. Explanation:None.
Answer:d Answer:b
Explanation:None. Explanation:Possible attributes of the instructor
entity set are ID, name, dept name, and salary.