TAILIEUCHUNG - Oracle PL/SQL by Example- P3

Tham khảo tài liệu 'oracle pl/sql by example- p3', công nghệ thông tin, cơ sở dữ liệu phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | LAB Lab Exercises 72 ELSE v_letter_grade F END IF -- control resumes here Letter grade is v_letter_grade EXCEPTION WHEN NO_DATA_FOUND THEN There is no such student or section END D How would you change the script to define a letter grade without specifying the upper limit of the final grade In the statement v_final_grade BETWEEN 90 and 100 number 100 is the upper limit. ANSWER The script should look similar to the are shown in bold. -- version SET SERVEROUTPUT ON DECLARE v_student_id NUMBER 102 v_section_id NUMBER 89 v_final_grade NUMBER v_letter_grade CHAR 1 BEGIN SELECT final_grade INTO v_final_grade FROM enrollment WHERE student_id v_student_id AND section_id v_section_id IF v_final_grade 90 THEN v_letter_grade A ELSIF v_final_grade 80 THEN v_letter_grade B ELSIF v_final_grade 70 THEN v_letter_grade C ELSIF v_final_grade 60 THEN v_letter_grade D ELSE v_letter_grade F END IF -- control resumes here Letter grade is v_letter_grade EXCEPTION WHEN NO_DATA_FOUND THEN There is no such student or section END Please purchase PDF Split-Merge on to remove this watermark. Lab Exercises LAB 73 In this example no upper limit is specified for the variable v_final_grade because the BETWEEN operator has been replaced with the operator. Thus this script can handle a value of v_final_grade that is greater than 100. Instead of assigning letter F to v_letter_ grade in version of the script the letter A is assigned to the variable v_letter_grade. As a result this script produces more accurate results. Please purchase PDF Split-Merge on to remove this watermark. LAB 74 LAB Nested IF Statements LAB OBJECTIVES After completing this lab you will be able to Use nested IF statements You have encountered different types of conditional controls the IF-THEN statement the IF-THEN-ELSE statement and the ELSIF statement.

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.