Você está na página 1de 22

SESSION 2 FORMAL EXAMINATIONS NOVEMBER/DECEMBER 2014

EXAMINATION DETAILS:

Unit Code: ISYS114


Unit Name: Introduction to System Design and Data Management
Duration of exam
3 hours and 10 minutes reading time
(incl. reading time if applicable):
Section A: 60+ questions (60 marks)
Section B: 5 questions (40 marks)
Section C: 8 questions (40 marks)
Section D: 8 questions (40 marks)
Total no. of questions:
This paper is worth 45% of the total marks for the course and will be
marked out of 180 marks corresponding to one(1) mark per minute.

Total no. of pages


(incl. this cover sheet):

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.

MATERIALS PERMITTED: No dictionaries permitted.


No calculators permitted.
Section A: Multiple-Choice [60 marks]
There are sixty multiple-choice questions. Each question is worth 1
mark.
You must answer these questions on the multiple-choice answer
sheet. Answers written on these question pages will not be marked.

1. Overlap rules in enhanced ER modeling are applicable when:


a. Subtype gets supertype attributes.
b. An entity belongs to two subtypes.
c. A number of associated entity types and relationships are grouped
together.
d. Data profiling is used during data modeling.

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.

3. Which of the following is NOT a valid data type for an attribute?


a. TIME
b. SUM
c. VARCHAR2(10)
d. NUMBER(5,2)

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.

5. A relation that has no transitive dependencies is in __ normal form.


a. first
b. second
c. third
d. None of the above.

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

11. Horizontal partitioning is implemented by placing:


a. Different rows into different tables, based on common column values.
b. Different columns into different tables, based on common row values.
c. Common rows into different tables, based on different column values.
d. Common columns into different tables, based on different row values.

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

13. The attribute on the left side of functional dependency is a __.


a. transitive dependency
b. composite key
c. recursive foreign key
d. determinant
14. A meaningful association between (or among) entity types is a(n) __.
a. relationship type
b. relationship instance
c. attribute integrity
d. mandatory attribute

15. The main goals of normalization are listed as follow EXCEPT:


a. To simplify the enforcement of referential integrity constraints.
b. To make it easier to maintain data.
c. To maximize data redundancy, thereby indexing is applicable.
d. To provide a better design that is an improved representation of business
rules.

16. Which of the following contains descriptions of objects created by a user?


a. Table
b. Connection
c. Catalog
d. Schema

17. Which of the following is not a datatype that Oracle provides?


a. TIME
b. VARCHAR2
c. NUMBER
d. DATE

18. DML stands for


a. Data Management Language
b. Data Manipulation Language
c. Data Modelling Language
d. Data Multiplicity Language

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

21. What is the result of CEIL(787.33,1)?


a. 787.34
b. 788
c. 787.3
d. An error message

22. What is the result of RTRIM(ABCABCDEFABCABC,ABC)?


a. DEF
b. ABCABCDEF
c. ABCABCDEFABC
d. None of the above

23. What is the result of SUBSTR(ABCDEFG,-3,2)?


a. EF
b. BC
c. ED
d. CB

24. What is the result of LENGTH(ABCDEFG ABC)?


a. 10
b. 11
c. 12
d. 13

25. How many arguments can a REPLACE function take?


a. 2
b. 3
c. Both a and b
d. None of the above

26. Which of the following is an in-built Oracle function that provides todays date
only?
a. NOW
b. TIMESTAMP
c. SYSDATE
d. TODAY

27. How many columns does a DUAL table have?


a. 1
b. 2
c. 3
d. 4

28. RENAME falls under which of the following categories?


a. DQL
b. DML
c. DCL
d. DDL

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

32. Which of the following requires a special commit protocol?


a. Location Transparency
b. Replication Transparency
c. Concurrency Transparency
d. Failure Transparency

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

35. Which statement below is FALSE.


a. An object-oriented model is built around classes of objects
b. The E-R model is built around entity types
c. An object encapsulates both data and behaviour
d. The E-R model can be used for data modelling as well as process and
event modeling.

36. Defining structural relationships between object-oriented and relational


representations of data, typically to enable the use of a relational database to
provide persistence for objects is called.
a. Objective-relational mapping.
b. Object-relational mapping.
c. Unified Mapping Language
d. Object-relation mapping.

37. Object-relational impedance mismatch due to structural relationships can occur


due to:
a. Inheritance structures
b. Representation of associations
c. Defining the identify of objects/entity instances
d. Both a and b

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.

