SQL UPDATE – quiz

For each question below, select the best answer. To select the best answer, click on the circle located on the left of this answer. When all questions are answered, click on the Submit button.

Question 1

Consider the fragment “set phone_number=4934455599988 where first_name = ‘Aamir’“. Which of the following is the most true?:
One or more first names are going to change.
phone_number must be equal to 4934455599988 to apply.
One or more phone numbers are going to change.
One phone number only is going to change.

Question 2

Which of the following fragments is not correct:
set phone_number=4934455599988
set phone_number=”4934455599988”
set first_name= aamir

Question 3

Which of the following fragment is preferable?:
set revenue=1000
set revenue=”1000”
set revenue=1000!

Question 4

In the statement “update customers set email='[email protected]' where first_name = ‘Aamir’”:
The table is customers, the column to change is first_name, the condition is on email.
The table is customers, the column to change is email, the condition is on first_name.

Question 5

Which of the following syntax is correct:
set email='[email protected]',phone_number=34455599988
set email='[email protected]' and phone_number=34455599988
set email='[email protected]' or phone_number=34455599988

Question 6

Which fragment is correct when you want to divide all revenues by 2:
set revenue = revenue * 2
divide revenue by 2
set revenue = revenue / 2
select revenue = revenue /2

Question 7

What happens when you do not use “where” in an update statements:
The update is not executed.
It updates all the rows in the table.
It updates all the columns in the table.
It updates all the fields in the table.
It does not execute.

 

 

Once you have completed the quiz, calculated your score and reviewed your answers, I invite you to go to the next lesson: SQL Insert.
 
Share on:

Something not clear? Ask your question here:

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
 

Author:
Last udpated: September 10, 2017
Created: September 2, 2014