Concept explainers
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 Omaha M
Works: employee_name company_name salary
------------------------------------------------
Anderson, Susan L Mutual of Omaha 48000
Brady, Dan L FDR 42000
Chen, Peter K FDR 53000
Clemson, Ann M First Bank 39000
Dale, Mary K Mutual of Omaha 58000
Gill, Mary L Union Pacific 48700
Harrison, Susan M Union Pacific 54320
Jackson, Kim A FDR 68000
Jason, Pat M FDR 83000
Kumar, Paul T FDR 44000
Company:
company_name city
-----------------------------
First Bank Omaha
FDR Omaha
Lincoln Star Lincoln
Mutual of Omaha Omaha
Union Pacific (UP) Omaha
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps
- 11. Foreign key is the one in which the ________ of one relation is referenced in another relation. a. Foreign key b. Primary key c. References d. Check constraintarrow_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_forwardWhere do domain restrictions begin and end?arrow_forward
- You have a table that contains the following fields: Last Name, First Name, Street, City, State, and Postal Code. There are 50,000 records in the table. What indexes would you create for the table? You have a table that contains the following fields: Book ISBN Number, Book Title, Author Last Name, Author First Name, Publication Year, and Publisher Name. There are 75,000 records in the table. What indexes would you create for the table?arrow_forwardSQL Use the IN operator to list the item ID and description of each item in category FSH or BRD.arrow_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