Mandatory Disclosure SCT's VTC, Faculty of Diploma Engineering ...
Faculty of Diploma Studies – 695
-
Upload
khangminh22 -
Category
Documents
-
view
1 -
download
0
Transcript of Faculty of Diploma Studies – 695
Faculty of Diploma Studies Department of Computer Engineering
ADBMS MCQ
1. DCL stands for
a) Data Control Language
b) Data Console Language
c) Data Console Level
d) Data Control Level
2. TCL stands for:
a) Transaction control languages
b) Transaction command languages
c) Transaction connect languages
d) None of the Mentioned
3. _________commands in SQL allow controlling access to data within
database.
a) Database
b) Data
c) Data control
d) All of the Mentioned
4. In an SQL statement, which of the following parts states the conditions
for row selection?
a) Where
b) From
c) Order By
d) Group By
Faculty of Diploma Studies – 695Department of Computer Engineering –
ADBMS MCQ Questions Bank
Data Control Language
b) Data Console Language
c) Data Console Level
d) Data Control Level
a) Transaction control languages
b) Transaction command languages
c) Transaction connect languages
d) None of the Mentioned
3. _________commands in SQL allow controlling access to data within
c) Data control
d) All of the Mentioned
4. In an SQL statement, which of the following parts states the conditions
695 – 07
3. _________commands in SQL allow controlling access to data within
4. In an SQL statement, which of the following parts states the conditions
Faculty of Diploma Studies Department of Computer Engineering
ADBMS MCQ
5. A transaction completes its execution is said to be
a) Committed
b) Aborted
c) Rolled back
d) Failed
6. Which of the following keyword is used with Data Control Language
(DCL) statements?
a) SELECT
b) INSERT
c) DELETE
d) GRANT
7. To obtain the structure of an Oracle table, the command to use is:
a) STRUCTURE [TableName].
b) DESCRIBE [TableName].
c) DESCRIBE STRUCTURE [TableName].
d) DESC TABLE [TableName]
8.If a transaction has obtained a __________ lock, it can read but cannot write
on the item
a) Shared mode
b) Exclusive mode
c) Read only mode
d) Write only mode
9. 2. If a transaction has obtained a ________ lock, it can both read and write
on the item
a) Shared mode
b) Exclusive mode
c) Read only mode
Faculty of Diploma Studies – 695Department of Computer Engineering –
ADBMS MCQ Questions Bank
5. A transaction completes its execution is said to be
6. Which of the following keyword is used with Data Control Language
obtain the structure of an Oracle table, the command to use is:
a) STRUCTURE [TableName].
b) DESCRIBE [TableName].
c) DESCRIBE STRUCTURE [TableName].
d) DESC TABLE [TableName]
8.If a transaction has obtained a __________ lock, it can read but cannot write
2. If a transaction has obtained a ________ lock, it can both read and write
695 – 07
6. Which of the following keyword is used with Data Control Language
obtain the structure of an Oracle table, the command to use is:
8.If a transaction has obtained a __________ lock, it can read but cannot write
2. If a transaction has obtained a ________ lock, it can both read and write
Faculty of Diploma Studies Department of Computer Engineering
ADBMS MCQ
d) Write only mode
10. The situation where no transaction can proceed with normal
execution is known as ________
a) Road block
b) Deadlock
c) Execution halt
d) Abortion
11. The default data type for a sequence object is . . . . . . A) int B) bigint C) tinyint D) decimal
12. Sequence objects can be used as an optional way to generate unique
numeric values in a table. A) True B) False
13. Sequence numbers are generated outside the scope of transactions; they are . . . . . . . . . . . whether the transaction is committed or roback. A) not consumed B) consumed
14. Sequence objects are not part of any table definition. They can be used across multiple tables. A) True B) False
15. Below a table named P is created. Then a sequence is created. Values are inserted into the table using sequence.
CREATE TABLE P
Faculty of Diploma Studies – 695Department of Computer Engineering –
ADBMS MCQ Questions Bank
situation where no transaction can proceed with normal
execution is known as ________
11. The default data type for a sequence object is . . . . . .
Sequence objects can be used as an optional way to generate unique numeric values in a table.
13. Sequence numbers are generated outside the scope of transactions; they are . . . . . . . . . . . whether the transaction is committed or ro
14. Sequence objects are not part of any table definition. They can be used across multiple tables.
15. Below a table named P is created. Then a sequence is created. Values table using sequence.
695 – 07
situation where no transaction can proceed with normal
Sequence objects can be used as an optional way to generate unique
13. Sequence numbers are generated outside the scope of transactions; they are . . . . . . . . . . . whether the transaction is committed or rolled
14. Sequence objects are not part of any table definition. They can be used
15. Below a table named P is created. Then a sequence is created. Values
Faculty of Diploma Studies Department of Computer Engineering
ADBMS MCQ
( ID int, Name varchar(255) ); CREATE SEQUENCE MySequenceAS Integer Start with 0 Increment by 1 Insert into P values (NEXT VALUE for MySequence, 'AA');Insert into P values (NEXT VALUE for MySequence, 'BB');Insert into P values (NEXT VALUE for MySequence, 'CC'); Insert into P values (NEXT VALUE for MySequence, 'AA');Insert into P values (NEXT VALUE for MySequence, 'BB');Insert into P values (NEXT VALUE for MySequence, 'CC');Select*from P; What will be the
A)
ID Name
0 AA
1 BB
2 CC
0 AA
1 BB
2 CC B)
ID Name
0 AA
1 BB
2 CC
1 AA
2 BB
3 CC
Faculty of Diploma Studies – 695Department of Computer Engineering –
ADBMS MCQ Questions Bank
CREATE SEQUENCE MySequence
Insert into P values (NEXT VALUE for MySequence, 'AA'); Insert into P values (NEXT VALUE for MySequence, 'BB');
into P values (NEXT VALUE for MySequence, 'CC');
Insert into P values (NEXT VALUE for MySequence, 'AA'); Insert into P values (NEXT VALUE for MySequence, 'BB'); Insert into P values (NEXT VALUE for MySequence, 'CC');
What will be the values in table P?
695 – 07
Faculty of Diploma Studies Department of Computer Engineering
ADBMS MCQ
C)
ID Name
0 AA
1 BB
2 CC
3 DD
4 EE
5 FF D)
ID Name
0 AA
1 BB
2 CC
3 AA
4 BB
5 CC
16. Sequence object can be restarted by A) NO CYCLE B) CONTROL SEQUENCEC) ALTER SEQUENCED) RESTART SEQUENCE
17. Apart from T-SQL, you can create and manage sequence objects using the Sequence folder located under the . . . . . . . . . . node for the database in SSMS.
A) Sequence B) Programability C) General D) Tools
18. The . . . . . . . clause specifies that the object should restart from the minimum value when its maximum value is exceeded.
Faculty of Diploma Studies – 695Department of Computer Engineering –
ADBMS MCQ Questions Bank
16. Sequence object can be restarted by using . . . . . . . .
B) CONTROL SEQUENCE C) ALTER SEQUENCE D) RESTART SEQUENCE
SQL, you can create and manage sequence objects using the Sequence folder located under the . . . . . . . . . . node for the database in
18. The . . . . . . . clause specifies that the object should restart from the minimum value when its maximum value is exceeded.
695 – 07
SQL, you can create and manage sequence objects using the Sequence folder located under the . . . . . . . . . . node for the database in
18. The . . . . . . . clause specifies that the object should restart from the
Faculty of Diploma Studies Department of Computer Engineering
ADBMS MCQ
A) Restart B) MIN_MAX C) CYCLE D) None of above 19. A sequence object can be A) tinyint B) smallint C) bigint D) decimal E) numeric F) a, b, c, d G) All of above 20. Sequence gives you guarantee that you won't have gaps. A) True B) False
21. What is the purpose of index in sql serverA. To enhance the query performanceB. To provide an index to a recordC. To perform fast searchesD. All of the mentioned
22. How many types of indexes are there in sql server?a) 1 b) 2 c) 3 d) 4
23. Does index take space in the disk?a) It stores memory as and when requiredb) Yes, Indexes are stored on diskc) Indexes are never stored on diskd) Indexes take no space 24. What are composite indexes?
Faculty of Diploma Studies – 695Department of Computer Engineering –
ADBMS MCQ Questions Bank
19. A sequence object can be of the following data types . . . . .
20. Sequence gives you guarantee that you won't have gaps.
What is the purpose of index in sql server To enhance the query performance To provide an index to a record To perform fast searches
mentioned
2. How many types of indexes are there in sql server?
. Does index take space in the disk? a) It stores memory as and when required b) Yes, Indexes are stored on disk c) Indexes are never stored on disk
. What are composite indexes?
695 – 07
Faculty of Diploma Studies Department of Computer Engineering
ADBMS MCQ
a) Are those which are composed by database for its internal
use
b) A composite index is a combination of index on 2 or
more columns
c) Composite index can never be created
d) None of the mentioned
25. If an index is _________________ the metadata and statistics continue
to exists
a) Disabling
b) Dropping
c) Altering
d) Both Disabling and Dropping
26. What is a view?
a) A view is a special stored procedure executed when certain event occurs
b) A view is a virtual table which results of executing a pre
query
c) A view is a database diagram
d) None of the Mentioned
27.Which of the following is not a limitation of view?
a) ORDER BY Does Not Work
b) Index Created on View Used Often
c) Cross Database Queries No
d) Adding Column is Expensive by Joining Table Outside View
Faculty of Diploma Studies – 695Department of Computer Engineering –
ADBMS MCQ Questions Bank
a) Are those which are composed by database for its internal
b) A composite index is a combination of index on 2 or
more columns
c) Composite index can never be created
d) None of the mentioned
_________________ the metadata and statistics continue
d) Both Disabling and Dropping
a) A view is a special stored procedure executed when certain event occurs
table which results of executing a pre-compiled
c) A view is a database diagram
27.Which of the following is not a limitation of view?
a) ORDER BY Does Not Work
b) Index Created on View Used Often
c) Cross Database Queries Not Allowed in Indexed View
d) Adding Column is Expensive by Joining Table Outside View
695 – 07
a) Are those which are composed by database for its internal
b) A composite index is a combination of index on 2 or
_________________ the metadata and statistics continue
a) A view is a special stored procedure executed when certain event occurs
compiled
Faculty of Diploma Studies Department of Computer Engineering
ADBMS MCQ
28. Syntax for creating views is __________
a) CREATE VIEW AS SELECT
b) CREATE VIEW AS UPDATE
c) DROP VIEW AS SELECT
d) CREATE VIEW AS UPDATE
29,You can delete a view with ___________ command.
a) DROP VIEW
b) DELETE VIEW
c) REMOVE VIEW
d) TRUNCATE VIEW
30. ___________ is stored only in the Master database.
a) Database-scoped Dynamic Management View
b) Complex View
c) Catalog View
d) None of the mentioned
31 - Which of the following is not a PL/SQL unit?
A - Table
B - Type
C - Trigger
D - Package
Faculty of Diploma Studies – 695Department of Computer Engineering –
ADBMS MCQ Questions Bank
28. Syntax for creating views is __________
a) CREATE VIEW AS SELECT
b) CREATE VIEW AS UPDATE
d) CREATE VIEW AS UPDATE
with ___________ command.
___________ is stored only in the Master database.
scoped Dynamic Management View
d) None of the mentioned
the following is not a PL/SQL unit?
695 – 07
Faculty of Diploma Studies Department of Computer Engineering
ADBMS MCQ
32. Out of the below data types which can be used for Date & time type?
a) Date
b) Datetimeoffset
c) Time
d) All
33. What is the ISO synonym for ntext data type?
a) New text
b) Next text
c) National Text
d) None of the above
34. Which data type is used to store binary data up to the limit of
2,147,483,647?
a) Image
b) Text
c) Ntext
d) None of the above
35. Which data type can be used to represent position in a hierarchy?
a. Hierarchy
b. Hierarchyid
c. Nhierarchyid
d. None of the above
36. What is the storage size of smallmoney data type?
a) 3 bytes
b) 2 bytes
c) 4 bytes
d) 8 bytes
37. What is the range of TinyInt data type in SQL Server?
a) 0-10
Faculty of Diploma Studies – 695Department of Computer Engineering –
ADBMS MCQ Questions Bank
32. Out of the below data types which can be used for Date & time type?
33. What is the ISO synonym for ntext data type?
34. Which data type is used to store binary data up to the limit of
35. Which data type can be used to represent position in a hierarchy?
e of smallmoney data type?
What is the range of TinyInt data type in SQL Server?
695 – 07
32. Out of the below data types which can be used for Date & time type?
34. Which data type is used to store binary data up to the limit of
35. Which data type can be used to represent position in a hierarchy?
Faculty of Diploma Studies Department of Computer Engineering
ADBMS MCQ
b) 0-255
c) -2^15 to 2^15-1
d) None of the above
38. Which data type in SQL server can
a) Timeonly
b) OnlyTime
c) Time
d) DateTime
39. What is the ISO synonym for real data type in SQL server?
a) Float(24)
b) Float(8)
c) Float(16)
d) None of the above
40. What is the default size of n in a column which is defined as VARCHAR(n)? a) NULL b) 0 c) 1 d) None of the above 41. For which Exception, if a SELECT statement attempts to retrieve data based on its conditions, this exception is raised when no rows satisfy the SELECT criteria?
a. TOO_MANY_ROWS
b. NO_DATA_FOUND
c. VALUE_ERROR
d. DUP_VAL_ON_INDEX
42. In the SQL Cursor, which attribute is TRUE when a cursor has some remaining rows to fetch, and FALSE when a cursor has no rows left to
Faculty of Diploma Studies – 695Department of Computer Engineering –
ADBMS MCQ Questions Bank
38. Which data type in SQL server can be used to store time in the table?
. What is the ISO synonym for real data type in SQL server?
default size of n in a column which is defined as
For which Exception, if a SELECT statement attempts to retrieve data based on its conditions, this exception is raised when no rows satisfy the SELECT criteria?
In the SQL Cursor, which attribute is TRUE when a cursor has some remaining rows to fetch, and FALSE when a cursor has no rows left to
695 – 07
be used to store time in the table?
For which Exception, if a SELECT statement attempts to retrieve data based on its conditions, this exception is raised when no rows
In the SQL Cursor, which attribute is TRUE when a cursor has some remaining rows to fetch, and FALSE when a cursor has no rows left to
Faculty of Diploma Studies Department of Computer Engineering
ADBMS MCQ
fetch? a. %ROWCOUNT
b. %FOUND
c. %NOTFOUND
d. %ISOPEN 43. To handle raised exceptions, you write separate routines called exception handlers.
a. Yes b. No
44. In PL/SQL, a warning or error condition is called an exception
a. True b. False
45. How many nested IF clauses can be included within an IF clause?a. 1 b. 0 c. 15 d. Any number
46. Which three of the following are implicit cursor attributes?
A. %found
B. %too_many_rows
C. %notfound
D. %rowcount
47. If left out, which of the following in a simple loop?
A. LOOP
B. END LOOP
C. IF-THEN
D. EXIT
Faculty of Diploma Studies – 695Department of Computer Engineering –
ADBMS MCQ Questions Bank
To handle raised exceptions, you write separate routines called
In PL/SQL, a warning or error condition is called an exception
How many nested IF clauses can be included within an IF clause?
46. Which three of the following are implicit cursor attributes?
If left out, which of the following would cause an infinite loop to occur
695 – 07
To handle raised exceptions, you write separate routines called
In PL/SQL, a warning or error condition is called an exception
How many nested IF clauses can be included within an IF clause?
would cause an infinite loop to occur
Faculty of Diploma Studies Department of Computer Engineering
ADBMS MCQ
48. The command used to open a CURSOR FOR loop is
A. open
B. fetch
C. parse
D. None, cursor for loops handle cursor opening implicitly.
49. What happens when row
A. It causes the cursor to close
B. It causes the cursor to open
C. It loads the current row values into variables
D. It creates the variables to hold the current row values
50. Select invalid variable types
A. CHAR
B. VARCHAR1
C. VARCHAR2
D. INTEGER
51. List the correct sequence of commands to process a set of records when using explicit cursors
A. INITIALIZE, GET, CLOSE
B. CURSOR, GET, FETCH, CLOSE
C. OPEN, FETCH, CLOSE
D. CURSOR, FETCH, CLOSE
52. Where do you declare an explicit cursor in the PL/SQL language?
A. In the PL/SQL working storage section
B. In the PL/SQL declaration section
C. In the PL/SQL body section
Faculty of Diploma Studies – 695Department of Computer Engineering –
ADBMS MCQ Questions Bank
The command used to open a CURSOR FOR loop is
D. None, cursor for loops handle cursor opening implicitly.
What happens when rows are found using a FETCH statement
A. It causes the cursor to close
B. It causes the cursor to open
C. It loads the current row values into variables
D. It creates the variables to hold the current row values
Select invalid variable types
List the correct sequence of commands to process a set of records when
A. INITIALIZE, GET, CLOSE
B. CURSOR, GET, FETCH, CLOSE
D. CURSOR, FETCH, CLOSE
an explicit cursor in the PL/SQL language?
A. In the PL/SQL working storage section
B. In the PL/SQL declaration section
C. In the PL/SQL body section
695 – 07
s are found using a FETCH statement
List the correct sequence of commands to process a set of records when
an explicit cursor in the PL/SQL language?
Faculty of Diploma Studies Department of Computer Engineering
ADBMS MCQ
D. In the PL/SQL exception section
53. which of the following is not an Oracle DML function?
A. DECODE
B. TRUNCATE
C. TO_CHAR
D. NVL
54. Select the invalid PL/SQL looping construct.
A. WHILE LOOP
...
END LOOP;
B. FOR rec IN some_cursor LOOP
...
END LOOP;
C. LOOP
...
UNTIL ;
END LOOP;
D. None of the above. All are valid.
55. Which listed attribute is an invalid attribute of an Explicit cursor.
A. %NOTFOUND
B. %FOUND
C. %ROWCOUNT
D. None of the above. All of these are v
Faculty of Diploma Studies – 695Department of Computer Engineering –
ADBMS MCQ Questions Bank
D. In the PL/SQL exception section
hich of the following is not an Oracle DML function?
Select the invalid PL/SQL looping construct.
B. FOR rec IN some_cursor LOOP
D. None of the above. All are valid.
Which listed attribute is an invalid attribute of an Explicit cursor.
D. None of the above. All of these are valid.
695 – 07
Which listed attribute is an invalid attribute of an Explicit cursor.
Faculty of Diploma Studies Department of Computer Engineering
ADBMS MCQ
56.Which of the following is not a valid Oracle PL/SQL exception.
A. NO_DATA_FOUND ORA
B. TWO_MANY_ROWS ORA
C. DUP_VAL_ON_INDEX ORA
D. OTHERS
57. What are the components of a package?
A. Box, wrapping and binding
B. Header and body
C. Specification and content
D. Specification and body
58. PL/SQL subprograms, unlike anonymous blocks, are compiled each time they are executed. True or False?
a. True
b.False
59. If you don't specify a mode for a parameter, what is the de
a.OUT
b.IN
c.COPY
d.DEFAULT
60. Which kind of parameters cannot have a DEFAULT value?
a.OUT
b.IN
c.CONSTANT
d.R(ead)
Faculty of Diploma Studies – 695Department of Computer Engineering –
ADBMS MCQ Questions Bank
56.Which of the following is not a valid Oracle PL/SQL exception.
A. NO_DATA_FOUND ORA-01403
B. TWO_MANY_ROWS ORA-01422
C. DUP_VAL_ON_INDEX ORA-00001
What are the components of a package?
A. Box, wrapping and binding
C. Specification and content
D. Specification and body
PL/SQL subprograms, unlike anonymous blocks, are compiled each time they are executed. True or False?
If you don't specify a mode for a parameter, what is the default mode?
Which kind of parameters cannot have a DEFAULT value?
695 – 07
56.Which of the following is not a valid Oracle PL/SQL exception.
PL/SQL subprograms, unlike anonymous blocks, are compiled each
fault mode?
Faculty of Diploma Studies Department of Computer Engineering
ADBMS MCQ
61. What are the three parameter modes for procedures?
a.IN, OUT, IN OUT
b.R(ead), W(rite), A(ppend)
c.CONSTANT, VARIABLE, DEFAULT
d.COPY, NOCOPY, REF
62. A stored procedure in SQL is a___________a) Block of functions b) Group of Transact-SQL statements compiled into a single execution plan. c) Group of distinct SQL statements.d) None of the mentioned
63. Temporary stored procedures are stored in _________ database.a) Master b) Model c) User specific d) Tempdb
64.A __________ is a special kind of a store procedure that executes in response to certain action on the table like insertion, deletion or updation of data. a) Procedures b) Triggers c) Functions d) None of the mentioned
65. Triggers are supported ina) Delete b) Update c) Views d) All of the mentioned
66. The CREATE TRIGGER statement is used to create the trigger. THE _____ clause specifies the table name on which t______ specifies that this is an AFTER INSERT trigger.a) for insert, on b) On, for insert c) For, insert d) None of the mentioned
Faculty of Diploma Studies – 695Department of Computer Engineering –
ADBMS MCQ Questions Bank
What are the three parameter modes for procedures?
b.R(ead), W(rite), A(ppend)
DEFAULT
A stored procedure in SQL is a___________
SQL statements compiled into a single execution
c) Group of distinct SQL statements.
procedures are stored in _________ database.
64.A __________ is a special kind of a store procedure that executes in response to certain action on the table like insertion, deletion or updation
Triggers are supported in
66. The CREATE TRIGGER statement is used to create the trigger. THE _____ clause specifies the table name on which the trigger is to be attached. The ______ specifies that this is an AFTER INSERT trigger.
695 – 07
SQL statements compiled into a single execution
procedures are stored in _________ database.
64.A __________ is a special kind of a store procedure that executes in response to certain action on the table like insertion, deletion or updation
66. The CREATE TRIGGER statement is used to create the trigger. THE _____ he trigger is to be attached. The
Faculty of Diploma Studies Department of Computer Engineering
ADBMS MCQ
67. What are the after triggers?a) Triggers generated after a particular operationb) These triggers run after an insert, update or delete on a tablec) These triggers run after an insert, views, update or delete on a tabled) All of the mentioned
68. The variables in the triggers are declared usinga) – b) @ c) / d) /@
69. The default extension for an Oracle SQL*Plus file is:a) .txt b) .pls c) .ora d) .sql
70.Which of the following is NOT an Oraclea) BEFORE b) DURING c) AFTER d) INSTEAD OF
71. what are the different in triggers?a) Define, Create b) Drop, Comment c) Insert, Update, Delete d) All of the mentioned
72. Triggers ________ enabled or disableda) Can be b) Cannot be c) Ought to be d) Always
73. Trigger is special type of __________ procedure.a) Stored b) Function c) View d) Table
Faculty of Diploma Studies – 695Department of Computer Engineering –
ADBMS MCQ Questions Bank
What are the after triggers? a) Triggers generated after a particular operation
These triggers run after an insert, update or delete on a tablec) These triggers run after an insert, views, update or delete on a table
The variables in the triggers are declared using
nsion for an Oracle SQL*Plus file is:
70.Which of the following is NOT an Oracle-supported trigger?
71. what are the different in triggers?
72. Triggers ________ enabled or disabled
Trigger is special type of __________ procedure.
695 – 07
These triggers run after an insert, update or delete on a table c) These triggers run after an insert, views, update or delete on a table
Faculty of Diploma Studies Department of Computer Engineering
ADBMS MCQ
74. Point out the correct statement.a) Triggers are database objectb) Three types of triggers are present in SQL Serverc) A DDL trigger is an action programmed to execute when a data manipulation language (DML) event occurs in the database serverd) None of the mentione
75. oint out the wrong statement.a) We can have an INSTEAD OF insert/update/delete trigger on a table that successfully executed b) DML Triggers are used to evaluate data after data manipulation using DML statements c) INSTEAD OF triggers cause their source DML od) AFTER triggers cause their source DML operation to skip
Faculty of Diploma Studies – 695Department of Computer Engineering –
ADBMS MCQ Questions Bank
statement. a) Triggers are database object b) Three types of triggers are present in SQL Server c) A DDL trigger is an action programmed to execute when a data manipulation language (DML) event occurs in the database server
out the wrong statement. a) We can have an INSTEAD OF insert/update/delete trigger on a table that
b) DML Triggers are used to evaluate data after data manipulation using
c) INSTEAD OF triggers cause their source DML operation to skipd) AFTER triggers cause their source DML operation to skip
695 – 07
c) A DDL trigger is an action programmed to execute when a data manipulation language (DML) event occurs in the database server
a) We can have an INSTEAD OF insert/update/delete trigger on a table that
b) DML Triggers are used to evaluate data after data manipulation using
peration to skip