Question: I DONT KNOW HOW TO ADD THE SQL DATA , the whole thing does not fit for the question so I screenshotted the data. If

I DONT KNOW HOW TO ADD THE SQL DATA , the whole thing does not fit for the question so I screenshotted the data. If you know a better way to go about this please let me know. Will thumbs up if done correctly/ helped

I DONT KNOW HOW TO ADD THE SQL DATA , the whole

table sql:

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';

-- ----------------------------------------------------- -- Table state -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS state ( state_id INT NOT NULL AUTO_INCREMENT, name VARCHAR(45) NOT NULL, abb VARCHAR(2) NOT NULL, PRIMARY KEY (state_id), UNIQUE INDEX abb_UNIQUE (abb ASC)) ENGINE = InnoDB;

-- ----------------------------------------------------- -- Table address -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS address ( address_id INT NOT NULL AUTO_INCREMENT, street1 VARCHAR(45) NOT NULL, street2 VARCHAR(45) NULL, city VARCHAR(45) NOT NULL, zip VARCHAR(5) NOT NULL, state_id INT NOT NULL, PRIMARY KEY (address_id), INDEX FK_ADDRESS_STATE_IDX (state_id ASC), CONSTRAINT FK_ADDRESS_STATE FOREIGN KEY (state_id) REFERENCES state (state_id) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB;

-- ----------------------------------------------------- -- Table person -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS person ( person_id INT NOT NULL AUTO_INCREMENT, first_name VARCHAR(45) NOT NULL, last_name VARCHAR(45) NOT NULL, sex VARCHAR(1) NOT NULL, dob DATETIME, address_id INT, PRIMARY KEY (person_id), INDEX FK_PERSON_ADDRESS_IDX (address_id ASC), CONSTRAINT FK_PERSON_ADDRESS FOREIGN KEY (address_id) REFERENCES address (address_id) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB;

-- ----------------------------------------------------- -- Table branch -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS branch ( branch_no VARCHAR(5) NOT NULL, address_id INT NOT NULL, PRIMARY KEY (branch_no), INDEX FK_BRANCH_ADDRESS_IDX (address_id ASC) COMMENT ' ', UNIQUE INDEX ADDRESS_ID_UNIQUE (address_id ASC), CONSTRAINT FK_BRANCH_ADDRESS FOREIGN KEY (address_id) REFERENCES address (address_id) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB;

-- ----------------------------------------------------- -- Table staff -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS staff ( staff_no VARCHAR(5) NOT NULL, person_id INT NOT NULL, position VARCHAR(45) NULL, salary INT NULL, branch_no VARCHAR(5) NOT NULL, PRIMARY KEY (staff_no), INDEX FK_STAFF_PERSON_IDX (person_id ASC), UNIQUE INDEX PERSON_ID_UNIQUE (person_id ASC), INDEX fk_staff_branch1_idx (branch_no ASC), CONSTRAINT FK_STAFF_PERSON FOREIGN KEY (person_id) REFERENCES person (person_id) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_staff_branch1 FOREIGN KEY (branch_no) REFERENCES branch (branch_no) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB;

SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

data sql screenshot:

thing does not fit for the question so I screenshotted the data.

If you know a better way to go about this please let

For this assignment, use the table and data from the last page. 1. Write the SQL statement to show workers with names that have the letter i before the last character. 2. Write the SQL statement to show all staff where the 2nd letter of their last names is 'e' 3. Write the SQL statement to show all staff where the 1st letter of their first names is 'e' and 3rd letter 'h' 4. Write the SQL to show the staff No, position, and salary of all the female workers. 5. Write the SQL to show the staff No, position, and salary of all the male workers who make more than $20,000.00 6. Write the SQL statement to show all rows where position is either Manager or NULL. 7. Write the SQL statement to show all rows in the table ordered by i. Ascending frame ii. Ascending position iii. Ascending salary 8. Show all rows in the table ordered by Notice the differences i. Descending f Name between the restuls. ii. Ascending position iii. Descending salary TSSEITE_4b HIN ....... 1.115 . . '' CP s', . . ' IT oddess_16 S. 10., d., ''. IS . ess, m., 55,5 Set tab. 21 C. Si, 411, clete, 600,105 ... I. 45,5 L Retro , 10. 633 ..... ..!!! ,,100 .. 235, SL 4179 ... ..! 0.13 Let', 1. w 1.15. FOTOS 175) - ,1-5, ex, -?.", sai , .. 179, Cected "It .. . . IM 13,90 Frede, C. 25, N. C5590 U.C.) . 14.4 CIAL, 09.12.... 123, ... C. 1145, . 23.11 Cose 4:55. DN 314 ..... . cata II 'C', 403. 10 195, Cle Sak GS,... TRESTITO Dereich Dresden I....., . 10. TOM ',1381 14 ... . .. DE Sa CS. C L Local, CN 11. . * . ' Pl. CET ET ER tree 123,, Adress_VUT .. va .......... .. Tel. 5. Cantina, , 25-13:30:02, wa -- tal) 4. ..... 1.' ' ...!!) ON''M. 4, Boco, 1551-12-19:00.00, 21.04. TALL ALL . ten TE T. ERIT Ww.W ..., ............ ......, 1 .....all rall 41 300-320, ca', Me ... il) ...) 113, 11:39 I hate SILT 31-10-31 WER ---..., 1 0, ... . ... 2009--000000 ... 18. Salegos.'15--20:30 La 11. in .. .. 25 31-09-10 13. D..., Det...... ... tel... .. CHH TER .. ,,,13--08:08,201 . - -8.00.00.00, all 151) 4. 18-10-01) satelit ........ , .... 1896--01) THE LI mik, 1. Oct. 2009... . e, em 19 man ,,.. ,,, ...al 15,"SL 2016-11-20:06:08, EL LANG, 30. Marks . Fre, legt, 21:30 TL 0,00 D...... 3. tel. ... 5- 8:10 000 Ft wall IN. To be 2. em ... Wid ................ 1993, -!! . te!! R. SI .......... 32. W ... . 1991 - 00:00 i 1 att att as, ,,..,.. wa, .... Th11-19 vall, wat es, ie, Pole 15-30, a. . -- 1339 18. . 04 --- 25:07. . ' ' '. .. SINI ". --20:00 , ', 'CLER ! . www. .. I do. Se trata 097.52 LL W... 500.000, , . IN stel. ' . -'. CIRE!!! 1526-5-2013 malal Hall we www.al mall, est, 100, CAT13.2 0,21 0, ha! - . 1. T. . CIL, 'E', CH 251-53,23 TE --- : Cele 1.650. 0.000,- 1, 2,194 ..., M. TI Call !!) -11-08:08:08, ... , , , ... 558 4. Tots.ti. 19 . 0, . etd, 8-1-20:00:00, 21 TIN. LT 1 . "B 11 HO ... .. I', ' ,' .. 499. ) den 4103, 14 4183, chess CE, CEL. 403. th. 13, 11 CIP, 14 d., Cleyte ... . 1. Crisis cat, O. G. GB 0,"late in ... 11.976 www.00 . 017-07-07 2 You ... IT - ' WER TE 003, .. ,, CC, 4. TTC Cite, . 11 4,6 kw,25 , 5 . te COSTI, 44 ... . ATT T. CEN! C1-64 .. , r5', ' ' Tantrally take 13.8, S., Islam ... 10.8931, ..., 2011, PAS ... . 120568,546, DILE, 1000, TREE I',451,378, , BLOND, . IBLE,950,0,1, Peter F 30,', 'Dugaand, T, ALL ALL LEN, 'Waco, , 21-12-22 08:06:06', 1.1, . C Cup, Y. ALL 41300, "', 'e', 'T', '1500-15-30-10:00, LED 1904-5-10 10:10:10,35), www.al GES, hall, W. '. - 08.00:00', 4.30, 'E', ''', '150-6-35 00:00:00', , LWS..., I, da C, Jackie L. CALL ISL-5-24 08:00:00 .... IL al al 122 mm. N. 15--10:00:00', 1 Bucale WALL . Sear's 2.-03.0, 2011 CLOS, Sacla 4130 LIS, Drescher, 1998-3401:00, CO Sere Shere', ' , " " . (135 Perly Lante , 'a', 'Carval' ale: 455, Poul, GISC, la ... GLS TH Central, S., , , , , , Ceyl', wl, wit amal1). Halus 155-13 00:00:00', ALL Lourdes "L963-5-15 00:00:00', Sleece," -- 0.000,- CER mi, assi , . 023-3-16 0:00 ... 1238, 136, alles, was SK ..., , , , ,--.., L, 1951, , 'Essa', 'a', 'S, LACI-S-1 00:00:00 GITES ... 10 CLE, L'I,','ISO-L-33 0:00:00', 122, CIT, 'S', ' MOS-21-2 00:00:00", 1981, ... IN!!". CLEE LEW-4-5.0.0.3.rar a CL, , ' 2011, 1990. '', 'e', 'T', '1500-5-30 6:00:00, 11) Milt. - Calle Pulo, ..., C: In yok Landed 1851, C1 , .........., CLER 1000 H30, beren, , 14, Dull, 'wa,...., aces, l'1-5 00:00:00', 11429, Seda, ' Clue', ' Hall, L., 201, Tom', 3, Y. ALL D, 1930, best , , 13. The 11":"1" Saalea, Case 15 414, 'd', 'Sale CI VE CHP, 108 ; .. L'ED, 345, 350, per, 53,1,ER, 2000, .. 2011,'2','',000, "L'1',' l'e', 0, '1', ,, . 105,2011 ,, Super 2000, . . 25.-2020, 314,150, Sebas, 8054,30,313, 90017, 0139, 240,000 P.1313 ... ,, gas, TES 3000,75,371.",agen', CORE104,745 Teller Bar, E., , 104,10 L'E' ,,'340, age, ILOCO, 5032 1155, STO I56.340, 13 I'8055,21,BONT less ISS-LO-L 0:00:00 , 1450 Net S-2 00:00:00 3. Tera', es 'T', '2000-12-30:10:10, 13 ALL 141 Shadow C, T', 'a', 'N, L-1-14 00:00:00', Lour, 30 Tel ' "1585-0-300:00:00.0 14, D.'. '805-18 08:00:00 Dende , 14 S. , s', CH, TER", "Errano, H', '1513-i-l: 0:25, L7, C. s, i all', '', )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!