Question
D. Run a SELECT statement against the COUNTRIES table to determine whether the following countries have independence dates or national holiday dates, or both. Predict
D. Run a SELECT statement against the COUNTRIES table to determine whether the following countries have independence dates or national holiday dates, or both. Predict the output of running the anonymous block found at the beginning of this question. Country Country_ID Independence Date National Holiday Date Output should be Antarctica 672 Iraq 964 Spain 34 United States 1 E. Finally, run the anonymous block found at the beginning of this question using each of the above country ids as input. Check whether your output answers are correct. 8. Examine the following code. What output do you think it will produce? DECLARE v_num1 NUMBER(3) := 123; v_num2 NUMBER; BEGIN IF v_num1 <> v_num2 THEN DBMS_OUTPUT.PUT_LINE('The two numbers are not equal'); ELSE DBMS_OUTPUT.PUT_LINE('The two numbers are equal'); END IF; END; Run the code to check if your prediction was correct. What was the result and why? Modify the code to use various comparison operators to see different results. 9. Write a PL/SQL block to accept a year and check whether it is a leap year. For example, if the year entered is 1990, the output should be 1990 is not a leap year. Hint: A leap year should be exactly divisible by 4, but not exactly divisible by 100. However, any year exactly divisible by 400 is a leap year. Test your solution with the following years: Year Result Should Be 1990 Not a leap year 2000 Leap year 1996 Leap year 1900 Not a leap year 2016 Leap year 1884 Leap year
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started