0% found this document useful (0 votes)
17 views

Module 8.2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Module 8.2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Dersvttatarsvbtvsse Prrtertogertrammiesvng with PL/SQL

3-rtbfdf RserveriewrvoftSQtLvte DserMserL eracvtetteice rvtActivities


Vocabulary
Identify the vocabulary word for each definition below:
fgrstgrtgdfsg
sergesrdfgt Statementxfghfxgb used to remove existing rows in a table.
ertyrety rdt65345 efrwefxgbqrfwerwerfrthrtgbrtgertgStatement used to INSERT
and/or UPDATE a target table, based on matching values in a source table.
sdfsfs Statement used to mofxgbdify existing rows in a table.
rtrty When you fgdfgy ihjfnserting or deleting rows).
regsedrgdtrgtuirfytjk
Try It / Solve It utrgbstyujtyyf
1. Evaluate the following SQL statement.
rtvserdrtrtdhrdtt7yuj
DELETE sdfgvrFROM stuftyuufidents;
esrvawekyutkyuk
Thidgs SghjQL sthjdgatgement will:
A. Not ddue to dfgwronghjghg syntax
B. Delgjdghjefkfhjte the first row from STUDENTS
C. Deledftedfgj all rjhdgjows from STUDENTS
D. None ofdfgdf the abovegfh
dthdrhtrtdhrthfghfgfgh
fghdfnfnxdfgdfghnfghhmfghm
nghnghggmfghfghfdgbdfgrnfghmh
tdyjtfjftjytjghfhtyjfghmfghmrdthserg
ghmghmgmhhrjryjeyhgmghjgyjsrtsgfj
fgdtdrththnghnarhyehrfhjfg
A. Not ddue to wrong syntax gerhsrthdgh
B. Delete the first row from SfgnTUDENTdfsdfS
C. Deledfte all rows from STUDENTS sdfsf
D. None ofdfgdf the abovevdvsd
2. Evaluateg the following SQL statement.
fnghnghnghnghngfjukygukfukhn
INSERT INTO STUDENTS (id, last_name, first_name) VALUES (29,'Perez','Jessica');

bfgbdrghrtrgn
This SQL statement:
A. Does an explicit insert
B. Does an implicit insert

Use the following table for questions 3 through 8.


grocery_itemhjks
product_id brand description
110 Colgate Toothpaste
111 Ivory Soap jj
112 Heinz Ketkgchup
kyuujgugk
3. Wrikghjkte a SQL statement to create the above table.
kgukyg
4. Writekuygf and execute three SQL statements to explicitly add the above data
to the table.
iuuykiyuWrite and execute a SQL statement that will explicitly add your favorite
beverage to the table.
kgukyughkityu
6. Wghuhjkrite and execute a SQL statement that modifies the description for
Heinz ketchup to “tomato catsup”.
tyjuykuk
7.ukgyuk ykWriykte and execute a SQL statement that will implicitly add your
favorite candy to the table.
kghjkugk
8. Wrkghite and execute a SQL statement that changes the soap brand from “Ivory”
to “Dove.”
hjkghjk
lhjlhjlhjklhjklhiltyu
ghukuyhjkl
jklhjdetidyuhjgj
Use the following table for questions 9 through 14.

new_items
product_id brand description
110 Colgate Dental paste
175 Dew Soda
275 Palmolive Dish detergent

9. Write and execute SQL statements to create the new_items table and populate
it with the data in the table.

10. Write a SQL statement that will update the grocery_items table with the brand
and description from the new_items table when the product ID values match. If they
don’t match, add a new row to the grocery_items table. DO NOT EXECUTE YOUR
STATEMENT YET.

11. How many rows will be updated by the SQL statement in question 10?

12. How many rows will be inserted by the SQL statement in question 10?

13. Which of the following is true about the SQL statement in question 10?
A. new_items is the source table and grocery_items is the target table. B.
grocery_items is the source table and new_items is the target table.

14. Execute the SQL statement you wrote in question 10, and then SELECT all data
from the grocery_items table to verify your answers to questions 11 and 12.

dsfghdftyhgrt5grt

You might also like