Question 7 Writes a PL/SQL function that calculates the factorial of a number passed as a parameter. The Factorial of a number n is defined as - 0! = 1 %3D n! = n*(n-1)*(n-2)*(n-3)... 1 for n> 0
Q: This is a database system question regarding SELECT: Which of the following statements is true for…
A: The above question is solved in step 2:-
Q: Please see the attached sql function question requiring an sql function to be written to calculate a…
A: alter session set plsql_code_type=native; CREATE FUNCTION mortgage_rate( p_principal…
Q: 1. Write the SQL statements to run the following commands: i. Create table Staff with the fields…
A: Here is the all sql query of above problem. See below step for code.
Q: Exercise 1: Addresses in Bahrain are identified using three numbers separated using commas and one…
A:
Q: Use SQL Developer or Oracle Live SQL to write the appropriate SQL commands as follows: A) FUNCTION:…
A: Answer: Oracle: CREATE FUNCTION Return_region_name(region_id IN NUMBER)RETURN NUMBERIS region_name…
Q: • Write an SQL query to fetch last_name from employees table using the alias name as Employee Name.…
A: Only first parts will be answered. Please upload other parts as a separate question again. a. An…
Q: SELECT MAX(datediff(minute,start_time,end_time)) as "Longest_ride",…
A: Your SQL code contains error related to function datediff.
Q: a) Write an SQL query to find the manufacturer and model for all aircraft models with capacity at…
A: a) SELECT Manufacturer , Model FROM Aircraft_Models WHERE Capacity>=300 ; b)…
Q: When we say that SQL is a declarative language, we mean that (a) it is possible to describe directly…
A: Declarative programming is a programming paradigm, or a way of creating the structure and parts of…
Q: Write a PL\SQL program to increase the salary of employee whose ID is 400 based on the following…
A: Given:- Here is Pl/sql Program to increase the salary of employee whose id is 400 based on, If…
Q: Print all the students by the name order desc by the gpa. Print all the computer sciences courses,…
A: As per our company guidelines, we are supposed to answer three subparts of a post and kindly…
Q: Assume that you have a table ABC that contains two columns: employee name e_name and the salary sal.…
A: We first create the table and fill some values. Next, we query for the required result.
Q: Exercise 1: Addresses in Bahrain are identified using three numbers separated using commas and one…
A: According to bartleby guidelines we need to solve only the first question, so please repost the…
Q: You are working with a database table that contains customer data. The table includes columns about…
A: You are working with a database table that contains customer data. The table includes columns about…
Q: Run these program in sql and description errors and print number of errors and correct to error…
A: Given that Run these program in sql and description errors and print number of errors and correct to…
Q: ite a PL/SQL program with an IMPLICIT cursor that goes through the table KUCERA and measures the…
A: Please use below to meet the above req
Q: Write a PL/SQL Function that accepts 4 integers, 2 representing the homeTeamID and visitorTeamID,…
A: Required: Write a PL/SQL Function that accepts 4 integers, 2 representing the homeTeamID and…
Q: First of all whole question is given I just need out of given queries ASAP!! Write the SQL…
A: create table User (User_id integer PRIMARY KEY, Name varchar(100), City varchar(100), Order_date…
Q: Use SQL Developer or Oracle Live SQL to write the appropriate SQL commands as follows: A) FUNCTION:…
A: A) : create function Return_region_name { @region_id num, } returns varchar as begin (select name…
Q: Write a PL/SQL block that declares and uses two cursors-one without a parameter and one with a…
A: DECLARE CURSOR dept_cursor IS SELECT department_id, department_name FROM departments WHERE…
Q: You are working with a database table that contains customer data. The table includes columns about…
A: SQL's LENGTH FunctionStructured Query Language's LENGTH string function returns the number of…
Q: Consider the following SQL queries. Now, translate these queries into an equivalent Relational…
A:
Q: What is the difference between scalar function and vector function in SQL DATABASE? Note: Question…
A: Answer ; Scalar is a user defined function that is written in SQL and it always return a single…
Q: develop a PL/SQL block that selects the maximum department ID in the departments table and stores it…
A: PL/SQL(Procedural Language / Structured Query Language) is the embedded procedural language and the…
Q: Q9. Write an SQL statement to answer the question: 'Are there any bookings not driven by qualified…
A: Hey there, I am writing the required solution for the above stated question.
Q: 1. Write a SQL function that accepts a principal mortgage amount, an annual percentage rate (APR),…
A: Short Summary: It appears that the formula you pasted here is not correct due to formattting issue…
Q: In the preceding PL/SQL block, determine the values and data types for each of the following cases.…
A: PL/SQL block, the values and data types for each of the following cases are: a) The value of…
Q: write necessary PHP code that reads data from the form and inserts into the Books table. Make use of…
A: PROGRAM CODE: <?php //change the username,password and db as per your mysql configuration…
Q: Create a PL/SQL database programming block with DECLARE BEGIN END; In Declare section define…
A: Below is the PLSQL block code:
Q: a) Write the standard SQL query to retrieve all information about the customer whose customer number…
A: Here is the Answer and Explanation
Q: Write a PL/SQL block that uses searched CASE statement to classify students based on their scores in…
A: The SEARCHED CASE statement is similar to the CASE statement, rather than using the selector to…
Q: Write a PL/SQL block of code that performs the following tasks: i Read a movie id provided by user…
A: the solution is an given below :
Q: id name supervisor A John Joyce Jim Jennifer Peter D null E C E Write an SQL statement to list any…
A: We can achieve the desired result by doing self join of the Employee table
Q: Retrieve customer FULL_NAME which full name (starts with uppercase letter N and end with lowercase…
A: To Retrieve customer FULL_NAME which full name (starts with uppercase letter N and end with…
Q: Write a PL/SQL block of code that performs the following tasks: i. Read a Book id provided by user…
A: For taking user input you have to use "&" this special character because in PL/SQL user can be…
Q: Write an SQL query to fetch worker names with salaries >= 50000 and <= 100000.
A: According to the asked question, the solution is given below with a proper explanation.
Q: Write an SQL query to fetch last_name from employees table using the alias name as Employee Name.…
A: As per our company guidelines, we are supposed to answer three subparts of a post and kindly…
Q: whats this error and how could i fix it correct ?
A: Here i saw the question and data , below i explain about the error: ORA-00907: missing right…
Q: Writes a PL/SQL function that calculates the factorial of a number passed as a parameter. The…
A: PL/SQL function to find factorial of number
Q: Write a to display user name and password. Password should be generated by concatenating first three…
A: Given in the above question we have to develop a SQL query to display list of student ids and…
Q: Answer the following questions based on the information in the PATIENT table below. Write SQL…
A: CREATE TABLE PATIENT(PID INT PRIMARY KEY, PNAME VARCHAR(10),AGE INT,ADATE DATE,GENDER VARCHAR(10));…
Q: In SQL, create Object-Identity and Reference Types
A: Introduction: Use REF(type-name) in a SQL query, where type-name denotes the referenced type. In…
Q: ) Write a SAS SQL statement to retrieve all columns from PG1.STORM_FINAL. (b) Modify the query to…
A: SAS SQL statements are given below :
Q: Write SQL code which declares two variables for name and address. Store your name and address in…
A: DECLARE is use to declare variables in SQL. SET is use to set the value of the variables.
Q: This is a valid SQL statement: Values stored in a table, but not in an Oracle instance, are stored…
A: Given: This is a valid SQL statement: Values stored in a table, but not in an Oracle instance, are…
Q: (b) Consider the schema of Customer table and write SQL statements for the following queries. sid…
A: 1. UPDATE CustomerSET salary = 40000WHERE occupation = 'supervisor'; 2. SELECT * FROM CustomersWHERE…
Q: Write an SQL query to fetch the employees whose name begins with any two characters, followed by a…
A: Question. Write an SQL query to fetch the employees whose name begins with any two characters,…
Q: Using an implicit cursor, write an anonymous block that will display all employees who've been hired…
A: Answer: Since no data or table is provided so I will be unable to provide you the output. Also I…
Step by step
Solved in 3 steps with 1 images
- SBN Title Author 12345678 The Hobbit J.R.R. Tolkien 45678912 DaVinci Code Dan Brown Your student ID DBS311 Your Name use the following statement to Write a PL/SQL Function that accepts 4 parameters, 2 strings representing students names, and 2 integers representing the marks they received in DBS311. The function will determine which student had the higher mark and return the name of the student. If the marks were the same, then return the word "same" and return "error" if an error occurs or the calculation can not be determined.Assignment : PL/SQL Practice Note: PL/SQL can be executed in SQL*Plus or SQL Developer or Oracle Live SQL. Write an anonymous PL/SQL block that will update the salary of all doctors in the Pediatrics area by 1000 (Note: Current salary + 1000). Verify that the salary has been updated by issuing a select * from doctor where area = ‘Pediatrics’. You may have to run the select statement twice to check the data before and after the update.Writes a PL/SQL function that calculates the factorial of a number passed as a parameter. The Factorial of a number n is defined as −0! = 1n! = n*(n-1)*(n-2)*(n-3)... 1 for n > 0
- INFO 2303 Database Programing Assignment # : PL/SQL Procedure & Function Practice Note: PL/SQL can be executed in SQL*Plus or SQL Developer or Oracle Live SQL. Write a function that takes patient date of birth. If the patient born after 30th June 1990 then he/she will be required to set appointment for immunization. Call this function from anonymous block to allow the user to enter the patient ID. Expected output: Enter the patient ID: 168 The status of X-immunization : REQUIREDAssignment : PL/SQL Practice Note: PL/SQL can be executed in SQL*Plus or SQL Developer or Oracle Live SQL. Write an anonymous PL/SQL block that will insert a new doctor into the DOCTOR Verify that insert has been done successfully by issuing a select * from doctor.In PL/SQL, Create a recursive store function called add_numbers to calculate the total of all consecutive positive integers from 1 to the number entered by the user. The number that will stop the function must be entered by the user when running the function and be passed to the function. If the user enters a zero or a negative number, display the total as 0. You can use the function in a SELECT statement to execute it. See sample outputs below. ADD_NUMBERS(5)---------------------------- 15 ADD_NUMBERS(3)----------------------------- 6
- Instructor (Instructor_Id, Instructor_Name, specialization, Address, #Department_Id)Write in PL/SQL a function named NumberInstructor_department that takes the id of a department as an input parameter and returns the number of instructors who are working in that department.INFO 2303 Database Programming Assignment : PL/SQL Practice Note: PL/SQL can be executed in SQL*Plus or SQL Developer or Oracle Live SQL. Write an anonymous PL/SQL block that will update the salary of all doctors in the Pediatrics area by 1000 (Note: Current salary + 1000). Verify that the salary has been updated by issuing a select * from doctor where area = ‘Pediatrics’. You may have to run the select statement twice to check the data before and after the update.PL/SQL Question I need to build pl/sql block that prompts a user for the number of visitors each day for the past 5 days and then displays the average number of visitors per day. For example; day 1: 19 day 2: 21 day 3: 23 ... The avg number of visitors is: ___ like this.
- Assume that you have a product code that has the following format: XXXXNNN Where X is a character and N is a digit. Notice that the length of the character part is not fixed, it may range from 2 to 4 characters, while the length of the second part may range from 2 to 3 digits but the first digit from the left is always 0 (zero). Write a PL/SQL program to separate the code into its two parts as shown in the following example: if the input is ABC031, the output should be: Product Name is: ABC Serial Number is: 031Assume that you have a product code that has the following format: XXXXNNN Where X is a character and N is a digit. Notice that the length of the character part is not fixed, it may range from 2 to 4 characters, while the length of the second part may range from 2 to 3 digits but the first digit from the left is always 0 (zero). Write a PL/SQL program to separate the code into its two parts as shown in the following example: if the input is ABC031, the output should be: Product Name is: ABC Serial Number is: 031 Hints: Use the following functions if needed: instr( string1, string2 [, start_position [, nth_appearance ] ] ) substr( string, start_position, [ length ] ) length( string ) DBMS_OUTPUT.PUT_LINE( )database development write a function and funcation call program in PL/SQL to sum the even integers between 1 and any number that is passed as a parameter in a function