40. Which statement is FALSE when describing an object:


a. An object is always something tangible.
b. An object has identify, structure and behaviour
c. An object is an instance of a class.
d. An object can be an event.

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

42. Which of the following is an organizational solution to pollution prevention?


i. videoconferencing
j. virtualisation
k. smart homes and appliances
l. collaboration tools

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

46. Which of the following requires a special commit protocol?


a. Location Transparency
b. Replication Transparency
c. Concurrency Transparency
d. Failure Transparency

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

49. Which of the following is an organizational solution to pollution prevention?


a. videoconferencing
b. virtualisation
c. smart homes and appliances
d. collaboration tools

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

2. A server-side extension ____.


a. provides its services to the Web server in a way that is totally transparent to the
client browser
b. must be downloaded and installed in the client computer
c. is only available for servers running Windows 2000 or greater
d. is not required to access a database over the Internet

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

6. Every XML document has a ____.


a. root element
b. base tag
c. schema
d. DTD

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

14. ____ management is designed to limit access to the database.


a. Authorization
b. User access
c. View
d. DBMS utility

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.

Case Description (I)


You are employed to develop data models for a university library system. You have identified the
following business rules:
Each patron can borrow one or more books from the library. Each book can be lent to at
most one patron at a time.
Each book can be written by one or multiple authors. Every author can write one or
multiple books.
Each book is published by only one publisher. Every publisher can publish one or more
books.
Question B1 (E-R Modeling)
Develop a conceptual level E-R diagram based on the business rules provided. The expected E-
R diagram should include entities, associative entities, relationships and corresponding
cardinalities. Do NOT include any attributes within entities. (10 marks)

Case Description (II)


After a number of interviews with library staff, you have recorded more information concerning
entities:
Each patron has a user ID (identifier, 8-bit characters), first name (10-bit variable
characters), last name (10-bit variable characters) and department (10-bit variable
characters).
A book has an item number (identifier, 8-bit characters), title (30-bit variable characters),
ISBN (13-bit characters), type (10-bit variable characters).
An author has an author ID (identifier, 4-bit characters), given name (10-bit variable
characters), family name (10-bit variable characters) and age (integer).
A publisher has a publisher ID (identifier, 4-bit characters), name (20-bit variable
characters) and country (10-bit variable characters).
Question B2 (E-R Modeling Cont.)
Refine the diagram from Question B1 so that every entity (do NOT add attributes to associative
entity) has identifier, attributes and corresponding data types. (5 marks)

Case Description (III)


Assume there are two types of patrons: student and staff. Following are the attributes for each
type of patron:
student: user ID, first name, last name, department, major (10-bit variable characters), age
(integer), postcode (4-bit characters)
staff: user ID, first name, last name, department, position (10-bit variable characters)
Each library patron must be a member of exactly one of these subtypes.
Question B3 (Enhanced E-R Modeling)
Modify the diagram from Question B2 so that it demonstrates the specialization of supertype
patron. (5 marks)

Question B4 (Logical Database Design)


Develop a logical data model based on the diagram from Question B3. The expected logical
data model should include tables, attributes, relationships, primary keys and foreign keys. (15
marks)

Question B5 (Physical Database Design)


Assume that the student table in the library system had an index on user ID (the primary key)
and indexes on major, age and postcode (all secondary keys). Further, assume that the library
system wanted a list of students majoring in IT or IS, over age 25, and from the 2200 postcode.
How could indexes be used so that only records that satisfy this qualification are accessed? (5
marks)

Section B - Answers
Q1 (10 marks)
BOOK book_author AUTHOR
PATRON
written by involved with
borrows

published by

PUBLISHER

Entities: 1 mark each * 4 = 4 marks


Associative entity: 2 marks
Relationships: 1 mark each (0.5 for cardinality along each end) * 4=4 marks

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>

Identifier: 0.5 each * 4 = 2 marks


Attributes: 0.5 each entity * 4 = 2marks
Correctness of data type: 1 mark

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>

Subtypes: 2 marks each for correct names and attributes *2 = 4 marks


Inheritance: 1 mark
Q4 (15 marks)
STUDENT
STAFF userID <pi> Characters (8) <M>
userID <pi> Characters (8) <M> firstName Variable characters (10)
firstName Variable characters (10) lastName Variable characters (10)
lastName Variable characters (10) department Variable characters (10)
department Variable characters (10) major Variable characters (10)
position Variable characters (10) age Integer
postcode Characters (4)
Identifier_1 <pi>
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>

