DATABASE_MANAGEMENT_SYSTEMS_1_

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

EXAMINATION

FACULTY OF SCIENCE AND


TECHNOLOGY

PROGRAMME(S): DIT,BIT,BCS,BSF

SESSION: DAY/EVENING
MODULE CODE AND TITLE: LEVEL:
2108,2101 DATABASE 1.2
MANAGEMENT SYSTEMS 1
DATE: TIME:
JUNE, 2024

DURATION: TOTALMARKS:
6 Hours 100

EXAMINER/LECTURER: MODERATOR:
Mr. Wakale Fazali Ms. Lillian Tamale

INSTRUCTIONS TO THE CANDIDATE/STUDENT


1. V-class is the ONLY official examination platform.
2. Use MYSQL commandline client for your Sql queries. You can take screen sheets in the
answer sheet. Any form of copying will lead to severe consequences.
3. Questions must be attempted in the answer booklet/sheet provided on V-class.
4. All queries should be directed to the examiner, Head of Department, or Dean.
5. You have SIX HOURS to complete this paper. No exam answer sheet shall be
accepted after the 6 hours (the system has closed).
6. This is an OPENBOOK (Online) examination.
7. Attempt 4 Questions in total. All questions carry equal marks (25 marks each).
8. Read each question carefully before beginning to type/write your answers.
9. Review the grades assigned to each question of the examination and allocate your
time accordingly.
10. Review your answers carefully before submitting your examination.
11. After submission of your exam answer sheet, Cross-Check to make sure your
examination was attached and has been sent to V-class and received a confirmation
message.

1
Section A (Compulsory)
QUESTION ONE: (25Marks)

The Ministry of ICT and National Guidance is expected to deliver its proposed budget for the

financial year 2024/2025. The information needed from the ministry in order to be considered

by the ministry of Finance for funding include; the department IDS, department names, number

of employees in those departments and the anticipated budget for each department. course

admitted to. The student DepartmentID is an integer and should not exceed 10 characters, the

Department name is a character with a maximum of 40 characters, Number of employees is an

integer not exceeding 3 characters while the Annual budget field is varchar and should have 10

characters maximum. The details of different departments include

DEPARTMENTID DEPARTMENT NUMBER OF Anual budget


NAME EMPLOYEES
10006 Finance and 65 12,000,000,000/=
administration
20188 National guidance 23 8,000,000,000/=
261748 Infrastructure 39 18,000,000,000/=
development
234510 Research and 44 4,000,000,000/=
development
419023 e-services 23 3,000,000,000/=
330001 Data networks 68 3.5,000,000,000/=
engineering
672902 Communication and 44 7,000,000,000/=
information technology
630003 Information systems 42 2,000,000,000/=
410001 Artificial intelligence 63 7,000,000,000/=

Required

2
Using SQL,
i. Create a database called “Ministry of ICT” (3 marks)
ii. Create a table called “proposed budget for the ministry” with the highlighted constraints
(4 marks)
iii. Insert the above Department details in the table created. (8 marks)
iv. The minister in charge of the ministry would like to know the total amount of money
proposed for financing by the ministry, issue an SQL statement that can enable him to
achieve this (5 marks).
v. The name Anual budget in the table inserted has been misspelt, change the above name
to Annual budget (5 marks)

QUESTION TWO: (25Marks)

The International Telecommunications Union (ITU) reports that more than 50% of the world’s women
are offline thus not using any form of modern data storage techniques to aid them in their businesses.
This is more pronounced in developing countries like Uganda, where the internet penetration rate for
adult women is 41%, compared to 53% for men. With this limited penetration of the internet, few
women can use online database systems to store their data. The Global System for Mobile
Communications Association (GSMA) found that 393 million adult women in developing countries do
not own mobile phones, and globally, women are 8% less likely to own a mobile phone than men. This
therefore means that a few women use database management systems to store their data. The gender
gap in mobile ownership in sub-Saharan Africa is 13%. Women are more likely than men to borrow or
share mobile phones (often within a household or from a male family member) and are rarely the
primary owners of a mobile device. GSMA further reports that women are more likely to have simpler
feature phones that do not support mobile internet use, and women are 20% less likely than men to own
a smartphone.
This therefore calls for skilling of women in data management to enhance their understanding of
business management techniques.
As a person who has studied database management systems,
i. Explain to the women with an illustration the layered architecture and the concept of
data mapping used during database design(13 marks)

3
ii. Almost all women in Uganda engaging in business use a file based form of storing data,
convince these women why they need to move from such a form of storing data to the
relational type. (12 marks)

