DATABASE | SQL | SQL INTERVIEW QUESTION AND ANSWERS 10 | WHAT COMMAND DO WE USE TO RENAME A DB? | WHAT IS BCP? | WHAT IS CROSS JOIN? | WHAT IS STORAGE MANAGER? | WHAT ARE STORED-PROCEDURES? AND WHAT ARE THE ADVANTAGES OF USING THEM? | WHAT IS DATABASE TRIGGER?

Sql Interview Question and Answers:

55.     What command do we use to rename a db?
      sp_renamedb “oldname” , “newname”
If someone is using db it will not accept sp_renmaedb. In that case first bring db to single user using sp_dboptions. Use sp_renamedb to rename database. Use sp_dboptions to bring database to multi user mode.

56.     What is BCP?

      BulkCopy is a tool used to copy huge amount of data from tables and views. BCP does not copy the structures same as source to destination.

57.     What is Cross Join?
      A cross join that does not have a WHERE clause produces the Cartesian product of the tables involved in the join. The size of a Cartesian product result set is the number of rows in the first table multiplied by the number of rows in the second table.

58.     What is Storage Manager?
      It is a program module that provides the interface between the low-level data stored in database, application programs and queries submitted to the system.

59.     What are stored-procedures? And what are the advantages of using them?
      Stored procedures are database objects that perform a user defined operation. A stored procedure can have a set of compound SQL statements. A stored procedure executes the SQL commands and returns the result to the client. Stored procedures are used to reduce network traffic.

60.     What is database Trigger?
      A database trigger is a PL/SQL block that can defined to automatically execute for insert, update, and delete statements against a table. The trigger can e defined to execute once for the entire statement or once for every row that is inserted, updated, or deleted.

No comments:

Post a Comment