13. What are Table and Field in SQL?
A table in SQL will have rows and columns organized. Field refer to number of columns and records refers to number of rows in a table
14. What are Joins in SQL?
A SQL join is used to combine rows from two or more tables with related columns between them
15. What are different types of JOINS in SQL?
- INNER JOIN or JOIN – It return rows where there is a matching values in both the tables.
- LEFT JOIN or LEFT OUTER JOIN – It returns all rows from left table and matched rows from right table. If no matching rows from right table, then it will return NULL values
- RIGHT JOIN or RIGHT OUTER JOIN – It returns all rows from right table and matched rows from left table. If no matching rows from left table, then it will return NULL values
- FULL JOIN or FULL OUTER JOIN – It will return all rows when there is a match in either of the table.
- SELF JOIN – It is when a table is joined to itself .
- CROSS JOIN or CARTESIAN JOIN – It will return Cartesian Product of sets of rows from the 2 joined table.
16. What are different types of Constraints in SQL?
Constraints are rules applied in database tables on how we perform various operation of data. Following are the types of Constraints:
- PRIMARY KEY – It uniquely identifies each row present in a table.