Interview questions with answers on SQL VOL-II


Q.1  Explain the use of the by GROUP BY and the HAVING clause?

Ans:  The GROUP BY partitions the selected rows on the distinct values of the column on which the group by has been done.The HAVING selects groups which match the criteria specified.

 

Q.2  What is a tuple?

Ans:  A tuple is an instance of data within a relational database.

Q.3  What is SQL Profiler?

Ans:  SQL Profiler is a graphical tool that allows system administrators to monitor events in an instance of Microsoft SQL Server. You can capture and save data about each event to a file or SQL Server table to analyze later.

Q.4  What is User Defined Functions?

Ans:  User-Defined Functions allow to define its own T-SQL functions that can accept 0 or more parameters and return a single scalar data value or a table data type.

Q.5  What is schema?

Ans:  A schema is collection of database objects of a Use.

Q.6  Define Self Join.

Ans:  This is a particular case when one table joins to itself, with one or two aliases to avoid confusion. A self join can be of any type, as long as the joined tables are the same. A self join is rather unique in that it involves a relationship with only one table. The common example is when company has a hierarchical reporting structure whereby one member of staff reports to another. Self Join can be Outer Join or Inner Join.

Q.7  Define Sequence?

Ans:  A Sequence is a database object that can be used to provide very quick generation of unique numbers.

Q.8  Define Equi Joins?

Ans:  A Equi Join is a join in which the join comparison operator is an equality. When two tables are joined together using equality or values in one or more columns, they make an Equi Join.

Q. 9 Define Cartesian Join?

Ans:  Joining two tables without a whereclause produces a Cartesian join which combines every row in one table with every row in another table.

Q.10  What are three SQL keywords used to change or set someone's permissions?

Ans:  GRANT, DENY, and REVOKE

Q.11  What are primary keys and foreign keys?

Ans:  Primary keys are the unique identifiers for each row. They must contain unique values and cannot be null. Due to their importance in relational databases, Primary keys are the most fundamental of all keys and constraints. A table can have only one Primary key.Foreign keys are both a method of ensuring data integrity and a manifestation of the relationship between tables.

Q.12  Define data model?

Ans:  Underlying the structure of the database is called as data model.

Q.13  What is an Entity?

Ans:  It is a 'thing' in the real world with an independent existence.

Q.14  What is BCP? When does it used?

Ans:  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.

  

Q.15  What is DataWarehousing?

Ans:  According to Bill Inmon, known as father of Data warehousing. “A Data warehouse is a subject oriented, integrated ,time variant, non volatile collection of data in support of management’s decision making process”.

Q.16  What are the advantages of Database?

Ans: 
  • Redundancy can be reduced
  • The data can be shared
  • Security can be enforced
  • Standards can be enforced
  • Integrity can be maintained
  •  Inconsistence can be avoided

Q.17  What are the advantage of SQL?

Ans: The advantages of SQL are:
  • Application written in SQL can be easily ported across systems.
  • SQL is a high level language that provides a greater degree of abstraction than procedural  languages.
  • SQL enables the end users and system personnel to deal with a number of Database management systems where it is available.  

Q.18  What is the difference between join and outer join?

Ans:  Outer joins return all rows from at least one of the tables or views mentioned in the FROM clause, as long as those rows meet any WHERE or HAVING search conditions.A join combines columns and data from two are more tables.

Q.19  Define Boyce coded normal form?

Ans:  A relation is said to be in Boyce coded normal form if it is already in the third normal form and every determine is a candidate key.

Q.20  What are the transaction properties?

Ans: 
  • Atomicity
  • Durability
  • Consistency
  • Isolation 

Q.21  What is data mining?

Ans:  Data mining refers to using variety of techniques to identify nuggests of information or decision making knowledge in bodies of data and extracting these in such a way that they can be put in the use in the areas such as decision support, predication, forecasting and estimation.

Q.22  Compare DBMS versus object oriented DBMS?

Ans:  DBMS consists of a collection of interrelated data and a set of programs to access that data.The object oriented DBMS is one of the type of dbms in which information is stored in the form of objects.

Q.23  What are the types of SQL Commands?

Ans: 
  • Data Definition Language (DDL)
  • Data Query Language (DQL)
  • Data Control Language (DCL)
  • Data Manipulation Language (DML)

Q.24  What is an attribute?

Ans:  An entity is represented by a set of attributes.Attributes are descriptive properties possessed by each member of an entity set.There are different types of attributes.
  • Simple
  • Derived
  • Composite
  • Single-valued

Q.25  What is an active database?

Ans:  Active database is a database that includes active rules, mostly in the form of ECA rules(Event Condition rules).Active database systems enhance traditional database functionality with powerful rule processing cabalities, providing a uniform and efficient mechanism for database system applications.

Q.26  Define Self Join?

Ans:  Self join means joining one table with itself.The self join can be viewed as a join of two copies of the same table.


Q. 27 What is meant by embedded SQL?

Ans:  They are SQL statements that are embedded with in application program and are prepared during the program preparation process before the program is executed. After it is prepared, the statement itself does not change(although values of host variables specified within the statement might change).

Q.28  What is Functional Dependency?

Ans:  A Functional dependency is denoted by X Y between two sets of attributes X and Y that are subsets of R specifies a constraint on the possible tuple that can form a relation state r of R. The constraint is for any two tuples t1 and t2 in r if t1[X] = t2[X] then they have t1[Y] = t2[Y]. This means the value of X component of a tuple uniquely determines the value of component Y.

Q.29  What are the different phases of transaction?

Ans: The different phases of transaction are
  • Analysis phase
  • Redo Phase
  • Undo phase

Q.30  What the difference between UNION and UNIONALL?

Ans:  Union will remove the duplicate rows from the result set while Union all does’nt.

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Best Hostgator Coupon Code