Top 26 SQL Interview Questions and Answers

Top 26 SQL Interview Questions and Answers
  1. What is SQL?

SQL means structured query language. It is a database language used for database creation, updating and deletion, fetching and modifying rows.

  1. When SQL appeared?

It appeared in the year 1974.

  1. What are the usages of SQL?

To execute queries against a database, retrieve data from a database, inserting records, updates records in a database, and deletes records from a database, to create new databases

  1. Which is the subset of SQL?
  • Data definition language (DDL)
  • Data manipulation language (DML)
  • Data control language (DCL)
  1. What is data definition language?

Data definition language (DDL) allows the user to CREATE, ALTER and DELETE database objects such as tables, view, sequence, etc.

  1. What is data manipulation language?

Data manipulation language is used to manipulate the data

  • Insert data into a database
  • Update data in the database
  • Delete data from the database
  1. What is data control language?

Data control language allows the user to control/grant access to the database. It includes two commands GRANT and revokes.

GRANT: to grant the specific user to perform a specific task.

REVOKE: to cancel previously denied or granted permissions.

 

  1. What are tables and fields in the database?

A table is a set of organized data. It has columns and rows. Columns can be categorized as vertical, and Rows are horizontal.Together they form a cell in which data can be filled

A table contains a specified number of a column called fields but can have any number of rows which is known as a record.

  1. What is a primary key?

A primary key is a great combination of fields which can uniquely specify a row. It is unique in nature.This is a unique key, and it is valued cannot be NULL.

  1. What is a foreign key?

A foreign key is associated with the primary key of another table. A relationship needs to be created between two tables by referencing foreign key with the primary key of another table. Thus primary key of other tables becomes foreign key for another table

  1. What is a unique key?

A Unique key means it uniquely identifies each record in the database. This provides uniqueness in the column or set of columns. The unique key can be null.

  1. What is the type of operators available in SQL?
  • Arithmetic operators
  • Logical operators
  • Comparison operator
  • Conditional operator
  1. What is an Index in SQL?

The index is used to increase the performance and help for faster retrieval of records from the table. An index also creates an entry for each value, and it is also faster to retrieve data and for performing search operations

  1. Which are the different types of indexes in SQL?

Three types of Indexes are:

  • Unique Index
  • Clustered Index
  • NonClustered Index
  1. State the difference between SQL and PL/SQL?

SQL is a language which helps to communicate with a relational database. It provides a way to define, manipulate and create databases.  PL/SQL is an advance version of SQL which is used to enhance the capabilities of SQL. It was developed by Oracle Corporation in the early 90’s. It adds procedural features of programming languages in SQL.

 

  1. What is view in SQL?

A view is a virtual table which contains a subset of data within a table. Views are not virtually present, and it takes lesser space to store. View can have data of more than one table, and it depends on the relationship between the tables.

  1. Which are the most commonly SQL joins?

Two commonly used SQL joins are INNER JOIN and  OUTER JOIN.

 

  1. What are the different types of joins in SQL?

Joins are used to merge two tables or retrieve data from tables. It depends on the relationship between tables.

  1. Following are the most commonly used joins in SQL:
  • Inner Join
  • Right Join
  • Left Join
  • Full Join
  1. What is Inner Join in SQL?

Inner join:

Inner join returns rows when there is at least one match of rows between the tables.

  1. What is Unique Index?

Unique Index does not have duplicate values in case if the column is unique indexed. A unique index can be applied automatically when the primary key is defined in any table.

  1. What is the difference between SQL, MySQL and SQL Server?

SQL or Structured Query Language is a language which is used to communicate with a relational database. It provides a way to define, manipulate and create databases. On the other hand, MySQL and Microsoft’s SQL Server both are relational database management systems that use SQL as their standard relational database language for performing operations.

 

  1. What is Right Join in SQL?

Right Join:

Right, join is used to return rows which are common between the tables. It returns all the rows from the right-hand side table even though there are no matches in the left-hand side table.

  1. What is Left Join in SQL?

Left Join:

A left join is used to retrieve rows which are common between the tables and all rows of the Left-hand side table. It returns all the rows from Left-hand side table even though there are no matches in the Right-hand side table.

  1. What is Full Join in SQL?

Full Join:

It returns rows when there are matching rows. It also shows all the rows from the left-hand side table and all the rows from the right-hand side table. It is like union of tables

  1. What is “TRIGGER” in SQL?

The trigger allows the user to execute a batch of SQL code whenever an insert, update or delete command is executed for a specific table. Triggers work on DML query. Triggers are special type of stored procedures that are defined to execute automatically in place or after data modifications.

