Haryana Engineering College , Engineering Institutes in Haryana, Engineering Colleges in Haryana, Haryana Engineering Colleges , Engineering Colleges in Haryana, Haryana Engineering Colleges, Engineering Institutes in Haryana, Haryana Engineering Institutes, List of Engineering Colleges in Haryana, Haryana Engineering Colleges List, List of Engineering Institutes in Haryana, Haryana Engineering Institutes List , Haryana Engineering College Exams in India , Ranking of haryana engineering colleges , Engineering Colleges in Haryana Institutes in India

Monday, August 18, 2008

Sql Server Interviews Questions








What are the categories in Sql command ?



  • Data Definition language (DDL)
  • Data Manipulation Language (DML)
  • Transaction Control Commands

What is Data Defination Language ?

Its include creating ,droping and altering table commands . The Data Definition Language (DDL) is used to create and destroy databases and database objects

CREATE TABLE is used in creation of table.
Syntax :CREATE TABLE tablename (colname col definition, colname col definition);

ALTER TABLE: If you want to modify a table definition we can use this command This command is used to alter column definition in table.

Syntax : ALTER TABLE tablename MODIFY (Column definition);

DROP TABLE: This command is used to remove an existing table permanently from database. Syntax : DROP TABLE tablename;


What is data manipulation language ?

The Data Manipulation Language (DML) is used to retrieve, insert and modify database information.

INSERT: This command is used to insert rows into the table. SYNTAX: INSERT INTO tablename VALUES (value,value,….);

SELECT: This is used to select values or data from table SYNTAX: SELECT column name1, column name2, …. FROM tablename;

If we want to select all column values from a table then SQL command use is SELECT * from tablename ;

DELETE: In order to delete rows from a table we use this command SYNTAX: DELETE FROM tablename WHERE condition;

UPDATE: This SQL command is used to modify the values in an existing table. SYNTAX: UPDATE tablename SET columnname = value, columnname = value,….. WHERE condition;


What is Transaction controls statement ?

ROLLBACK – This SQL command is used to undo the current transaction SYNTAX: ROLLBACK;

SAVEPOINT: This is used to identify a point in a transaction to which we can later rollback.

SYNTAX: SAVEPOINT savepoint_identifier;

COMMIT: This command is used to make all changes permanent in database and also marks the end of transaction. SYNTAX: COMMIT;

What are the two level of Constraints takes palce in sql?

  • Column Level
  • Table Level

What is primary key ?

  • A column or a group of columns can define primary key.
  • In primary value is not appear more than once in the table.
  • Cannot have NULL value in it.

What is REFERENTIAL INTEGRITY ?

The table on which the column or a combination of columns is defined by this constraint is called the foreign key is called child table. When this constraint is defined a relation is defined between this table which has the foreign key and a table that has the primary key in relationship with this. This is called as referenced key. The table which has the primary key or in other words the referenced key is called as parent table.

What is View ?

  • A View is nothing but a window of an existing table.
  • In other words it is a logical representation that is created from one or existing base table. After creation of view it can be used just as a base table. That is one can query or select values of data’s from views and it also possible to update a view.
  • Views are created by suing CREATE VIEW command in SQL
  • SYNTAX: CREATE VIEW viewname AS SELECT statement

Whats do you mean by composite key?

When multiple fields are used as a primary key, they are called a composite key.

What is foreign key?

  • A foreign key is a field (or fields) that points to the primary key of another table.
  • The purpose of the foreign key is to ensure referential integrity of the data.
  • In other words, only values that are supposed to appear in the database are permitted.

What are the Common types of constraints which we used in sql?

  • NOT NULL
  • UNIQUE
  • CHECK
  • Primary Key
  • Foreign Key

What are the Benefits of Stored Procedures?

  • Precompiled execution
  • Reduced client/server traffic
  • Efficient reuse of code and programming abstraction
  • Enhanced security controls.

How many type of triggers?

  • After Trigger
  • Multiple After Triggers
  • Instead Of Triggers
  • Mixing Triggers Type

What is normalization?

Normalization is the process of organizing it into tables in such a way that the results of using the database are always unambiguous and as intended. . Normalization may have the effect of duplicating data within the database and often results in the creation of additional tables. The normal forms of relational database theory provide criteria for determining a table's degree of vulnerability to logical inconsistencies and anomalies.

What is Boyce-Codd normal form ?

A table is in Boyce-Codd normal form (BCNF) if and only if, for every one of its non-trivial functional dependencies X ? Y, X is a superkey—that is, X is either a candidate key or a superset thereof.

What is Domain/key normal form?

Domain/key normal form (or DKNF) requires that a table not be subject to any constraints other than domain constraints and key constraints.

What is self join?

self-join to simplify nested SQL queries where the inner and outer queries reference the same table . These joins allow you to retrieve related records from the same table. The most common case where you'd use a self-join is when you have a table that references itself, such as the employees table shown below.



0 comments:

About This Blog

Lorem Ipsum

Back to TOP