Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Based on the following relational schemas: MUKIM (MukimID. Mukim Title) GOVERNMENT_AID (Aid ID, Aid Title AidDescription) CITIZEN (NRIC.MukimlD*, FullName, Race, Address, Contact No) RECEIVE (ReceiveID.

image text in transcribed
image text in transcribed
image text in transcribed
Based on the following relational schemas: MUKIM (MukimID. Mukim Title) GOVERNMENT_AID (Aid ID, Aid Title AidDescription) CITIZEN (NRIC.MukimlD*, FullName, Race, Address, Contact No) RECEIVE (ReceiveID. NRIC, AidD* ReceiveDate, Receive Time) Write the SQL commands to: a) Display the NRIC and full name of all citizens who come from mukim 'GALI 2. The output must be sorted according to full name in ascending order. (2 marks) b) Display details of citizens who receive the government aid. Data that need to be displayed are NRIC, full name, mukim title and also the aid title received by the citizens. Sort the output according to mukim title in ascending order. (3 marks) c) Display citizens who receive more than one government aids. Data that need to be displayed are NRIC and full name of the citizen, and also total number of government aids received by the citizen. The output must be sorted according to the highest number of government aids received first then sort according to full name using ascending method. (3 marks) d) Using subquery, display the citizen that did not receive any government aid. In the ouput, display the citizen NRIC, full name and his/her mukim title. Sort the output according to mukim title and full name using ascending method. (3 marks) Month Duration Month Allowance QUESTION 2 Examine the following SCHOLARSHIP table: SSNum StudentName Program 1001 Zakaria Bachelor 1002 Hawa Bachelor 1003 Ahmad Diploma 1004 Aisyah Diploma 1005 Daud Diploma 48 785 42 725 600 30 24 24 500 500 a) List the scholarship details for all diploma programs. Sort the result according to student ID in ascending order. (2 Marks) b) Display scholarship number and total amount of allowance each student receives through its whole period of program. Rename the column as "SCHOLARSHIP and TOTAL ALLOWANCE" respectively. Sort the result from the highest to the lowest amount of total allowance. (3 Marks) QUESTION 3 Given below are the relational schemas for Rose Florist database. Use SQL statements to answer all questions. FLOWER (FLOWER_CODE. FLOWER_TYPE, FLOWER PRICE, SUPPLIER_ID*) SUPPLIER (SUPPLIER ID. SUPPLIER_NAME, SUPPLIER_ADDRESS SUPPLIER_TELEPHONE) PURCHASE CUST_NO" FLOWER_CODE, BUY_DATE, BUY QUANTITY, BUY_TOTAL AMOUNT) CUSTOMER (CUST NO. CUST_NAME, CUST_ADDRESS, CUST_GENDER) a) Find how many purchases are being made at Rose Florist in January 2020. Rename the column as Total_Purchase (2 marks) b) For every flower, list the flower code, flower type supplier name and supplier address Sort the output according to flower code in descending order. (2 marks) After completing a course in database management, you have been hired as an intern by Sohar Community Hospital. You are assigned with a team to develop a database system for the hospital's software system project - a Hospital Management System. The system also considers the coronavirus Covid-19 pandemic situation and wants to have a special monitoring for Covid-19 patients. After conducting a series of interviews with a number of hospital administrators and employees, the following are the system descriptions: A doctor must treat a minimum of one patient, while, a patient may be treated by one or more doctors. Every time a doctor treats a patient, the treatment date, details, and charges are recorded. Doctor details that need to be stored are doctor ID, name, contact number, date hired and license number Patient is a person who is either admitted to the hospital, or not. With regards of the current situations, special consideration to the Covid-19 pandemic must be recorded. Each patient has the following details: patient ID, name, address, birth date, gender, and contact number. A Covid patient must undergo one or more Covid Tests. Covid Test is a laboratory test given only to Covid patients. Each Covid Test has a test ID, date, description, and result that need to be recorded whenever a Covid patient undergoes a Covid Test. A patient is assigned to one bed if he/she needs to be admitted. If not, a patient is not assigned a bed. A bed may or may not be assigned to any patient. A bed has a bed number, type and location. Draw an Entity Relationship Diagram (ERD) for the above scenario. Identify all entities, attributes, relationships, connectivity, primary key(s) and foreign key(s). (10 marks)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

More Books

Students also viewed these Databases questions