AJAX Interview Questions

1) What are the usages of SQL?

  • To execute queries against a database
  • To retrieve data from a database
  • To inserts records in a database
  • To update records in a database
  • To delete records from a database
  • To create new databases
  • To create new tables in a database
  • To create views in a database

2) Does SQL support programming?

  • No, SQL doesn't have loop or Conditional statement. It is used like commanding language to access databases.

3) What are the subsets of SQL?

  • Data definition language (DDL) - Data definition language(DDL) allows you to CREATE, ALTER and DELETE database objects such as schema, tables, view, sequence etc.

  • Data manipulation language (DML) - Data manipulation language makes user able to access and manipulate data. It is used to perform following operations.
    • Insert data into database
    • Retrieve data from the database
    • Update data in the database
    • Delete data from the database
  • Data control language (DCL) - Data control language allows you to control access to the database. It includes two commands GRANT and REVOKE.
    • GRANT: to grant specific user to perform specific task.
    • REVOKE: to cancel previously denied or granted permissions.

4) What are the type of operators available in SQL?

  • Arithmetic operators
  • Logical operators
  • Comparison operator

5) What is the difference between clustered and non clustered index in SQL?

There are mainly two types of indexes in SQL, Clustered index and non clustered index. The differences between these two indexes is very important from SQL performance perspective.

  • One table can have only one clustered index but it can have many non clustered index. (approximately 250).
  • Clustered index determines how data is stored physically in table. Actually clustered index stores data in cluster, related data is stored together so it makes simple to retrieve data.
  • Reading from a clustered index is much faster than reading from non clustered index from the same table.
  • clustered index sort and store data rows in the table or view based on their key value, while non cluster have a structure separate from the data row.

6) What is the SQL query to display current date?

  • There is a built in function in SQL called GetDate() which is used to return current timestamp.

7) Which types of join is used in SQL widely?

  • The knowledge of JOIN is very necessary for an interviewee. Mostly used join is INNER JOIN and (left/right) OUTER JOIN.

8) What is "TRIGGER" in SQL?

  • Trigger allows you to execute a batch of SQL code when an insert, update or delete command is executed against a specific table.
  • Actually triggers are special type of stored procedures that are defined to execute automatically in place or after data modifications.

9) What is self join and what is the requirement of self join?

  • Self join is often very useful to convert a hierarchical structure to a flat structure. It is used to join a table to itself as like if that is the second table.

10) What is the difference between DELETE and TRUNCATE statement in SQL?

  • The main differences between SQL DELETE and TRUNCATE statements are given below:
    • DELETE is a DML command. TRUNCATE is a DDL command.
    • We can use WHERE clause in DELETE command. We cannot use WHERE clause with TRUNCATE
    • DELETE statement is used to delete a row from a table TRUNCATE statement is used to remove all the rows from a table.
    • DELETE is slower than TRUNCATE statement. TRUNCATE statement is faster than DELETE statement.
    • You can rollback data after using DELETE statement. It is not possible to rollback after using TRUNCATE statement.

Comments

Popular posts from this blog

Basic Terminology

What is normalization in DBMS?

Object oriented programming concepts in PHP