SQL Interview Questions
SQL stands for Structured Query Language , and it is used to communicate with the Database. SQL initially was invented in 1970. It is a database language used for creation, deletion, fetching rows and modifying rows from a database etc,. 
Standard SQL Commands are Select.
Database is nothing but an organized form of data for easy access, storing, retrieval and managing of data. This is also known as structured form of data which can be accessed in many ways. Where databases are more complex they are often developed using formal design and modeling techniques.
Example: Hospital Management System Database, School Management Database, Bank Management Database, etc,.
DBMS stands for Database Management System. DBMS is a system software responsible for the creation, retrieval, updation and management of the database. It ensures that our data is consistent, organized and is easily accessible by serving as an interface between the database and its end users or application softwares.
It appeared in 1974. SQL is one of the often used languages for maintaining the relational database. SQL. In 1986 SQL become the standard of American National Standards Institute (ANSI) and ISO(International Organization for Standardization) in 1987.
SQL is responsible for maintaining the relational data and the data structures present in the database.

* To execute queries against a database
* To retrieve data from a database
* To inserts records in a database
* To updates 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
* To perform complex operations on the database.
DBMSs are software applications that help you build and maintain databases. RDBMS is a subset of DBMS, and it is a database management system based on the relational model of the DBMS.
* It is more scalable and secure than Oracle
* It widely supports procedural extensions
* Oracle too is secure and scalable but not up to the extent SQL
* The support to the same is limited
Constraints are used to set the rules for all records in the table. If any constraints get violated then it can abort the action that caused it.
Constraints are defined while creating the database itself with the CREATE TABLE statement or even after the table is created once with the ALTER TABLE statement.
There are 5 major constraints are used in SQL, such as
NOT NULL : That indicates that the column must have some value and cannot be left NULL.
UNIQUE : This constraint is used to ensure that each row and column has a unique value and no value is being repeated in any other row or column.
PRIMARY KEY : This constraint is used in association with NOT NULL and UNIQUE constraints such as on one or the combination of more than one column to identify the particular record with a unique identity.
FOREIGN KEY : It is used to ensure the referential integrity of data in the table. It matches the value in one table with another using the PRIMARY KEY.
CHECK : It ensures whether the value in columns fulfills the specified condition.
This is a keyword used to query data from more tables based on the relationship between the fields of the tables. Keys play a major role when JOINs are used.
There are various types of join which can be used to retrieve data and it depends on the relationship between tables.
Inner Join : Inner join return rows when there is at least one match of rows between the tables.
Right Join : Right join return rows which are common between the tables and all rows of Right hand side table. Simply, it returns all the rows from the right hand side table even though there are no matches in the left hand side table.
Left Join : Left join return rows which are common between the tables and all rows of Left hand side table. Simply, it returns all the rows from Left hand side table even though there are no matches in the Right hand side table.
Full Join : Full join return rows when there are matching rows in any one of the tables. This means, it returns all the rows from the left hand side table and all the rows from the right hand side table.