Concept explainers
Im trying to run the following SQL in Oracle:
SELECT GUEST_KR.FIRSTNAME, GUEST_KR.LASTNAME,FEE_KR.DateCharged,FEE_KR.FeeDescription,FEE_KR.FeeCharged,SUM(FeeCharged) AS TotalFeeCharged
FROM FEE_KR
JOIN SERVICE_KR ON FEE_KR.ServiceID = SERVICE_KR.ServiceID
JOIN GUEST_KR ON SERVICE_KR.ServiceID = GUEST_KR.GuestID
WHERE ServiceName IN ('First Name', 'Last Name', 'Date Charged', 'Fee Description')
WHERE ServiceName NOT IN (SELECT FEETYPE FROM REPORT_FILTER_KR)
GROUP BY GUEST_KR.FIRSTNAME, GUEST_KR.LASTNAME,FEE_KR.DateCharged,FEE_KR.FeeDescription,FEE_KR.FeeCharged
ORDER BY SUM(FeeCharged) DESC;
And I'm recieving this error:
Error starting at line : 1 in command -
SELECT GUEST_KR.FIRSTNAME, GUEST_KR.LASTNAME,FEE_KR.DateCharged,FEE_KR.FeeDescription,FEE_KR.FeeCharged,SUM(FeeCharged) AS TotalFeeCharged
FROM FEE_KR
JOIN SERVICE_KR ON FEE_KR.ServiceID = SERVICE_KR.ServiceID
JOIN GUEST_KR ON SERVICE_KR.ServiceID = GUEST_KR.GuestID
WHERE ServiceName IN ('First Name', 'Last Name', 'Date Charged', 'Fee Description')
WHERE ServiceName NOT IN (SELECT FEETYPE FROM REPORT_FILTER_KR)
GROUP BY GUEST_KR.FIRSTNAME, GUEST_KR.LASTNAME,FEE_KR.DateCharged,FEE_KR.FeeDescription,FEE_KR.FeeCharged
ORDER BY SUM(FeeCharged) DESC
Error at Command Line : 6 Column : 1
Error report -
SQL Error: ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended"
*Cause:
*Action:
How do I fix this?
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
- plz help in sql In Triggers, BEFORE means before the changes are made in memory but after the changes are permanently saved to disk. Select one: a. True b. Falsearrow_forwardWrite sql code for Use derived tables and joins to create a list of players who have scored more than 200 runs, taken more than 10 wickets, and taken more than two catches. runs is form batting wicketstaken from bowling catches is from fielding table (which is same as other tables0arrow_forwardIs this statement true or false: Oracle SQL allows full expression-based use of both provided (built-in) and user-definable functions.arrow_forward
- Database https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_allarrow_forwarddatabase: sql Q1. Create the following tables: Carrier Attribute name Type Size Constraint carrierID Varchar2 10 Primary key carrierName Varchar2 100 NOT NULL Phone Varchar2 50 LIKE ‘+966%’ Range Varchar2 30 Value is either ‘International’ or ‘Local’ Review Attribute name Type Size Constraint ReviewID INT Primary key Stars INT NOT NULL Comment Varchar2 70 Name Varchar2 50 Default ’User’ CustomerID INT Foreign key references customers ProductID INTarrow_forwardFor SQL The error seems to be that there is an apostrophe in reed's, but the apostrophe is the symbol that is allowing the table to be read. 'frank reed's vegetables' so it comes up as an error instead of loading the table. Find and correct the error in the following: select *from l_supplierswhere supplier_name = 'frank reed's vegetables';arrow_forward
- Write the SQL Code for Select the names of wicketkeeper along with the number of sixes that they have hit (while batting) ? table is in the picarrow_forwardCreate an anonymous block in PL/SQL to list all the countries from Country table where Currency contain keyword ‘Dollar’. Perform following steps: Create user define type with name of the country, currency.Type should contain datatype for name and currency using %type only.Display should include Name of the country, currency code using user defined type. Filter for the data : All the countries from Country table where Currency contain keyword ‘Dollar’.arrow_forwardi amm trying to do some work in sql developer insert data from nametest to names i want only to insert year ,name and gender ,then create a id for each data in the databse . what commend shouldi use ? i try "INSERT INTO names(Year, Name, gender),SELECT (Year_, name_, genderA) FROM namestest; it shows Error starting at line : 1 in command -INSERT INTO names(Year, Name, gender),SELECT (Year_, name_, genderA) FROM namestestError at Command Line : 2 Column : 21Error report -SQL Error: ORA-00926: missing VALUES keyword00926. 00000 - "missing VALUES keyword"*Cause: how to make it corrrect ?and make a "id "for each data ?arrow_forward
- I use the My SQL Workbench ,this question is for My SQL class ,can you provide me the solution using the My SQL workbench ?arrow_forwardORACLE 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';arrow_forwardHow can you dynamically execute a SQL query in PL/SQL? a. Using EXECUTE IMMEDIATE statement b. Using DBMS_SQL package c. Using FETCH statement d. Using OPEN-FOR statementarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education