Escolar Documentos
Profissional Documentos
Cultura Documentos
EXAMINATION DETAILS:
INSTRUCTIONS:
All questions to be attempted.
Answer ALL questions in the FOUR (4) sections.
Answer Section A using the Multiple Choice Answer sheet.
Answer Sections B, C, and D in separate booklets.
Mark each booklet with your name, student Id and which section
it contains.
2. The reasons for using an entity cluster approach are listed as follow EXCEPT
when:
a. To enable a hierarchical decomposition of a macro-level data model into
finer and finer views of the data.
b. To create several different entity cluster segments each with a different
focus.
c. To focus part of the model on an area of interest to a community of users.
d. To specialize the presentation of a simple enterprise-wide E-R diagram.
4. A surrogate key should be created for the primary key of a relation as follow
EXCEPT:
a. The natural primary key cannot be guaranteed to be unique over time.
b. The natural primary key is made up of more than two attributes which will
cause performance issues with database software.
c. The relation has a composite primary key.
d. The relation has a foreign key.
6. Which one the following is NOT considered as a major input to physical design?
a. Logical database structures developed during logical design.
b. User processing requirements identified during requirements definition.
c. Characteristics for the DBMS and other components of the computer-
operating environment.
d. An established data quality audit program to understand the nature and
extent of data quality problems.
7. The attribute(s) that can uniquely differentiate entity instances is (are) called __.
a. weak entity
b. ternary
c. identifier
d. unary relationship
8. A(n) __ is associated with a data value, indicating when some event occurred that
affected the data value.
a. associative entity instance
b. mandatory attribute
c. time stamp
d. cardinality constraint
9. Which of the following is true about specialization in the enhanced E-R model?
a. Specialization is a bottom-up process, the direct reverse of generalization.
b. A completeness constraint addresses the question whether an instance of
a supertype may simultaneously be a member of two (or more) subtypes.
c. A disjointness constraint addresses whether an instance of a supertype
must also be a member of at least one subtype.
d. A subtype discriminator in specialization is an attribute of a supertype
whose values determine the target subtypes.
10. The design to ensure that every relation has a primary key and that the data
values for that primary key are all valid is called __.
a. entity integrity rule
b. referential integrity rule
c. domain constraint
d. functional dependency
12. A(n) __ is a named logical storage unit in which data from one or more database
tables may be stored.
a. index
b. tablespace
c. physical file
d. hash index table
19. Which of the following SQL keyword when used in a statement, deletes all the
records in the table when executed once?
a. DELETE
b. TRUNCATE
c. BOTH a and b
d. None of the above
20. Which of the following SQL keyword is used to sort the records in a table?
a. SORT BY
b. ARRANGE BY
c. ORDER BY
d. GROUP BY
26. Which of the following is an in-built Oracle function that provides todays date
only?
a. NOW
b. TIMESTAMP
c. SYSDATE
d. TODAY
29. Which of the following is the right way to declare a datatype to store a number that
has 2 places before and after the decimal point (Eg: xx.xx)
a. NUMBER(4,2)
b. NUMBER(2,2)
c. NUMBER(5)
d. None of the above
30. Which of the following SQL keywords is used to apply when an aggregate function
as a condition?
a. WHERE
b. HAVING
c. GROUP BY
d. ORDER BY
31. Which of the following is not improved via use of distributed databases compared
to centralised databases?
a. Response times
b. Reliability/availability
c. Communication costs
d. Software costs
33. For a multi-site join the distributed DBMS must decide where to access the data
and how to proceed with the join. The three step process:
a. Query decomposition, Global optimisation, Data localisation
b. Global optimisation, Data localisation, Query decomposition
c. Data localisation, Query decomposition, Global optimisation
d. None of the above
34. Which of the following methods to provide Object Persistence Using Relational
Databases involves passing SQL code as a parameter
a. Call-level Application Program Interface (API)
b. SQL Mapping Frameworks
c. Object-Relational Mapping Frameworks
d. Proprietary Approaches
38. An objects capability to maintain its state between application execution sessions
is known as :
e. Persistence.
f. Perseverance
g. Statistics
h. Permanence
39. Which method is being used for mapping an inheritance structure to a relational
schema when attributes from the subclasses are included in one table (only one
table with all attributes from superclass and subclasses).
a. Table per subclass.
b. Table per concrete class with implicit polymorphism.
c. Table per concrete class with unions.
d. Table per class hierarchy.
41. Which of the following is not one of the information drives that are part of humans
inner needs?
e. Ubiquity
f. Unison
g. Unequality
h. Universality
43. Which of the following roles are responsible for making green choices and
decisions?
m. Administrators
n. Software and Database Designers
o. Users
p. All of the above
44. Which of the following concerns the delivery of competitively-priced goods and
services that satisfy human needs and bring quality of life, while progressively
reducing ecological impacts.
q. Eco-efficiency
r. Eco-economics
s. Eco-equity
t. Eco-effectiveness
45. Which of the following is not an improved via use of distributed databases
compared to centralised databases?
a. Response times
b. Reliability/availability
c. Communication costs
d. Software costs
47. For a multi-site join the distributed DBMS must decide where to access the data
and how to proceed with the join. The three step process:
a. Query decomposition, Global optimisation, Data localisation
b. Global optimisation, Data localisation, Query decomposition
c. Data localisation, Query decomposition, Global optimisation
d. None of the above
48. Which of the following is not one of the information drives that are part of humans
inner needs?
a. Ubiquity
b. Unison
c. Unequality
d. Universality
50. Which of the following roles are responsible for making green choices and
decisions?
a. Administrators
b. Software and Database Designers
c. Users
d. All of the above
51. Which of the following concerns the delivery of competitively-priced goods and
services that satisfy human needs and bring quality of life, while progressively
reducing ecological impacts.
a. Eco-efficiency
b. Eco-economics
c. Eco-equity
d. Eco-effectiveness
1. ____ is a collection of technologies used to access any type of data source and manage
the data through a common interface.
a. DAO
b. UDA
c. ODBC
d. OLE-DB
3. What is the first step in the exchange between a Web browser and a database?
a. The HTML output is displayed on the client computers Web browser.
b. The middleware receives the query result and creates the HTML-formatted
page.
c. The clients Web browser requests a page from a Web server.
d. The Web-to-database middleware uses ODBC to connect to the database.
4. What is the last step in the exchange between a Web browser and a database?
a. The HTML output is displayed on the client computers Web browser.
b. The middleware receives the query result and creates the HTML-formatted page.
c. The Web browser requests a page from a Web server.
d. The Web-to-database middleware uses ODBC to connect to the database.
5. XML allows the definition of new ____, such as <ProdPrice>, to describe the data
elements used in an XML document.
a. elements
b. tags
c. schemas
d. DTDs
7. A(n) ____ file provides the composition of the databases logical model and defines the
syntax rules for an XML document.
a. XMLD
b. HTML
c. DTD
d. meta
8. Using ____, you can extract data from an XML document and convert it into a text file.
a. XMLD
b. XSLT
c. DTD
d. XML schema
9. The ____ contains business data extracted from the operational database and from
external data sources.
a. data store
b. ETL tools
c. data visualization tool
d. data analysis tool
10. Data is captured from the OLTP system and placed on the ____ on a near-real time
basis.
a. decision support system
b. portal
c. data warehouse
d. dashboard
11. Data ____ implies that all business entities, data elements, data characteristics, and
business metrics are described in the same way throughout the enterprise.
a. volatility
b. time-variation
c. subject-orientation
d. integration
12. The person responsible for the control of the centralized and shared database is the
database ____.
a. analyst
b. administrator
c. programmer
d. user
13. ____ are general statements of direction or action that communicate and support DBA
goals.
a. Standards
b. Policies
c. Documentation
d. Procedures
15. ____ cover all tasks directly related to procedures create a safety valve, ensuring the
availability of consistent data in case of system (hardware/software) failures.
a. Backup and recovery
b. System support
c. Performance monitoring and tuning
d. Security auditing and monitoring
Section B: Data Modelling and Design [40 marks]
Please answer the questions in one of the answer booklets provided. Write
Section B and your details on the front cover.
There are five (5) questions, each worth different marks. See each question for the
number of marks assigned to each question.
Questions B1-B3 include Case Descriptions relevant to the question. All questions
concern the data models for a university library system.
Section B - Answers
Q1 (10 marks)
BOOK book_author AUTHOR
PATRON
written by involved with
borrows
published by
PUBLISHER
Q2 (5 marks)
BOOK AUTHOR
PATRON book_author authorID <pi> Characters (4) <M>
itemNo <pi> Characters (8) <M>
userID <pi> Characters (8) <M> title Variable characters (30) written by givenName Variable characters (10)
firstName Variable characters (10) ISBN Characters (13) involved withfamilyName Variable characters (10)
borrows
lastName Variable characters (10) type Variable characters (10) age Integer
department Variable characters (10) Identifier_1 <pi> Identifier_1 <pi>
Identifier_1 <pi>
published by
PUBLISHER
publisherID <pi> Characters (4) <M>
name Variable characters (20)
country Variable characters (10)
Identifier_1 <pi>
Q3 (5 marks)
ST UDENT
ST AFF major Variable characters (10)
position Variable characters (10) age Integer
postcode Characters (4)
a type of
PAT RON
userID <pi> Characters (8) <M>
firstName Variable characters (10)
lastName Variable characters (10)
department Variable characters (10)
Identifier_1 <pi>
BOOK AUTHOR
book_author
a type of itemNo <pi> Characters (8) <M> authorID <pi> Characters (4) <M>
authorID <pi,fi2> Characters (4) <M> involved with
userID <fi1> Characters (8) givenName Variable characters (10)
written by itemNo <pi,fi1> Characters (8) <M>
publisherID <fi2> Characters (4) familyName Variable characters (10)
title Variable characters (30) Identifier_1 <pi> age Integer
PATRON ISBN Characters (13) Identifier_1 <pi>
userID <pi> Characters (8) <M> type Variable characters (10)
firstName Variable characters (10) borrows Identifier_1 <pi>
lastName Variable characters (10)
department Variable characters (10)
Identifier_1 <pi>
published by
PUBLISHER
publisherID <pi> Characters (4) <M>
name Variable characters (20)
country Variable characters (10)
Identifier_1 <pi>
Q5 (5 marks)
A row selection qualification clause will be used:
WHERE (major = IS OR major = IT) AND age > 25 AND postcode = 2200. (1 mark)
Indexes on these fields (major, age, postcode) can be used to considerable advantage in this
situation. Assume that each index qualification (e.g., major = IS) produces a list of record
numbers for the records satisfying that qualification. Lists can be merged to process OR
operators, and lists can be intersected to process AND operators. (2 marks)
Indexes may be scanned in main memory, and the list operations also done without accessing
secondary memory, thus composing the list of qualified records very quickly. Only then does
secondary memory need to be accessed for only those records that satisfy the whole query. (2
marks)
NOTE: there is ambiguity in the statement "Each book is published by only one publisher".
In the sample solution, the statement is read as "Each book cannot be published by more than
one publisher". In order to infer a clear 1:1 relationship, it should normally say "Each book is
published by one and only one publisher".
In either case, just state your interpretation/assumptions so that such a question can be marked
accordingly.
Section C: SQL [40 marks]
Start a new booklet. Write Section C and your details on the front cover.
There are eight (8) questions. Each question is worth 5 marks.
Question C1 (5 marks)
Embedded SQL
Dynamic SQL
Question C2 (5 marks)
List any five (5) string functions and explain what they do in a sentence each.
LTRIM: searches for a pattern and deletes it from the string, Starts from left.
RTRIM: searches for a pattern and deletes it from the string, Starts from right.
Use the information given in the set of tables below to answer Questions C3-C8. The
tables store information for a Car Rental Company. The Schema and Sample Data for each
table are provided.
Schema: CUSTOMERS
Name Datatyp Constraint Description
e s
CUSID CHAR(4) P.K Customer ID
CUSNAME VARCHAR2(30) Customer Name
CUSDOB DATE Customer Date of Birth
*******************************************************************************
Schema: CARS
Name Datatyp Constraint Description
e s
CARID CHAR(5) P.K Car ID
CARMODEL VARCHAR2(15) Model of the Car
RATE NUMBER(5,2) Rental value per day
*******************************************************************************
Schema: HIRE
Name Datatyp Constraint Description
e s
CARID CHAR(5) P.K,F.K1 Car ID
CUSID VARCHAR2(15) P.K,F.K2 Customer ID
DATEHIRED NUMBER(5,2) P.K Date the car gets hired
DAYSHIRED No.of.days car is hired
for
Question C3 (5 marks)
Write an SQL statement that displays all details of cars if the rental value of the car is between
$300 and $650 per day. Sort the rate in descending order.
Question C4 (5 marks)
Write an SQL statement that displays names of customers in uppercase if the name has the
letter a as the second character and the last character has to be t and the customer dob is after
1990.
Question C5 (marks)
Write an SQL statement that displays car id, date the car has been hired, name of the customer
who hired the car-MUST use join.
Question C6 (5 marks)
How would you use SUBQUERY and write the same task given in Question C5.
Question C7 (5 marks)
Write an SQL statement that displays car id and the number of times the car has been rented
out.
Question C8 (5 marks)
Write an SQL statement that displays model of the car, customer name, date the car has been
hired and the number of days it was hired for.
3. SELECT *
FROM CARS
WHERE RATE BETWEEN 300 AND 650
ORDER BY RATE DESC;
(Note: $ in query is wrong, it is okay to use RATE>300 AND RATE <650)
4. SELECT UPPER(CUSNAME)
FROM CUSTOMERS
WHERE CUSNAME LIKE _a%t
AND CUSDOB>=01-JAN-1990;
(Date Comparison must be DD-MON-YY or DD-MON-YYYY )
6. SELECT CUSNAME
FROM CUSTOMERS
WHERE CUSID IN (
SELECT CUSID
FROM HIRE)
7. SELECT CARID,COUNT(CARID)
FROM HIRE
GROUP BY CARID
8. SELECT CARMODEL,CUSNAME,DATEHIRED,DAYSHIRED
FROM CARS,CUSTOMERS,HIRE
WHERE CARS.CARID=HIRE.CARID
AND HIRE.CUSID=CUSTOMERS.CUSID
Section D: Database Concepts and Issues [40 marks]
There are 8 short answer questions. Please answer the questions in the answer
booklet provided. You should reference the diagram below where applicable.
Question B1
Which XML rule is being broken in this file. (2 marks)
<?xml version="1.0" encoding="utf-8"?>
<html>
<heading>Welcome to my site</heading>
<p>This is a good example of an XML file that breaks the rules of XML.</p>
<a href="more.html">Click for more</a><br>
<a href="about.html">About us</a>
</html>
Answer: Every element must be closed (1 mark), Empty elements must be formatted (1 mark).
Question B2
Create the XML to match the given picture. (7 marks)
Possible Answer:
<?xml version="1.0"?>
<students> (1 mark)
<student> (1 mark)
<name>Albert Ben</name> (1 mark)
<id>1001001</id> (1 mark)
<programme>BIT</programme> (1 mark)
<date_joined>2010-01-02</date_joined> (1 mark)
</student>
<student>
<name>Michael John</name>
<id>1001002</id>
<programme>BIT</programme>
<date_joined>2009-01-02</date_joined>
</student>
<student>
<name>Joey Lancer</name>
<id>1001003</id>
<programme>BITC</programme>
<date_joined>2010-02-02</date_joined>
</student>
</students> (1 mark)
Question B3
Modify the mysql_insert.php for inserting users data into the Table. Include error handling. (7
marks)
Screenshot
mysql_insert.php
<?php
$link = mysql_connect('localhost', 'root', '') or die('Could not connect: ' . mysql_error());
mysql_select_db('test') or die('Could not select database');
$name=$_POST['Name'];
$email=$_POST['Email'];
header("Location: mysql_query.php");
?>
Answer
<?php
require "config.php";
$link = mysql_connect('localhost', 'root', '') or die('Could not connect: ' . mysql_error());
mysql_select_db('test') or die('Could not select database');
$name=$_POST['Name'];
$email=$_POST['Email'];
// prepare the query, 3 marks
$query = "INSERT INTO students
(Name,Email)
VALUES (
'$name',
'$email
)";
//2 marks
$result = mysql_query($query);
//2 marks
if (!$result) {
die ('SQL Error : ' . mysql_error());
}
header("Location: mysql_query.php");
?>
Question B4
What is a data warehouse? Explain its four characteristics. (5 marks)
subject-oriented data warehouse data are organized and summarized by topic, such as
customers, patients, students and products. (1 mark)
integrated data are stored in one place in the data warehouse, even though the data originate
from everywhere in the organisation and from a variety of external sources. Therefore, it should
have consistent naming conventions, formats, encoding structures; from multiple data sources (1
mark)
time-variant data in a data warehouse represent snapshots of data at various points in time in
the past, such as the ends of each month, unlike an operational application whose data are
accurate as of the moment. Therefore, users can see trends and changes (1 mark)
non-updatable (or non-volatile) users can only read the data and not able to change the
content of the data. (1 mark)
Question B5
What is a deadlock? And how can it be avoided? (3 marks)
Answer: Deadlocks occur when two or more transactions have locked common resources, and
each waits for the other to unlock their resources (1 mark).
Question B6
What is a view? How is it created? What are the advantages of creating view? (6 marks)
Answer: A view is an individual users picture of the database / a view is a subset of a table.
(2 mark)
View is used when we do not want others to see the complete details of the database. When
we create view, we can restrict the users to see the inner complexity, relationships and some
of the records from the table. So it provides more security in views and maintains the data
integrity. It provides the simplified data to the user. (3 marks)
Question D7 (6 marks)
What is the difference between GreenIT and GreenIS? Use point form to list at least three
features of each.
Answer:
GreenIT
http://www8.hp.com/au/en/products/servers/moonshot/index.html
GreenIS
Green IS, in contrast, refers to the design and implementation of information systems that
contribute to sustainable business processes. Green IS, for example, helps an
organization to:
Reduce transportation costs with a fleet management system and dynamic routing of
vehicles to avoid traffic congestion and minimize energy consumption
Support team work and meetings when employees are distributed throughout the world,
and thus reduce the impact of air travel. IS can move remote working beyond
telecommuting to include systems that support collaboration, group document
management, cooperative knowledge management, and so forth.
Track environmental information (such as toxicity, energy used, water used, etc.) about
the creation of products, their components, and the fulfillment of services
Monitor a firm's operational emissions and waste products to manage them more
effectively
Provides information to consumers so they can make green choices more conveniently
and effectively.
Question D8 (6 marks)
Present and describe in one or two sentences each any three (3) of the eight (8) propositions
that are part of the Institutional Perspective to GreenIT.
1. Governance and power systems, rules, and laws, will give structure to and shape
organisational responses, procedures and protocols around the institution of Green IT
initiatives