You are on page 1of 9

Ministry of Higher Education Colleges of Applied Sciences

Midterm Exam Academic year 2009/2010 Course name: Introduction to DataBase (SFDV3002) Date: Saturday 7/11/2009 Time: 1 Hour ( 4.00 5.00 pm) College: Ibri College of Applied Science

Students Name____________________________________________ Group No.__________


Instructions for students This exam lasts 1 hour and is worth 10% to your final mark for SFDV3002 Please, place all bags/folders etc at the front or back of the room. TURN OFF all mobile phones DO NOT TALK during the exam without permission from the invigilator Hand the exam paper back to your invigilator at the end of the exam For Lecturer use only Question Multiple choice (15 x 4) Short answer Total (4 x 10) Mark allotted 60 40 100 Mark scored

Student ID:________________

Examiner:

Signature .

1 out of 6

Answers:

Please move the answers of section (1) to the matrix below.

Section (1): Multiple choice questions

10

11

12

13

14

15

2 out of 6

Section (1): Multiple choice questions

60 Marks ( 4 x15)

1. To define the structure of the database we use: a. DDL b. DML c. DCL d. All of the above.

2. One or more of the DBMS types are: a. Hierarchical. b. Relational. c. Network. d. All of the above.

3. One of the drawbacks of file-based database systems is: 3 out of 6

a. Applications are independent of data. b. No data duplication. c. No standard data model. d. All of the above.

4. The degree of a relation is the number of its: a. Associated entities.


b. Attributes.

c. Users. d. None of the above.

5. Each attribute name must be unique within: a. One database. b. One schema. c. One entity. d. Can't be unique.
6. Metadata is stored in a. sequence b. file c. column d. catalog

7.

The project operator, in algebraic notations: a. Takes one input relation and produces two output relations. b. Takes two input relations and produces one output relation. c. Takes one input relation and produces one output relation. d. Takes two input relations and produces two output relations.

8. Which of the following string comparison is correct in Oracle 10g? a. B=b

4 out of 6

b. c. d.

= a A = a

None of the above

9. In databases, integrity rules can apply to: a. One column. b. One relation. c. Whole database. d. All of the above.

10.A column declared as unique must have a. b. c. d. Not null values Non-duplicate values Zero values All the above

11.

The set operators, in algebraic notations: a. Takes compatible source relations. b. Produces output relation that has attributes of source relations. c. Produces output relation that doesn't have any duplicate tuple. d. All of the above.

12.salary > 10000 is a a. b. c. d. Built-in integrity rule User defined Integrity rule Both A and B None of the above

5 out of 6

13.Table constraint is usually written a. b. c. d. At the end of the create table query. After the column Before the column None of the above

14.

The order by clause sorts the column by default in a. b. c. d. Ascending order Descending order No order None of the above

15. A normal field in one relation that is a primary key in another relation is called: a. Composite key. b. Foreign key. c. Surrogate key. d. Alternate key.

Section (2) Short answer questions

40 Marks (4x10)

Consider the following two tables, and answer the questions 1 to 3.

Employee Emp_ID 12 14 15 18 19 22 Emp_NAME Salem Abdullah Aisha Rahma Eiman Barka Dept_Code
ACCT ACCT COSC FINC

<null>
INFO

6 out of 6

Department Dept_code
ACCT FINC COSC INFO

Dept_Name
Accounting Finance Computer Science Information Science

1. Write an SQL statement to add a column Emp_address of data type variable character of size 50 in the Employee table.

Possible solution: Alter table employee Add (Emp_add Char(50));

2. Write an SQL statement that will retrieve Employee ID, Employee name and the department name that he/she works in.

Possible solution: Select From Emp_id , Emp_name , Dept_name Employee , Department

Where Employee.Dept_code = Department.Dept_code;

3. Write an algebraic notation that will retrieve the same output in the previous question(2).

Possible solution:

7 out of 6

Emp_id , Emp_name , Dept_name ( Employee.Dept_code = Department.Dept_code ( Employee Department ))

4. Translate the following ER Diagram into relational model. Show different relations that will result in addition to their attributes and PKs and FKs.

Lecturer # Lect_NUM * Lect_name *Lect_officeno * Lect_depart

Tought Teach

Course # Cs_NUM * Cs_name * Prerequisite to their attributes and PKs and FKs.

Possible solution:

Lecturer = ( Lect_NUM, Lect_name, Lect_officeno, Lect_depart )

Course

= ( Cs_NUM, Cs_name, Prerequisite )

Enrol

= ( Lect_NUM, Cs_NUM )

8 out of 6

9 out of 6