This Post Has 41 Comments

  1. XEvil 6.0 automatically solve most kind of captchas,
    Including such type of captchas: ReCaptcha v.2, ReCaptcha v.3, Hotmail (Microsoft), Google, SolveMedia, BitcoinFaucet, Steam, +12000
    + hCaptcha, ReCaptcha Enterprise supported in new XEvil 6.0!

    1.) Fast, easy, precisionly
    XEvil is the fastest captcha killer in the world. Its has no solving limits, no threads number limits
    you can solve even 1.000.000.000 captchas per day and it will cost 0 (ZERO) USD! Just buy license for 59 USD and all!

    2.) Several APIs support
    XEvil supports more than 6 different, worldwide known API: 2captcha.com, anti-captcha (antigate), rucaptcha.com, DeathByCaptcha, etc.
    just send your captcha via HTTP request, as you can send into any of that service – and XEvil will solve your captcha!
    So, XEvil is compatible with hundreds of applications for SEO/SMM/password recovery/parsing/posting/clicking/cryptocurrency/etc.

    3.) Useful support and manuals
    After purchase, you got access to a private tech.support forum, Wiki, Skype/Telegram online support
    Developers will train XEvil to your type of captcha for FREE and very fast – just send them examples

    4.) How to get free trial use of XEvil full version?
    – Try to search in Google “Home of XEvil”
    – you will find IPs with opened port 80 of XEvil users (click on any IP to ensure)
    – try to send your captcha via 2captcha API ino one of that IPs
    – if you got BAD KEY error, just tru another IP
    – enjoy! 🙂
    – (its not work for hCaptcha!)

    WARNING: Free XEvil DEMO does NOT support ReCaptcha, hCaptcha and most other types of captcha!

    http://xrumersale.site/

  2. XEvil 6.0 automatically solve most kind of captchas,
    Including such type of captchas: ReCaptcha v.2, ReCaptcha v.3, Hotmail (Microsoft), Google, Solve Media, BitcoinFaucet, Steam, +12k
    + hCaptcha, ReCaptcha Enterprise supported in new XEvil 6.0!

    1.) Fast, easy, precisionly
    XEvil is the fastest captcha killer in the world. Its has no solving limits, no threads number limits
    you can solve even 1.000.000.000 captchas per day and it will cost 0 (ZERO) USD! Just buy license for 59 USD and all!

    2.) Several APIs support
    XEvil supports more than 6 different, worldwide known API: 2captcha.com, anti-captchas.com (antigate), rucaptcha.com, death-by-captcha, etc.
    just send your captcha via HTTP request, as you can send into any of that service – and XEvil will solve your captcha!
    So, XEvil is compatible with hundreds of applications for SEO/SMM/password recovery/parsing/posting/clicking/cryptocurrency/etc.

    3.) Useful support and manuals
    After purchase, you got access to a private tech.support forum, Wiki, Skype/Telegram online support
    Developers will train XEvil to your type of captcha for FREE and very fast – just send them examples

    4.) How to get free trial use of XEvil full version?
    – Try to search in Google “Home of XEvil”
    – you will find IPs with opened port 80 of XEvil users (click on any IP to ensure)
    – try to send your captcha via 2captcha API ino one of that IPs
    – if you got BAD KEY error, just tru another IP
    – enjoy! 🙂
    – (its not work for hCaptcha!)

    WARNING: Free XEvil DEMO does NOT support ReCaptcha, hCaptcha and most other types of captcha!

    http://xrumersale.site/

  3. [url=https://xn--72-6kcuxniij4a1i.xn--p1ai/]https://xn--72-6kcuxniij4a1i.xn--p1ai[/url]

  4. [url=https://bijuteriya-optom.ru/]https://bijuteriya-optom.ru/[/url]

  5. We agree with the technology assessment statement issued by the American Society of Clinical Oncology in 2005 that current information is insufficient to determine fully the effect of aromatase inhibitors on cardiovascular disease, especially coronary heart disease where to get nolvadex In recent years, the media has always reported that China is deep rooted The city is developing rapidly, and there is a tendency to catch up Anderson herbal medicine for premature ejaculation and erectile dysfunction with Silicon Valley, so Silicon Valley is always vigilant about the East

  6. Although the meta analysis did not use the results from the post crossover phase of the Ecochard 2000 trial, it should be noted that there was one live birth out of 12 randomised participants clomid side effects for men

  7. Nanomedicine applications in the treatment of breast cancer current state of the art dose clomid

Leave a Reply

Close Menu