Download SQL Interview Questions Part 1 graphic type that can be scaled to use with the Silhouette Cameo or Cricut. An SVG's size can be increased or decreased without a loss of quality. All of our downloads include an image, Silhouette file, and SVG file. It should be everything you need for your next project. Our SVG files can be used on adhesive vinyl, heat transfer and t-shirt vinyl, or any other cutting surface
SQL Interview Questions Part 1
1.) What is SQL?
SQL stands for structural query language and SQL was developed during 1970’s at IBM. SQL is standard database language for Relational Database Management System (RDBMS).
SQL language is used to perform database operations like insert, delete, update and modify database.
2.) What is a Database?
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.
Example: School Management Database, Bank Management Database.
3.) What is DBMS?
The database management system is a collection of programs that enables user to store, retrieve, update and delete information from a database.
4.) What is RDBMS?
Relational Database Management system (RDBMS) is a database management system (DBMS) that is based on the relational model.
Data from relational database can be accessed or reassembled in many different ways without having to reorganize the database tables. Data from relational database can be accessed using an API, Structured Query Language (SQL).
5.) What are the different type of SQL's statements?
SQL statements are broadly classified into three. They are
• DDL – Data Definition Language
• DML– Data Manipulation Language
• DCL– Data Control Language
6.) What is a Table in a database?
A table is a collection of records of a specific type. For example, employee table, salary table etc.
7.) What is a field in a database?
A field is an area within a record reserved for a specific piece of data.
Examples: Employee Name, Employee ID etc.
8.) What is a Record in a database?
A record is the collection of values / fields of a specific entity: i.e. an Employee, Salary etc.
9.) Define SQL Insert Statement?
SQL INSERT statement is used to add rows to a table. For a full row insert, SQL Query should start with “insert into “statement followed by table name and values command, followed by the values that need to be inserted into the table. The insert can be used in several ways:
• To insert a single complete row.
• To insert a single partial row.
10.) Define SQL Update Statement?
SQL Update is used to update data in a row or set of rows specified in the filter condition.
The basic format of an SQL UPDATE statement is, Update command followed by table to be updated and SET command followed by column names and their new values followed by filter condition that determines which rows should be updated.
11.) Define SQL Delete Statement?
SQL Delete is used to delete a row or set of rows specified in the filter condition.
The basic format of an SQL DELETE statement is, DELETE FROM command followed by table name followed by filter condition that determines which rows should be updated.
12.) What are wild cards used in database for Pattern Matching?
SQL Like operator is used for pattern matching. SQL 'Like' command takes more time to process.
So before using "like" operator, consider suggestions given below on when and where to use wild card search.
• Don't overuse wild cards. If another search operator will do, use it instead.
• When you do use wild cards, try not to use them at the beginning of the search pattern, unless absolutely necessary. Search patterns that begin with wild cards are the slowest to process.
• Pay careful attention to the placement of the wild card symbols. If they are misplaced, you might not return the data you intended.
13.) What is a join? Explain the different types of joins?
Join is a query, which retrieves related columns or rows from multiple tables.
• Right Join: Return all rows from the right table, even if there are no matches in the left table.
• Equi Join: Joining two tables by equating two common columns.
• Non-Equi Join: Joining two tables by equating two common columns.
• Outer Join: Joining two tables in such a way that query can also retrieve rows that do not have corresponding join value in the other table.
• Left Join: Return all rows from the left table, even if there are no matches in the right table.
• Full Join: Return rows when there is a match in one of the tables.
14.) What is Self-Join?
Self-join is query used to join a table to itself. Aliases should be used for the same table comparison.
15.) What is Cross Join?
Cross Join will return all records where each row from the first table is combined with each row from the second table.
16.) What is a view?
The views are virtual tables. Unlike tables that contain data, views simply contain queries that dynamically retrieve data when used.
17.) What is a materialized view?
Materialized views are also a view but are disk based. Materialized views get updates on specific duration, based upon the interval specified in the query definition. We can index materialized view.
18.) What are the advantages and disadvantages of views in a database?
The advantages and disadvantages are,
Advantages:
• Views don't store data in a physical location.
• The view can be used to hide some of the columns from the table.
• Views can provide Access Restriction, since data insertion, update and deletion is not possible with the view.
Disadvantages:
• When a table is dropped, associated view become irrelevant.
• Since the view is created when a query requesting data from view is triggered, it’s a bit slow.
• When views are created for large tables, it occupies more memory.
19.) What is normalization?
Normalization is the process of minimizing redundancy and dependency by organizing fields and table of a database.
The main aim of Normalization is to add, delete or modify field that can be made in a single table.
20.) What is Denormalization?
Denormalization is a technique used to access the data from higher to lower normal forms of database.
It is also process of introducing redundancy into a table by incorporating data from the related tables.
21.) What are the different type of normalization?
In database design, we start with one single table, with all possible columns. A lot of redundant data would be present since it’s a single table.
The process of removing the redundant data, by splitting up the table in a well-defined fashion is called normalization.
• First Normal Form (1NF): A relation is said to be in first normal form if and only if all underlying domains contain atomic values only. After 1NF, we can still have redundant data.
• Second Normal Form (2NF): A relation is said to be in 2NF if and only if it is in 1NF and every non key attribute is fully dependent on the primary key. After 2NF, we can still have redundant data.
• Third Normal Form (3NF): A relation is said to be in 3NF, if and only if it is in 2NF and every non key attribute is non-transitively dependent on the primary key.
22.) What is a "primary key"?
• A PRIMARY INDEX or PRIMARY KEY is something which comes mainly from database theory. From its behavior is almost the same as an UNIQUE INDEX, i.e. there may only be one of each value in this column.
• Primary Key is a type of a constraint enforcing uniqueness and data integrity for each row of a table. All columns participating in a primary key constraint must possess the NOT NULL property.
23.) What is a unique key?
• A Unique key constraint uniquely identified each record in the database. This provides uniqueness for the column or set of columns.
• A Primary key constraint has automatic unique constraint defined on it. But not, in the case of Unique Key.
• There can be many unique constraint defined per table, but only one Primary key constraint defined per table.
24.) What is a foreign key?
A foreign key is one table which can be related to the primary key of another table. Relationship needs to be created between two tables by referencing foreign key with the primary key of another table.
25.) What is a Composite Key?
A Composite primary key is a type of candidate key, which represents a set of columns whose values uniquely identify every row in a table.
For example: if "Employee_ID" and "Employee Name" in a table is combined to uniquely identify a row it’s called a Composite Key.
26.) What is a Composite Primary Key?
A Composite primary key is a set of columns whose values uniquely identify every row in a table.
What it means is that, a table which contains composite primary key will be indexed based on the columns specified in the primary key. This key will be referred in Foreign Key tables.
For example: if the combined effect of columns, "Employee_ID" and "Employee Name" in a table is required to uniquely identify a row, it’s called a Composite Primary Key. In this case, both the columns will be represented as primary key.
27.) What is an Index?
An index is performance tuning method of allowing faster retrieval of records from the table. An index creates an entry for each value and it will be faster to retrieve data.
28.) What are all the different types of indexes?
There are three types of indexes, they are
• Unique Index: This indexing does not allow the field to have duplicate values if the column is unique indexed. Unique index can be applied automatically when primary key is defined.
• Clustered Index: This type of index reorders the physical order of the table and search based on the key values. Each table can have only one clustered index.
• NonClustered Index: NonClustered Index does not alter the physical order of the table and maintains logical order of data. Each table can have 999 non clustered indexes.
--------------------------------
1.) What is SQL?
SQL stands for structural query language and SQL was developed during 1970’s at IBM. SQL is standard database language for Relational Database Management System (RDBMS).
SQL language is used to perform database operations like insert, delete, update and modify database.
2.) What is a Database?
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.
Example: School Management Database, Bank Management Database.
3.) What is DBMS?
The database management system is a collection of programs that enables user to store, retrieve, update and delete information from a database.
4.) What is RDBMS?
Relational Database Management system (RDBMS) is a database management system (DBMS) that is based on the relational model.
Data from relational database can be accessed or reassembled in many different ways without having to reorganize the database tables. Data from relational database can be accessed using an API, Structured Query Language (SQL).
5.) What are the different type of SQL's statements?
SQL statements are broadly classified into three. They are
• DDL – Data Definition Language
• DML– Data Manipulation Language
• DCL– Data Control Language
6.) What is a Table in a database?
A table is a collection of records of a specific type. For example, employee table, salary table etc.
7.) What is a field in a database?
A field is an area within a record reserved for a specific piece of data.
Examples: Employee Name, Employee ID etc.
8.) What is a Record in a database?
A record is the collection of values / fields of a specific entity: i.e. an Employee, Salary etc.
9.) Define SQL Insert Statement?
SQL INSERT statement is used to add rows to a table. For a full row insert, SQL Query should start with “insert into “statement followed by table name and values command, followed by the values that need to be inserted into the table. The insert can be used in several ways:
• To insert a single complete row.
• To insert a single partial row.
10.) Define SQL Update Statement?
SQL Update is used to update data in a row or set of rows specified in the filter condition.
The basic format of an SQL UPDATE statement is, Update command followed by table to be updated and SET command followed by column names and their new values followed by filter condition that determines which rows should be updated.
11.) Define SQL Delete Statement?
SQL Delete is used to delete a row or set of rows specified in the filter condition.
The basic format of an SQL DELETE statement is, DELETE FROM command followed by table name followed by filter condition that determines which rows should be updated.
12.) What are wild cards used in database for Pattern Matching?
SQL Like operator is used for pattern matching. SQL 'Like' command takes more time to process.
So before using "like" operator, consider suggestions given below on when and where to use wild card search.
• Don't overuse wild cards. If another search operator will do, use it instead.
• When you do use wild cards, try not to use them at the beginning of the search pattern, unless absolutely necessary. Search patterns that begin with wild cards are the slowest to process.
• Pay careful attention to the placement of the wild card symbols. If they are misplaced, you might not return the data you intended.
13.) What is a join? Explain the different types of joins?
Join is a query, which retrieves related columns or rows from multiple tables.
• Right Join: Return all rows from the right table, even if there are no matches in the left table.
• Equi Join: Joining two tables by equating two common columns.
• Non-Equi Join: Joining two tables by equating two common columns.
• Outer Join: Joining two tables in such a way that query can also retrieve rows that do not have corresponding join value in the other table.
• Left Join: Return all rows from the left table, even if there are no matches in the right table.
• Full Join: Return rows when there is a match in one of the tables.
14.) What is Self-Join?
Self-join is query used to join a table to itself. Aliases should be used for the same table comparison.
15.) What is Cross Join?
Cross Join will return all records where each row from the first table is combined with each row from the second table.
16.) What is a view?
The views are virtual tables. Unlike tables that contain data, views simply contain queries that dynamically retrieve data when used.
17.) What is a materialized view?
Materialized views are also a view but are disk based. Materialized views get updates on specific duration, based upon the interval specified in the query definition. We can index materialized view.
18.) What are the advantages and disadvantages of views in a database?
The advantages and disadvantages are,
Advantages:
• Views don't store data in a physical location.
• The view can be used to hide some of the columns from the table.
• Views can provide Access Restriction, since data insertion, update and deletion is not possible with the view.
Disadvantages:
• When a table is dropped, associated view become irrelevant.
• Since the view is created when a query requesting data from view is triggered, it’s a bit slow.
• When views are created for large tables, it occupies more memory.
19.) What is normalization?
Normalization is the process of minimizing redundancy and dependency by organizing fields and table of a database.
The main aim of Normalization is to add, delete or modify field that can be made in a single table.
20.) What is Denormalization?
Denormalization is a technique used to access the data from higher to lower normal forms of database.
It is also process of introducing redundancy into a table by incorporating data from the related tables.
21.) What are the different type of normalization?
In database design, we start with one single table, with all possible columns. A lot of redundant data would be present since it’s a single table.
The process of removing the redundant data, by splitting up the table in a well-defined fashion is called normalization.
• First Normal Form (1NF): A relation is said to be in first normal form if and only if all underlying domains contain atomic values only. After 1NF, we can still have redundant data.
• Second Normal Form (2NF): A relation is said to be in 2NF if and only if it is in 1NF and every non key attribute is fully dependent on the primary key. After 2NF, we can still have redundant data.
• Third Normal Form (3NF): A relation is said to be in 3NF, if and only if it is in 2NF and every non key attribute is non-transitively dependent on the primary key.
22.) What is a "primary key"?
• A PRIMARY INDEX or PRIMARY KEY is something which comes mainly from database theory. From its behavior is almost the same as an UNIQUE INDEX, i.e. there may only be one of each value in this column.
• Primary Key is a type of a constraint enforcing uniqueness and data integrity for each row of a table. All columns participating in a primary key constraint must possess the NOT NULL property.
23.) What is a unique key?
• A Unique key constraint uniquely identified each record in the database. This provides uniqueness for the column or set of columns.
• A Primary key constraint has automatic unique constraint defined on it. But not, in the case of Unique Key.
• There can be many unique constraint defined per table, but only one Primary key constraint defined per table.
24.) What is a foreign key?
A foreign key is one table which can be related to the primary key of another table. Relationship needs to be created between two tables by referencing foreign key with the primary key of another table.
25.) What is a Composite Key?
A Composite primary key is a type of candidate key, which represents a set of columns whose values uniquely identify every row in a table.
For example: if "Employee_ID" and "Employee Name" in a table is combined to uniquely identify a row it’s called a Composite Key.
26.) What is a Composite Primary Key?
A Composite primary key is a set of columns whose values uniquely identify every row in a table.
What it means is that, a table which contains composite primary key will be indexed based on the columns specified in the primary key. This key will be referred in Foreign Key tables.
For example: if the combined effect of columns, "Employee_ID" and "Employee Name" in a table is required to uniquely identify a row, it’s called a Composite Primary Key. In this case, both the columns will be represented as primary key.
27.) What is an Index?
An index is performance tuning method of allowing faster retrieval of records from the table. An index creates an entry for each value and it will be faster to retrieve data.
28.) What are all the different types of indexes?
There are three types of indexes, they are
• Unique Index: This indexing does not allow the field to have duplicate values if the column is unique indexed. Unique index can be applied automatically when primary key is defined.
• Clustered Index: This type of index reorders the physical order of the table and search based on the key values. Each table can have only one clustered index.
• NonClustered Index: NonClustered Index does not alter the physical order of the table and maintains logical order of data. Each table can have 999 non clustered indexes.
--------------------------------
Prepared by: V. Raga Malika
Download SQL Interview Questions Part 1 All SVG file downloads also come bundled with DXF, PNG, and EPS file formats. All designs come with a small business commercial license. These SVG cut files are great for use with Silhouette Cameo or Cricut and other Machine Tools.