Consider the following table: 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.
Q: Create a Procedure in PL/SQL takes employee_id, rate_salary, rate_commission. This function will…
A: Find the required procedure in PL/SQL given as below :
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: 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: Imagine a student table with following columns: Student(Stuid, Name , Age, Major) Write a…
A: given table Student Stuid Name Age Major
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: In Sql Oracle Apex application, Using GROUPING SETS, write a query to show the following groupings:…
A: First query performs a grouping on two columns Department_Id and Job_Id Group By X, Y means put all…
Q: SELECT MAX(datediff(minute,start_time,end_time)) as "Longest_ride",…
A: Your SQL code contains error related to function datediff.
Q: Sondt File Student Number Student Name Address Telephone (v) Corse File Course Number Description…
A: SELECT courseNumber, description FROM courseFile WHERE professorNumber=(select professorNumber from…
Q: write sample sql quiries for these Write a query to display employee number, first name, job id…
A: Please refer below for your reference: Queries are: 1. SELECT employee number, first name, job id…
Q: We have employee table contains (emp-no, emp-name, emp-age, emp-salary, emp-department) write a…
A: Given Employee table contains the attributes: emp_no, emp_name, emp_age, emp_salary, emp_department
Q: Question 11. Write the SQL statement that will implement the relational algebra expressions in the…
A: The queries are given below
Q: You have to only develop a SQL query Write a query to display the resort name, rate of all the…
A: Here have to determine about sal query for given scenario.
Q: True or FalseString comparisons in SQL are case sensitive.
A: Explanation: The data in DBMS is stored and retrieved by using a specific language called SQL. DBMS…
Q: Code three tests: 1) for a student who has courses 2) for student who does not have courses 3) a…
A:
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: Write PL/SQL or T-SQL procedures to accomplish the following tasks: A: obtain the name and credit…
A: Actually, SQL stands for Structured Query Language.
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: 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: Create a procedure in PL/SQL takes Department Id and return record data type has maximum salary,…
A: Find the required procedure in PL/SQL given as below :
Q: How does a parameter query differ from a select query?
A: A parameterized query is a sort of SQL query that expects somewhere around one boundary for…
Q: in SQL, Create a Stored Function to identify the total number of staff assigned to each ward (the…
A: A stored function (also known as a consumer feature or user-described characteristic) is a fixed of…
Q: QL QUERIES Employees(EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_D…
A: To write a query in SQL for the above criteria. 1.SQL Min() and Max() functions are used to find the…
Q: Write the following inserts, deletes, or updates in SQL, using the universityschema. Insert every…
A: Explanation: In the below query, “insert, select, into, from and where” are the keywords used. The…
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: Write the pl/sql block of code to call the above created package by passing the employee number in…
A: Pl/SQL program to display the Employee detail if Employee id is present in the Database then his…
Q: In Oracle PL/SQL programming language, %TYPE keyword would give you some advantages when you are…
A: Below are the advantages:
Q: 1. Use Employees table a) To display First_Name, Salary and Department_id ofall the employees, whose…
A: 1. A) select First_name, Salary, Department_idfrom Employeeswhere Department_id IN(50,80)…
Q: Write SQLSQL statements for following: Student( Enrno, name, courseId, emailId, cellno)…
A: We need to create tables for Student and Course And we need to insert values into these tables.…
Q: Get all students id and name whose marks are greater than average mark in SQL in section
A: Query :-- SELECT StudentId, StudnetName FROM STUDENT_MARKS WHERE SQL > (SELECT avg(SQL) FROM…
Q: Use the following table to find the OUTPUT of the following SQL queries: Table Name: Patients…
A: Answer: 22114454
Q: What variables should be taken into account when determining whether or not to establish an index…
A: Introduction: A SQL index is a fast lookup database used to locate frequently sought records. An…
Q: ASSUME 6.2 IS DONE Write a SQL statement to get the list of all the tasks that started after…
A: Let's understand step by step : 1. Here given that 6.2 is already done so 6.2.1 : Task table is…
Q: QUESTION 2. Write a PL/SQL PROCEDURE that can list the Top-N customers (id and name) and the amounts…
A: ANSWER: PL/SQL Procedure:
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: 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: 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 script to create a PL/SQL procedure that modifies the next date of appointment of certain…
A: write a script to create a PL/SQL procedure that modifies the next date of appointment of ceratin…
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: Write the following inserts, deletes, or updates in SQL, using the universityschema. Increase the…
A: To change the records that are already existed in a table, the “UPDATE” statement is used. The…
Q: All of the following are true about relational table except
A: Relational databases are always in the form of a table
Q: Write an appropriate SQL query to display all the STUDENT_SURNAMES and STUDENT_NAMES, as well as the…
A: Answer: 1. Let's create a sample table first: CREATE TABLE STUDENTREC(STUDENT_NAMES VARCHAR(255),…
Q: 31) Using functions display: a) sum of all salaries b) average of all salaries c) highest salary…
A: As per our company guidelines we are supposed to answer only one question. Kindly repost other…
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: Perform the following operation in sql for insertion, updating and deletion using the referential…
A: Four tables are created using the below table scripts. The table design it already taking the…
Step by step
Solved in 2 steps
- 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.SQL Database Write PL/SQL or T-SQL procedures to accomplish the following tasks: Obtain the first name and last name, separated by a space, of the guide whose number currently is stored in I_GUIDE_NUM. Place these values in the variables I_FIRST_NAME and I_LAST_NAME. Output the contents of I_GUIDE_NUM, I_FIRST_NAME, and I_ LAST_NAME. Obtain the number of persons, customer number, and customer last name for every reservation whose ID currently is stored in I_RESERVATION_ID. Place these values in the variables I_NUM_PERSONS, I_CUSTOMER_NUM, and I_LAST_NAME, respectively. Output the contents of I_NUM_PERSONS, I_CUSTOMER_NUM, and I_LAST_NAME. Add a row to the GUIDE table. Change the last name of the guide whose number is stored in I_GUIDE_NUM to the value currently found in I_LAST_NAME. Delete the guide whose number is stored in I_GUIDE_NUMdatabase 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
- 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.Computer Science This question is related to pl/SQL:- Using a Cursor in a Package In this assignment, you work with the sales tax computation because the Brewbean's lead programmer expects the rates and states applying the tax to undergo some changes. The tax rates are currently stored in packaged variables but need to be more dynamic to handle the expected changes. The lead programmer has asked you to develop a package that holds the tax rates by state in a packaged cursor. The BB TAX table is updated as needed to reflect which states are applying sales tax and at what rates. This package should contain a function that can receive a two-character state abbreviation (the shopper's state) as an argument, and it must be able to find a match in the cursor and return the correct tax rate. Use an anonymous block to test the function with the state value NC.SQL QUERIES Employees(EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID)Department(DEPARTMENT_ID,DEPARTMENT_NAME,MANAGER_ID,LOCATION_ID)A: Write a query in SQL to display the minimum, maximum salary and DEPARTMENT_ID of all thosedepartments whose minimum salary is greater than 4000 in ascending order.
- 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.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 insert a new doctor into the DOCTOR Verify that insert has been done successfully by issuing a select * from doctor.SQL QUERIES Employees(EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID)Department(DEPARTMENT_ID,DEPARTMENT_NAME,MANAGER_ID,LOCATION_ID)A: Write a query in SQL to display the minimum, maximum salary and DEPARTMENT_ID of all thosedepartments whose minimum salary is greater than 4000 in ascending order. B: Write a Query in SQL to display characters only from 2 to 5 of “Last_Name” from Employees table. C: Write a query in SQL to display the HIRE_DATE of every employee in following format.Format: 11-july-2019
- **In SQL** Write a SELECT statement that returns these columns: InstructorDept The DepartmentName column from the Departments table for a related instructor LastName The LastName column from the Instructors table FirstName The FirstName column from the Instructors table CourseDescription The CourseDescription column from the Courses table CourseDept The DepartmentName column from the Departments table for a related instructor Return one row for each course that’s in a different department than the department of the instructor assigned to teach that course. (Hint: You will need to join the Departments table to both the Instructors table and the Courses table, which will require you to use table aliases to distinguish the two tables.)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.Create a PL/SQL database programming block with DECLARE BEGIN END; In Declare section define a local scalar (simple) variables. lv_deptno NUMBER And assign initial values as 10 lv_deptno NUMBER := 50; In Declare section again, define a cursor and select last_name, salary and manager_id of employees the ones who are working in the department defined in a) In this example department will be lv_deptno:=50; Sample code: Cursor c_emp as SELECT last_name, salary, manager_id FROM employees WHERE department_id = lv_deptno; In the execution section (BEGIN and END) Create CURSOR FOR LOOP for cursor to process In this cursor loop, your code has to check salary and also manager_id numbers each time new records being fetched. And based on these conditions either employee gets raise or not get raise. If employee salary is less than 5000 and also if employees managers is either 101 or 124 then it means employee is due for raise otherwise employee is not due for raise Sample…