detection. Exercise 1: Addresses in Bahrain are identified using three numbers separated using commas and one single blank space. The three numbers are the house number, road number, and the block...

Use (DECLARE and BEGIN)
detection.<br>Exercise 1:<br>Addresses in Bahrain are identified using three numbers separated using commas and one single<br>blank space. The three numbers are the house number, road number, and the block number<br>respectively. Assume that the three numbers can have I to 4 digits.<br>An example of a valid address is: '32, 1024, 5240'.<br>Write a PL/SQL program that extracts the three components of the address for further processing.<br>A sample of the output is as follows:<br>The house number is: 32<br>The road number is: 1024<br>The block number is: 5240<br>Exercise 2:<br>Consider the following student table Student (S ID, S_fname, S_Iname, S_DOB, F_ID).<br>Write a PL/SQL program that<br>1. Extracts the year from the student date of birth,<br>2. Checks whether the year is a leap year, then<br>3. prints the student's first name, last name and whether he was born in a leap year.<br>A sample of the output is as follows:<br>Mohammed Ali was born in a leap year<br>Mohammed Ali was not born in a leap year //if the year of birth is not leap<br>//if the year of birth is leap<br>NB: A leap year is divisible by 4, but not divisible by 100, or it is divisible by 400. For example, 2000<br>and 2004 are leap years, but 1900 and 2001 are not leap years. (Hint: The function MOD (n, d)<br>divides n by d and returns the integer remainder from the operation).<br>Use YEAR() built-in function to extract the year from the date of birth.<br>

Extracted text: detection. Exercise 1: Addresses in Bahrain are identified using three numbers separated using commas and one single blank space. The three numbers are the house number, road number, and the block number respectively. Assume that the three numbers can have I to 4 digits. An example of a valid address is: '32, 1024, 5240'. Write a PL/SQL program that extracts the three components of the address for further processing. A sample of the output is as follows: The house number is: 32 The road number is: 1024 The block number is: 5240 Exercise 2: Consider the following student table Student (S ID, S_fname, S_Iname, S_DOB, F_ID). Write a PL/SQL program that 1. Extracts the year from the student date of birth, 2. Checks whether the year is a leap year, then 3. prints the student's first name, last name and whether he was born in a leap year. A sample of the output is as follows: Mohammed Ali was born in a leap year Mohammed Ali was not born in a leap year //if the year of birth is not leap //if the year of birth is leap NB: A leap year is divisible by 4, but not divisible by 100, or it is divisible by 400. For example, 2000 and 2004 are leap years, but 1900 and 2001 are not leap years. (Hint: The function MOD (n, d) divides n by d and returns the integer remainder from the operation). Use YEAR() built-in function to extract the year from the date of birth.

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here