Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Write and execute XML statements for the following two queries:
Q1. Find the name of an employee who lives in Lincoln and works in Omaha.
Q2. Find salaries of employees who live in the same cities as the companies for which they work.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Question 59arrow_forward3. Show the ID of all the authors that do not have any books. a). Using a join: b). Using a subquery:arrow_forward(1) for each Customer (e.g., customer C), display all other customers who have higher salary than this Customer (e.g., customer C). (use inner join, display each customer’s ID, name, and all higher salaries, you don’t need to display information about the customers who have higher salary.) (2) for each Customer (e.g., customer C), display all other customers who have higher salary and are younger than this Customer (e.g., customer C).arrow_forward
- Below are some rows of the PROVIDERS table for a factory: PCODE 10192 98411 0489035 NAME Hans, Inc. Tools and More Motors Inc. PHONE 231 - 3092 231-1029 993 - 1821 All providers from the factory zone of the city start with 231. You want to get the providers that are in the factory zone of the city. Which of the following is more appropriate? O a. O b. SELECT * FROM PROVIDERS WHERE PHONE LIKE '% 231' O C. O d. SELECT * FROM PROVIDERS WHERE PHONE LIKE $231%' SELECT * FROM PROVIDERS WHERE PHONE LIKE 231 SELECT * FROM PROVIDERS WHERE PHONE LIKE '%231%'arrow_forwardWhich of the following are equivalent to WHERE attribute IN (123, 200)? a. WHERE attribute BETWEEN 123 AND attribute = 200 b. WHERE attribute = 123 AND attribute = 200 c. WHERE attribute <= 123 AND attribute >= 200 d. WHERE attribute = 123 OR attribute = 200arrow_forwardWrite an XML file that describes information of students in a class. The following table has the students' details: Name ID Ahmed 1000 Muhammad 2000 Note that the root element start and end tags are providedarrow_forward
- Task 12: When deleting a customer, subtract the balance multiplied by the sales rep’s commission rate from the commission for the corresponding sales rep.arrow_forwardApply the First Normal Form (1NF) and Second Normal Form (2NF) steps to the following two tables. ST_ID ST_Name ST_Major St_Phone ST_Email 100 Marla jen ACCT (703) 111-2222 mjen@gmail.com 110 Jan Bok MGMT (703) 222-3333 jbok@verizon.net 115 Lee Chan MIS (703) 333-4444 (703) 444-5555 lchan@cox.net Table 1 ID Name Courses 1 Ashely Key MIS 302, MIS 303 2 Katy Pery MIS 310 3 Mickey Zen MIS 303, MIS 350 Table 2arrow_forwardwrite the code for the following triggers in MySQL following the style shown in the text. A: When adding a customer, add the customer balance multiplied by the sales rep's commission rate to the commission for the corresponding sales rep. B: When updating a customer, add the difference between the new balance and the old balance multiplied by the sales rep's commission rate to the commission for the corresponding sales rep. C: When deleting a customer, subtract the balance multiplied by the sales rep's commission rate from the commission for the corresponding sales rep. CREATE TABLE REP(REP_NUM CHAR(2) PRIMARY KEY,LAST_NAME CHAR(15),FIRST_NAME CHAR(15),STREET CHAR(15),CITY CHAR(15),STATE CHAR(2),POSTAL_CODE CHAR(5),COMMISSION DECIMAL(7,2),RATE DECIMAL(3,2) );CREATE TABLE CUSTOMER(CUSTOMER_NUM CHAR(3) PRIMARY KEY,CUSTOMER_NAME CHAR(35) NOT NULL,STREET CHAR(20),CITY CHAR(15),STATE CHAR(2),POSTAL_CODE CHAR(5),BALANCE DECIMAL(8,2),CREDIT_LIMIT DECIMAL(8,2),REP_NUM CHAR(2) );INSERT INTO…arrow_forward
- Write and execute XML statements for the following two queries: Q1. Find the name of an employee who lives in Lincoln and works in Omaha. Q2. Find salaries of employees who live in the same cities as the companies for which they work. Data to be used for this assignment Employee Name street city gender -------------------------------------------------------- Anderson, Susan L 108th Omaha F Brady, Dan L P street Lincoln M Chen, Peter K 124th Omaha M Clemson, Ann M O Lincoln F Dale, Mary K 132th Omaha F Gill, Mary L P street Lincoln F Harrison, Susan M Old Mill Omaha F Jackson, Kim A 178th Omaha F Jason, Pat M 8th C.Bluffs M Kumar, Paul T Dodge…arrow_forwardMySQL Workbench Will the following select statements work? If the queries don’t work, explain why and then correct them.a-) SELECT NAME, EMPLOYEE_ID, SALARYFROM EMPLOYEE_TBL E, EMPLOYEE_PAY_TBL EPWHERE EMPLOYEE_ID = EMPLOYEE_ID AND NAME LIKE '%MITH';b-) SELECT E.NAME, E.EMPLOYEE_ID, EP.SALARYFROM EMPLOYEE_TBL E, EMPLOYEE_PAY_TBL EPWHERE NAME LIKE '%MITH';c-) SELECT E.NAME, E.EMPLOYEE_ID, EP.SALARYFROM EMPLOYEE_TBL E, EMPLOYEE_PAY_TBL EPWHERE E.EMPLOYEE_ID = EP.EMPLOYEE_ID AND E.NAME LIKE '%MITH';d-) SELECT ENAME, COUNT(*)FROM EMPWHERE ENAME = '&NAME'ORDER BY ENAME;e-) SELECT DEPT_ID, COUNT(*)FROM EMPGROUP BY DEPT_IDHAVING ENAME='ALIYE';f-) SELECT F_NAME, L_NAMEWHERE F_NAME LIKE '%A'FROM EMP, DEPT;g-) SELECT NAME, SALARYFROM DEPT, EMPWHERE DEPT.ID = EMP.ID AND SUM(SALARY);arrow_forwardSQL give the algebraic form of these queries: //agregation select count(enfant_id) as "nombre enfants n'ont pas besoin d’aliment de substitution" from enfant where déjeuner='0'; select nom_ag "nom",prénom_ag "prénom",nb_heure_par_se "heures par semaine", count(agents_id) "nombre des agents" from agents_entretien group by jour; // union select nom_en, prénom_en,'fils' as fils_ou_parent from enfant union select nom_ac,prénom_ac,'parent' as fils_ou_parent from parent_actual; select nom_en, prénom_en,'fils' as fils_ou_parent from enfant where enfant.parent_id='2' union select nom_ac,prénom_ac,'parent' as fils_ou_parent from parent_actual where parent_id='2'; // intersection select * from agents_entretien where jour in(select jour from nettoyage) INTERSECT select * from agents_entretien where jour in(select jour from nettoyage); //division select * from agents_entretien,nettoyage where agents_entretien.jour=nettoyage.jour group by nom_ag having count(*)=(select count(*) from…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- 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
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education