Skip to Content

TheBlogReaders.com

Salesforce.com, PHP, MySQL, Javascript, Ajax, Htacces

SQL Interview questions and Answers For Freshers Patr-5

Be First!

sql41.Say True or False. Give explanation if False.
INSERT statement does not allow copying rows from one table to another.

False. INSERT statement allows to add rows to a table copying rows from an existing table.

42.How do you copy rows from one table to another?
The INSERT statement can be used to add rows to a table by copying from another table. In this case, a subquery is used in the place of the VALUES clause.

43.What happens if you omit the WHERE clause in the UPDATE statement?
All the rows in the table are modified.

44.Can you modify the rows in a table based on values from another table? Explain.
Yes.

Use of subqueries in UPDATE statements allow you to update rows in a table based on values from another table.

45.Say True or False. Give explanation if False.
The DELETE statement is used to delete a table from the database.

False. The DELETE statement is used for removing existing rows from a table.

46.What happens if you omit the WHERE clause in a delete statement?
All the rows in the table are deleted.

47.Can you remove rows from a table based on values from another table? Explain.
Yes, subqueries can be used to remove rows from a table based on values from another table.

48.Say True or False. Give explanation if False.
Attempting to delete a record with a value attached to an integrity constraint, returns an error.

True.

49.Say True or False. Give explanation if False.
You can use a subquery in an INSERT statement.

True.

50.What is the purpose of the MERGE statement in SQL?
The MERGE statement allows conditional update or insertion of data into a database table. It performs an UPDATE if the rows exists, or an INSERT if the row does not exist.

(163)

Previous
Next

Leave a Reply