Font size
S
M
L
XL
WorksheetsDatabase Practice
Total questions: 126
Worksheet time: 1hrs 3mins
Name
Class
Date
1.
Database can be used in the following:
a)
Bank
b)
airline
c)
university
d)
all the above
2.
DBMS stands for_______________
a)
DATABASE MANAGEMENT SQL
b)
DATABASE MANAGEMENT SERVER
c)
DATABASE MANAGEMENT SYSTEM
d)
a. DATABASE SERVER2000
3.
The __________ is a collection of inter-related data which is used to retrieve, insert and delete the data efficiently.
a)
database
b)
file system
c)
explorer
d)
data
4.
A software which is used to manage the database.
a)
file explorer
b)
DBMS
c)
data explorer
d)
data administrator
5.
Purpose of database is________
a)
retricting unauthorized access
b)
backup and recovery
c)
redundancy control
d)
All the above
6.
An advantage of the database management approach is
a)
Data is dependent on programs
b)
Data redundancy increases.
c)
Data is integrated and can be accessed by multiple programs.
d)
None of the above
7.
.A ________is raw fact
a)
DATA
b)
INFORMATION
c)
SCHEMA
d)
table
8.
An _______________is the processed data
a)
data
b)
date
c)
information
d)
none of the above
9.
Data about a data
a)
data
b)
metadata
c)
information
d)
none of the above
10.
Course(course_id,sec_id,semester) Here the course_id,sec_id and semester are __________ and course is a _________
a)
relation,attribute
b)
attribute,entity
c)
attribute, attribute
d)
entity, realation
11.
Which of the following can be a multivalued attribute?
a)
phone_number
b)
name
c)
age
d)
none of the above
12.
The feature possessed by each entity is _________
a)
entity
b)
attribute
c)
relation
d)
model
13.
The attribute name could be structured as an attribute consisting of first name, middle initial, and last name. This type of attribute is called
a)
single attribute
b)
composite attribute
c)
multivalued attribute
d)
derived attribute
14.
The attribute AGE is calculated from DATE_OF_BIRTH. The attribute AGE is
a)
single attribute
b)
composite attribute
c)
multivalued attribute
d)
derived attribute
15.
Basic elements of ER model are
a)
entity
b)
attribute
c)
relationship
d)
all the above
16.
____________ defines define a database as a collection of objects with features and methods
a)
object oriented model
b)
network model
c)
relational model
d)
entity relationshop model
17.
A _________ is the main tool for providing data abstraction
a)
DELETE
b)
DATA MODEL
c)
DROP
d)
KEY
18.
The process of analyzing relation schemas to achieve minimal redundancy and insertion or update anomalies is classified as
a)
normalization
b)
denomination
c)
isolation
d)
de-normalization
19.
Normalisation ___________ data duplication.
a)
eliminates
b)
Equalises
c)
increases
d)
maximizes
20.
Eliminating modification anomalies is an ________ of normalization.
a)
advantage
b)
disadvantage
c)
either an advantage or disadvantage
d)
neither an advantage nor disadvantage
21.
Considering the relational database, the functional dependency between two attributes A and B is denoted by
a)
A → B
b)
B $ A
c)
AB → R
d)
R ← AB
22.
which data type will accept NULL value
a)
date
b)
varchar
c)
int
d)
all the above
23.
SQL stands for_________
a)
Structured Query Language
b)
standard query language
c)
structure question language
d)
second query language
24.
Which of the following is not a valid SQL type?
a)
character
b)
numeric
c)
float
d)
decimal
25.
Which amongst the following is not a category of SQL command.
a)
DDL
b)
DML
c)
DCL
d)
SCL
26.
______________commands manipulates the structure of the objects.
a)
DDL
b)
DML
c)
DCL
d)
TCL
27.
The __________ command Modifies database schema.
a)
delete
b)
alter
c)
update
d)
none of the above
28.
Which of the following statement is true ?
a)
DELETE does not free the space containing the table and TRUNCATE free the space containing the table
b)
Both DELETE and TRUNCATE free the space containing the table
c)
Both DELETE and TRUNCATE does not free the space containing the table
d)
DELETE free the space containing the table and TRUNCATE does not free the space containing the table
29.
In SQL, which command(s) is(are) used to change a table’s storage characteristics?
a)
ALTER TABLE
b)
change table
c)
modify table
d)
None of the above
30.
Which of the following is not a DDL command
a)
update
b)
truncate
c)
delete
d)
none of the above
31.
Which of the following is/are the DDL statements?
a)
create
b)
drop
c)
alter
d)
all the above
32.
Which SQL sub language is used for creating and destroying table structure?
a)
ddl
b)
dml
c)
dcl
d)
tcl
33.
The __________command is used for creating database and table
a)
alter
b)
create
c)
Alter
d)
update
34.
The ____________clause is used for specifying the condition
a)
where
b)
group by
c)
order by
d)
from
35.
The ____________command is used for inserting values into the table
a)
select
b)
update
c)
delete
d)
insert
36.
The _________commands to manipulate the information stored in the database.
a)
DDL
b)
DML
c)
DCL
d)
TCL
37.
The database language that allows us to access data in a database is called
a)
dml
b)
ddl
c)
dcl
d)
tcl
38.
DCL provides commands to perform actions like
a)
Change the structure of Tables
b)
insert,update or delete the records
c)
Authorizing Access and other control over Database
d)
none of the above
39.
DCL stands for
a)
Data Condition Language
b)
Data Control Language
c)
Direct Control Language
d)
Direct Calling Language
40.
Which includes commands for controlling data and access to the database
a)
TCL
b)
DDL
c)
DML
d)
DCL
41.
Which of the following are TCL commands ?
a)
UPDATE and TRUNCATE
b)
SELECT and INSERT
c)
GRANT and REVOKE
d)
ROLLBACK and SAVEPOINT
42.
_________ command is used to create roles,permission
a)
ddl
b)
dml
c)
dcl
d)
tcl
43.
TCL stands for
a)
Transaction Common Language
b)
Transactional Control Language
c)
Transact Calling Line
d)
Tree Control Language
44.
Each modification done in database transaction is first recorded into the
a)
Pendrive
b)
Log
c)
Disk
d)
Datamart
45.
If the state of the database no longer reflects a real state of the world that the database is supposed to capture, then such a state is called
a)
Consistent state
b)
Parallel state
c)
Atomic state
d)
Inconsistent state
46.
The _______ means that data used during the execution of a transaction cannot be used by a second transaction until the first one is completed.
a)
Serializability
b)
Atomicity
c)
Isolation
d)
Time stamping
47.
Consider money is transferred from (1)account-A to account-B and (2) account-B to account-A. Which of the following form a transaction?`
a)
Only 1
b)
Only 2
c)
Both 1 and 2 individually
d)
Either 1 or 2
48.
TDS stands for
a)
Transit Data Stream
b)
T-SQL Data Stream
c)
Transparent Data Stream
d)
Tabular Data Stream
49.
Which of these is not a major component of SQL Server Architecture
a)
Storage Engine
b)
Database Engine
c)
Relational Engine
d)
SQL Server Network Interface - SNI
50.
Optimizer's role is to find the
a)
Choosing existing Plan Cache
b)
Minimal Query Run Time
c)
Binding Query Plan
d)
Normalized Query Plan
51.
.ndf file is a _____
a)
Secondary File
b)
Log File
c)
Primary File
d)
None of these
52.
Which component in Transaction manager is used for keeping track of Transaction Committed and Transaction Rollback
a)
Lock Manager
b)
Log Manager
c)
Lazy Writer
d)
None of these
53.
A __________ is a data type that derived from an existing data type.
a)
User-defined datatypes
b)
System Databases
c)
User Tables
d)
System Tables
54.
Mention the name of user-defined datatype in the following query : CREATE TYPE CountryCode FROM VARCHAR(3) NOT NULL;
a)
CREATE
b)
CountryCode
c)
VARCHAR
d)
NOT NULL
55.
The sql where clause
a)
limits the column data that are returned.
b)
limits the row data are returned
c)
Retrieves all rows in the table without any condition
d)
None of the above
56.
The__________ operator selects values within a given range
a)
Between
b)
not between
c)
like
d)
not like
57.
The ______operator is used in a WHERE clause to search for a specified pattern in a column
a)
List
b)
range
c)
string
d)
logical
58.
The__________ operator returns true or false
a)
List
b)
range
c)
string
d)
logical
59.
The pattern 'a%' is used to ________
a)
Finds any values that start with "a" and are at least 2 characters in length
b)
Finds any values that have "or" in any position
c)
Finds any values that ends with “a”
d)
Finds any values that starts with “a”
60.
The pattern 'a_ _%' is used to ________
a)
Finds any values that start with "a" and are at least 2 characters in length
b)
Finds any values that have "or" in any position
c)
Finds any values that ends with “a”
d)
Finds any values that starts with “a”
61.
The pattern '%or%' is used to ________
a)
Finds any values that start with "a" and are at least 2 characters in length
b)
Finds any values that have "or" in any position
c)
Finds any values that ends with “a”
d)
Finds any values that starts with “a”
62.
The pattern 'a%o' is used to ________
a)
Finds any values that start with "a" and are at least 2 characters in length
b)
Finds any values that start with "a" and ends with "o"
c)
Finds any values that ends with “a”
d)
Finds any values that starts with “a”
63.
The pattern '%a' is used to ________
a)
Finds any values that start with "a" and are at least 2 characters in length
b)
Finds any values that have "or" in any position
c)
Finds any values that ends with “a”
d)
Finds any values that starts with “a”
64.
Which clause is used sort the data in ascending or descending order?
a)
group clause
b)
where clause
c)
order by
d)
none of the above
65.
If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is used by default
a)
asc
b)
desc
c)
there is no default value
d)
Random
66.
The _________ clause was added to SQL because the WHERE keyword cannot be used with aggregate functions.
a)
GROUP BY
b)
ORDER BY
c)
HAVING
d)
NONE OF THE ABOVE
67.
A ______________statement returns different value from specified column
a)
top
b)
DISTINCT
c)
both a &b
d)
none of the above
68.
SQL Select statement to retrieve unique record from a table is
a)
select distinct
b)
select union
c)
select unionall
d)
none of the above
69.
which function returns the number of items in a group, including NULL values and duplicates
a)
COUNT (ALL expression)
b)
COUNT (DISTINCT expression)
c)
COUNT (*)
d)
COUNT (column1,column2)
70.
________returns the minimum value from the specified column
a)
minimum()
b)
min()
c)
max()
d)
maximum()
71.
Which select rows from the table 'myTable' that have NULL in column column1?
a)
Select * from myTable where column1 is NULL
b)
Select * from myTable where column1=NOT NULL
c)
select * from myTable where coulmn1 NOT NULL
d)
Select * from myTable where column1 equals NULL
72.
You need to calculate the total of all salaries in the accounting department. Which group function should you use?
a)
MIN
b)
MAX
c)
SUM
d)
COUNT
73.
FOREIGN key must be linked to the _______in another table.
a)
Default constraint
b)
Check constraint
c)
NOT NULL constraint
d)
Primary key constraint
74.
How many unique constraints can be defined in a single table?
a)
1
b)
0
c)
exactly 3
d)
More than one
75.
How many types of constraints are present in SQL Server ?
a)
5
b)
6
c)
7
d)
8
76.
A ____________ constraint is used in conjunction with the REFERENCES clause.
a)
Primary key
b)
Unique
c)
Not null
d)
Foreign key
77.
What is true about Unique and primary key?
a)
Unique can have multiple NULL values but Primary can have one.
b)
Unique can have NULL value but Primary can’t have.
c)
Both can have duplicate values
d)
None of the Mentioned
78.
Which of the constraint can be enforced one per table ?
a)
Primary key constraint
b)
Not Null constraint
c)
Foreign Key constraint
d)
Check constraint
79.
.A_______ key it will accept NULL values
a)
Primary key
b)
Not Null
c)
Foreign key
d)
None of the above
80.
A_________key is used to join the child table with parent table.
a)
Primary key
b)
Foreign key
c)
Composite key
d)
All the above
81.
._______keyword is used to test that a condition is true for one or more of the values returned by a subquery.
a)
ALL
b)
ANY
c)
IN
d)
EXISTS
82.
What is a subquery?
a)
A subquery is a select-from-where expression that is nested within another query
b)
A subquery is any query that is executed after another query
c)
A subquery is a condition that excludes all the invalid tuples from the database
d)
NONE OF THE ABOVE
83.
Which of the following clause is mandatorily used in a sub-query?
a)
SELECT
b)
sum
c)
ORDER BY
d)
GROUP BY
84.
Query within a query is called as________
a)
Correlated subquery
b)
Nested subquery
c)
Inline query
d)
None of the above
85.
A subquery can be used to _________.
a)
create groups of data
b)
sort data in a specific order
c)
convert data to a different format
d)
retrieve data based on an unknown condition
86.
What type of join is needed when you wish to return rows that do have matching values?
a)
OUTER JOIN
b)
INNER JOIN
c)
LEFT JOIN
d)
RIGHT JOIN
87.
How many tables may be included with a join?
a)
2
b)
3
c)
1
d)
ALL THE MENTIONED
88.
A join that displays only the rows that have a match in both joined tables.
a)
Inner join
b)
View join
c)
Alter join
d)
Outer join
89.
ON predicate is written like a
a)
FROM
b)
where clause
c)
SELECT
d)
ORDER BY
90.
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-compiled query
c)
A view is a database diagram
d)
None of the Mentioned
91.
Syntax for creating views is
a)
CREATE VIEW AS SELECT
b)
CREATE VIEW AS update
c)
CREATE VIEW IN TABLE
d)
CREATE TABLE WITH VIEW
92.
You can delete a view with ___________ command.
a)
DROP VIEW
b)
delete view
c)
remove view
d)
none of the above
93.
View cannot include________ clause.
a)
Order by
b)
Group by
c)
Compute by
d)
A and C
94.
A ________is logical representation of the base table.
a)
View
b)
Trigger
c)
Instance
d)
Index
95.
A table can have only one___________ index.
a)
Non-clustered index
b)
Clustered index
c)
Composite index
d)
None of the above
96.
A table can have multiple ___________index.
a)
Non-clustered index
b)
Clustered index
c)
Composite index
d)
None of the above
97.
The variables in the triggers are declared using
a)
@
b)
;
c)
_@
d)
none of the above
98.
What are the after triggers?
a)
Triggers generated after a particular operation
b)
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
d)
all the mentioned
99.
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)
Triggers
b)
select
c)
view
d)
all the above
100.
A______________is a stored program that you can pass parameters into.
a)
stored procedure
b)
function
c)
both a & b
d)
none of the above
101.
Advantage of SQL stored procedure
a)
Maintainability
b)
Re-use of code
c)
Security
d)
ALL THE ABOVE
102.
__________ provides details on any database object.
a)
SP_CHANGEOWNER
b)
SP_RENAME
c)
SP_CHANGE
d)
NONE OF THE ABOVE
103.
_________is a basic T-SQL control-flow statement.
a)
if else
b)
while
c)
goto
d)
none of the above
104.
Which of the following blocks are used for error handling in SQL Server ?
a)
TRY…CATCH
b)
TRY…FINAL
c)
TRY…END
d)
CATCH…TRY
105.
Which of the following is a Error function used within CATCH block ?
a)
ERROR_STATE()
b)
ERROR_STATUS()
c)
ERROR_MSG()
d)
All of the mentioned
106.
Which of the following is global variable for error handling ?
a)
@@ERRORS
b)
@@ERROR
c)
@@ERR
d)
None of the mentioned
107.
Error function used for returning the line number of T-SQL statement that caused error is___________
a)
ERROR_STATE()
b)
ERROR_LINE()
c)
ERROR_NUMBER()
d)
ERROR_MESSAGE()
108.
This returns the name of the stored procedure or trigger where the error occurred.
a)
ERROR_PROCEDURE()
b)
ERROR_LINE()
c)
ERROR_NUMBER()
d)
ERROR_MESSAGE()
109.
This returns the state number of the error
a)
ERROR_STATE()
b)
ERROR_LINE()
c)
ERROR_NUMBER()
d)
ERROR_MESSAGE()
110.
This returns the full text of error message.
a)
ERROR_STATE()
b)
ERROR_LINE()
c)
ERROR_NUMBER()
d)
ERROR_MESSAGE()
111.
This returns the name of the stored procedure or trigger where the error occurred.
a)
ERROR_STATE()
b)
ERROR_PROCEDURE()
c)
ERROR_NUMBER()
d)
ERROR_MESSAGE()
112.
This returns the error number and its value :
a)
ERROR_STATE()
b)
ERROR_LINE()
c)
ERROR_NUMBER()
d)
ERROR_MESSAGE()
113.
It is the process of verifying who you are
a)
Authorization
b)
Authentication
c)
Both
d)
None of these
114.
Select the incorrect authentication mode in SQL Server?
a)
Windows Mode
b)
Mixed Mode
c)
Option 1 & 2
d)
DOS Mode
115.
A long awaited security feature in SQL Server 2012 was
a)
User-defined database roles
b)
User-defined server roles
c)
Fixed database roles
d)
Fixed user roles
116.
If we wish to grant a privilege and to allow the recipient to pass the privilege on to other users, we use _____
a)
GRANT
b)
WITH GRANT option
c)
DENY
d)
REVOKE
117.
Which one is not a security components in SQL Server
a)
Ownership
b)
Permissions
c)
Principals
d)
Securables
118.
Members of this Fixed Server role have Full Control on the instance and can perform any task.
a)
Server Admin
b)
Security Admin`
c)
Setup Admin
d)
SysAdmin
119.
To access an object within a database, the user must be granted permission to the _____
a)
Operating System
b)
SQL Server
c)
Database
d)
Object
120.
The purpose of backup is:
a)
To restore a computer to an operational state following a disaster
b)
To restore small numbers of files after they have been accidentally deleted
c)
To restore one among many version of the same file for multiple backup environment
d)
All of the mentioned
121.
To decide on a backup strategy for your organization, which of the following should you consider?
a)
RPO (Recovery Point Objective)
b)
RTO (Recovery Time Objective)
c)
Both RPO & RTO
d)
None of these
122.
Which one of these helps to restore the database to the point where it failed.
a)
File backup
b)
Differential Backups
c)
File log
d)
Transaction log
123.
Name the recovery model to be used when Data is Critical and data loss should be minimal.
a)
Simple Recovery Model
b)
Full Recovery Model
c)
Bulk Logged Recovery Model
d)
Partial Recovery Model
124.
Which of the following backup technique saves available storage space (space efficient)?
a)
Full backup
b)
Partial Backup
c)
Differential backup
d)
None of these
125.
Following recovery model gives you the most protection against data loss.
a)
Full recovery
b)
Bulk-logged
c)
Simple
d)
All of above
126.
What permission is required to take a database backup?
a)
db_backupoperator
b)
sysadmin
c)
db_owner
d)
All of these
Reset
