Data BaseData Base

download Data BaseData Base

of 25

description

Data BaseData Base

Transcript of Data BaseData Base

  • Data Base

    0371240

    Examination

    Booklet

    Contributed by:

    Mr. Ahmed Al-Ghoul

    1

  • Faculty of Administrative and Financial Sciences BusinessNetworking 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 thedatabase?

    A. DCL B. =DDL C. DML D. None of these

    2) The DML is used for: a) Creating tablesb) =Retrieving datac) Deleting usersd) Inserting datae) Deleting data

    A. b,c,d B. =b,d,e C. None of these D. 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 issuesb) Storage structure definition

    c) Develop application programsd) 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. attribute B. =record C. field D. table

    8) Which language is used to define the integrity constraints?

    A. DCL B. DDL C. =DML D. 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. =True B. False

    11) SQL is a _______ language.

    A. =non-procedural B. object-oriented C. procedural

    12) SQL statements can be executed without a DBMS.

    A. True B. =False

    13) SQL stands for _______.

    A. Structured Question Language B. Structural Query Language C. =Structured Query Language D. Systematic Query Language

    14) SQL is used for:

    A. creating, managing and deleting tables and manage the relationships amongthe stored date .

    B. generating queries, organizing, managing and retrieving data stored in a

    4

  • database .C. maintaining data integrity and coordinate data sharing .

    A. A and B B. B and C C. =All of the above D. None of the above

    15) What are the two types of tables that can be created in a RDBMS?

    A. =Permanent and Temporary B. Static and Dynamic C. Local and Global

    16) The ON COMMIT clause can be applied to _______ tables.

    A. permanent B. =temporary C. both temporary and permanent

    17) Which of the following are valid column constraints:

    A. NULL B. DISTINCT

    C CHECK D. FOREIGN KEY

    A. A B. C C. =C, D 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. A and D B. B and C C. A, C and D 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. =database systemB. data structureC. file processing systemD. file-oriented system

    22) Which of the following is used for archiving purposes?

    A. transaction fileB. work fileC. =history fileD. security file

    23) Which of the following is used as a temporary file created by an information system for a single task?

    A. transaction fileB. work fileC. history fileD. security file

    24) Typically, a database management system is managed by a person called a _____________.

    A. system managerB. technology managerC. database managerD. =database administrator

    25) A _____ language allows a user to specify a task without specifyinghow the task will be accomplished.

    A. programming B. database

    6

  • C. =queryD. user-oriented

    26) A _____ refers to the complete definition of a database, including descriptions of all fields, tables, and relationships.

    A. =schema B. data repositoryC. data manipulation languageD. none of the above

    27) Intranets and extranets use the same protocols as the Internet; they are called _____.

    A. =Web-centric B. externally alignedC. frame compatibleD. HTML-based

    28) A (n) _________ is software that connects dissimilar applications and enables them to communicate and exchange data.

    A. =MiddlewareB. applicationC. protocolD. extranet

    29) ______ is the language used to write Web pages for the Internet.

    A. THMLB. LMHTC. MHTLD. =HTML

    30) Which of these is an example of an entity?

    A. studentB. a patients nameC. an employees IDD. =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 integrityB. 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. =referential integrityB. domain integrity.C. entity integrity constraint.D. a data validation constraint.

    33) A(n) ____________ is a person, place, thing, or event for which datais collected and maintained.

    A. primary keyB. =tableC. recordD. entity

    34) A(n) ____________ is a field or combination of fields that can be used to access or retrieve records.

    A. foreign keyB. =secondary keyC. ERDD. command key

    35) A _____ relationship has an associative entity with its own characteristics.

    A. 1:1 B. =M:NC. 1:MD. all of the above

    36) The first entity in the relationship is the _________ entity.

    A. =parentB. child.C. motherD. brother

    37) A type of cardinality notation called _______ notation because of the shapes

    A. doves footB. birds footC. = footD. any one from the above

    8

  • 38) In a crows foot cardinality notation a single bar indicates

    A. =B. manyC. zeroD. one and only one

    39) In a crows foot cardinality notation a double bar indicates A. oneB. manyC. zeroD. =one and only one

    40) A table design that contains a repeating group is called_______ .

    A. a repetitive groupB. unfixedC. =D. 1NF

    41) Standard notation format is represented in the example of_____.

    A. FIELD 1: NAME (FIELD 2, FIELD 3) B. =NAME (FIELD 1, FIELD 2, FIELD 3)C. (FIELD 1, FIELD 2, FIELD 3)D. ,FIELD 2, FIELD 3 (NAME)

    42) A (n) __________ record is one that contains a repeating group.

    A. =unnormalizedB. 1NFC. 2NFD. 3NF

    43) in the 1NF

    A. All key attributes definedB. No repeating groups in a tableC. All attributes dependent on a primary keyD. =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. second normal formB. third normal formC. fourth normal formD. fifth normal form

    46) Non key field is a field that is________________

    A. not a candidate key for the primary keyB. a candidate key for the primary keyC. a primary keyD. none of the above is correct

    47) STUDENT (STUDENT-NUMBER, STUDENT-NAME, TOTAL-CREDITS,

    GPA, ADVISOR-NUMBER, ADVISOR-NAME, (COURSE-NUMBER,COURSE-DESC, NUM-CREDITS, GRADE)(

    The STUDENT table above is___________A. unnormalizedB. in the 1NFC. in the 2NFD. in the 3NF

    48) STUDENT (STUDENT-NUMBER, STUDENT-NAME, TOTAL-CREDITS, GPA, ADVISOR-NUMBER, ADVISOR-NAME, COURSE-NUMBER, COURSE-DESC, NUM-CREDITS, GRADE)

    The STUDENT table above is________________ A. unnormalizedB. in the 1NFC. in the 2NFD. in the 3NF

    49) A _____ contains records that contain day-to-day business and operational data.

    A. transaction file B. work fileC. table fileD. 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 forsoftware from different vendors to interact and exchange data usesSQL

    Statements.A. ODBCB. JDBCC. HTMLD. XML

    52)A (n) _____________ is a query language that allows PC users tocommunicate 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. record B. tableC. fieldD. primary key

    54)In a crows foot cardinality notation a circle indicates

    A. oneB. manyC. zeroD. 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. CompatibilityB. referential integrityC. cardinalityD. normalization

    11

  • 56)in the 2NF

    A. Attributes may be functionally dependent on nonkey attributesB. No attribute dependent on a nonkey attributeC. no attributes dependent on a primary keyD. none of the above is correct

    57)Data that the db needs to manage itself is called.

    A. User data.B. system data.C. Information data.D. 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 existingdatabase objects is called.

    A. DDL.B. DCL.C. DML.D. DFL.

    60)You can create a new object in a data base by.

    A. DDL.B. DCL.C. DML.D. DFL.

    61)the category that includes commands that protect the integrity of thedatabase and the consistency of data by controlling and managingthe access to the database structures.

    A. DDL.B. DCL.C. DML.D. DFL.

    62)Arithmetic Expressions can be used with.

    12

  • A. With number data type.B. With date data type.C. With character data type.D. Both a and b

    63)SQL is:

    A. Procedural Query Language. B. Structure Query Language. C. Non procedural Language. D. B and C.

    64)In SQL; the statements are executed:

    A. Statement by statement. B. Block of statements together. C. All of the statements together. D. 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 thats 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. Modify the structure of the DB. B. Manipulate data in existing DB objects. C. Protect the integrity of the DB. D. All of the above.

    67)The Insert command is one of the popular command in:

    A. DDL.B. DML.C. DCL.D. None of the above.

    68)SQL*Plus is:

    A. Procedural Query Language. B. Structure Query Language. C. Non procedural Language. D. Is an oracle tool.

    13

  • E. is an Oracle tool an

    69)SQL : A. A languageB. ANSI standardC. Keyword cannot be abbreviated.D. 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. You get an error. B. You get 200. C. You get 700. D. You get null value.

    71)Commands in data definition language (DML) allow you:

    A. Modify the structure of the DB. B. Manipulate data in existing DB objects. C. Protect the integrity of the DB. D. 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. select job from emp;B. select job from emp where job is not null;C. select * from emp;D. 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

    Locationfrom 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. select ename from emp where ename like J_M%S;B. select ename from emp where ename like 'J_M%S';C. select ename from emp where ename like 'j_m%s';D. 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. Perform calculations on dataB. Manipulate output for groups of rowsC. Format dates and numbers for displayD. All of the above

    77)Functions are a very powerful feature of SQL and can be used to do:

    A. Perform calculations on dataB. Manipulate output for groups of rowsC. Format dates and numbers for display

    15

  • D. All of the above

    78)The function that Pads the character value right-justified is.

    A. LENGTHB. TrimC. LPADD. CONCAT

    79)NVL Function

    A. Converts null to an actual valueB. Converts date to an character data type.C. Converts null to numbers.D. Converts numbers to a null value.

    80)Outer join operator is

    A. The plus sign (+).B. The minus sign (-).C. The multiply sign ( * ).D. None of the above.

    81)(

  • B. Self joinC. Cartesian product D. Non equijoin.

    85)When you want to write a simple join query, the minimum number ofjoin conditions required is :

    A. the number of tables minus one.B. The number of tables. C. The number of tables plus one.D. Non of the above.

    86)The single row function LPAD:

    A. Pads the character value right-justifiedB. Pads the character value left justified.C. Pads the character value Center-justifiedD. Non of the above.

    87)In a self join query, a table is joined to itself by using:

    A. Non-Equijoins to treat the tables as two separate tables.B. Equijoins to treat the tables as two separate tables.C. Table aliases to treat the tables as two separate tables.D. Non of the above.

    88)you can use STDDEV and VARIANCE functions for:

    A. Date data type.B. Numeric data type.C. Character data type.D. Any data type.

    89)multiple-row comparison operators ( < ANY ) means.

    A. More than the minimum value in the subquery. B. less than the maximum value in the SubqueryC. less than the minimum value in the subqueryD. All of the above.

    90)Review the following output :

    17

  • A.SQL> select e.ename, d.deptno, d.dname

    2 FROM emp e, dept d3 WHERE e.deptno(+) = d.deptno;4 and d.deptno=40;

    B.SQL> select e.ename, d.deptno, d.dname

    2 FROM emp e, dept d3 WHERE e.deptno = d.deptno(+)4 and d.deptno=40;

    C.SQL> SELECT e.ename, d.deptno, d.dname

    2 FROM emp e, dept d3 WHERE e.deptno = d.deptno;(+)

    D.SQL> select e.ename, d.deptno, d.dname

    2 FROM emp e, dept d3 WHERE e.deptno(+) = d.deptno(+)4 and deptno = 40;

    91)Review the following output :

    A. SQL> SELECT deptno, AVG(sal(2 FROM emp3 GROUP BY deptno4 having avg(sal) >2000

    B. SQL> select deptno, AVG(sal) 2 FROM emp 3 WHERE AVG(sal) > 2000 4 GROUP BY deptno;

    C. SQL> SELECT deptno, AVG(sal) 2 FROM emp 3 GROUP BY avg(sal) 4 having avg(sal) >2000;

    D. SQL> SELECT deptno, AVG(sal) 2 FROM emp 3 where sal>1500 4 GROUP BY deptno 5 having avg(sal)>2000;

    92)Review the following output :

    A. SQL>select ename, to_char(hiredate, 'dd "of"

    month yyyy HH:MI:SS AM') Hiredatefrom emp

    where ename='KING;'

    B. SQL> select ename, to_char(hiredate,

    fmddspth of month yyyy fmHH:MI:SS AM) hiredate

    from empwhere ename= KING;

    C. SQL> select ename, to_date(hiredate,'ddspth

    "of" month yyyy HH:MI:SS AM') hiredate

    from empwhere ename='KING;'

    D. SQL> select ename, to_char(hiredate,

    'ddspth "of" month year HH:MI:SS AM') hiredate

    from emp 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 yourOracle database. Which of the following choices identifies the type ofstatement you would use when trying to obtain data from thedatabase?

    A. selectB. update

    C. insertD. delete

    95)You are identifying a table for use in your select clause that was notcreated by you. Which of the following choices identifies thereference that must be included in your select statement so thatOracle knows where to look for the information?

    A. AliasB. Schema

    C. ExpressionD. Session

    19

  • 96)Use the following code block to answer this question:SQL> select empno, ename, mgrfrom emp;

    EMPNO ENAME MGR--------- ---------- ---------

    7369 SMITH 79027499 ALLEN 76987521 WARD 76987566 JONES 78397654 MARTIN 7698

    7698 BLAKE 78397782 CLARK 78397788 SCOTT 7566

    7839 KING7844 TURNER 7698

    7876 ADAMS 77887900 JAMES 7698

    7902 FORD 75667934 MILLER 7782

    SQL> select empno, ename, nvl(mgr,'none') as mgrfrom emp;

    Which of the following choices describes what Oracle will return as theoutput in the MGR column for KINGs record from this query?

    A. Oracle returns NULL in the MGR column for KINGs record.B. Oracle returns MGR in the MGR column for KINGs record.C. Oracle returns NONE in the MGR column for KINGs record.D. Oracle returns an error.

    97)You are concatenating information from two columns in an SQLquery. Which of the following choices best identifies the specialcharacter required for this operation?

    A. @B. #C. ||D. /

    98)You may use the contents from the standard EMP table used in thisdiscussion to answer the following question. You are attempting tocalculate 20 percent of the salary and commission for all employeesof the company. Which of the following SQL statements would beappropriate for the task?

    A. select empno, ename, sal/20, comm/20 from emp;B. select empno, ename, sal*20, comm*20 from emp;C. select empno, ename, sal/.20, comm/.20 from emp;D. 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 YORK20 RESEARCH DALLAS

    30 SALES CHICAGO40 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. describeB. getC. runD. spool

    101) A DML statement is executed when you:

    A. Add new rows to a tableB. modify existing rows in a tableC. Remove existing rows from a tableD. all of the above.

    21

  • 102) With the flowing syntax you can INSERT INTO table [(column [,column...])] VALUES(value [, value...]);

    A. insert one row at a time.B. Insert multiple rows at a time.C. Insert one column at a time.D. Insert multiple columns at a time.

    103) In insert statement If a date is required to be entered in a formatother than the default (for example, another century) and/or a specifictime is required, you must use

    A. the TO_DATE function.B. the TO_CHAR function.C. The NVL function.D. Non of the above.

    104) Which of those statements allows the you to add values interactivelyas 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 abovesyntax allow you to

    A. insert new row B. adding a rows to a table by copying rows from anther table.C. Inserting multiple new rowsD. All of the above

    106) when you Modify existing rows with the UPDATE statement the valecan be.

    A. simple value.B. An expression.C. subquery.D. All of the above.

    22

  • 107) DELETE [FROM] table [WHERE condition]; from the above syntaxif you omit the where clause.

    A. all rows in the table are deleted.B. It will give you an error.C. No rows will be deleted.D. Only one row will be deleted.

    108) Database transaction end with one of the following events:

    A. COMMIT or ROLLBACK is issuedB. DDL or DCL statement executes (automatic commit)C. User exitsD. all of the above.

    109) the user Tables in the Oracle Database contains.

    A. Collection of tables created and maintained by the Oracle serverB. Contain database informationC. Collection of tables created and maintained by the userD. all of the above.

    110) You can change a columns datatype, size, and default value byusing.

    A. alter statement.B. Modify statement.C. Resize statement.

    23

  • 24

    Number of Question Answer1 B2 B3 A4 C5 B6 C7 B8 C9 A10 A11 A12 B13 C14 C15 A16 B17 C18 D19 A21 A22 C23 B24 D25 C26 A27 A28 A29 D30 D

    Number of Question Answer31 C32 A33 B34 B35 B36 A37 C38 A39 D40 C41 B42 A43 D44 B45 A46 A47 A48 B49 A50 A51 A52 A53 C54 D55 A56 A57 B58 D59 C

  • 25

    Number of Question Answer60 A61 B62 D63 D64 A65 C66 A67 B68 D69 D70 D71 B72 A73 D74 B75 B76 D77 D78 C79 A80 C81 B82 D83 D84 C85 A86 A87 C88 B

    Number of Question Answer89 B90 A91 A92 B93 A94 A95 C96 D97 C98 D99 A100 A101 D102 A103 B104 A105 B106 D107 A108 D109 C110 A