Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Just need Answer for 5, 6, 7, 8 For this assignment, use the table and data from the last page. 1. Write the SQL statement

Just need Answer for 5, 6, 7, 8 image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
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 fname 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 Descending salary lariaDB [labe2]> select * from staff; staff_no person_id | position | salary | branch_no SG501 1576 Supervisor 320000 | B714 SG502 1411 Manager 180880 B187 SG505 1845 | Teller 8eeee B266 SG507 1231 Assistant 30000 B731 SG508 1531 | Teller 8eeee B647 SG512 1312 Teller 8eeee B553 SG514 949 Assistant 3eeee B745 SG515 808 Manager 21eeee B443 SG516 1102 Manager 18eeee B190 SG525 1252 Teller 1eeeee B266 SG527 910 Supervisor | 360000 B647 SG528 901 Manager 21eeee B424 SG529 1258 Teller 1eeeee B164 SG530 442 | Assistant 2eeee B553 SG531 1543 Assistant 3eeee B623 SG535 1075 Teller 80880 B632 SG540 859 Manager 21e8ee | B745 SG542 1291 | Supervisor 36eeee B632 SG543 1417 Teller 108888 B731 SG550 913 Assistant 3eeee B724 SG555 997 Supervisor 36eeee B647 SG558 616 Supervisor 360020 B960 SG560 850 Supervisor 32eeee B960 SG562 1582 Assistant 2eeee B164 SG570 421 Manager 21eeee B911 SG571 1165 Supervisor 32eeee B623 SG572 925 Assistant 2eeee B623 SG577 1435 Assistant 3eeee B942 SG578 1402 Teller 1e2880 B553 SG585 403 Assistant 30880 B424 SG587 1159 Assistant 2eeee B942 SG588 940 | Teller | 8eeee B424 SG591 943 | Assistant | 20000 B443 SG592 937 Assistant 3e8ee | B647 MariaDB [labo2]> select * from person; I person_id | first_name last_name | sex dob | address_id 287 400 Bruno 403 Mariano 406 Cherryl 409 | Jennie 412 Vallie 415 Myron 418 Ben 421 Houston 424 Codi 427 Natasha 430 Ivory 433 Reinaldo 436 | Dreama 439 Jonas 442 | Shaquana 445 Xenia 448 Lionel 451 | Erin 454 | Latricia 457 Melissa 460 Leigh 463 Nicky 466 | Enrique 469 Karina 472 Jerry 475 | Drusilla 478 Nadine Rapozo | Caffey Klumpp Hinesley Snedden Hone Haygood Dimaggio Coles Douthitt Pittenger Quintero Zucker Mangini Schissler Pasko Stone M M F F F M M M F F 'M M 1939-02-23 ee:00:00 1926-12-09 00:00:00 1993-12-01 00:00:00 1904-10-06 00:00:00 1913-05-01 00:00:00 NULL 1983-10-30 00:00:00 1951-11-17 00:00:00 1974-03-05 00:00:00 NULL 1956-09-21 00:00:00 | NULL NULL NULL 1900-11-13 00:00:00 1963-02-06 00:00:00 1990-10-02 00:00:00 1925-05-12 00:00:00 1930-@7-18 00:00:00 NULL 1984-12-12 00:00:00 NULL 1985-08-20 00:00:00 1986-07-01 00:00:00 NULL 1931-01-18 00:00:00 NULL 287 NULL 251 217 NULL NULL 293 255 NULL 271 257 NULL NULL 213 111 247 167 163 NULL NULL 267 269 231 233 131 299 F M M Sam F M Poblete Rhein Donis Oberle Naranjo Cantin Burchett Canale Brumback | M | F F Type here to search MariaDB [labo2]> select * from branch; +--- + | branch_no | address_id B424 B947 B942 B714 B901 B724 B936 B443 B164 B647 B623 B911 B632 B745 B266 B553 B960 B731 B190 B187 103 115 119 125 131 137 157 163 165 167 183 185 187 199 209 241 247 267 269 279 MariaDB (labe2]> select from state; | state_id name | abb 100 Alabama 102 Alaska AK 104 Arizona AZ 106 Arkansas AR 108 California CA 110 Colorado 112 Connecticut CT 114 Delaware 116 Florida FL 118 Georgia GA 12e Hawaii HI 122 Idaho ID 124 Illinois IL 126 Indiana IN 128 Iowa 13 | Kansas KS 132 Kentucky KY 134 Louisiana LA 136 Maine ME 138 Maryland MD 140 Massachusetts MA 142 Michigan MI 144 Minnesota | MN 146 Mississippi 148 Missouri MO 150 Montana MT 152 Nebraska NE 154 Nevada NV 156 New Hampshire NH 158 New Jersey NJ 160 New Mexico | NM 162 New York NY 164 North Carolina NC 166 North Dakota ND MS

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

How to prepare washing soda from common salt?

Answered: 1 week ago

Question

Explain strong and weak atoms with examples.

Answered: 1 week ago

Question

Explain the alkaline nature of aqueous solution of making soda.

Answered: 1 week ago