2.Write a program in PL/SQL to input a number and calculate its Factorial.
Q: Given a table students in SQL. Write a SQL query to add a column Address Varchar(30) in the student…
A: Given Table: students We have to add a new column Address Varchar(30) to the given table students.…
Q: Write the SQL code to create a copy of EMP_1, including all of its data, and naming the copy EMP_2.
A: The “CREATE TABLE AS” statement is used to create a new table from the existing table. The Syntax…
Q: Q1 Write a program in PL/SQL to print a list of names employees and the names of the departments to…
A: Textual PL/SQL Code :- -- create a table --CREATE TABLE Employees ( id INTEGER PRIMARY KEY, Name…
Q: Create a PL/SQL Program that asks user to enter 2 numbers, then finds an average of two numbers and…
A: PL/SQL program is : SET SERVEROUTPUT ON;DECLAREv_x NUMBER :=&first;v_y NUMBER…
Q: Use CASE statement in PL SQL block, where take a character as input from the user and print…
A:
Q: Write a PL/SQL program using an explicit cursor that displays all patients PLCO_ID numbers from…
A: Here we write PL/SQL program using explicit cursor :…
Q: A stored procedure in SQL is a_ Group of distinct SQL statements. O Group of transactions O Block of…
A: Note: This is a multiple-question-based problem. As per company guidelines, only the first question…
Q: Write a SQL query to count the number of orders that have a purchase amount greater than 1000
A: SUMMARY: - hence we discussed all the points
Q: Exercise 1: Addresses in Bahrain are identified using three numbers separated using commas and one…
A:
Q: The system variable that records the select statement that SQL * FORMS most recently used to…
A: Question. The system variable that records the select statement that SQL * FORMS most recently used…
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: The DECLARE section in the trigger is used to declare any variables used inside the trigger code.…
A: we are going to see if The DECLARE section in the trigger is used to declare any variables used…
Q: Please develop PL/SQL program that asks for a radius of a cirle. After user enters a radius number,…
A: Below is the required PL/SQL program: - Approach: - Declare the variable to store the…
Q: In SQL, write the appropriate statements to insert default values for these three tables, each table…
A: Prescription table: INSERT INTO prescription (pre_no,pre_date,pre_amount)VALUES (10,12,1200); INSERT…
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: 3.Write a program in PL/SQL to display sum of odd numbers from 1 to n.
A: CODE: DECLARE num NUMBER(3) := 1; tot NUMBER(4) := 0; BEGIN dbms_output.Put_line('Odd numbers…
Q: database development write a function and funcation call program in PL/SQL to sum the even integers…
A: Algorithm: Start Declare necessary variables Initialize sum to 0 and num to 1 define a function…
Q: How are the relational operators used in SQL different from those used in C#?
A: Relational operator: Relational operator is a programming language operator used for checking the…
Q: Computer Science * IN SQL* Write an SQL statement that selects all customers with a city starting…
A: selects all customers with a city starting with any character, followed by "land".
Q: Write three functions in SQL which does the following: The first function should take an integer…
A: In MYSQL function Syntax to convert number from one base to another follows:- CONV(<num to…
Q: Write an sql query to show country code, country name of those employees whose country name…
A: Please refer below for your reference: Queries: 1.SELECT country code, country name FROM employees…
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: In SQL Server, character data types may be distinguished as follows: NVARCHAR, NVARCHAR, and…
A: Introduction: A SQL developer must choose what information will be kept in each column before…
Q: IN SQL ** Write a query sentence to display the names, jobs, dates of appointment and employee…
A: Given Columns to display: name, job, appointmentDate,empNo Condition: First column has to be empNo…
Q: Write PL/SQL code to accept the text and reverse the text and test whether the given character is…
A: DECLARE @string NVARCHAR(255); SET @string = 'szaaa'; SELECT CASE WHEN @string=REVERSE(@string)THEN…
Q: Write a sql query to create the given table.
A:
Q: You write the SQL query below. Add a statement to your SQL query that will retrieve the first 3…
A: SELECT employee_id, SUBSTR(postal_code,1,3) AS new_postal_code FROM employee ORDER BY postal_code
Q: Assignment : PL/SQL Practice Note: PL/SQL can be executed in SQL*Plus or SQL Developer or Oracle…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
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: Instructor (Instructor_Id, Instructor_Name, specialization, Address, #Department_Id) Write in…
A: First we have to create a table Instructor with details such as Instructor_name, Specialization,…
Q: Write a function and a call program in PL/SQL to sum the even integers between 1 and any number that…
A: given to write pl/sqlprocedure function for sum of 1 to n even numbers: Below is the procedure of…
Q: 5) Write an SQL Query to display the accountno, name, Recurrent_acno, amount whose fixed deposit…
A: Required:
Q: What is true about table functions in standard SQL? (a) table functions can operate on only one…
A: The table-valued function is a function that is able to return tables. Hence, correct answer is…
Q: NVARCHAR, NVARCHAR, and NVARCHAR are all character data types in SQL Server.
A: Introduction: Building a table requires deciding what data to put in each column. A data type tells…
Q: In sql get to know the HR database, its tables, and their contents. Show the SQL query and the…
A: Steps: Display employees where the first name or last name starts with S. Display manager ID…
Q: Employees(EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_D…
A: SELECT * FROM employees WHERE salary > ALL(SELECT avg(salary)FROM employees GROUP BY…
Q: Write an SQL query to print the first three characters of FIRST_NAME from Worker table. Write an SQL…
A: We are going to write query for both 1- To print the first three characters of FIRST_NAME from…
Q: NFO 2303 Database Programing Assignment # : PL/SQL Procedure & Function Practice Note: PL/SQL…
A: What is SQL? SQL stands for Structured Query Language SQL lets you access and manipulate databases…
Q: If you write PL/SQL program contains a cursor; which of the following stater written inside the…
A: Let's try to fit the given statements into pl/sql
Q: develop PL/SQL program that asks for a radius of a circle. After user enters a radius number, the…
A: Algorithm: Start Read radius Using the formula 2*3.14*radius calculate perimeter Display perimeter…
Q: 3. Write a program in PL/SQL to calculate factorial of n.
A: Given:
Q: Write PL/SQL program to print the highest digit value of an integer entered by the user? Ex:
A: ANSWER : Program : FUNCTION FBIG(N NUMBER) RETURN NUMBERIS R NUMBER; M NUMBER; S NUMBER;BEGIN M :=…
Q: In SQL, write the appropriate statements to insert default values for these two tables, each table…
A: SQL Query for the creation of table:
Q: calculate the overtime hours using if then and end if .
A: SQL> SQL> -- Calculating overtime hours with IF. SQL> set echo on SQL> DECLARE 2…
Q: PL/SQL function to return count of employees in each department having salary greater than 500000
A: Given: Create a PL/SQL function to return count of employees in each department having salary…
Q: Develop PL/SQL program Create a program that asks for an instructor ID. Find a) the full name of…
A: a) DECLARE CURSOR x_inst_info IS SELECT inst_id first_name…
Q: Write a sql query to create the following table.
A: Given, Table:
Q: In sql how would you write a stored procedure with two parameters and check if those two are subsets…
A: Creating a SQL Stored Procedure with Parameters To create a stored procedure with parameters using…
Q: Write a program in PL/SQL to print 1st n numbers with a difference of 3 and starting from 3.
A: select * from a/DeclareI number;begin I:=0;Loop I:=I+3; insert into a values(i); Exit…
Step by step
Solved in 2 steps
- relation: Book (BookID, Author, ISBN, Title) Write a PL/SQL block of code that performs the following tasks: Read a Book id provided by user at run time and store it in a variable. Fetch the Author and title of the book having the entered id and store them inside two variables Display the fetched book author and title.this example is about sqlWrite in SQL
- 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.SQL QUERIES Employees(EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE,JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID,DEPARTMENT_NAME)Department(DEPARTMENT_ID, DEPARTMENT_NAME, MANAGER_ID, LOCATION_ID)Location(LOCATION_ID,STREET_ADDRESS,POSTAL_CODE,CITY,STATE_PROVINCE,COUNTRY_ID) Write a Query in SQL to delete the record of all those cities where city name ends with b fromlocations table.SQL QUERIES Employees(EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE,JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID,DEPARTMENT_NAME)Department(DEPARTMENT_ID, DEPARTMENT_NAME, MANAGER_ID, LOCATION_ID)Location(LOCATION_ID,STREET_ADDRESS,POSTAL_CODE,CITY,STATE_PROVINCE,COUNTRY_ID) Write a query in SQL to display the DEPARTMENT_NAME of all those Departments whoseDEPARTMENT_ID is greater than the DEPARTMENT_ID of Physics department. Write a Query in SQL to show the FIRST_NAME of all those employees whose salary is lessthan the salary of all those employees whose MANAGER_ID is 101 or 102.
- develop PL/SQL program that asks for a radius of a circle.After user enters a radius number, the program then calculates 1. Circumference and 2.sql queries Employees(EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE,JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID,DEPARTMENT_NAME)Department(DEPARTMENT_ID, DEPARTMENT_NAME, MANAGER_ID, LOCATION_ID)Location(LOCATION_ID,STREET_ADDRESS,POSTAL_CODE,CITY,STATE_PROVINCE,COUNTRY_ID) Write a query in SQL to display the Entire data of All those employees whoseDEPARTMENT_ID is greater than the DEPARTMENT_ID of all those employees who earn morethan 50,000 per month Write a query in SQL to display the minimum, maximum salary and DEPARTMENT_NAMEof all those departments whose minimum salary is greater than 4000 in ascending order.Given the following relation: Movie (MovieID, Title, Genre, Year) Write a PL/SQL block of code that performs the following tasks: Read a movie id provided by user at run time and store it in a variable. Fetch the Genre and title of the movie having the entered id and store them inside two variables Display the fetched movie Genre and title.