Primary keys: 1 mark for each table * 7 = 7 marks


Foreign keys: 2 marks for each table (book,book_author) * 2 = 4 marks
Inheritance: 2 marks for each subtype of patron with inherited attributes and primary keys
(staff,student) * 2 = 4 marks

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 the sample solution, from publisher to books, we have a 1:M relationship


("Each publisher publishes one or more books"). In the other direction, the
solution has a 0:1 relationship. Again, if we read the above statement
as "Each book is published by one and only one publisher", the we would
have a 1:1 relationship.

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)

What are the two (2) different types of SQL?

Embedded SQL

Dynamic SQL

The reasons why SQL is embedded at times is:

1) Queries take less time to process


2) More secure
3) Less complexity

Question C2 (5 marks)

List any five (5) string functions and explain what they do in a sentence each.

CONCAT: stiches multiple strings together

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.

SUBSTR: Finds and displays a substring within a string

LENGTH: displays the length of a input string

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

Data: Customer Table


CUSID CUSNAME CUSDOB
A001 Taylor Swift 19-JUN-94
A002 Kanye West 21-DEC-83
A003 Britney Spears 31-MAY-91
A004 Katy Perry 12-SEP-86

*******************************************************************************
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

Data: CARS Table


CARID CARMODEL RATE
C001 LP 610-4 726.34
C002 Ferrari 458 620.17
C003 Mazda-3 231.66
C004 Merc C63 322.11

*******************************************************************************
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

Data: HIRE Table


CARID CUSID DATEHIRED DAYSHIRED
C001 A002 01-NOV-14 2
C002 A002 13-SEP-14 3
C003 A001 31-MAY-14 2
C002 A003 19-NOV-14 1
C001 A002 08-JUN-14 5
C002 A001 03-FEB-14 2
C001 A003 13-SEP-14 5

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.

Answers to the questions:

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 )

5. SELECT CUSNAME, CUSID, DATEHIRED


FROM CUSTOMERS, HIRE
WHERE CUSTOMERS.CUSID=HIRE.CUSID

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)

Createtable SQL satement


CREATE TABLE students
(
Name varchar(15),
Email varchar(15)
);

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'];

//write your code here;

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)

Answer: It is a subject-oriented, integrated, time-variant, nonvolatile collection of data in support


of managements decision-making process.
(1 mark for definition)

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).

Deadlock Prevention (2 marks)


Lock all records required at the beginning of a transaction
Two-phase locking protocol
o Growing phase
o Shrinking phase

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)

It is created through a defining query. (1 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

An information technology (IT) transmits, processes, or stores information.

Green IT is mainly focused on energy efficiency and equipment utilization. It addresses


issues such as:

Designing energy efficient chips and disk drives

http://www8.hp.com/au/en/products/servers/moonshot/index.html

Replacing personal computers with energy efficient thin clients

Use of virtualization software to run multiple operating systems on one server

Reducing the energy consumption of data centers

Using renewable energy sources to power data centers

Reducing electronic waste from obsolete computing equipment

Promoting telecommuting and remote computer administration to reduce transportation


emissions

GreenIS

An information system (IS) is an integrated and cooperating set of software using


information technologies to support individual, group, organizational, or societal goals.

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

2. Business and IT managers are more likely to be environmentally responsible (e.g


implement GreenIT) if they are doing so by rigorous and comprehensive environmental
regulations (e.g. Aimed at reducing GHG emissions)

3. Organisations are more likely to be environmentally responsible if there are well-


defined systems of self-regulation with tangible recognition for rewarding often costly
GreenIT initiatives

4. Business and IT executives are more likely to introduce environmentally responsible


programmes, if Green IT is promoted by, and institutionalised through, industry
standards, business publication, consultancy bodies, and other fora in which
executives participate

5. Business and IT executives are more likely to introduce environmentally responsible


programmes, if they are aware of the cost reductions associated with the
implementation of Green IT initiatives and the resulting increase in profits.

6. Business and IT executives are more likely to introduce environmentally responsible


programmes such as Green IT if doing so enhances their image and attracts Green
Investors.

7. Business and IT executives are more likely to introduce environmentally responsible


Green IT programmes if their activities, processes and products are being monitored
and reported upon by independent non-government organisations, the press, and
society at large.

8. Business and IT executives will mimic successful GreenIT strategies of others


leading to industry-wide isomorphism in terms of environmental responsibility practices
with regard to the operation and use of IT. BUT beware GREENWASHING

END OF EXAM PAPER

Você também pode gostar