Test Question Oct 2020
Test Question Oct 2020
INSTRUCTIONS:
Please answer ALL questions on separate papers (your own Answer Sheets).
Submit all answer through Edmodo
1) In Oracle, the ___________ function compares expr1 and expr2. If expr1 and expr2 are
equal, this function returns NULL.
A. DECODE
B. COALESCE
C. NULLIF
D. NVL2
3) You are the DBA of CEKAL Corp. You need to retrieve the employee names and salaries
from the employment tables, and to make the results assorted by salary, NOT in
ascending order. Just in case, if two names match for a salary are found, the two names
should be shown in alphabetical order. How do you do this?
A. ORDER BY sal NON-ASC, ename;
B. ORDER BY ename, sal;
C. ORDER BY sal DESC, ename;
D. ORDERED BY sal,ename;
4) The standard EMP table we have worked with so far in the book contains 14 records
corresponding to employees of the corporation. One of those records has a NULL value
stored in the MGR column. You issue the following command on that table: SELECT
COUNT(MGR) FROM EMP; Which of the following choices identifies the result Oracle will
return?
A. 13
B. 11
C. 12
D. 14
ICT502 DATABASE ENGINEERING TEST 25 NOVEMBER 2020
5) Which single-row function would you use to return a specific portion of a character
string?
A. INSTR
B. SUBSTR
C. LPAD
D. LEAST
7) What SQL statement would return the following about clerks in each department?
8) You are evaluating a procedure that has the function MOD (100,10). What would be the
result?
A. 10000
B. 10
C. 100
D. 0
ICT502 DATABASE ENGINEERING TEST 25 NOVEMBER 2020
Which of the following choices contains the line with the error?
A. Select Farm_Name, Cow_Id,
B. COUNT(Carton) As Number_Of_Cartons
C. Group By Cow_Id;
D. There are no errors in the statement.
a) On regular basis, Mariah can finish the staff monthly claims analysis in less than an hour.
But ever since the database is shared for the whole company using the DBMS approach,
the time taken to do the analysis has increased to 3 hours. Explain the situation that is
happening to Mariah.
(2 marks)
b) Sales Information System and Human Resources System are two systems that are mainly
used by Woods Company to manage their business. The databases of the systems are not
linked together because of the departmental ownership. Explain TWO (2) problems that
the company might encounter if the current database approach is still being practiced.
(4 marks)
c) In data modeling, sometimes it necessary to show an entity with a relationship to itself
but in different roles. Name that type of relationship and illustrate it with ONE (1)
example.
(4 marks)
ICT502 DATABASE ENGINEERING TEST 25 NOVEMBER 2020
The relational schema below shows the database for LetReadBook Library system.
CUSTOMER (custid, custname, custemail, custphone, custbirthdate, registerdate)
STAFF (staffid, staffname, staffemail, salary, staffphone, staffbirthdate, hiredate,
position)
BOOK (isbn, booktitle, quantity, bookpublisher, bookauthor)
BORROW (borrowid, borrowdate, custid, staffid)
BORROW_BOOK (borrowid, isbn)
There are a lot of customers who will borrow books from the library every day. The weekly
borrowing limit is only 5 books per customer. The borrowing of the book is handled by the staff
at the counter.
Answer the following questions by using SQL and Relational Algebra.
a) Database is a shared collection of logically related data. Explain the meaning of logically
related data.
(2 marks)
b) In methodology of database design, explain the importance of reviewing back the data
model with users as one of the steps in conceptual database design.
(2 marks)
TV99 is the new free channel television intending to develop a new system to store
information on the production of TV programs. As a new database designer of TV99, you
are required to design the database structure according to the following business rules
and specifications:
ICT502 DATABASE ENGINEERING TEST 25 NOVEMBER 2020
• TV99 has many producers to produce TV programs. However, each TV program can
only be produced by one producer.
• TV programs can be documentary, news, or dramas. Documentary programs contain
the title of the documentary, scope, and duration. While, in news program there are
language of news, presenters, duration and time slot. Dramas programs have the
script writer, genre, number of episode and duration. Each TV program is identified by
a program code.
• One producer can be assisted by many production crews. Each production crew can
work with many producers. The crew id, name, department, and contact number are
recorded. While, for producer, an id, name, and contact numbers will be stored.
• For each production work, the schedule of production like date and day of production,
location, hours of work and overtime claim are recorded.
Draw the Entity Relationship Diagram for the above case study. Be sure to indicate the
multiplicity of each relationship. Show the attributes that are associated with each entity,
marking the primary and the foreign keys.
(15 marks)