whats the wrong of my code ?how to fix it ?
Q: The following code is for Oracle Oracle SQL. Please check it for errors? CREATE PROCEDURE…
A: А stоred рrосedure is а рreраred SQL соde thаt yоu саn sаve, sо the соde саn be…
Q: select * from cast where cast_id=162652763; Use explain to display the query plan without creating…
A: the answer is given below
Q: You execute a SQL command to insert the value 0.00372 into an Oracle attribute field with datataype…
A: Answer: .003
Q: Put your code in the main method given below. [Hint: SQL will return all accounts from the…
A: table name AccountingDB display all account
Q: What's the retail price of the most expensive book written by Sam Smith? Determine the total profit…
A: We have to write the sql code for the given question. like- What's the retail price of the most…
Q: SQL code for (see image for the table structure): Create a stored procedure “changeCreditLimit” to…
A: The solution is an given below :
Q: Using the sample "Solmaris Condo" "database" (just a bunch of tables with a theme) I had you create…
A: SAMPLE DATABASE TABLE: OFFICE OFFICE_NUM OFFICE_NAME ADDRESS AREA CITY STATE ZIP_CODE 1…
Q: The StayWell Property Management team considers creating a discount scheme for the property owners…
A: Dear Student, In your code the name of the column will not be displayed you need to use the below…
Q: Using SQL: List the CD title (i.e. `Title` field of `Titles` table) and the number of tracks (NOT…
A: SQL stands for Structured Query Language.
Q: Question 4 You do not have a table named ‘employee’.What happens when you run this piece of code?…
A: The above question is solved in step 2 :-
Q: SELECT MAX(datediff(minute,start_time,end_time)) as "Longest_ride",…
A: Your SQL code contains error related to function datediff.
Q: The given SQL creates a Song table and inserts some songs. The SELECT statement selects all songs.…
A: SQL stands for Structured Query Language.
Q: What's wrong with my SQL code? It doesn't run. The SQL files are in the images attached. Queries…
A: Input Data : A set of SQL queries To find : Debug the queries for the correctness of the output
Q: Hi, I have a question regarding pl/sql stored procedure. I am trying to create a sp that takes 4 in…
A: Hello student Greetings Hope you are doing great. Thank You!!! The error message you received…
Q: This actually didnt work to resolve my problem... Heres what I have so far. CREATE TABLE Horse (…
A: Please refer to the following step for the complete solution of the problem above.
Q: On a SQL terminal for (e.g., sqlite3) someone type the following: select ‘456’; What is expected as…
A: Answer: The correct option is “(a) the number is 456”
Q: for a pl sql code . DECLARE rec_stu stus%ROWTYPE; lv_stu_num stus.stuid%TYPE := 50; BEGIN when…
A: Here in this question we can add 2 variables by if else conditions; as you want to add stu 49 for…
Q: how could this sql code alwasy shows "missing right parenthesis"???? its surely have parenthesis.
A: Yes, you are correct. You have balanced all parenthesis. But still it's showing this because there…
Q: There will be an error in below PL/SQL code. Specify which section(line) or keyword will cause this…
A: Below is the answer with explanation:
Q: n Sql Oracle Application ,Amend the previous statement to not suppress duplicates and examine the…
A: 30 Rows returned
Q: Commands In the sec0411_employees table, change the credit limit to $27.00 for
A: Update query is to change the values in a table as per the asked condition but the sql syntax is…
Q: my SQL Server command is giving me errors how do i fix it? CREATE FUNCTION FN_TOTALUNITCOST()…
A: SQL Server is a relational database management system developed by Microsoft. As a database server,…
Q: I have table named "Measurements" and a variable in oracle SQL in a column called "Size" that…
A: I have done a sample case with the said input to find the new weight.…
Q: MS SQL server Create a Stored Procedures with the name of “usp_CalculateTotals”.…
A: Creating Procedure using PL/SQL for the following, mode 1: Calculate the total balance of all the…
Q: When you run the following SQL command, the result is "no data found." You know that one record…
A: The answer as given below:
Q: UPDATE NONCAT SET Category =NULL WHERE ITEM_ID = UF39; Task 7: In the NONCAT table, change the…
A: Solution: UPDATE NONCAT SET Category =NULL WHERE ITEM_ID = 'UF39';
Q: ast_name and also how many sections instructor teaches. Print all this data on one line for one…
A: In this problem, we want to create an SQL query that retrieves instructor information, including…
Q: The following is the script for the SQL: set sql_safe_updates=0; drop table if exists message;…
A: Hi We have ran the below scripts and mentioned the results as well. drop table message; --…
Q: Write and execute a SQL query to list all patient numbers and encounter ids which do not have any…
A: Actually, SQL stands for Structured Query Language.
Q: The course I'm taking is database management. I have attached the necessary information for this…
A: Hence, the question has been solved in detailed explanation manner.Explanation:Part A - Using a For…
Q: Write the SQL statements to do the following: Create a trigger named trg_updatecustbalance2 to…
A: The question is to write the SQL query for the given problem.
Q: Translate the following SQL query to a pandas statement in Python so that it can be executed on the…
A: count(*)-count number of rows satisfying the condition sqldta-table name conditions;- case>1000…
Q: The SQL statement below is used to select students with the last name "Smith". What is wrong with…
A: To search for a last name in an SQL query, we can use the WHERE clause along with the LIKE operator…
Q: In SQL, is this a true or false statement: Pseudocolumns contain values present in a table, but not…
A: Pseudo columns: A pseudo-column is like a column for a table but not stored in a table in reality.…
Q: T-SQL procedure for MICROSOFT SQL SERVER A: obtain the name and credit limit of the customer…
A: Given : T-SQL procedure for MICROSOFT SQL SERVER A: obtain the name and credit limit of the customer…
Q: got this error when running code: DBMS_OUTPUT.PUT_LINE('Job Title: ' || Emp_rec.Job_Title);…
A: In this question we have to write a PL/SQL code that will perform the following tasks: Turn on the…
Q: The InstantRide Management team considers creating a new team for Car Maintenance. The new team…
A: Here have to determine about sql query for given problem statement of used car.
Q: Is this statement true or false: Oracle SQL allows full expression-based use of both provided…
A: Step 1:- Given:- Is this statement true or false: Oracle SQL allows full expression-based use of…
Q: Write a SQL command please Write a query that displays the last name in uppercase letters and…
A: This query can be solved using different SQL functions. Here is the answer with explanation.
Q: Given the following SQL statement, which statement is most accurate?SELECT customer# FROM…
A: SQL statement The given SQL statement is SELECT customer# FROM customers JOIN…
Q: For SQL The error seems to be that there is an apostrophe in reed's, but the apostrophe is the…
A: SQL stands for Structured Query language.
Q: How do I do this question in SQL command? Use the Oracle database employees table and CASE…
A: Given, Use the Oracle database employees table and CASE expression to decode the department id.…
ina sql developer code .
i have added for price <150 like
ADD CONSTRAINT price CHECK (price < 150);
DECLARE
price
BEGIN
exception
insert into orders values (430 king street',books,225);
when (price > 150);
dbms_output.put_line('too expensive ');
END;
when price is over 150 ,will show too expensive
whats the wrong of my code ?how to fix it ?
Step by step
Solved in 2 steps
- I am stuck on a question. Please assist with writing this code: Create a trigger for the EMPLOYEES table that will set the commission amount to .4 whenever the department_id is 80. Test your trigger COMPLETELY for every event it is defined. (Sometimes, UPDATE statements must have UPDATE tablename on a separate line by itself to keep APEX from hanging). This should work both for new rows and existing rows that are updated. Scenerio: All employees who are in the sales department (80) will have their commission always set to .4. This trigger is to enforce this business rule automatically.The Finance team wants to calculate a VAT (8%) on the amount of the stay reservations in the database. However, the team wants to calculate the VAT after the discounts are applied on the prices. In addition, it is important to remember if there is no discount/offers, then the value is NULL in the TRAVELS table. Create a procedure called VATCalculator to calculate the VAT amount and return with the corresponding travel ID. In addition, execute the procedure to account for NULL values and send the respective result to the team. The VAT value should be rounded to 2 decimals.write SQL queries to create procedures for a database called Saleco. The database contains the following tables: customer, invoice, line, product, and vendor. A procedure called get_customer_invoices that takes a customer ID as input and returns a list of all invoices for that customer, along with the total amount due for each invoice. A procedure called get_vendor_products that takes a vendor ID as input and returns a list of all products sold by that vendor, along with the number of units sold and the total revenue generated for each product. A procedure called get_invoice_details that takes an invoice ID as input and returns a list of all products purchased on that invoice, along with the quantity purchased, the unit price, and the total price for each product.
- ORACLE SQL - I have this code and I am getting the error message that there is an error near: WHERE SQR_FT > '1500'; INSERT INTO PROPERTY (office_num, address, sqr_ft, bdrms, floors, monthly_rent, owner_num)vALUES (office_num_val, address_val, sqr_ft_value, bdrms_value, floors_value, monthly_rent_value, owner_num_value)WHERE SQR_FT > '1500';From Oracle SQL Need Code Task 4: In the NONCAT table, increase the price of each item in category BRD by 5%.this oracle code have some error , how to fix it ? this is the sql code .and it have error . CREATE or replace PROCEDURE CONVERT_VAL(&v1 varchar2(2), &v2 varchar2(2), &amt number)asval varchar(100);val1 varchar(2):= ':v1';val2 varchar(2):=':v2';amount number:= :amt;BeginSelect case when val1!=val2 then case when lower(val1)='km' and lower(val2) = 'cm' then amount||lower(val1) ||amount*100000||' '||lower(val2) when lower(val1)='km' and lower(val2) = 'mt' then amount||lower(val1) ||amount*1000||' '||lower(val2) when lower(val1)='km' and lower(val2) = 'mm' then amount||lower(val1) ||amount*1000000||' '||lower(val2) when lower(val1)='cm' and lower(val2) = 'km'…
- Assistance with SQL statements Previous code; CREATE TABLE Lab4program_piershed ( code VARCHAR(5) PRIMARY KEY, name VARCHAR(20), tel VARCHAR(20));CREATE TABLE Lab4course_xxxx ( cid INT PRIMARY KEY, name VARCHAR(20), credits INT, mycode VARCHAR(5), FOREIGN KEY (mycode) REFERENCES Lab4program_xxxx(code)); 1. Insert 3 records into your Lab4program_xxxx table. The code should be "CPS", "TECH", "MATH", or "BIO". Please copy/paste your SQL statements with the output message in the text that shows you successfully insert 3 records to your table. 2. Insert 4 records into your Lab4course_xxxx table with at least 2 different mycode. Please copy/paste your SQL statements with the output message in the text that shows you successfully insert 4 records to your table.Task 3: The Marketing team wants to collect emails of the users on InstantStay. However, the team needs a SQL statement to execute inside their programming environment. You need to create a statement that they can easily run the EXECUTE command to return a single column table containing the USER_EMAIL addresses. Task: Create a prepared statement for use with the EXECUTE command.Instructor(Instructor_Id, Instructor_Name, specialization, Address,#Department_Id)Department(Department_Id, Department_Name)Course(Course_code, Course_Title,Credit_hours,Contact_hours,#Department_Id)Teaching(#Instructor_Id, #Course_code)a) Express in SQL the following queries:i. Change to 6 the number of contact hours of the course which has thecode “ITDR2104”.ii. Add a new column named instructorLoad of type Number(2) to thetable instructor.iii. List the details of all the courses having a code that starts with“ITDR”. The output should be sorted in descending order by credithours.iv. Find the number of courses taught by the instructor whose name is“Ahmed”.v. List the names of all departments along with the number of coursesoffered by each department.vi. Find the titles of courses, which are taught by the instructor who isnamed “Ahmed”.b) Create a view named instructor_of_DBCourse to contain the details(Instructor_Name, specialization, Address, Department_Id) ofinstructors who teach…
- Problem Your task is to write an SQL query that uses SQL's time constants to dynamically determine the timezone the database server is configured to use. Your query should return the timezone as a single string value with the timezone offset relative to the Coordinated Universal Time (UTC). The single output column should be named tz_offset, and the value should be in the form: UTC: where and use two digits in 24-hour format, padded with leading zeroes if necessary. Example: if the server used India's timezone the output should be: | tz_offset | | UTC+05:30 (1 row) query.sql> init.sql 1Hello! I was given those tables(no data) and I am supossed to write sql code for the following. But I looks like I have a syntax error or there is something I have wrote wrong. (see images) (1) Create a trigger “insert_inventory” on table “Inventory”. The trigger is fired after a row is inserted in table “Inventory”. After a row is inserted in table “inventory”, the “itemid”, the insertion time, and the action is inserted in table “Inventory_history”. The action is set to ‘add an item’. The oldprice is set to null. Test your trigger by inserting a row into Inventory and displaying the contents of Inventory_history. (3) Create a trigger “change_price” on table “Inventory”. The trigger is fired before a change is made to the “Inventory” table. Before the price of an item is changed, the “itemid”, the item’s old price, the action, and the time of change are inserted into the table “Inventory_history”. The action is set to “price change”. Test your trigger by updating a row in Inventory…. Write a T-SQL correlated subquery selecting the store code, store name, store ytd sales from the store table where the store code matches the selection result of the max store code from the store table where the store code matches. /* Created with SQL Script Builder v.1.5 */ /* Type of SQL : SQL Server */ CREATE TABLE EMPLOYEE ( EMP_CODE int, EMP_TITLE varchar(4), EMP_LNAME varchar(15), EMP_FNAME varchar(15), EMP_INITIAL varchar(1), EMP_DOB datetime, JOB_CODE varchar(5), STORE_CODE int ); INSERT INTO EMPLOYEE VALUES('1','Mr.','Williamson','John','W','5/21/1964','SEC','3'); INSERT INTO EMPLOYEE VALUES('2','Ms.','Ratula','Nancy','','2/9/1969','MGR','2'); INSERT INTO EMPLOYEE VALUES('3','Ms.','Greenboro','Lottie','R','10/2/1961','GEN','4'); INSERT INTO EMPLOYEE VALUES('4','Mrs.','Rumpersfro','Jennie','S','6/1/1971','GEN','5'); INSERT INTO EMPLOYEE VALUES('5','Mr.','Smith','Robert','L','11/23/1959','GEN','3'); INSERT INTO EMPLOYEE…