Data Base 0371240 Examination Booklet

advertisement
Data Base
0371240
Examination
Booklet
Contributed by:
Mr. Ahmed Al-Ghoul
1
Faculty of Administrative and Financial Sciences Business
Networking and Systems Management Department
Database Management System
LECTURER :- AHMAD AL_GHOUL
2006/2007
2
1) Which of the following languages is used to define the schema of the
database?
A. DCL
B. =DDL
C. DML
D. None of these
2)
a)
b)
c)
d)
e)
The DML is used for:
Creating tables
=Retrieving data
Deleting users
Inserting data
Deleting data
A.
B.
C.
D.
b,c,d
=b,d,e
None of these
All of these
3) Which language is used to permit or prohibit access to a table?
A. =DCL
B. DDL
C. DML
D. All of these
4) The relationship between data is defined in the _______.
A. physical level
B. =view level
C. =logical level
5) The security features of the database are set up by the _______.
A. Online Users
B. =Database Administrator
C. =Naive Users
D. Application Programmer
6) Which of the following are the roles of the Database Administrator:
a) Managing security issues
b) Storage structure definition
c) Develop application programs
d) Take backups of the database
A. a
B. a,b,c
C. =a,b,d
D. All of these
7) A group of associated fields is called a _______.
3
A.
B.
C.
D.
attribute
=record
field
table
8) Which language is used to define the integrity constraints?
A.
B.
C.
D.
DCL
DDL
=DML
None of these
9) The database oriented approach _______ the redundancy of data
compared to the file oriented approach.
A. =reduces
B. increases
10) SQL is platform independent.
A.
B.
=True
False
11) SQL is a _______ language.
A. =non-procedural
B. object-oriented
C. procedural
12) SQL statements can be executed without a DBMS.
A.
B.
True
=False
13) SQL stands for _______.
A.
B.
C.
D.
Structured Question Language
Structural Query Language
=Structured Query Language
Systematic Query Language
14) SQL is used for:
A. creating, managing and deleting tables and manage the relationships among
the stored date.
B. generating queries, organizing, managing and retrieving data stored in a
4
database.
C. maintaining data integrity and coordinate data sharing.
A.
B.
C.
D.
A and B
B and C
=All of the above
None of the above
15) What are the two types of tables that can be created in a RDBMS?
A.
B.
C.
=Permanent and Temporary
Static and Dynamic
Local and Global
16) The ON COMMIT clause can be applied to _______ tables.
A.
B.
C.
permanent
=temporary
both temporary and permanent
17) Which of the following are valid column constraints:
A. NULL
B. DISTINCT
C CHECK
D. FOREIGN KEY
A.
B.
C.
D.
A
C
=C, D
All of the above
18) Which of the following are valid table constraints:
A. PRIMARY KEY
B. UNIQUE
C. CHECK
D. FOREIGN KEY
A.
B.
C.
D.
A and D
B and C
A, C and D
=All of the above
19) Table constraints can be applied to individual columns and groups
of columns.
A.
True
5
B. False
20) Which of these describes a major advantage in using databases for
storing data?
A. The data have a better chance of being available for the user in an
accurate, integral form.
B. All of the data is stored in one place and therefore more vulnerable
to loss or destruction.
C. Bureaucratic procedures may make it difficult for users to access
data.
D. Data retrieval cannot be optimized for a single application.
21) A _______________ consists of linked tables that form one overall
data structure.
A.
B.
C.
D.
=database system
data structure
file processing system
file-oriented system
22) Which of the following is used for archiving purposes?
A.
B.
C.
D.
transaction file
work file
=history file
security file
23) Which of the following is used as a temporary file created by an
information system for a single task?
A.
B.
C.
D.
transaction file
work file
history file
security file
24) Typically, a database management system is managed by a person
called a _____________.
A.
B.
C.
D.
system manager
technology manager
database manager
=database administrator
25) A _____ language allows a user to specify a task without specifying
how the task will be accomplished.
A. programming
B. database
6
C. =query
D. user-oriented
26) A _____ refers to the complete definition of a database, including
descriptions of all fields, tables, and relationships.
A.
B.
C.
D.
=schema
data repository
data manipulation language
none of the above
27) Intranets and extranets use the same protocols as the Internet;
they are called _____.
A.
B.
C.
D.
=Web-centric
externally aligned
frame compatible
HTML-based
28) A (n) _________ is software that connects dissimilar applications
and enables them to communicate and exchange data.
A.
B.
C.
D.
=Middleware
application
protocol
extranet
29) ______ is the language used to write Web pages for the Internet.
A.
B.
C.
D.
THML
LMHT
MHTL
=HTML
30) Which of these is an example of an entity?
A.
B.
C.
D.
student
a patient’s name
an employee’s ID
=all of the above
31) The rule that a primary key cannot have a null value, and if the
primary key is a composite key, none of the component fields can
contain a null value is referred to as:
A. referential integrity
B. domain integrity.
C. =entity integrity constraint.
7
D. a data validation constraint.
32) The rule that requires that a foreign key value cannot be entered in
one table unless it matches an existing primary key in another table
A.
B.
C.
D.
=referential integrity
domain integrity.
entity integrity constraint.
a data validation constraint.
33) A(n) ____________ is a person, place, thing, or event for which data
is collected and maintained.
A.
B.
C.
D.
primary key
=table
record
entity
34) A(n) ____________ is a field or combination of fields that can be
used to access or retrieve records.
A.
B.
C.
D.
foreign key
=secondary key
ERD
command key
35) A _____ relationship has an associative entity with its own
characteristics.
A.
B.
C.
D.
1:1
=M:N
1:M
all of the above
36) The first entity in the relationship is the _________ entity.
A.
B.
C.
D.
=parent
child.
mother
brother
37) A type of cardinality notation called _______ notation because of
the shapes
A.
B.
C.
D.
dove’s foot
bird’s foot
= foot
any one from the above
8
38) In a crow’s foot cardinality notation a single bar indicates
A.
B.
C.
D.
=
many
zero
one and only one
39) In a crow’s foot cardinality notation a double bar indicates
A. one
B. many
C. zero
D. =one and only one
40) A table design that contains a repeating group is called_______ .
A.
B.
C.
D.
a repetitive group
unfixed
=
1NF
41) Standard notation format is represented in the example of_____.
A.
B.
C.
D.
FIELD 1: NAME (FIELD 2, FIELD 3)
=NAME (FIELD 1, FIELD 2, FIELD 3)
(FIELD 1, FIELD 2, FIELD 3)
,FIELD 2, FIELD 3 (NAME)
42) A (n) __________ record is one that contains a repeating group.
A.
B.
C.
D.
=unnormalized
1NF
2NF
3NF
43) in the 1NF
A.
B.
C.
D.
All key attributes defined
No repeating groups in a table
All attributes dependent on a primary key
=All of the above
44) What are the three steps of normalization to third normal form for
databases?
A. Identify the primary key, select secondary keys, and define
relationships.
9
B. =Remove repeating groups, remove partial dependencies, and
remove transitive dependencies.
C. Define entities, select relationships, and define attributes.
D. None of the above is correct.
45) A table design is in __________________ if it is 1NF and if all the
fields that are not part of the primary key are functionally dependent
on the entire primary key.
A.
B.
C.
D.
second normal form
third normal form
fourth normal form
fifth normal form
46) Non key field is a field that is________________
A.
B.
C.
D.
not a candidate key for the primary key
a candidate key for the primary key
a primary key
none of the above is correct
47) STUDENT (STUDENT-NUMBER, STUDENT-NAME, TOTALCREDITS,
GPA, ADVISOR-NUMBER, ADVISOR-NAME, (COURSE-NUMBER,
COURSE-DESC, NUM-CREDITS, GRADE))
The STUDENT table above is___________
A. unnormalized
B. in the 1NF
C. in the 2NF
D. in the 3NF
48) STUDENT (STUDENT-NUMBER, STUDENT-NAME, TOTALCREDITS, GPA, ADVISOR-NUMBER, ADVISOR-NAME, COURSENUMBER, COURSE-DESC, NUM-CREDITS, GRADE)
The STUDENT table above is ________________
A. unnormalized
B. in the 1NF
C. in the 2NF
D. in the 3NF
49) A _____ contains records that contain day-to-day business and
operational data.
A. transaction file
B. work file
C. table file
D. master file
10
50) Scalability refers to _____.
A. a system can be modified, expanded, or down-sized easily to meet
changing needs .
B. data can be shared across the enterprise, allowing more users
access to more data .
C. consistent standards are set for data names, formats, and
documentation .
D. systems are relatively independent of how the physical data is
maintained.
51) _________ is an industry-standard protocol that makes it possible for
software from different vendors to interact and exchange data uses
SQL
Statements.
A. ODBC
B. JDBC
C. HTML
D. XML
52) A (n) _____________ is a query language that allows PC users to
communicate with servers and mainframe computers.
A. structured query language.
B. standard query language.
C. procedural query language.
D. manipulation query language.
53) A _____ refers to a single characteristic or fact about an entity.
A.
B.
C.
D.
record
table
field
primary key
54) In a crow’s foot cardinality notation a circle indicates
A.
B.
C.
D.
one
many
zero
one and only one
55) The process of creating table designs by assigning specific files or
attributes to each table in the database is _____.
A.
B.
C.
D.
Compatibility
referential integrity
cardinality
normalization
11
56) in the 2NF
A.
B.
C.
D.
Attributes may be functionally dependent on nonkey attributes
No attribute dependent on a nonkey attribute
no attributes dependent on a primary key
none of the above is correct
57) Data that the db needs to manage itself is called.
A.
B.
C.
D.
User data.
system data.
Information data.
All of the above.
58) The Redo Logs (Transaction log)
A. A type of operating system files.
B. In which Oracle records all changes or transactions that happen to
the db.
C. Redo logs work in a circular fashion.
D. all of the above.
59) SQL Commands that allow you to manipulate data in existing
database objects is called.
A.
B.
C.
D.
DDL.
DCL.
DML.
DFL.
60) You can create a new object in a data base by.
A.
B.
C.
D.
DDL.
DCL.
DML.
DFL.
61) the category that includes commands that protect the integrity of the
database and the consistency of data by controlling and managing
the access to the database structures.
A.
B.
C.
D.
DDL.
DCL.
DML.
DFL.
62) Arithmetic Expressions can be used with.
12
A.
B.
C.
D.
With number data type.
With date data type.
With character data type.
Both a and b
63) SQL is:
A.
B.
C.
D.
Procedural Query Language.
Structure Query Language.
Non procedural Language.
B and C.
64) In SQL; the statements are executed:
A.
B.
C.
D.
Statement by statement.
Block of statements together.
All of the statements together.
B and C.
65) Rollback segments used for:
A. Records all changes or transactions that happen to the DB.
B. Used to recover the committed data that’s not written to the data
files.
C. Used to undo transaction.
D. Used to hold users personal information.
66) Commands in data definition language (DDL) allow you:
A.
B.
C.
D.
Modify the structure of the DB.
Manipulate data in existing DB objects.
Protect the integrity of the DB.
All of the above.
67) The ‘Insert’ command is one of the popular command in:
A.
B.
C.
D.
DDL.
DML.
DCL.
None of the above.
68) SQL*Plus is:
A.
B.
C.
D.
Procedural Query Language.
Structure Query Language.
Non procedural Language.
Is an oracle tool.
13
E. is an Oracle tool an
69) SQL :
A.
B.
C.
D.
A language
ANSI standard
Keyword cannot be abbreviated.
All of the above.
70) If you divide number 500 on the number one, then you add 200,
multiply the result by null. The result will be:
A.
B.
C.
D.
You get an error.
You get 200.
You get 700.
You get null value.
71) Commands in data definition language (DML) allow you:
A.
B.
C.
D.
Modify the structure of the DB.
Manipulate data in existing DB objects.
Protect the integrity of the DB.
All of the above.
72) Review the following output :
which of the following SQL statements likely produced the output above:
A. select deptno || ' ' || dname || ' in ' || loc Departments from dept;
B. select deptno || “ “ || dname || “ in “ || loc DEPARTMENT from
dept;
C. select deptno || ' ' || ‘dname’ || ' in ' || loc DEPARTMENT from dept;
D. select dname || ' ' || deptno || in || loc departments from dept;
73) Review the following output :
which of the following SQL statements likely produced the output above:
14
A.
B.
C.
D.
select job from emp;
select job from emp where job is not null;
select * from emp;
select distinct job from emp;
74) Review the following output :
which of the following SQL statements likely produced the output above:
A. select deptno as Department_Number, dname as Name, loc
location from dept;
B. select deptno as "Department_Number", dname name ,loc
"Location"
from dept;
C. select deptno as ‘Department_Number’, dname name ,loc
‘Location’
from dept;
D. select "Department_Number", NAME, "LOCATION"
from dept;
75) Review the following output :
which of the following SQL statements likely produced the output above:
A.
B.
C.
D.
select ename from emp where ename like J_M%S;
select ename from emp where ename like 'J_M%S';
select ename from emp where ename like 'j_m%s';
select ename from emp where ename like 'J_MS% ';
76) Functions are a very powerful feature of SQL and can be used to do:
A.
B.
C.
D.
Perform calculations on data
Manipulate output for groups of rows
Format dates and numbers for display
All of the above
77) Functions are a very powerful feature of SQL and can be used to do:
A. Perform calculations on data
B. Manipulate output for groups of rows
C. Format dates and numbers for display
15
D. All of the above
78) The function that Pads the character value right-justified is.
A.
B.
C.
D.
LENGTH
Trim
LPAD
CONCAT
79) NVL Function
A.
B.
C.
D.
Converts null to an actual value
Converts date to an character data type.
Converts null to numbers.
Converts numbers to a null value.
80) Outer join operator is
A.
B.
C.
D.
The plus sign (+).
The minus sign (-).
The multiply sign ( * ).
None of the above.
81) ( <ALL ) comparison operator means.
A.
B.
C.
D.
more than the maximum value in the subquery.
less than the minimum value in the subquery.
is equivalent to IN
none of the above.
82) you can use MAX and MIN functions for:
A.
B.
C.
D.
Date data type.
Numeric data type.
Character data type.
Any data type.
83) You can Place subquery in.
A.
B.
C.
D.
where clause
having clause
from clause.
All of the above.
84) when you need to display all the possible combinations of rows from
multiple tables, we use.
A. Outer join
16
B. Self join
C. Cartesian product
D. Non equijoin.
85) When you want to write a simple join query, the minimum number of
join conditions required is :
A.
B.
C.
D.
the number of tables minus one.
The number of tables.
The number of tables plus one.
Non of the above.
86) The single row function LPAD:
A.
B.
C.
D.
Pads the character value right-justified
Pads the character value left – justified.
Pads the character value Center-justified
Non of the above.
87) In a self join query, a table is joined to itself by using:
A.
B.
C.
D.
Non-Equijoins to treat the tables as two separate tables.
Equijoins to treat the tables as two separate tables.
Table aliases to treat the tables as two separate tables.
Non of the above.
88) you can use STDDEV and VARIANCE functions for:
A.
B.
C.
D.
Date data type.
Numeric data type.
Character data type.
Any data type.
89) multiple-row comparison operators ( < ANY ) means.
A.
B.
C.
D.
More than the minimum value in the subquery.
less than the maximum value in the Subquery
less than the minimum value in the subquery
All of the above.
90) Review the following output :
17
A. SQL> select e.ename, d.deptno,
B. SQL> select e.ename, d.deptno,
d.dname
d.dname
FROM emp e, dept d 2
2 FROM emp e, dept d
WHERE e.deptno(+) = d.deptno; 3
)+(3 WHERE e.deptno = d.deptno
4 and d.deptno=40;
4 and d.deptno=40;
C. SQL> SELECT e.ename, d.deptno,
D. SQL> select e.ename, d.deptno,
d.dname
d.dname
2 FROM emp e, dept d
2 FROM emp e, dept d
3 WHERE e.deptno = d.deptno(+); )+(3 WHERE e.deptno(+) = d.deptno
4 and deptno = 40;
91) Review the following output :
A. SQL> SELECT deptno, AVG(sal(
FROM emp 2
GROUP BY deptno 3
4 having avg(sal) >2000
C. SQL> SELECT deptno, AVG(sal)
FROM emp
2
GROUP BY avg(sal)
3
4 having avg(sal) >2000;
B. SQL> select deptno, AVG(sal)
emp
2 FROM
3 WHERE AVG(sal) > 2000
deptno;
4 GROUP BY
D. SQL> SELECT deptno, AVG(sal)
FROM emp
2
3 where sal>1500
4 GROUP BY deptno
5 having avg(sal)>2000;
92) Review the following output :
A. SQL>select ename,
B. SQL> select ename,
to_char(hiredate, 'dd "of"
to_char(hiredate,
month yyyy HH:MI:SS AM') Hiredate
‘fmddspth “of” month yyyy
from emp
fmHH:MI:SS AM’) hiredate
where ename='KING';
from emp
where ename= ‘KING’;
C. SQL> select ename, to_date(hiredate, D. SQL> select ename,
'ddspth
to_char(hiredate,
"of" month yyyy
'ddspth "of" month year
HH:MI:SS AM') hiredate
HH:MI:SS AM') hiredate
from emp
from emp
where ename='KING';
where ename='KING';
18
93) Review the following output :
A.
SQL> select ename, sal, comm,
(sal*12)+NVL(comm,0)
FROM emp
where ename = 'KING';
B.
SQL> SELECT ename,
comm, (sal*12)+
NVL(COMM,0)
FROM emp
where ename = 'KING';
C.
SQL> SELECT ename, comm,
(sal*12)+
)'NVL(COMM,'NO COMM
3 FROM emp
4 where ename = 'KING';
D.
SQL> SELECT ename, sal,
comm,
(sal*12)+ COMM
3 FROM emp
4 where ename = 'KING';
94) You are determining which type of SQL statement to use in your
Oracle database. Which of the following choices identifies the type of
statement you would use when trying to obtain data from the
database?
A. select
B. update
C. insert
D. delete
95) You are identifying a table for use in your select clause that was not
created by you. Which of the following choices identifies the
reference that must be included in your select statement so that
Oracle knows where to look for the information?
A. Alias
B. Schema
C. Expression
D. Session
19
96) Use the following code block to answer this question:
SQL> select empno, ename, mgr
from emp;
EMPNO ENAME MGR
--------- ---------- --------7369 SMITH 7902
7499 ALLEN 7698
7521 WARD 7698
7566 JONES 7839
7654 MARTIN 7698
7698 BLAKE 7839
7782 CLARK 7839
7788 SCOTT 7566
7839 KING
7844 TURNER 7698
7876 ADAMS 7788
7900 JAMES 7698
7902 FORD 7566
7934 MILLER 7782
SQL> select empno, ename, nvl(mgr,'none') as mgr
from emp;
Which of the following choices describes what Oracle will return as the
output in the MGR column for KING’s record from this query?
A. Oracle returns NULL in the MGR column for KING’s record.
B. Oracle returns MGR in the MGR column for KING’s record.
C. Oracle returns NONE in the MGR column for KING’s record.
D. Oracle returns an error.
97) You are concatenating information from two columns in an SQL
query. Which of the following choices best identifies the special
character required for this operation?
A.
B.
C.
D.
@
#
||
/
98) You may use the contents from the standard EMP table used in this
discussion to answer the following question. You are attempting to
calculate 20 percent of the salary and commission for all employees
of the company. Which of the following SQL statements would be
appropriate for the task?
A.
B.
C.
D.
select empno, ename, sal/20, comm/20 from emp;
select empno, ename, sal*20, comm*20 from emp;
select empno, ename, sal/.20, comm/.20 from emp;
select empno, ename, sal*.20, comm*.20 from emp;
20
99) You may use the contents of the following code block to answer this
question:
SQL> select * from dept;
DEPTNO DNAME LOC
--------- -------------- ------------10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
You issue the following statement in Oracle: select distinct dname,
loc from dept. Which of the following choices correctly describes the
result Oracle will return?
A. Oracle returns the distinct combinations of values from DNAME and
LOC.
B. Oracle returns only three distinct values from DNAME in the DEPT
table.
C. Oracle returns only the distinct values from the DEPTNO column.
D. Oracle returns the contents of all four records from the table.
100) Review the following output from a SQL*Plus session:
Name Null? Type
----------------------------- -------- -----------SYMPTOM NOT NULL VARCHAR2(10)
CAUSE VARCHAR2(10)
TREATMENT VARCHAR2(9)
Which of the following keywords likely produced the output above?
A. describe
B. get
C. run
D. spool
101) A DML statement is executed when you:
A.
B.
C.
D.
Add new rows to a table
modify existing rows in a table
Remove existing rows from a table
all of the above.
21
102) With the flowing syntax you can INSERT INTO
column...])] VALUES(value [, value...]);
A.
B.
C.
D.
table [(column [,
insert one row at a time.
Insert multiple rows at a time.
Insert one column at a time.
Insert multiple columns at a time.
103) In insert statement If a date is required to be entered in a format
other than the default (for example, another century) and/or a specific
time is required, you must use
A.
B.
C.
D.
the TO_DATE function.
the TO_CHAR function.
The NVL function.
Non of the above.
104) Which of those statements allows the you to add values interactively
as below
Enter value for department_id:
Enter value for department_name:
Enter value for location:
A. SQL> INSERT INTO
dept (deptno, dname, loc)
VALUES(&department_id, '&department name', '&location');
B. SQL> INSERT INTO
dept (deptno, dname, loc)
VALUES(department_id, 'department name', 'location');
C. SQL> INSERT INTO
dept (deptno, dname, loc)
(&department_id, '&department name', '&location');
D. non of the above.
105) INSERT INTO table (column [ , column ]) Subquery; The above
syntax allow you to
A. insert new row
B. adding a rows to a table by copying rows from anther table.
C. Inserting multiple new rows
D. All of the above
106) when you Modify existing rows with the UPDATE statement the vale
can be.
A.
B.
C.
D.
simple value.
An expression.
subquery.
All of the above.
22
107) DELETE [FROM] table [WHERE condition]; from the above syntax
if you omit the where clause.
A.
B.
C.
D.
all rows in the table are deleted.
It will give you an error.
No rows will be deleted.
Only one row will be deleted.
108) Database transaction end with one of the following events:
A.
B.
C.
D.
COMMIT or ROLLBACK is issued
DDL or DCL statement executes (automatic commit)
User exits
all of the above.
109) the user Tables in the Oracle Database contains.
A.
B.
C.
D.
Collection of tables created and maintained by the Oracle server
Contain database information
Collection of tables created and maintained by the user
all of the above.
110) You can change a column’s datatype, size, and default value by
using.
A. alter statement.
B. Modify statement.
C. Resize statement.
23
Number of Question
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
21
22
23
24
25
26
27
28
29
30
Answer
B
B
A
C
B
C
B
C
A
A
A
B
C
C
A
B
C
D
A
A
C
B
D
C
A
A
A
D
D
Number of Question
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Answer
C
A
B
B
B
A
C
A
D
C
B
A
D
B
A
A
A
B
A
A
A
A
C
D
A
A
B
D
C
24
Number of Question
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Answer
A
B
D
D
A
C
A
B
D
D
D
B
A
D
B
B
D
D
25
78
79
80
81
82
83
84
85
86
87
88
C
A
C
B
D
D
C
A
A
C
B
Number of Question
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
Answer
B
A
A
B
A
A
C
D
C
D
A
A
D
A
B
A
B
D
A
D
C
A
26
Download