SQL Top 50 Interview Q & A

download SQL Top 50 Interview Q & A

of 6

Transcript of SQL Top 50 Interview Q & A

  • 8/17/2019 SQL Top 50 Interview Q & A

    1/6

     

    Author By SUNIL NAIDU, ANKYZ KALLEPALLY (Bangalore) SQL SERVER 

    SQL SERVER INTERVIEW QUESTION ND NSWERS 2015

    1. Define RDBMS? 

    RDBMS stands for relational database management system which is used to store

    the data into collection of tables. It also gives the relational operators to manipulate

    the data which is stored into the table.

    2. What is SQL? 

    SQL stands for structured query language which is used to perform the CURD

    (Create, Update, Retrieve, Delete) operation of the data from the database.

    3. What are the tables?

    Table is a set of the data which is organized into the rows and columns. Row is

    categorized as horizontal whereas column are as vertical.

    4. Give the name of different types of join? 

    There are many kinds of join which are –  1. Inner Join

    2. Full Join

    3. Left Join

    4. Right Join

    5. Explain primary key? 

    It is combination of fields which uniquely specify a row and it have no NULL value.

    6. Define Normalization? 

    It is a process of minimizing the dependency and redundancy by maintaining tables

    and fields.

    7. What is index?

    It is method used for performance tuning which allow faster retrieval of record

    from the table.

    8. What are the different types of index?

    There are 3 types of indexes i.e.

    1. Unique Index2. Clustered Index

    3. Nonclustered Index

    9. Explain query? 

    Query is a code which is written to get the result according to the condition specified

    in the code.

  • 8/17/2019 SQL Top 50 Interview Q & A

    2/6

     

    Author By SUNIL NAIDU, ANKYZ KALLEPALLY (Bangalore) SQL SERVER 

    SQL SERVER INTERVIEW QUESTION ND NSWERS 2015

    10. What are the types of subquery?

    There are two types of subquery i.e.

    1. Correlated subquery

    2. Non correlated subquery

    11. What SQL clause is used to restrict the rows returned by a query? 

    WHERE clause is used to restrict the rows returned by a query.

    12. What is the use of DELETE command? 

    DELETE command is used to delete the data from the table according to the

    condition specified in WHERE clause.

    13. What is the use of TRUNCATE Command?

    TRUNCATE command also deletes the data but delete all the rows which isspecified in the table.

    14. Explain constraint?

    It can be used to specify the limit on the data type of table. It is specified when we

    create and alter the table.

    15. What is composite key?

    It is a primary key that consists of more than one field that uniquely identifies a

    record.

    16. What command is used to permanently remove a record from a database table?

    DROP command is used to permanently remove a record from a database table.

    17. What is the use of Wildcards? 

    Wildcards is used to perform pattern matches.

    18. What is cluster Index? 

    It is used for easy retrieval of data from the database by altering the way that the

    records are stored. Database sorts out rows by the column which is set to beclustered index.

  • 8/17/2019 SQL Top 50 Interview Q & A

    3/6

     

    Author By SUNIL NAIDU, ANKYZ KALLEPALLY (Bangalore) SQL SERVER 

    SQL SERVER INTERVIEW QUESTION ND NSWERS 2015

    19. What are all types of user defined functions?

    There are three types of user defined functions –  

    1. Inline Table valued functions.

    2. Multi statement valued functions

    3. Scalar Functions.

    20. Explain Collation? 

    It is a set of rules that is used to determine that how character data can be

    compared and sorted.

    21. What is the full form of OLTP? 

    OLTP stands for online transaction processing which can be used for data entry and

    easy retrieval processing of data.

    22. What are the different types of collation sensitivity?There are many types of collation sensitivity that are –  

    1. Width Sensitivity

    2. Accent Sensitivity

    3. Case Sensitivity

    4. Kana Sensitivity

    23. What are the disadvantages of Stored procedure? 

    The disadvantages are –  

    1. Executed only in database

    2. Utilizes more memory in the database server.

    24. Explain Clause?

    It is used to limit the result set by giving condition to the query.

    25. What is the use of minus operator? 

    MINUS operator returns the rows from the first query but not from the second

    query. Matching records of first and second query and other rows from the first

    query will be displayed as a result set.

    26. What is the use of INTERSECT operator?

    It is used to return the rows which are returned by both the queries.

    27. What is the use of scalar functions?

    Scalar function is used to return a single value based on the input value.

  • 8/17/2019 SQL Top 50 Interview Q & A

    4/6

     

    Author By SUNIL NAIDU, ANKYZ KALLEPALLY (Bangalore) SQL SERVER 

    SQL SERVER INTERVIEW QUESTION ND NSWERS 2015

    28. What is the use of aggregate function?

    It is used to evaluate the mathematical calculation and returns single value.

    29. Which keyword is used to select unique records from a table? 

    DISTINCT keyword is used to select unique records from a table.

    30. What is use of LIKE operator? 

    LIKE operator is used in query for pattern matching.

    31. Explain DeNormalization?

    It is used to access the data from higher to lower forms of database and it also

    introduce the redundancy by incorporating data from the related tables.

    32. What is 1NF? 

    1NF means first normal form which removes all duplicate columns from the table.

    33. Give the name of the different types of SQL’s statements? 

    There are three types of SQL statements –  

    1. Data Manipulation Language

    2. Data Definition Language

    3. Data Control Language

    34. Define Data definition language?

    It defines the structure which holds the data like Create, Alter, Drop etc.

    35. What are the Advantages of SQL ?

    The advantages of SQL are –  

    1. Easy to learn

    2. Can perform very complex and sophisticated database operations.

    3. Every major DBMS supports SQL etc.

    36. What is the use of Inner join? 

    Inner join is used to combine the rows from two tables and create a result set

    containing only such records that are present in both the tables based on the joiningcondition.

    37. How can we transpose a table using SQL?

    We can transpose a table by using CASE statement or DECODE statement.

  • 8/17/2019 SQL Top 50 Interview Q & A

    5/6

     

    Author By SUNIL NAIDU, ANKYZ KALLEPALLY (Bangalore) SQL SERVER 

    SQL SERVER INTERVIEW QUESTION ND NSWERS 2015

    38. Explain Data Control language?

    DCL is used to control the access to the database by using GRANT and REVOKE

    command.

    39. Which types of operators are available in SQL?

    There are three types of operators in SQL –  

    1. Comparison operator

    2. Arithmetic operators

    3. Logical operators

    40. What is the use of getDate() command?

    getDate() command is used to return current timestamp.

    41. What is the use of REVOKE command? 

    REVOKE command is used to cancel previously denied or granted permissions.

    42. What are the levels of constraints? 

    There are the two levels of constraints –  

    1. column level constraint

    2. table level constraint

    43. What are the advantages of stored procedures?

    There are many advantages of stored procedures –  

    1. Reduce the network traffic and latency

    2. Boost application performance.

    3. Provide better security to data.

    4. Promote code reuse.

    5. Encapsulate the logic

    6. change stored procedure code without affecting clients etc.

    44. Explain the properties of relational tables?

    Relational tables have six properties:

    1. Each row is unique.

    2. Values are atomic.

    3. The sequence of columns is insignificant.

    4. Each column must have a unique name.

    5. The sequence of rows is insignificant.

    6. Column values are of the same kind.

    45. What is the full form of ACID?

    ACID stands for Atomicity, Consistency, Isolation and Durability.

  • 8/17/2019 SQL Top 50 Interview Q & A

    6/6

     

    Author By SUNIL NAIDU, ANKYZ KALLEPALLY (Bangalore) SQL SERVER 

    SQL SERVER INTERVIEW QUESTION ND NSWERS 2015

    46. What is the use of GRANT command? 

    GRANT command is used to grant specific user to perform specific task.

    47. What is SQL Aliases?

    SQL aliases are used to temporarily rename a table or a column heading.

    48. What is the use of SELECT DISTINCT statement?

    SELECT DISTINCT statement is used to return only different values.

    49. What is the use of SQL check constraint?

    CHECK constraint limits the value range that can be placed in a column.

    50. What is the use of SQL IN operator?

    SQL IN operator is used to allow you to specify the multiple values in a WHERE

    clause.