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.
Q: OB. The function must contain a return statement. Oc.It is similar to the PL/SQL procedure except…
A: Which of the following is not true about the PLSQL functions? OPTION : B
Q: Oracle PL/SQL Create an anonymous block that prints all instructors First Name, Last name, and a…
A: Anonymous block means where it has a PL/SQL programs unit that does not have a name. It has an…
Q: table name: Accounts columns: account_num char(9) which is the primary key name varchar (20)…
A: SQL: CREATE TABLE Accounts ( account_num char(9) PRIMARY KEY, namevarchar(20), balance double );…
Q: 5. Use XAMPP Control Panel (My SQL) to answer the following questions. Write SQL queries statement…
A: CODE:- Creating table PROPERTY and inserting values in it:- -- create table PROPERTY CREATE…
Q: SOQL Assignment Salesforce: You have to write a SOQL query in which we have to find out all the…
A: Use the Salesforce Object Query Language (SOQL) to search your organization’s Salesforce data for…
Q: Assignment : PL/SQL Practice Note: PL/SQL can be executed in SQL*Plus or SQL Developer or…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: Section B- EXCEPTION HANDLING TASK 1 Write a PL/SQL block to retrieve employees from the ENEW table…
A: Answer: PL/SQL example table query: create table ENEW(empID int not null primary key,empName…
Q: SOQL Assignment: You have to write a SOQL Query In which we have to find all the contact whose…
A: Intro: This is Salesforce Object Query Language designed to work with SFDC Database. It can search a…
Q: SOQL Assignment Salesforce: You have to write a SOQL query in which we have to find out all the 1000…
A: Use the Salesforce Object Query Language (SOQL) to search your organization’s Salesforce data for…
Q: SELECT MAX(datediff(minute,start_time,end_time)) as "Longest_ride",…
A: Your SQL code contains error related to function datediff.
Q: Database course: Write SQL queries to do the following A. List names of IT students.…
A: The SQL queries are given in step 2.
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: SQL Query for Outputting Sorted Data Using Group By Clause
A: In this question we need to provide the syntax for outputting sorted data using GROUP BY clause.
Q: Student (snum: integer, sname: string, major: string, level: string, age: integer) Class (cname:…
A: CREATE TABLE student( snum INT, sname VARCHAR(10),…
Q: Question 7 Writes a PL/SQL function that calculates the factorial of a number passed as a parameter.…
A: I give the PL/SQL code along with its output screenshot
Q: Write the SQL statements for the following User table. User_id Name City Order_date…
A: --query to create user tablecreate table user(User_id int primary key,Name varchar(50),City…
Q: PL/SQL Create a simple loop that prints instructor names, where instructor IDs are in the range…
A: Required: PL/SQL Create a simple loop that prints instructor names, where instructor IDs are in…
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: Guideline: Pls create employees table and populate it with the scripts provided for you (if the…
A: Answer: Our instruction is answer the first three part from the first part and I have given SQL…
Q: Q1: Write a query to find the students working in a company having more ratings than their seniors
A: select student_name from EMPLOYEES RATING TABLE where designation != senior and rating >= 9
Q: PL/SQL The following PL/SQL code implements a cursor and displays the first 3 highest students’…
A: The modified code to output the average of the top three grades is....
Q: Write SQL queries for the following statements. 1) Write a stored procedure which takes an integer…
A: Create proc using create command Create a variable as input parameter Declare incrementation…
Q: Write a PL/SQL function that accepts employee ID as input and returns employee first name , last…
A: Below is the function that returns the upper case last, first names and email of an employee when…
Q: Note: PL/SQL can be executed in SQL*Plus or SQL Developer or Oracle Live SQL. 1. Write an anonymous…
A: SOLUTION: Below schema is used for this exercise : CREATE TABLE "DOCTOR" ( "DOC_ID" NUMBER,…
Q: AL Distributors would like to know the number of months between the current date and the order date…
A: According to the Question below the Solution:
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: 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: 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: Task 2 Stored PL/SQL procedure Implement a stored PL/SQL procedure PARTSUPPLIER that lists…
A: For task 1 Tab_Sup is supplier table name having columns Sup_name, Sup_key Tab_Part is part table…
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: 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: oracle pl/sql Create a while loop that finds a product of all even numbers from 2 to 12.
A: Here I have declared a variable with a value of 2. Next, I have created a while loop that runs till…
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: Oracle SQL • Create a function that sums two numbers if any of the two numbers ins larger than 10 ,…
A: Given the following code
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: Appointments AppointmentID 1 P1 2 P2 PatientID AppointmentTime AppointmentDate TreatmentID DentistID…
A: As per out guidelines, we are supposed to answer only 1st 3 questions. Kindly repost the remaining…
Q: In PL/SQL, Create a recursive store function called add_numbers to calculate the total of all…
A: Program plan:Declare the required variables.The “add_numbers” function returns the value. Otherwise,…
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: in sql The EMPLOYEE table contains these columns: EMP_ID NOT NULL, Primary Key SSNUM NOT NULL,…
A: Answer to the above question is in step2.
Q: What method of Statement is used if you want to execute DELETE SQL statement?
A: Answer:
Q: PL/SQL Display the full name (first and last) and salary of all employees in descending order…
A: The select keyword will be used for displaying the names from the table employees. The DESC keyword…
Q: You are working with a database table that contains customer data. The table includes columns about…
A: Introduction You are working with a database table that contains customer data. The table includes…
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: es in relational algebra. Find the username of users who are from ‘Muscat’. Find the IDs of pictures…
A: 1. Find the username of users who are from ‘Muscat’ SELECT username FROM users where place='Muscat'…
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: Create a function that calculate the total commission
A: The solution is written in SQL query. Please check step 2 for the solution.
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: his question is related to pl/SQL:- Using a Cursor in a Package In this assignment, you work with…
A: Answer: I have given answer in the handwritten format
Q: SQL: Create a SQL query that uses an uncorrelated subquery and no joins to display the descriptions…
A: Code: select p_descript from product where v_code in (select v_areacode from vendor where v_areacode…
Q: 5. Now compute Average GPA in each class. Display class_code, Class_GPA. Assume all courses are 3…
A: Now compute Average GPA in each class. Display class_code, Class_GPA. Assume all courses are 3…
INFO 2303
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.
Step by step
Solved in 4 steps with 2 images
- Change the CONTACT view so that no users can accidentally perform DML operations on the view.In the initial creation of a table, if a UNIQUE constraint is included for a composite column that requires the combination of entries in the specified columns to be unique, which of the following statements is correct? a. The constraint can be created only with the ALTER TABLE command. b. The constraint can be created only with the table-level approach. c. The constraint can be created only with the column-level approach. d. The constraint can be created only with the ALTER TABLE MODIFY command.The Car Maintenance team also wants to store the actual maintenance operations in the database. The team wants to start with a table to store CAR_ID (CHAR(5)), MAINTENANCE_TYPE_ID (CHAR(5)) and MAINTENANCE_DUE (DATE) date for the operation. Create a new table named MAINTENANCES. The PRIMARY_KEY should be the combination of the three fields. The CAR_ID and MAINTENACNE_TYPE_ID should be foreign keys to their original tables. Cascade update and cascade delete the foreign keys.
- Task 2: The Car Maintenance team also wants to store the actual maintenance operations in the database. The team wants to start with a table to store CAR_ID (CHAR(5)), MAINTENANCE_TYPE_ID (CHAR(5)) and MAINTENANCE_DUE (DATE) date for the operation. Create a new table named MAINTENANCES. The PRIMARY_KEY should be the combination of the three fields. The CAR_ID and MAINTENACNE_TYPE_ID should be foreign keys to their original tables. Cascade update and cascade delete the foreign keys. Answer in MYSQL pleaseTask 2: The Car Maintenance team also wants to store the actual maintenance operations in the database. The team wants to start with a table to store CAR_ID (CHAR(5)), MAINTENANCE_TYPE_ID (CHAR(5)) and MAINTENANCE_DUE (DATE) date for the operation. Create a new table named MAINTENANCES. The PRIMARY_KEY should be the combination of the three fields. The CAR_ID and MAINTENANCE_TYPE_ID should be foreign keys to their original tables. Cascade update and cascade delete the foreign keys. SQL DataBase Test: Create a new table to store maintenance operations Test Query: DESCRIBE MAINTENANCES Expected Results Field Type Null Key Default Extra CAR_ID char(5) NO PRI NULL MAINTENANCE_TYPE_ID char(5) NO PRI NULL MAINTENANCE_DUE date NO PRI NULLTask 2: The Car Maintenance team also wants to store the actual maintenance operations in the database. The team wants to start with a table to store CAR_ID (CHAR(5)), MAINTENANCE_TYPE_ID (CHAR(5)) and MAINTENANCE_DUE (DATE) date for the operation. Create a new table named MAINTENANCES. The PRIMARY_KEY should be the combination of the three fields. The CAR_ID and MAINTENANCE_TYPE_ID should be foreign keys to their original tables. Cascade update and cascade delete the foreign keys. Create a new table to store maintenance operations Test Query DESCRIBE MAINTENANCES Expected Results Field Type Null Key Default Extra CAR_ID char(5) NO PRI NULL MAINTENANCE_TYPE_ID char(5) NO PRI NULL MAINTENANCE_DUE date NO PRI NULL
- Create a new table named BOOK_TYPE in the finalexam database. The BOOK_TYPE table has two character columns: TYPE has a length of 3 characters and is the table’s primary key, and DESCRIPTION has a length of 20 characters.xplain Local Descriptor Table?CREATE TABLE DOCTOR(DOC_ID NUMBER(3),DOC_NAME VARCHAR2(9),DATEHIRED DATE,SALPERMON NUMBER(12),AREA VARCHAR2(20),SUPERVISOR_ID NUMBER(3),CHGPERAPPT NUMBER(3),ANNUAL_BONUS NUMBER(5),CONSTRAINT DOCTOR_DOC_ID_PK PRIMARY KEY (DOC_ID)); INSERT INTO DOCTOR VALUES(432, 'Harrison' , TO_DATE('05-DEC-94'), 12000,'Pediatrics', 100, 75, 4500); INSERT INTO DOCTOR VALUES(509, 'Vester' , TO_DATE('09-JAN-00'), 8100,'Pediatrics', 432, 40, null); INSERT INTO DOCTOR VALUES(389, 'Lewis' , TO_DATE('21-JAN-96'), 10000,'Pediatrics', 432, 40, 2250); INSERT INTO DOCTOR VALUES(504, 'Cotner' , TO_DATE('16-JUN-98'), 11500,'Neurology', 289, 85, 7500); INSERT INTO DOCTOR VALUES(235, 'Smith' , TO_DATE('22-JUN-98'), 4550,'Family Practice', 100, 25, 2250); INSERT INTO DOCTOR VALUES(356, 'James' , TO_DATE('01-AUG-98'), 7950,'Neurology', 289, 80, 6500); INSERT INTO DOCTOR VALUES(558, 'James' , TO_DATE('02-MAY-95'), 9800,'Orthopedics', 876, 85, 7700); INSERT INTO DOCTOR VALUES(876, 'Robertson' , TO_DATE('02-MAR-95'),…
- CREATE TABLE DOCTOR(DOC_ID NUMBER(3),DOC_NAME VARCHAR2(9),DATEHIRED DATE,SALPERMON NUMBER(12),AREA VARCHAR2(20),SUPERVISOR_ID NUMBER(3),CHGPERAPPT NUMBER(3),ANNUAL_BONUS NUMBER(5),CONSTRAINT DOCTOR_DOC_ID_PK PRIMARY KEY (DOC_ID)); INSERT INTO DOCTOR VALUES(432, 'Harrison' , TO_DATE('05-DEC-94'), 12000,'Pediatrics', 100, 75, 4500); INSERT INTO DOCTOR VALUES(509, 'Vester' , TO_DATE('09-JAN-00'), 8100,'Pediatrics', 432, 40, null); INSERT INTO DOCTOR VALUES(389, 'Lewis' , TO_DATE('21-JAN-96'), 10000,'Pediatrics', 432, 40, 2250); INSERT INTO DOCTOR VALUES(504, 'Cotner' , TO_DATE('16-JUN-98'), 11500,'Neurology', 289, 85, 7500); INSERT INTO DOCTOR VALUES(235, 'Smith' , TO_DATE('22-JUN-98'), 4550,'Family Practice', 100, 25, 2250); INSERT INTO DOCTOR VALUES(356, 'James' , TO_DATE('01-AUG-98'), 7950,'Neurology', 289, 80, 6500); INSERT INTO DOCTOR VALUES(558, 'James' , TO_DATE('02-MAY-95'), 9800,'Orthopedics', 876, 85, 7700); INSERT INTO DOCTOR VALUES(876, 'Robertson' , TO_DATE('02-MAR-95'),…CREATE TABLE DOCTOR(DOC_ID NUMBER(3),DOC_NAME VARCHAR2(9),DATEHIRED DATE,SALPERMON NUMBER(12),AREA VARCHAR2(20),SUPERVISOR_ID NUMBER(3),CHGPERAPPT NUMBER(3),ANNUAL_BONUS NUMBER(5),CONSTRAINT DOCTOR_DOC_ID_PK PRIMARY KEY (DOC_ID)); INSERT INTO DOCTOR VALUES(432, 'Harrison' , TO_DATE('05-DEC-94'), 12000,'Pediatrics', 100, 75, 4500); INSERT INTO DOCTOR VALUES(509, 'Vester' , TO_DATE('09-JAN-00'), 8100,'Pediatrics', 432, 40, null); INSERT INTO DOCTOR VALUES(389, 'Lewis' , TO_DATE('21-JAN-96'), 10000, 'Pediatrics', 432, 40, 2250); INSERT INTO DOCTOR VALUES(504, 'Cotner' , TO_DATE('16-JUN-98'), 11500,'Neurology', 289, 85, 7500); INSERT INTO DOCTOR VALUES(235, 'Smith' , TO_DATE('22-JUN-98'), 4550, 'Family Practice', 100, 25, 2250); INSERT INTO DOCTOR VALUES(356, 'James' , TO_DATE('01-AUG-98'), 7950,'Neurology', 289, 80, 6500); INSERT INTO DOCTOR VALUES(558, 'James' , TO_DATE('02-MAY-95'), 9800, 'Orthopedics', 876, 85, 7700); INSERT INTO DOCTOR VALUES(876, 'Robertson' , TO_DATE('02-MAR-95'),…CREATE TABLE DOCTOR(DOC_ID NUMBER(3),DOC_NAME VARCHAR2(9),DATEHIRED DATE,SALPERMON NUMBER(12),AREA VARCHAR2(20),SUPERVISOR_ID NUMBER(3),CHGPERAPPT NUMBER(3),ANNUAL_BONUS NUMBER(5),CONSTRAINT DOCTOR_DOC_ID_PK PRIMARY KEY (DOC_ID)); INSERT INTO DOCTOR VALUES(432, 'Harrison' , TO_DATE('05-DEC-94'), 12000,'Pediatrics', 100, 75, 4500); INSERT INTO DOCTOR VALUES(509, 'Vester' , TO_DATE('09-JAN-00'), 8100,'Pediatrics', 432, 40, null); INSERT INTO DOCTOR VALUES(389, 'Lewis' , TO_DATE('21-JAN-96'), 10000,'Pediatrics', 432, 40, 2250); INSERT INTO DOCTOR VALUES(504, 'Cotner' , TO_DATE('16-JUN-98'), 11500,'Neurology', 289, 85, 7500); INSERT INTO DOCTOR VALUES(235, 'Smith' , TO_DATE('22-JUN-98'), 4550,'Family Practice', 100, 25, 2250); INSERT INTO DOCTOR VALUES(356, 'James' , TO_DATE('01-AUG-98'), 7950,'Neurology', 289, 80, 6500); INSERT INTO DOCTOR VALUES(558, 'James' , TO_DATE('02-MAY-95'), 9800,'Orthopedics', 876, 85, 7700); INSERT INTO DOCTOR VALUES(876, 'Robertson' , TO_DATE('02-MAR-95'),…