Sql Server Interviews Questions
What are the categories in Sql command ?
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. 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?
What is primary key ?
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 ?
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?
What are the Common types of constraints which we used in sql?
What are the Benefits of Stored Procedures?
How many type of triggers?
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:
Post a Comment