Section B Answer two questions


QUESTION THREE: (25Marks)

Mr Uhuru recently visited United Arab Emirates in 2023 and liked the meals served in that
country. Upon return to Uganda, Mr uhuru started a risky venture of opening up an Arabic
restaurant in kampala. This restaurant sales 3 dishes; Khameer,Chebab and Regag.
The restaurant has captured some basic data from their few months of operation. This data is
divided in three datasets; sales, menus and members . the data sets are as set below
Sales Table

customer_id order_date product_id


A 2021-01-01 1
A 2021-01-01 2
A 2021-01-07 2
A 2021-01-10 3
A 2021-01-11 3
A 2021-01-11 3
B 2021-01-01 2
B 2021-01-02 2
B 2021-01-04 1
B 2021-01-11 1
B 2021-01-16 3
B 2021-02-01 3
C 2021-01-01 3
C 2021-01-01 3

4
product_id product_name price
1 Khameer, 28,000
2 Regag. 35,000
3 Chebab 23,000
customer_id order_date product_id
C 2021-01-07 3

Menu Table members table

customer_id join_date
A 2021-01-07
B 2021-01-09

Using sql statements,


i. What is the total amount each customer spent at the restaurant?(5 marks)

ii. How many days has each customer visited the restaurant?(4 marks)

iii. What is the most purchased item on the menu and how many times was it purchased

by all customers(5 marks)

iv. Which item was the most popular for each customer?(4 marks)

v. Which item was purchased first by the customer after they became a member?(3

marks)

vi. Which item was purchased just before the customer became a member?(4 marks)

5
QUESTION FOUR: (25Marks)

Entity relational diagrams are a very important aspect in database management systems, a
person who would like to come up with a good database ought to start with having good entity
relational diagrams
With clear examples, Explain the following terms as used in entity relation diagrams (5 marks
each)
i. Specialization
ii. Foreign key and primary key
iii. Composite attributes and Multivalued attributes
iv. Generalization
v. Relational model and relational constraints

QUESTION FIVE: (25Marks)


Finca Bank uses a relational database to control information related to its loans.The customers
are located in different districts across the country and hold an account with the bank. The
system holds the details about a particular loan, the depositor and the borrower. The
information given below is of relation called Loans in its database system.
Loan Relation
Branch (branch_name, branch_district)
Customer (customer_name, customer_district, customer_street)
Account (account_number, branch_name, balance)
Loan (loan_number, branch_name, amount)
Depositor (customer_name, account_number)
Borrower (customer_name, loan_number).

With the information provided above, use relational algebra to answer the questions below
i. Find all loans of over 2,000,000 (4 Marks)
ii. Find the loan number for each loan of an amount greater than 1,000,000. (4 Marks)
iii. Find the names of all customers who have a loan, an account, or both from the bank.
5marks
iv. Find the names of all customers who have a loan and an account at bank. (4 Marks)

6
v. Find the names of all customers who have a loan at the Masaka branch. (4 Marks)
vi. Find the names of all customers who have a loan at the Masaka branch but do not have
an account at any branch of the bank. (4 Marks)

QUESTION SIX: (25Marks)


The information below is for guests who visited imperial hotel in Uganda. Use it to answer
questions that follow:
Guests Table
GNO Lname Nationality RoomNo Date Rstatus Accfee NDays
G001 Maina Kenyan 89 01/12/2023 Executive 80000 10
G002 Jimmy American 4 01/12/2023 Royal 60000 20
G003 Loy Tanzanian 11 02/12/2023 executive 95000 30
G004 Dominic american 15 03/12/2023 VIP 120000 45
GOO5 Mathew British 19 03/12/2023 Royal 56000 15
G006 Norah kenyan 17 04/12/2023 VIP 130000 60
G007 Hilda American 12 05/12/2023 Executive 95000 13
G008 Tim British 9 05/12/2023 VIP 140000 70
G009 Nancy American 67 06/12/2023 VIP 140000 60
G10 Laura American 81 07/12/2023 Executive 96000 15

Required
i. Create database called imperial Hotel and a table called Guests (5 marks)
ii. Make GNO to be the primary key of the table with a maximum of four characters (2
marks)
iii. Populate the table as seen above (5 marks)
iv. Create query that will display all guests who are not in the vip rooms (3 marks)
v. Create a query which will display all the guests who are either Kenyan or Tanzanian
nationals (3 marks)
vi. Create a query to display all the quests whose accommodation fee is below 90000 (3
marks)
vii. Create a query to display all guests whose accommodation fee is above 80000 but below
120000 (4 marks)

You might also like