{"id":1615,"date":"2023-12-13T06:14:22","date_gmt":"2023-12-13T06:14:22","guid":{"rendered":"https:\/\/www.kaashivinfotech.com\/blog\/?p=1615"},"modified":"2026-06-06T12:26:24","modified_gmt":"2026-06-06T12:26:24","slug":"experience-sql-interview-questions","status":"publish","type":"post","link":"https:\/\/www.kaashivinfotech.com\/blog\/experience-sql-interview-questions\/","title":{"rendered":"Experience SQL Interview Questions &#038; Answers"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"1615\" class=\"elementor elementor-1615\">\n\t\t\t\t<div class=\"elementor-element elementor-element-9e2b6f5 e-flex e-con-boxed e-con e-parent\" data-id=\"9e2b6f5\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-608ebd6 elementor-widget elementor-widget-text-editor\" data-id=\"608ebd6\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>SQL, or Structured Query Language, is a powerful and standardized programming language designed for managing and manipulating relational databases. It serves as a means to interact with databases, enabling users to create, retrieve, update, and delete data. SQL is widely used in various industries for tasks ranging from simple data queries to complex database management and administration.<\/p><p>Databases, organized in a tabular format, store information that can be easily accessed and managed using SQL. SQL provides a set of commands that allow users to interact with the database, making it a fundamental skill for anyone working with data or involved in software development.<\/p><p>These questions cover some advanced\u00a0 aspects of SQL concepts.it is used to crack the sql interviews<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-7832f5d e-flex e-con-boxed e-con e-parent\" data-id=\"7832f5d\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-7729662 elementor-widget elementor-widget-text-editor\" data-id=\"7729662\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Experienced SQL Interview Questions<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-9f9c2bc e-flex e-con-boxed e-con e-parent\" data-id=\"9f9c2bc\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-6461e7d elementor-widget elementor-widget-accordion\" data-id=\"6461e7d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"accordion.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-accordion\">\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-1051\" class=\"elementor-tab-title\" data-tab=\"1\" role=\"button\" aria-controls=\"elementor-tab-content-1051\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">1. Fetch in Employee-table Date-of-Joing before the jan-01-2015 employee details ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-1051\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"1\" role=\"region\" aria-labelledby=\"elementor-tab-title-1051\"><p>This query will fetch the details of employees who joined before January 1st, 2015 from the &#8220;Employee-table&#8221;:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">SELECT * FROM Employee-table WHERE Date-of-Joining &lt; &#039;2015-01-01&#039;;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><p>\u00a0<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-1052\" class=\"elementor-tab-title\" data-tab=\"2\" role=\"button\" aria-controls=\"elementor-tab-content-1052\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">2. Explain the SQL Query for orderby ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-1052\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"2\" role=\"region\" aria-labelledby=\"elementor-tab-title-1052\"><p>The\u00a0<strong>ORDER BY<\/strong>\u00a0clause in SQL is used to sort the results of a query in ascending or descending order based on one or more columns. The basic syntax for an\u00a0<strong>ORDER BY<\/strong>\u00a0clause is:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">SELECT column1, column2, ...<br\/>FROM table_name<br\/>ORDER BY column1 [ASC|DESC], column2 [ASC|DESC], ...;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ol><li><strong> SELECT :<\/strong><\/li><\/ol><ul><li>specifies the columns to be returned in the result set.<\/li><\/ul><ol start=\"2\"><li><strong> FROM :<\/strong><\/li><\/ol><ul><li>specifies the table to be queried.<\/li><\/ul><ol start=\"3\"><li><strong> ORDER BY :<\/strong><\/li><\/ol><ul><li>sorts the results based on one or more columns. The ASC keyword is used to sort the results in ascending order (which is the default), and the DESC keyword is used to sort the results in descending order.<\/li><\/ul><p>For example, to sort the results of a query on the\u00a0<strong>employees<\/strong>\u00a0table by last name in ascending order and first name in descending order:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">SELECT last_name, first_name<br\/>FROM employees<br\/>ORDER BY last_name ASC, first_name DESC;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-1053\" class=\"elementor-tab-title\" data-tab=\"3\" role=\"button\" aria-controls=\"elementor-tab-content-1053\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">3. What is subqueries ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-1053\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"3\" role=\"region\" aria-labelledby=\"elementor-tab-title-1053\"><ul><li>Subqueries in SQL are queries nested within another query. They are used to return data that will be used in the main query as a condition to further restrict the data to be retrieved. Subqueries can be used in various parts of a SQL statement, such as the SELECT clause, FROM clause, WHERE clause, and HAVING clause.<\/li><\/ul><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">SELECT column_name(s)<br\/>FROM table_name<br\/>WHERE column_name operator <br\/>(SELECT column_name FROM table_name WHERE condition);<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-1054\" class=\"elementor-tab-title\" data-tab=\"4\" role=\"button\" aria-controls=\"elementor-tab-content-1054\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">4. Explain the Grant ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-1054\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"4\" role=\"region\" aria-labelledby=\"elementor-tab-title-1054\"><p>The\u00a0<strong>GRANT<\/strong>\u00a0statement in SQL is used to grant privileges (e.g. SELECT, INSERT, UPDATE, DELETE, EXECUTE) to a user or role on a specific database object (e.g. table, view, stored procedure, etc.). The basic syntax for the\u00a0<strong>GRANT<\/strong>\u00a0statement is:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">GRANT privilege [, privilege] ... ON object_type object_name TO user [WITH GRANT OPTION];<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ol><li><strong> privilege :<\/strong><\/li><\/ol><ul><li>specifies the privilege(s) to be granted.<\/li><\/ul><ol start=\"2\"><li><strong> object_type :<\/strong><\/li><\/ol><ul><li>specifies the type of object being granted access to (e.g. TABLE, VIEW, PROCEDURE, etc.).<\/li><\/ul><ol start=\"3\"><li><strong> object_name :<\/strong><\/li><\/ol><ul><li>specifies the name of the object being granted access to.<\/li><\/ul><ol start=\"4\"><li><strong> user :<\/strong><\/li><\/ol><ul><li>specifies the name of the user or role to be granted access.<\/li><\/ul><ol start=\"5\"><li><strong> WITH GRANT OPTION :<\/strong><\/li><\/ol><ul><li>allows the recipient of the grant to pass on the privilege to other users.<\/li><\/ul><p>For example, to grant the SELECT privilege on a table named\u00a0<strong>employees<\/strong>\u00a0to a user named\u00a0<strong>jane<\/strong>:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">GRANT SELECT ON employees TO jane;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><p>Note that the exact syntax and available privileges may vary depending on the specific database management system being used (e.g. MySQL, Microsoft SQL Server, Oracle, etc.).<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-1055\" class=\"elementor-tab-title\" data-tab=\"5\" role=\"button\" aria-controls=\"elementor-tab-content-1055\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">5. Explain the Revocke ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-1055\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"5\" role=\"region\" aria-labelledby=\"elementor-tab-title-1055\"><p>The\u00a0<strong>REVOKE<\/strong>\u00a0statement in SQL is used to revoke privileges that have been granted to a user or role on a specific database object (e.g. table, view, stored procedure, etc.). The basic syntax for the\u00a0<strong>REVOKE<\/strong>\u00a0statement is:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">REVOKE privilege [, privilege] ... ON object_type object_name FROM user;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ol><li><strong> privilege :<\/strong><\/li><\/ol><ul><li>specifies the privilege(s) to be revoked.<\/li><\/ul><ol start=\"2\"><li><strong> object_type :<\/strong><\/li><\/ol><ul><li>specifies the type of object being revoked access from (e.g. TABLE, VIEW, PROCEDURE, etc.).<\/li><\/ul><ol start=\"3\"><li><strong> object_name :<\/strong><\/li><\/ol><ul><li>specifies the name of the object being revoked access from.<\/li><\/ul><ol start=\"4\"><li><strong> user :<\/strong><\/li><\/ol><ul><li>specifies the name of the user or role to have access revoked.<\/li><\/ul><p>For example, to revoke the SELECT privilege on a table named\u00a0<strong>employees<\/strong>\u00a0from a user named\u00a0<strong>jane<\/strong>:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">REVOKE SELECT ON employees FROM jane;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><p>Note that the exact syntax may vary depending on the specific database management system being used (e.g. MySQL, Microsoft SQL Server, Oracle, etc.).<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-1056\" class=\"elementor-tab-title\" data-tab=\"6\" role=\"button\" aria-controls=\"elementor-tab-content-1056\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">6. Explain the self join ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-1056\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"6\" role=\"region\" aria-labelledby=\"elementor-tab-title-1056\"><ul><li>A self join is a type of join operation in SQL where a table is joined with itself. In other words, it&#8217;s a way of combining data from a single table based on a relationship between two columns in that same table.<\/li><\/ul><ul><li>To perform a self join, you need to use an alias to differentiate between the two instances of the same table. The syntax for a self join is as follows:<\/li><\/ul><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">SELECT t1.column_name, t2.column_name<br\/>FROM table_name t1<br\/>JOIN table_name t2 ON t1.column_name = t2.column_name<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ul><li>In this example, table_name is the name of the table being joined, and column_name is the column being used to join the table to itself.<\/li><\/ul><ul><li>For instance, consider a table named employees with columns employee_id, employee_name, and manager_id. In this table, the manager_id column contains the ID of the employee&#8217;s manager. You can use a self join to find the names of all employees and their corresponding managers:<\/li><\/ul><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">SELECT e.employee_name, m.employee_name AS manager_name<br\/>FROM employees e<br\/>JOIN employees m ON e.manager_id = m.employee_id;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ul><li>In this query, the employees table is joined to itself based on the relationship between the manager_id and employee_id columns. The e and m aliases are used to differentiate between the two instances of the employees table. The result is a list of employee names and their corresponding manager names.<\/li><\/ul><p><br \/><br \/><\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-1057\" class=\"elementor-tab-title\" data-tab=\"7\" role=\"button\" aria-controls=\"elementor-tab-content-1057\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">7. Explain the cross join ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-1057\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"7\" role=\"region\" aria-labelledby=\"elementor-tab-title-1057\"><p>A cross join (also known as a cartesian product) in SQL is a join operation in which every row from the first table is paired with every row from the second table. The result of a cross join is a table that has a number of rows equal to the number of rows in the first table multiplied by the number of rows in the second table.<\/p><p>The basic syntax for a cross join is:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">SELECT column1, column2, ...<br\/>FROM table1<br\/>CROSS JOIN table2;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ol><li><strong> SELECT :<\/strong><\/li><\/ol><ul><li>specifies the columns to be returned in the result set.<\/li><\/ul><ol start=\"2\"><li><strong> FROM :<\/strong><\/li><\/ol><ul><li>specifies the first table to be queried.<\/li><\/ul><ol start=\"3\"><li><strong> CROSS JOIN :<\/strong><\/li><\/ol><ul><li>specifies the type of join to be performed.<\/li><\/ul><p>For example, to find all possible combinations of colors and sizes for a product:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">SELECT colors.color_name, sizes.size_name<br\/>FROM colors<br\/>CROSS JOIN sizes;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><p>Note that cross joins are often used in combination with the\u00a0<strong>WHERE<\/strong>\u00a0clause to filter the results to only include meaningful combinations of rows.<\/p><p><br \/><br \/><\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-1058\" class=\"elementor-tab-title\" data-tab=\"8\" role=\"button\" aria-controls=\"elementor-tab-content-1058\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">8. Explain the unique key ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-1058\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"8\" role=\"region\" aria-labelledby=\"elementor-tab-title-1058\"><p>In SQL, a unique key is a constraint that ensures that the values in a specific column or set of columns of a table are unique and non-duplicate. A unique key can be defined at the time the table is created, or it can be added later using an\u00a0<strong>ALTER TABLE<\/strong>\u00a0statement.<\/p><p>The basic syntax for defining a unique key constraint during table creation is:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">CREATE TABLE table_name (<br\/>   column1 data_type constraint_name UNIQUE,<br\/>   column2 data_type,<br\/>   ...<br\/>);<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ol><li><strong> CREATE TABLE :<\/strong><\/li><\/ol><ul><li>specifies that a new table is being created.<\/li><\/ul><ol start=\"2\"><li><strong> table_name :<\/strong><\/li><\/ol><ul><li>specifies the name of the new table.<\/li><\/ul><ol start=\"3\"><li><strong> column1 :<\/strong><\/li><\/ol><ul><li>specifies the name of the first column in the table.<\/li><\/ul><ol start=\"4\"><li><strong> data_type :<\/strong><\/li><\/ol><ul><li>specifies the data type of the column.<\/li><\/ul><ol start=\"5\"><li><strong> constraint_name :<\/strong><\/li><\/ol><ul><li>specifies the name of the constraint being defined.<\/li><\/ul><ol start=\"6\"><li><strong> UNIQUE :<\/strong><\/li><\/ol><ul><li>specifies that the values in the column must be unique.<\/li><\/ul><p>For example, to create a table named\u00a0<strong>employees<\/strong>\u00a0with a unique key constraint on the\u00a0<strong>employee_id<\/strong>\u00a0column:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">CREATE TABLE employees (<br\/>   employee_id INT PRIMARY KEY,<br\/>   last_name VARCHAR(30),<br\/>   first_name VARCHAR(30),<br\/>   ...<br\/>);<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><p>Note that in this example, the unique key constraint is also defined as the primary key of the table. In SQL, a primary key is a special type of unique key that is used to uniquely identify each row in the table.<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-1059\" class=\"elementor-tab-title\" data-tab=\"9\" role=\"button\" aria-controls=\"elementor-tab-content-1059\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">9. Normalization types and explain each 1,2,3,4 ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-1059\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"9\" role=\"region\" aria-labelledby=\"elementor-tab-title-1059\"><p>Normalization is the process of organizing data in a database to minimize redundancy and improve data integrity. There are several normalization levels, each with its own set of rules. The most commonly used normalization levels are 1st, 2nd, 3rd, and 4th normal forms.<\/p><ol><li><strong> First Normal Form (1NF):<\/strong><\/li><\/ol><ul><li>Each table has a primary key.<\/li><li>Each column has a unique name.<\/li><li>Each column has a single value, and values in a column are of the same type.<\/li><li>Columns are atomic, meaning that a column value cannot be further decomposed.<\/li><\/ul><ol start=\"2\"><li><strong> Second Normal Form (2NF):<\/strong><\/li><\/ol><ul><li>Meets all the requirements of 1NF.<\/li><li>Each non-key column is functionally dependent on the primary key.<\/li><li>This means that each non-key column is dependent on the entire primary key and not just a part of it.<\/li><\/ul><ol start=\"3\"><li><strong> Third Normal Form (3NF) :<\/strong><\/li><\/ol><ul><li>Meets all the requirements of 2NF.<\/li><li>There are no transitive functional dependencies between non-key columns.<\/li><li>Transitive functional dependencies occur when a column depends on another column, which depends on a third column.<\/li><\/ul><ol start=\"4\"><li><strong> Fourth Normal Form (4NF):<\/strong><\/li><\/ol><ul><li>Meets all the requirements of 3NF.<\/li><li>There are no multi-valued dependencies.<\/li><li>Multi-valued dependencies occur when a column depends on another column, but not on the primary key.<\/li><\/ul><p>These normalization rules help to ensure that data is stored in an organized, consistent, and efficient manner. The goal of normalization is to minimize data redundancy and eliminate the potential for inconsistent data. It is important to note that normalization is not always necessary or appropriate for all database designs, and sometimes a trade-off must be made between data normalization and performance.<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10510\" class=\"elementor-tab-title\" data-tab=\"10\" role=\"button\" aria-controls=\"elementor-tab-content-10510\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">10. Explain the Stored procedure syntax ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10510\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"10\" role=\"region\" aria-labelledby=\"elementor-tab-title-10510\"><p>The syntax for creating a stored procedure in SQL can vary between different SQL implementations, such as MySQL, Oracle, Microsoft SQL Server, and others. However, the basic structure is as follows:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">CREATE PROCEDURE procedure_name (<br\/>    [IN | OUT | INOUT] parameter1 data_type,<br\/>    [IN | OUT | INOUT] parameter2 data_type,<br\/>    ...<br\/>)<br\/>BEGIN<br\/>    -- Declare variables here, if needed<br\/>    <br\/>    -- Execute SQL statements here<br\/>    <br\/>    -- Return values, if needed<br\/>END;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ol><li><strong> CREATE PROCEDURE :<\/strong><\/li><\/ol><ul><li>Specifies that you want to create a stored procedure.<\/li><\/ul><ol start=\"2\"><li><strong> procedure_name :<\/strong><\/li><\/ol><ul><li>Specifies the name of the stored procedure.<\/li><\/ul><ol start=\"3\"><li><strong> [IN | OUT | INOUT] :<\/strong><\/li><\/ol><ul><li>Specifies the type of parameter.\u00a0<strong>IN<\/strong>\u00a0parameters are used to pass values into the stored procedure.\u00a0<strong>OUT<\/strong>\u00a0parameters are used to return values from the stored procedure.\u00a0<strong>INOUT<\/strong>\u00a0parameters are used to pass values into the stored procedure and to return values.<\/li><\/ul><ol start=\"4\"><li><strong> parameter1, parameter2, &#8230; :<\/strong><\/li><\/ol><ul><li>Specifies the parameters to pass into the stored procedure.<\/li><\/ul><ol start=\"5\"><li><strong> data_type :<\/strong><\/li><\/ol><ul><li>Specifies the data type of the parameter.<\/li><\/ul><ol start=\"6\"><li><strong> BEGIN :<\/strong><\/li><\/ol><ul><li>Specifies the start of the stored procedure&#8217;s code.<\/li><\/ul><ol start=\"7\"><li><strong> END :<\/strong><\/li><\/ol><ul><li>Specifies the end of the stored procedure&#8217;s code.<\/li><\/ul><p>Here is an example that creates a stored procedure that returns the number of employees in the\u00a0<strong>employees<\/strong>\u00a0table:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">CREATE PROCEDURE count_employees()<br\/>BEGIN<br\/>    SELECT COUNT(*) AS count<br\/>    FROM employees;<br\/>END;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><p>In this example, the stored procedure is named\u00a0<strong>count_employees<\/strong>\u00a0and takes no parameters. The stored procedure uses the SELECT statement to count the number of rows in the\u00a0<strong>employees<\/strong>\u00a0table and returns the result with the AS keyword.<\/p><p>Note that the specific syntax for creating stored procedures can vary between different SQL implementations, such as MySQL, Oracle, Microsoft SQL Server, and others.<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10511\" class=\"elementor-tab-title\" data-tab=\"11\" role=\"button\" aria-controls=\"elementor-tab-content-10511\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">11. Explain the CONSTRAINTS ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10511\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"11\" role=\"region\" aria-labelledby=\"elementor-tab-title-10511\"><p>Constraints in SQL are rules that enforce data integrity and consistency within a database. There are several types of constraints in SQL:<\/p><ol><li><strong> NOT NULL constraint :<\/strong><\/li><\/ol><ul><li>Ensures that a column cannot contain a null value.<\/li><\/ul><ol start=\"2\"><li><strong> UNIQUE constraint :<\/strong><\/li><\/ol><ul><li>Ensures that all values in a column are unique and no duplicate values are allowed.<\/li><\/ul><ol start=\"3\"><li><strong> PRIMARY KEY constraint :<\/strong><\/li><\/ol><ul><li>A combination of a\u00a0<strong>NOT NULL<\/strong>\u00a0and\u00a0<strong>UNIQUE<\/strong>\u00a0constraint, ensuring that each row in a table has a unique and non-null value.<\/li><\/ul><ol start=\"4\"><li><strong> FOREIGN KEY constraint :<\/strong><\/li><\/ol><ul><li>Refers to the primary key of another table, ensuring that the values in a column match the values in the referenced table.<\/li><\/ul><ol start=\"5\"><li><strong> CHECK constraint :<\/strong><\/li><\/ol><ul><li>Limits the values that can be entered into a column based on a specified condition.<\/li><\/ul><ol start=\"6\"><li><strong> DEFAULT constraint :<\/strong><\/li><\/ol><ul><li>Sets a default value for a column if no value is specified when inserting a new row.<\/li><\/ul><p>The syntax for adding constraints to a table depends on the SQL implementation you are using. Here is an example for adding a\u00a0<strong>NOT NULL<\/strong>\u00a0constraint to the\u00a0<strong>first_name<\/strong>\u00a0column of the\u00a0<strong>employees<\/strong>\u00a0table in SQL:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">ALTER TABLE employees<br\/>ADD CONSTRAINT first_name_nn NOT NULL (first_name);<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><p>This example adds a\u00a0<strong>NOT NULL<\/strong>\u00a0constraint to the\u00a0<strong>first_name<\/strong>\u00a0column and specifies the constraint name as\u00a0<strong>first_name_nn<\/strong>.<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10512\" class=\"elementor-tab-title\" data-tab=\"12\" role=\"button\" aria-controls=\"elementor-tab-content-10512\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">12. Explain the Check constraints ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10512\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"12\" role=\"region\" aria-labelledby=\"elementor-tab-title-10512\"><p><strong>CHECK<\/strong>\u00a0constraints in SQL are used to limit the values that can be inserted into a column based on a specified condition. The constraint defines a logical expression that must evaluate to\u00a0<strong>TRUE<\/strong>\u00a0for a new record to be inserted into the table.<\/p><p>Here&#8217;s the basic syntax for adding a\u00a0<strong>CHECK<\/strong>\u00a0constraint to a column in SQL:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">ALTER TABLE table_name<br\/>ADD CONSTRAINT constraint_name CHECK (condition);<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ol><li><strong> ALTER TABLE :<\/strong><\/li><\/ol><ul><li>Changes the structure of an existing table.<\/li><\/ul><ol start=\"2\"><li><strong> table_name :<\/strong><\/li><\/ol><ul><li>The name of the table to which you want to add the constraint.<\/li><\/ul><ol start=\"3\"><li><strong> ADD CONSTRAINT :<\/strong><\/li><\/ol><ul><li>Adds a constraint to the table.<\/li><\/ul><ol start=\"4\"><li><strong> constraint_name :<\/strong><\/li><\/ol><ul><li>A name you assign to the constraint.<\/li><\/ul><ol start=\"5\"><li><strong> CHECK :<\/strong><\/li><\/ol><ul><li>Specifies that you are adding a CHECK constraint.<\/li><\/ul><ol start=\"6\"><li><strong> condition :<\/strong><\/li><\/ol><ul><li>A logical expression that must evaluate to TRUE for a new record to be inserted into the table.<\/li><\/ul><p>Here&#8217;s an example that adds a\u00a0<strong>CHECK<\/strong>\u00a0constraint to the\u00a0<strong>age<\/strong>\u00a0column of the\u00a0<strong>employees<\/strong>\u00a0table to ensure that the age is between 18 and 65:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">ALTER TABLE employees<br\/>ADD CONSTRAINT age_ck CHECK (age &gt;= 18 AND age &lt;= 65);<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><p>In this example, a\u00a0<strong>CHECK<\/strong>\u00a0constraint is added to the\u00a0<strong>age<\/strong>\u00a0column of the\u00a0<strong>employees<\/strong>\u00a0table. The constraint checks that the value of the\u00a0<strong>age<\/strong>\u00a0column is greater than or equal to 18 and less than or equal to 65 for each new record. If a record is inserted with an\u00a0<strong>age<\/strong>\u00a0value outside of this range, the insert operation will fail and an error message will be returned.<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10513\" class=\"elementor-tab-title\" data-tab=\"13\" role=\"button\" aria-controls=\"elementor-tab-content-10513\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">13. What is Hash ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10513\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"13\" role=\"region\" aria-labelledby=\"elementor-tab-title-10513\"><p>A hash in SQL is a mathematical function that transforms data of arbitrary length into a fixed length representation, called a hash value or digest. It&#8217;s often used in database management systems for indexing, searching and comparison purposes, as hash values are quicker to compare than the original data.<\/p><p>There are several types of hash functions used in SQL:<\/p><ul><li>1. MD5 &#8211; 128-bit hash value<\/li><li>2. SHA-1 &#8211; 160-bit hash value<\/li><li>3. SHA-2 (224, 256, 384 or 512 bit)<\/li><li>4. SHA-3 (224, 256, 384 or 512 bit)<\/li><\/ul><p>Hash values are usually generated for passwords for security purposes, as storing the actual password in a database is not recommended for security reasons. Instead, a hash of the password is stored, and when a user logs in, the system hashes the entered password and compares it to the stored hash.<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10514\" class=\"elementor-tab-title\" data-tab=\"14\" role=\"button\" aria-controls=\"elementor-tab-content-10514\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">14. Explain the Indexing ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10514\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"14\" role=\"region\" aria-labelledby=\"elementor-tab-title-10514\"><p>Indexing in SQL is a technique used to speed up the retrieval of data from a database. An index is a data structure that provides a mapping between values in a specific column (or columns) of a table and their location on disk. This enables the database management system to quickly find and retrieve the rows that match a specific search criteria, without having to scan the entire table.<\/p><p>Here are some benefits of using indexing in SQL:<\/p><ol><li><strong> Faster query performance :<\/strong><\/li><\/ol><ul><li>Indexes speed up the process of searching for data, which can significantly improve the performance of SELECT, UPDATE and DELETE statements.<\/li><\/ul><ol start=\"2\"><li><strong> Improved query optimization :<\/strong><\/li><\/ol><ul><li>The database management system can use indexes to optimize the execution plan for complex queries.<\/li><\/ul><ol start=\"3\"><li><strong> Better scalability :<\/strong><\/li><\/ol><ul><li>Indexes can help to reduce the load on the database, making it more scalable as the size of the data grows.<\/li><\/ul><p>To create an index in SQL, you can use the CREATE INDEX statement, specifying the table name, the name of the index, and the columns that you want to index:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">CREATE INDEX index_name<br\/>ON table_name (column1, column2, ...);<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><p>\u00a0<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10515\" class=\"elementor-tab-title\" data-tab=\"15\" role=\"button\" aria-controls=\"elementor-tab-content-10515\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">15. Difference between clustered and non clustered index ?   <\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10515\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"15\" role=\"region\" aria-labelledby=\"elementor-tab-title-10515\"><p>In SQL, a clustered index and a non-clustered index are two types of indexes that you can create on a table to speed up data retrieval operations.<\/p><ol><li><strong> Clustered Index :<\/strong><\/li><\/ol><ul><li>A clustered index determines the physical order of data in a table. In other words, the data in the table is stored on disk in the same order as the clustered index. There can be only one clustered index per table, as the data can only be physically ordered in one way. Clustered indexes are often used on columns that have a high cardinality, meaning that the values in the column are unique and evenly distributed.<\/li><\/ul><ol start=\"2\"><li><strong> Non-Clustered Index :<\/strong><\/li><\/ol><ul><li>A non-clustered index does not affect the physical order of data in the table. Instead, it provides a mapping between the values in a specific column and the location of the corresponding data on disk. Non-clustered indexes are stored separately from the data in the table, and can be used to speed up the execution of SELECT, UPDATE and DELETE statements that involve the indexed columns. You can create multiple non-clustered indexes on a single table.<\/li><\/ul><p>frequently used in search conditions, is unique, and has a high cardinality. You should consider creating a non-clustered index on a column that is frequently used in search conditions, but is not unique, or has a low cardinality.<\/p><p>It is important to note that while indexes can significantly improve the performance of data retrieval, they can also have a negative impact on the performance of data modification operations, such as INSERT, UPDATE and DELETE, as the indexes have to be updated every time the data in the indexed columns is changed. Therefore, it is important to carefully consider the columns that you want to index, and to regularly evaluate and adjust your indexing strategy as your data and workload evolves.<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10516\" class=\"elementor-tab-title\" data-tab=\"16\" role=\"button\" aria-controls=\"elementor-tab-content-10516\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">16. Explain the Sql injection ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10516\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"16\" role=\"region\" aria-labelledby=\"elementor-tab-title-10516\"><p>SQL injection is a type of security vulnerability that occurs in database-driven web applications. It allows attackers to inject malicious code into SQL statements that are executed by the database management system. The malicious code can be used to steal sensitive information, modify or delete data, or gain unauthorized access to the system.<\/p><p>SQL injection attacks take advantage of insecure coding practices that allow user input to be directly included in SQL statements without proper validation or escaping.<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">SELECT * FROM users WHERE id = &#039;&#039; OR 1=1 --&#039;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><p>This SQL statement will always return all rows from the users table, bypassing the intended restriction on the id column.<\/p><p>To prevent SQL injection, it is important to follow secure coding practices, such as:<\/p><ul><li>Using parameterized queries (also known as prepared statements) that separate the SQL statement from the data that is passed to it.<\/li><li>Validating and escaping user input to ensure that it does not contain any malicious code.<\/li><li>Using stored procedures and views, which can enforce a more secure and consistent coding style.<\/li><li>Keeping the database and web application software up-to-date with the latest security patches.<\/li><\/ul><p>By following these best practices, you can reduce the risk of SQL injection and ensure the security of your database-driven web applications.<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10517\" class=\"elementor-tab-title\" data-tab=\"17\" role=\"button\" aria-controls=\"elementor-tab-content-10517\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\"> 17. Can we do union with 3 columns in one table and 4 columns in another table ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10517\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"17\" role=\"region\" aria-labelledby=\"elementor-tab-title-10517\"><ul><li>No, in SQL, the number of columns in each SELECT statement in a UNION operation must be the same. In other words, you cannot perform a UNION operation between a table with 3 columns and another table with 4 columns.<\/li><li>To perform a UNION operation, you need to make sure that each SELECT statement in the UNION operation has the same number of columns, with the same data types, in the same order.<\/li><li>For example, if you have two tables,\u00a0<strong>table1<\/strong>\u00a0with 3 columns and\u00a0<strong>table2<\/strong>\u00a0with 4 columns, you can perform a UNION operation by adding a constant value or a NULL value to the SELECT statement from\u00a0<strong>table2<\/strong>\u00a0to match the number of columns in\u00a0<strong>table1:<\/strong><\/li><\/ul><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">SELECT column1, column2, column3 FROM table1<br\/>UNION<br\/>SELECT column1, column2, column3, NULL as column4 FROM table2;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ul><li>This will return a result set that has the same number of columns as the SELECT statement from\u00a0<strong>table1<\/strong>, with the additional column in\u00a0<strong>table2<\/strong>\u00a0being filled with NULL values.<\/li><\/ul><p><br \/><br \/><\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10518\" class=\"elementor-tab-title\" data-tab=\"18\" role=\"button\" aria-controls=\"elementor-tab-content-10518\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">18. Difference between DBMS and RDBMS ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10518\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"18\" role=\"region\" aria-labelledby=\"elementor-tab-title-10518\"><p>DBMS (Database Management System) and RDBMS (Relational Database Management System) are both types of database management systems, but they have some differences:<\/p><ol><li><strong> Structure :<\/strong><\/li><\/ol><ul><li>?A DBMS can have any type of data structure, including hierarchical, network, and object-oriented, while an RDBMS is specifically designed to use a relational data structure, where data is organized into tables with rows and columns.<\/li><\/ul><ol start=\"2\"><li><strong> Relationships :<\/strong><\/li><\/ol><ul><li>?An RDBMS can define and enforce relationships between tables using keys, such as primary and foreign keys, while a DBMS may not have this capability.<\/li><\/ul><ol start=\"3\"><li><strong> Query Language :<\/strong><\/li><\/ol><ul><li>?An RDBMS uses SQL (Structured Query Language) as its primary query language, while a DBMS may use a different query language.<\/li><\/ul><ol start=\"4\"><li><strong> Data Integrity :<\/strong><\/li><\/ol><ul><li>?An RDBMS provides features for enforcing data integrity, such as constraints, triggers, and stored procedures, while a DBMS may not have these features.<\/li><\/ul><ol start=\"5\"><li><strong> Scalability :<\/strong><\/li><\/ol><ul><li>RDBMSs are typically more scalable than other types of DBMSs, as they can handle larger amounts of data and support multiple users with concurrent access.<\/li><\/ul><p>In summary, an RDBMS is a type of DBMS that uses a relational data structure, supports SQL, and provides features for enforcing data integrity and scalability.<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10519\" class=\"elementor-tab-title\" data-tab=\"19\" role=\"button\" aria-controls=\"elementor-tab-content-10519\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">19. Query for Top 5 salary from employee table ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10519\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"19\" role=\"region\" aria-labelledby=\"elementor-tab-title-10519\"><p>To retrieve the top 5 salaries from an employee table in SQL, you can use the following query:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-markup code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-markup code-embed-code\">SELECT TOP 5 salary<br\/>FROM employee<br\/>ORDER BY salary DESC;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ul><li>This query uses the\u00a0<strong>TOP<\/strong>\u00a0clause to limit the number of rows returned to 5. The\u00a0<strong>ORDER BY<\/strong>\u00a0clause sorts the rows in descending order based on the\u00a0<strong>salary<\/strong>\u00a0column, so that the highest salaries are returned first. The\u00a0<strong>DESC<\/strong>\u00a0keyword specifies a descending sort order.<\/li><\/ul><p><br \/><br \/><\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10520\" class=\"elementor-tab-title\" data-tab=\"20\" role=\"button\" aria-controls=\"elementor-tab-content-10520\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">20. Query for Second highest salary ?   <\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10520\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"20\" role=\"region\" aria-labelledby=\"elementor-tab-title-10520\"><p>To retrieve the second highest salary in SQL, you can use the following query:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">SELECT MAX(salary)<br\/>FROM employee<br\/>WHERE salary NOT IN (SELECT MAX(salary) FROM employee);<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ul><li>This query uses the\u00a0<strong>MAX<\/strong>\u00a0function to find the highest salary in the\u00a0<strong>employee<\/strong>\u00a0table, and then uses a subquery to exclude that salary from the result set. The subquery finds the highest salary in the\u00a0<strong>employee<\/strong>\u00a0table, and the outer query returns the maximum salary that is not equal to the highest salary. This gives you the second highest salary.<\/li><\/ul><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10521\" class=\"elementor-tab-title\" data-tab=\"21\" role=\"button\" aria-controls=\"elementor-tab-content-10521\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">21. Create Store Procedure for employee table ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10521\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"21\" role=\"region\" aria-labelledby=\"elementor-tab-title-10521\"><p>To create a stored procedure in SQL for an\u00a0<strong>employee<\/strong>\u00a0table, you can use the following syntax:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">CREATE PROCEDURE get_employee_info (@employee_id INT)<br\/>AS<br\/>BEGIN<br\/>    SELECT *<br\/>    FROM employee<br\/>    WHERE employee_id = @employee_id;<br\/>END;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><p>This stored procedure takes a single input parameter,\u00a0<strong>@employee_id<\/strong>, and returns all columns from the\u00a0<strong>employee<\/strong>\u00a0table for the specified employee ID. To execute the stored procedure, you can use the following syntax:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">EXEC get_employee_info @employee_id = 123;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><p>Replace\u00a0<strong>123<\/strong>\u00a0with the actual employee ID you want to retrieve. This will execute the stored procedure and return the results.<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10522\" class=\"elementor-tab-title\" data-tab=\"22\" role=\"button\" aria-controls=\"elementor-tab-content-10522\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">22. Explain the Group by syntax ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10522\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"22\" role=\"region\" aria-labelledby=\"elementor-tab-title-10522\"><p>The\u00a0<strong>GROUP BY<\/strong>\u00a0clause in SQL is used to group rows that have the same values in specified columns into summary rows, like &#8220;find the number of customers in each city&#8221;.<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">SELECT column1, aggregate_function(column2)<br\/>FROM table_name<br\/>GROUP BY column1;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ul><li><strong>column1, column2, &#8230;<\/strong>\u00a0are the columns that you want to retrieve from the\u00a0<strong>table_name.<\/strong><\/li><li><strong>table_name<\/strong>\u00a0is the name of the table that you want to retrieve data from.<\/li><li><strong>ORDER BY column1 [ASC|DESC]<\/strong>\u00a0sorts the result set in ascending order (<strong>ASC<\/strong>) or descending order (<strong>DESC<\/strong>) based on the values in\u00a0<strong>column1.<\/strong><\/li><li><strong>column2 [ASC|DESC]<\/strong>\u00a0sorts the result set based on the values in\u00a0<strong>column2<\/strong>, either in ascending order (<strong>ASC<\/strong>) or descending order (<strong>DESC<\/strong>), if the values in\u00a0<strong>column1<\/strong>\u00a0are the same.<\/li><\/ul><p>Here is an example of using the\u00a0<strong>ORDER BY<\/strong>\u00a0clause to sort the\u00a0<strong>employees<\/strong>\u00a0in the employee table by their salaries in descending order:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">SELECT first_name, last_name, salary<br\/>FROM employee<br\/>ORDER BY salary DESC;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><p>This query selects the\u00a0<strong>first_name, last_name,<\/strong>\u00a0and\u00a0<strong>salary<\/strong>\u00a0columns from the\u00a0<strong>employee<\/strong>\u00a0table, and sorts the results by the\u00a0<strong>salary<\/strong>\u00a0column in descending order. The\u00a0<strong>DESC<\/strong>\u00a0keyword specifies a descending sort order. The query returns the employees sorted by their salaries, with the highest salaries first.<\/p><p>Here is the syntax for using the\u00a0<strong>GROUP BY<\/strong>\u00a0clause in SQL:<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10523\" class=\"elementor-tab-title\" data-tab=\"23\" role=\"button\" aria-controls=\"elementor-tab-content-10523\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">23. CRUD operations with stored procedure ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10523\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"23\" role=\"region\" aria-labelledby=\"elementor-tab-title-10523\"><ol><li><strong> Create :<\/strong><\/li><\/ol><ul><li>To create a new record in a table, you can use the following stored procedure:<\/li><\/ul><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">CREATE PROCEDURE sp_insert_employee (@first_name VARCHAR(50), @last_name VARCHAR(50), @salary INT)<br\/>AS<br\/>BEGIN<br\/>  INSERT INTO employee (first_name, last_name, salary)<br\/>  VALUES (@first_name, @last_name, @salary)<br\/>END;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ol start=\"2\"><li><strong> Read :<\/strong><\/li><\/ol><ul><li>To read data from a table, you can use the following stored procedure:<\/li><\/ul><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">CREATE PROCEDURE sp_select_employee (@id INT = NULL)<br\/>AS<br\/>BEGIN<br\/>  SELECT *<br\/>  FROM employee<br\/>  WHERE (@id IS NULL OR id = @id)<br\/>END;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ol start=\"3\"><li><strong> Update :<\/strong><\/li><\/ol><ul><li>To update an existing record in a table, you can use the following stored procedure:<\/li><\/ul><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">CREATE PROCEDURE sp_update_employee (@id INT, @first_name VARCHAR(50), @last_name VARCHAR(50), @salary INT)<br\/>AS<br\/>BEGIN<br\/>  UPDATE employee<br\/>  SET first_name = @first_name,<br\/>      last_name = @last_name,<br\/>      salary = @salary<br\/>  WHERE id = @id<br\/>END;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ol start=\"4\"><li><strong> Delete :<\/strong><\/li><\/ol><ul><li>To delete an existing record in a table, you can use the following stored procedure:<\/li><\/ul><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">CREATE PROCEDURE sp_delete_employee (@id INT)<br\/>AS<br\/>BEGIN<br\/>  DELETE FROM employee<br\/>  WHERE id = @id<br\/>END;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><p>These stored procedures can be executed by calling them and passing in the necessary parameters. For example:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">EXEC sp_insert_employee &#039;John&#039;, &#039;Doe&#039;, 50000;<br\/>EXEC sp_select_employee 1;<br\/>EXEC sp_update_employee 1, &#039;Jane&#039;, &#039;Doe&#039;, 60000;<br\/>EXEC sp_delete_employee 1;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10524\" class=\"elementor-tab-title\" data-tab=\"24\" role=\"button\" aria-controls=\"elementor-tab-content-10524\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">24. Explain the db first approach ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10524\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"24\" role=\"region\" aria-labelledby=\"elementor-tab-title-10524\"><ul><li>The &#8220;database-first&#8221; approach is a software development process where the database design is created before the development of the application. In this approach, the database design is created using a database management system (DBMS) such as SQL Server, Oracle, or MySQL. The database design typically includes tables, columns, relationships, constraints, and other database objects.<\/li><li>Once the database design is complete, the application can be developed to interact with the database. This may involve creating entities, data access layers, and other components to interact with the database. The application is then typically tested against the database to ensure that it works as expected.<\/li><li>The database-first approach can be useful in situations where the data structure is well-understood and well-defined, and the database is a critical component of the application. This approach can also be useful in situations where the database design is complex, and it is necessary to have a detailed understanding of the data structure before developing the application.<\/li><li>However, the database-first approach can also have some drawbacks. For example, it can be difficult to make changes to the database design once the application has been developed, and the application may become tightly coupled to the database, making it difficult to change the database or use a different database management system in the future.<\/li><\/ul><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10525\" class=\"elementor-tab-title\" data-tab=\"25\" role=\"button\" aria-controls=\"elementor-tab-content-10525\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">25. Swap two numbres ?   <\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10525\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"25\" role=\"region\" aria-labelledby=\"elementor-tab-title-10525\"><ul><li>While it&#8217;s not very common to swap two numbers in SQL (as SQL is mainly used for database queries and updates), it is possible to do so using SQL variables and mathematical operations. Here&#8217;s an example of swapping two numbers using SQL:<\/li><\/ul><ul><li>Suppose we have two variables, @num1 and @num2, that contain the values we want to swap. We can swap these values by using a third variable, @temp, to temporarily hold one of the values during the swap.<\/li><\/ul><p>The SQL code to swap @num1 and @num2 would look like this:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">DECLARE @num1 INT, @num2 INT, @temp INT;<br\/>SET @num1 = 10;<br\/>SET @num2 = 20;<br\/><br\/>-- print the original values<br\/>PRINT &#039;Before Swap:&#039;<br\/>PRINT &#039;num1 = &#039; + CAST(@num1 AS VARCHAR) + &#039;, num2 = &#039; + CAST(@num2 AS VARCHAR)<br\/><br\/>-- swap the values<br\/>SET @temp = @num1;<br\/>SET @num1 = @num2;<br\/>SET @num2 = @temp;<br\/><br\/>-- print the swapped values<br\/>PRINT &#039;After Swap:&#039;<br\/>PRINT &#039;num1 = &#039; + CAST(@num1 AS VARCHAR) + &#039;, num2 = &#039; + CAST(@num2 AS VARCHAR)<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">EXEC sp_insert_employee &#039;John&#039;, &#039;Doe&#039;, 50000;<br\/>EXEC sp_select_employee 1;<br\/>EXEC sp_update_employee 1, &#039;Jane&#039;, &#039;Doe&#039;, 60000;<br\/>EXEC sp_delete_employee 1;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ul><li>In this code, we first declare the variables @num1, @num2, and @temp as integers, and then assign the initial values 10 and 20 to @num1 and @num2, respectively.<\/li><li>We then use the PRINT statement to display the original values of @num1 and @num2.<\/li><li>Next, we swap the values of @num1 and @num2 by first assigning the value of @num1 to @temp, and then assigning the value of @num2 to @num1 and the value of @temp (which contains the original value of @num1) to @num2.<\/li><li>Finally, we use the PRINT statement again to display the swapped values of @num1 and @num2.<\/li><\/ul><p>When we run this code, the output would look like this:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">Before Swap:<br\/>num1 = 10, num2 = 20<br\/>After Swap:<br\/>num1 = 20, num2 = 10<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ul><li>As you can see, the values of @num1 and @num2 have been successfully swapped using SQL.<\/li><\/ul><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10526\" class=\"elementor-tab-title\" data-tab=\"26\" role=\"button\" aria-controls=\"elementor-tab-content-10526\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">26. Explain the Composite key ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10526\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"26\" role=\"region\" aria-labelledby=\"elementor-tab-title-10526\"><ul><li>A composite key in SQL is a combination of two or more columns that together form a primary key for a table. A primary key is a unique identifier for each row in a table, and composite keys allow multiple columns to be used as the unique identifier.<\/li><\/ul><p>Here is an example of how to create a composite key in SQL:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">CREATE TABLE Employee (<br\/>  EmployeeID INT NOT NULL,<br\/>  DepartmentID INT NOT NULL,<br\/>  Name VARCHAR(50) NOT NULL,<br\/>  Salary DECIMAL(10, 2) NOT NULL,<br\/>  PRIMARY KEY (EmployeeID, DepartmentID)<br\/>);<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ul><li>In this example, the\u00a0<strong>EmployeeID<\/strong>\u00a0and\u00a0<strong>DepartmentID<\/strong>\u00a0columns together form the composite primary key for the\u00a0<strong>Employee<\/strong>\u00a0table. This means that no two rows in the table can have the same values for both\u00a0<strong>EmployeeID<\/strong>\u00a0and\u00a0<strong>DepartmentID.<\/strong><\/li><li>Composite keys are useful in situations where a single column is not sufficient to uniquely identify a row. For example, in a company with multiple departments, it is possible for two employees to have the same employee ID. By using a composite key that includes both the employee ID and the department ID, each row in the table can be uniquely identified.<\/li><\/ul><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10527\" class=\"elementor-tab-title\" data-tab=\"27\" role=\"button\" aria-controls=\"elementor-tab-content-10527\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">27. What is transaction ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10527\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"27\" role=\"region\" aria-labelledby=\"elementor-tab-title-10527\"><p>A transaction in SQL refers to a sequence of database operations that are executed as a single unit of work. In other words, a transaction is a way of grouping multiple SQL statements into a single, atomic operation.<\/p><p>A transaction has the following properties:<\/p><ol><li><strong> Atomicity :<\/strong><\/li><\/ol><ul><li>A transaction is treated as a single, indivisible unit of work. If any part of the transaction fails, the entire transaction is rolled back, and the database is returned to its original state.<\/li><\/ul><ol start=\"2\"><li><strong> Consistency :<\/strong><\/li><\/ol><ul><li>A transaction ensures that the database remains in a consistent state. If the transaction is completed successfully, the data in the database is guaranteed to be in a valid state.<\/li><\/ul><ol start=\"3\"><li><strong> Isolation :<\/strong><\/li><\/ol><ul><li>Each transaction is isolated from other transactions. This means that one transaction cannot interfere with another transaction that is running simultaneously.<\/li><\/ul><ol start=\"4\"><li><strong> Durability :<\/strong><\/li><\/ol><ul><li>A transaction is durable, meaning that its effects are permanent, even if the database or the system crashes.<\/li><\/ul><p>Transactions are useful for ensuring the integrity and consistency of the data in a database. They are used to ensure that multiple operations are performed together, as a single, indivisible unit of work, and to ensure that the database remains in a consistent state, even in the face of errors or system failures.<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10528\" class=\"elementor-tab-title\" data-tab=\"28\" role=\"button\" aria-controls=\"elementor-tab-content-10528\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">28. How to access the database in JSON format ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10528\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"28\" role=\"region\" aria-labelledby=\"elementor-tab-title-10528\"><p>In SQL, you can use the\u00a0<strong>FOR JSON<\/strong>\u00a0clause to return the result of a query in JSON format. Here is an example of how to use this clause in SQL Server:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">SELECT * FROM Employee-table<br\/>FOR JSON PATH<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><ul><li>This will return the entire\u00a0<strong>Employee-table<\/strong>\u00a0as a single JSON object, where each row in the table is represented as a JSON object within an array. The PATH option is used to return the JSON objects as a nested structure, which allows you to access properties of nested objects.<\/li><\/ul><p>If you want to return the result of a query as a flat JSON object, you can use the FOR\u00a0<strong>JSON AUTO<\/strong>\u00a0clause instead:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">SELECT * FROM Employee-table<br\/>FOR JSON AUTO<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><p>This will return the result of the query as a single flat JSON object, where the columns of each row are represented as properties of the JSON object.<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-accordion-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-10529\" class=\"elementor-tab-title\" data-tab=\"29\" role=\"button\" aria-controls=\"elementor-tab-content-10529\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon elementor-accordion-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-closed\"><svg class=\"e-font-icon-svg e-fas-plus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-accordion-icon-opened\"><svg class=\"e-font-icon-svg e-fas-minus\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-accordion-title\" tabindex=\"0\">29. Get the output from employee-table count of employee date of joning in a every months ?<\/a>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-10529\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"29\" role=\"region\" aria-labelledby=\"elementor-tab-title-10529\"><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">example:<br\/>Month    count of employe<br\/>jan                  5<br\/>feb                 10<br\/>march            1<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><p>To get the output from the employee table that shows the count of employees who joined in each month, you can use the following SQL query:<\/p><div class=\"code-embed-wrapper\"> <pre class=\"language-sql code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-sql code-embed-code\">SELECT <br\/>  DATE_FORMAT(date_of_joining, &#039;%M&#039;) AS Month, <br\/>  COUNT(*) AS count_of_employee <br\/>FROM employee_table <br\/>GROUP BY Month<br\/>ORDER BY Month;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><p>Explanation:<\/p><ul><li>The\u00a0<strong>DATE_FORMAT<\/strong>\u00a0function is used to format the\u00a0<strong>date_of_joining<\/strong>\u00a0column into a month name.<\/li><li>The\u00a0<strong>GROUP BY<\/strong>\u00a0clause groups the rows by the month name and the\u00a0<strong>COUNT(*)<\/strong>\u00a0function counts the number of employees in each group.<\/li><li>The\u00a0<strong>ORDER BY<\/strong>\u00a0clause sorts the result set by the month name in ascending order.<\/li><\/ul><p>This query will give you a result set that shows the count of employees who joined in each month, as in the example you provided.<\/p><p>\u00a0<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>SQL, or Structured Query Language, is a powerful and standardized programming language designed for managing and manipulating relational databases. It serves as a means to interact with databases, enabling users to create, retrieve, update, and delete data. SQL is widely used in various industries for tasks ranging from simple data queries to complex database management [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":25773,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[724],"tags":[742,749,757,740,741,751,748,745,747,743,755,756,753],"class_list":["post-1615","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-interview-questions","tag-interview-questions-sql","tag-sql-interview","tag-sql-interview-question","tag-sql-interview-questions","tag-sql-interview-questions-and-answers","tag-sql-interview-questions-and-answers-for-experienced","tag-sql-interview-questions-and-answers-for-freshers","tag-sql-interview-questions-for-beginners","tag-sql-interview-questions-for-experienced","tag-sql-interview-questions-for-freshers","tag-sql-queries-interview-questions-and-answers","tag-sql-server-interview-questions-and-answers","tag-top-sql-interview-questions"],"_links":{"self":[{"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/posts\/1615","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/comments?post=1615"}],"version-history":[{"count":0,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/posts\/1615\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/media\/25773"}],"wp:attachment":[{"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/media?parent=1615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/categories?post=1615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/tags?post=1615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}