<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-664651663704607214</id><updated>2024-10-24T14:09:52.458-07:00</updated><category term="Java Interview Questions"/><title type='text'>Learn Technical Skills</title><subtitle type='html'>PHP: Core php, Drupal, Joomla, Zencart, Phpnuke Cakephp, Dolphin, Magento, Wordpress, CodeIgniter, Zend Framework, X-cart...&#xa;&#xa;Java: Core Java, J2EE(Jsp, Servlet, Jdbc), Struts, Hibernate, Spring, Jsf. &#xa; &#xa;Database: MySql &amp;amp; Oracle.&#xa;&#xa;JavaScript: Core javascript, Ajax, JQuery.&#xa;&#xa;Others: Html, Xhtml, css, XML.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-3250516640285742446</id><published>2022-08-14T01:43:00.005-07:00</published><updated>2022-08-14T05:47:20.392-07:00</updated><title type='text'>  Basic MySQL Interview Questions #2</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&lt;span face=&quot;-apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial&quot; style=&quot;background-color: white; color: #515151; letter-spacing: 0.1px;&quot;&gt;Basic MySQL Interview Questions #2&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span face=&quot;-apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial&quot; style=&quot;background-color: white; color: #515151; letter-spacing: 0.1px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;h2 id=&quot;d&quot; style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; line-height: 1.25; margin-bottom: 0px; margin-top: 2.25rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Difference between MyISAM vs InnoDB (very important question)&lt;/span&gt;&lt;/h2&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 1rem; margin-top: 1.25rem; overflow-wrap: break-word;&quot;&gt;Now that we have a basic understanding of MyISAM and InnoDB, let’s compare them on various factors:&lt;/p&gt;&lt;ul style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 0px; margin-top: 1.25rem; padding-left: 1.25rem;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;a class=&quot;rank-math-link&quot; href=&quot;https://hevodata.com/learn/myisam-vs-innodb/#d1&quot; style=&quot;background-color: transparent; box-sizing: border-box; color: #fd8412; text-decoration-line: none;&quot;&gt;MyISAM vs InnoDB: Storage Engine Type&lt;/a&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.5; margin-top: 0.75rem;&quot;&gt;&lt;a class=&quot;rank-math-link&quot; href=&quot;https://hevodata.com/learn/myisam-vs-innodb/#d2&quot; style=&quot;background-color: transparent; box-sizing: border-box; color: #fd8412; text-decoration-line: none;&quot;&gt;MyISAM vs InnoDB: Locking&lt;/a&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.5; margin-top: 0.75rem;&quot;&gt;&lt;a class=&quot;rank-math-link&quot; href=&quot;https://hevodata.com/learn/myisam-vs-innodb/#d3&quot; style=&quot;background-color: transparent; box-sizing: border-box; color: #fd8412; text-decoration-line: none;&quot;&gt;MyISAM vs InnoDB: Foreign Keys&lt;/a&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.5; margin-top: 0.75rem;&quot;&gt;&lt;a class=&quot;rank-math-link&quot; href=&quot;https://hevodata.com/learn/myisam-vs-innodb/#d4&quot; style=&quot;background-color: transparent; box-sizing: border-box; color: #fd8412; text-decoration-line: none;&quot;&gt;MyISAM vs InnoDB: ACID Properties&lt;/a&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.5; margin-top: 0.75rem;&quot;&gt;&lt;a class=&quot;rank-math-link&quot; href=&quot;https://hevodata.com/learn/myisam-vs-innodb/#d5&quot; style=&quot;background-color: transparent; box-sizing: border-box; color: #fd8412; text-decoration-line: none;&quot;&gt;MyISAM vs InnoDB: Performance&lt;/a&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.5; margin-top: 0.75rem;&quot;&gt;&lt;a class=&quot;rank-math-link&quot; href=&quot;https://hevodata.com/learn/myisam-vs-innodb/#d6&quot; style=&quot;background-color: transparent; box-sizing: border-box; color: #fd8412; text-decoration-line: none;&quot;&gt;MyISAM vs InnoDB: Reliability&lt;/a&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; line-height: 1.5; margin-top: 0.75rem;&quot;&gt;&lt;a class=&quot;rank-math-link&quot; href=&quot;https://hevodata.com/learn/myisam-vs-innodb/#d7&quot; style=&quot;background-color: transparent; box-sizing: border-box; color: #fd8412; text-decoration-line: none;&quot;&gt;MyISAM vs InnoDB: Caching and Indexing&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span face=&quot;proxima-nova, sans-serif&quot; style=&quot;color: #32325d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #232629; font-family: -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI Adjusted&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Liberation Sans&amp;quot;, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;MYISAM:&lt;/p&gt;&lt;ol style=&quot;background-color: white; border: 0px; box-sizing: inherit; color: #232629; font-family: -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI Adjusted&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Liberation Sans&amp;quot;, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; list-style-image: initial; list-style-position: initial; margin-bottom: var(--s-prose-spacing); margin-left: 30px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing-condensed); margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;&quot;&gt;MYISAM supports Table-level Locking&lt;/li&gt;&lt;li style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing-condensed); margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;&quot;&gt;MyISAM designed for need of speed&lt;/li&gt;&lt;li style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing-condensed); margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;&quot;&gt;MyISAM does not support foreign keys hence we call MySQL with MYISAM is DBMS&lt;/li&gt;&lt;li style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing-condensed); margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;&quot;&gt;MyISAM stores its tables, data and indexes in diskspace using separate three different files. (tablename.FRM, tablename.MYD, tablename.MYI)&lt;/li&gt;&lt;li style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing-condensed); margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;&quot;&gt;MYISAM not supports transaction. You cannot commit and rollback with MYISAM. Once you issue a command it’s done.&lt;/li&gt;&lt;li style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing-condensed); margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;&quot;&gt;MYISAM supports fulltext search&lt;/li&gt;&lt;li style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;&quot;&gt;You can use MyISAM, if the table is more static with lots of select and less update and delete.&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #232629; font-family: -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI Adjusted&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Liberation Sans&amp;quot;, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;INNODB:&lt;/p&gt;&lt;ol style=&quot;background-color: white; border: 0px; box-sizing: inherit; color: #232629; font-family: -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI Adjusted&amp;quot;, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Liberation Sans&amp;quot;, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; list-style-image: initial; list-style-position: initial; margin: 0px 0px 0px 30px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing-condensed); margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;&quot;&gt;InnoDB supports Row-level Locking&lt;/li&gt;&lt;li style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing-condensed); margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;&quot;&gt;InnoDB designed for maximum performance when processing high volume of data&lt;/li&gt;&lt;li style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing-condensed); margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;&quot;&gt;InnoDB support foreign keys hence we call MySQL with InnoDB is RDBMS&lt;/li&gt;&lt;li style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing-condensed); margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;&quot;&gt;InnoDB stores its tables and indexes in a tablespace&lt;/li&gt;&lt;li style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;&quot;&gt;InnoDB supports transaction. You can commit and rollback with InnoDB&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;h3 id=&quot;d1&quot; style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; line-height: 1.25; margin-bottom: 0px; margin-top: 2.25rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;1. MyISAM vs InnoDBStorage: Engine Type&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 1rem; margin-top: 1.25rem; overflow-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;MyISAM&lt;/span&gt;&amp;nbsp;is a non-transactional storage type, and any write option needs to be rolled back manually (if needed).&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 1rem; margin-top: 1.25rem; overflow-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;InnoDB&lt;/span&gt;&amp;nbsp;is a transaction storage type that automatically rollbacks the writes if they are not completed.&lt;/p&gt;&lt;h3 id=&quot;d2&quot; style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; line-height: 1.25; margin-bottom: 0px; margin-top: 2.25rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;2. MyISAM vs InnoDBStorage: Locking&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 1rem; margin-top: 1.25rem; overflow-wrap: break-word;&quot;&gt;Locking is the mechanism in MySQL that prevents two users from modifying the duplicate rows at the same time by locking the row. The users can’t change the table when locking is enabled.&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 1rem; margin-top: 1.25rem; overflow-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;MyISAM&lt;/span&gt;&amp;nbsp;uses the default method of table locking and allows a single session to modify the table. This means only one user at a time can alter the table. If another user tries to change the table, they will get a message saying that it is locked. The table locking method is helpful for read-only databases as it doesn’t require a lot of memory.&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 1rem; margin-top: 1.25rem; overflow-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;InnoDB&lt;/span&gt;&amp;nbsp;uses row-level locking of the table. This method supports multiple sessions on the same row by only locking the rows in the modification process. Row-locking is helpful for databases that have multiple users.&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 1rem; margin-top: 1.25rem; overflow-wrap: break-word;&quot;&gt;The only disadvantage of row-level locking is that it consumes a lot of memory, and querying and modifying data takes time.&lt;/p&gt;&lt;h3 id=&quot;d3&quot; style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; line-height: 1.25; margin-bottom: 0px; margin-top: 2.25rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;3. MyISAM vs InnoDBStorage: Foreign Keys&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 1rem; margin-top: 1.25rem; overflow-wrap: break-word;&quot;&gt;A foreign key is a column in one table that links the data to another table. It prevents users from adding records that destroy the link between two tables.&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 1rem; margin-top: 1.25rem; overflow-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;MyISAM&lt;/span&gt;&amp;nbsp;doesn’t support the Foreign key option.&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 1rem; margin-top: 1.25rem; overflow-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;InnoDB&lt;/span&gt;&amp;nbsp;supports the Foreign Key option.&lt;/p&gt;&lt;h3 id=&quot;d4&quot; style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; line-height: 1.25; margin-bottom: 0px; margin-top: 2.25rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;4. MyISAM vs InnoDBStorage: ACID Properties&amp;nbsp;&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 1rem; margin-top: 1.25rem; overflow-wrap: break-word;&quot;&gt;ACID stands for Atomicity, Consistency, Isolation, and Durability. MyISAM doesn’t support ACID properties whereas InnoDB supports ACID properties.&lt;/p&gt;&lt;h3 id=&quot;d5&quot; style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; line-height: 1.25; margin-bottom: 0px; margin-top: 2.25rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;5. MyISAM vs InnoDBStorage: Performance&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 1rem; margin-top: 1.25rem; overflow-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;InnoDB&lt;/span&gt;&amp;nbsp;supports transactional properties, i.e. rollbacks and commits, and has a higher speed of writing. The performance of InnoDB for large volumes of data is better as compared to MyISAM.&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 1rem; margin-top: 1.25rem; overflow-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;MyISAM&lt;/span&gt;&amp;nbsp;doesn’t support transactional properties and is faster to read. As compared to InnoDB, the performance for a high volume of data is less.&lt;/p&gt;&lt;h3 id=&quot;d6&quot; style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; line-height: 1.25; margin-bottom: 0px; margin-top: 2.25rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;6. MyISAM vs InnoDBStorage: Reliability&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 1rem; margin-top: 1.25rem; overflow-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;InnoDB&lt;/span&gt;&amp;nbsp;uses a transactional log to log every operation and hence gives reliable operations. Thus, in case of failure, data can be recovered quickly by using those logs.&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 1rem; margin-top: 1.25rem; overflow-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;MyISAM&amp;nbsp;&lt;/span&gt;offers no data integrity; hardware failures and canceled operations can cause data to become corrupt.&lt;/p&gt;&lt;h3 id=&quot;d7&quot; style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; line-height: 1.25; margin-bottom: 0px; margin-top: 2.25rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;7. MyISAM vs InnoDBStorage: Caching and Indexing&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 1rem; margin-top: 1.25rem; overflow-wrap: break-word;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;InnoDB&lt;/span&gt;&amp;nbsp;supports a large pool of buffers that caches both data and indexes. However, there is no support for a Full-text search.&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 1rem; margin-top: 1.25rem; overflow-wrap: break-word;&quot;&gt;The&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;MyISAM&lt;/span&gt;&amp;nbsp;key buffer is only meant for indexes, and a full-text search is supported in MyISAM.&lt;/p&gt;&lt;h2 id=&quot;conc&quot; style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; line-height: 1.25; margin-bottom: 0px; margin-top: 2.25rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Conclusion&lt;/span&gt;&lt;/h2&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #32325d; font-family: proxima-nova, sans-serif; margin-bottom: 1rem; margin-top: 1.25rem; overflow-wrap: break-word;&quot;&gt;This article listed the critical differences between InnoDB and MyISAM by comparing them against critical factors. It is important to be aware of the properties of each database because it becomes easier to make a choice. You should be aware of the similarities they possess and also what differentiates them. Hopefully, after reading this article you have a better understanding of InnoDB and MyISAM.&lt;/p&gt;&lt;h3 style=&quot;background-color: white; box-sizing: border-box; color: #3a3a3a; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 22px; line-height: 32px; margin-bottom: 0px; margin-top: 30px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box;&quot;&gt;What are the differences between a primary key and a foreign key?&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #3a3a3a; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16px; height: auto; line-height: 28px; margin: 16px 0px 0px; text-align: justify;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;table-responsive&quot; style=&quot;background-color: white; box-sizing: border-box; color: #3a3a3a; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16px; line-height: 28px; margin-top: 16px; overflow-x: auto; width: 783px;&quot;&gt;&lt;table class=&quot;table table-bordered&quot; style=&quot;border-collapse: collapse; border: 0px; color: #212529; margin: auto; max-width: 100%; min-width: 100%; overflow-x: auto; width: fit-content;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;background-color: #008dd9; border: 1px solid rgb(222, 226, 230); box-sizing: border-box; color: white; font-size: 16px; line-height: 25px; padding: 0.75rem; text-align: center; vertical-align: top;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;Primary Key&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #008dd9; border: 1px solid rgb(222, 226, 230); box-sizing: border-box; color: white; font-size: 16px; line-height: 25px; padding: 0.75rem; text-align: center; vertical-align: top;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;Foreign Key&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(222, 226, 230); box-sizing: border-box; font-size: 16px; line-height: 25px; padding: 0.75rem; vertical-align: top;&quot;&gt;It helps in the unique identification of data in a database&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(222, 226, 230); box-sizing: border-box; font-size: 16px; line-height: 25px; padding: 0.75rem; vertical-align: top;&quot;&gt;It helps establish a link between tables&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(222, 226, 230); box-sizing: border-box; font-size: 16px; line-height: 25px; padding: 0.75rem; vertical-align: top;&quot;&gt;There can be only one primary key for a table&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(222, 226, 230); box-sizing: border-box; font-size: 16px; line-height: 25px; padding: 0.75rem; vertical-align: top;&quot;&gt;There can be more than one foreign key for a table&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(222, 226, 230); box-sizing: border-box; font-size: 16px; line-height: 25px; padding: 0.75rem; vertical-align: top;&quot;&gt;Primary key attributes cannot have duplicate values in a table&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(222, 226, 230); box-sizing: border-box; font-size: 16px; line-height: 25px; padding: 0.75rem; vertical-align: top;&quot;&gt;Duplicate values are acceptable for a foreign key&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(222, 226, 230); box-sizing: border-box; font-size: 16px; line-height: 25px; padding: 0.75rem; vertical-align: top;&quot;&gt;Null values are not acceptable&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(222, 226, 230); box-sizing: border-box; font-size: 16px; line-height: 25px; padding: 0.75rem; vertical-align: top;&quot;&gt;Null values are acceptable&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(222, 226, 230); box-sizing: border-box; font-size: 16px; line-height: 25px; padding: 0.75rem; vertical-align: top;&quot;&gt;We can define primary key constraints for temporarily created tables&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(222, 226, 230); box-sizing: border-box; font-size: 16px; line-height: 25px; padding: 0.75rem; vertical-align: top;&quot;&gt;It cannot be defined for temporary tables&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid rgb(222, 226, 230); box-sizing: border-box; font-size: 16px; line-height: 25px; padding: 0.75rem; vertical-align: top;&quot;&gt;The primary key index is automatically created&lt;/td&gt;&lt;td style=&quot;border: 1px solid rgb(222, 226, 230); box-sizing: border-box; font-size: 16px; line-height: 25px; padding: 0.75rem; vertical-align: top;&quot;&gt;The index is not created automatically&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;h3 style=&quot;background-color: white; box-sizing: border-box; color: #3a3a3a; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 22px; line-height: 32px; margin-bottom: 0px; margin-top: 30px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box;&quot;&gt;What is the difference between primary key and unique key?&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #3a3a3a; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16px; height: auto; line-height: 28px; margin: 16px 0px 0px; text-align: justify;&quot;&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #3a3a3a; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16px; height: auto; line-height: 28px; margin: 16px 0px 0px; text-align: justify;&quot;&gt;While both are used to enforce the uniqueness of the column defined, the primary key would create a clustered index, whereas the unique key would create a non-clustered index on the column. The primary key does not allow ‘NULL’, but the unique key does.&lt;span style=&quot;box-sizing: border-box; font-weight: 600;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #3a3a3a; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16px; height: auto; line-height: 28px; margin: 16px 0px 0px; text-align: justify;&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: border-box; color: #3a3a3a; font-family: &amp;quot;Open Sans&amp;quot;, sans-serif; font-size: 16px; height: auto; line-height: 28px; margin: 16px 0px 0px; text-align: justify;&quot;&gt;&lt;img alt=&quot;Unique Key&quot; class=&quot;alignnone size-full wp-image-212963 lazyloaded&quot; data-ll-status=&quot;loaded&quot; height=&quot;402&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; src=&quot;https://intellipaat.com/blog/wp-content/uploads/2015/12/Unique-key.jpg&quot; srcset=&quot;https://intellipaat.com/blog/wp-content/uploads/2015/12/Unique-key.jpg 800w, https://intellipaat.com/blog/wp-content/uploads/2015/12/Unique-key-768x386.jpg 768w, https://intellipaat.com/blog/wp-content/uploads/2015/12/Unique-key-537x270.jpg 537w&quot; style=&quot;border-style: none; box-sizing: border-box; height: auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;800&quot; /&gt;&lt;/p&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; line-height: 1.3em; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;How to add columns in MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-align: justify;&quot;&gt;A column is a series of cells in a table that stores one value for each row in a table. We can add columns in an existing table using the ALTER TABLE statement as follows:&lt;/p&gt;&lt;div class=&quot;codeblock&quot; style=&quot;background-color: rgba(214, 189, 189, 0.3); border-color: rgb(213, 221, 198) rgb(213, 221, 198) rgb(213, 221, 198) rgba(113, 136, 107, 0.67); border-image: initial; border-style: solid; border-width: 1px 1px 1px 4px; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin-bottom: 8px; padding-left: 0px; text-align: justify; width: 790px;&quot;&gt;&lt;div class=&quot;dp-highlighter&quot; style=&quot;margin: 8px 0px; overflow: scroll hidden; padding-top: 0px; width: 730px;&quot;&gt;&lt;div class=&quot;bar&quot; style=&quot;padding-left: 45px;&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot; style=&quot;border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;li class=&quot;alt&quot; style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px; width: 730px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;ALTER&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;TABLE&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;table_name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;ADD&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;COLUMN&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;column_name&amp;nbsp;column_definition&amp;nbsp;[&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;FIRST&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;AFTER&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;existing_column];&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; line-height: 1.3em; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;What is the difference between the database and the table?&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; text-align: justify;&quot;&gt;There is a major difference between a database and a table. The differences are as follows:&lt;/p&gt;&lt;ul class=&quot;points&quot; style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; line-height: 24px; list-style: circle; text-align: justify;&quot;&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;Tables are a way to represent the division of data in a database while the database is a collection of tables and data.&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;Tables are used to group the data in relation to each other and create a dataset. This dataset will be used in the database. The data stored in the table in any form is a part of the database, but the reverse is not true.&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;A database is a collection of organized data and features used to access them, whereas the table is a collection of rows and columns used to store the data.&lt;/li&gt;&lt;/ul&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em; text-align: justify;&quot;&gt;How to delete a table in MySQL?&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;&quot;&gt;We can delete a table in MySQL using the Drop Table statement. This statement removes the complete data of a table, including structure and definition from the database permanently. Therefore, it is required to be careful while deleting a table. After using the statement, we cannot recover the table in MySQL. The statement is as follows:&lt;/p&gt;&lt;div class=&quot;codeblock&quot; style=&quot;background-color: rgba(214, 189, 189, 0.3); border-color: rgb(213, 221, 198) rgb(213, 221, 198) rgb(213, 221, 198) rgba(113, 136, 107, 0.67); border-image: initial; border-style: solid; border-width: 1px 1px 1px 4px; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; margin-bottom: 8px; padding-left: 0px; text-align: justify; width: 790px;&quot;&gt;&lt;div class=&quot;dp-highlighter&quot; style=&quot;margin: 8px 0px; overflow: scroll hidden; padding-top: 0px; width: 730px;&quot;&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot; style=&quot;border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;li class=&quot;alt&quot; style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px; width: 730px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;DROP&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;TABLE&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;table_name;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em; text-align: justify;&quot;&gt;How to add foreign keys in MySQL?&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;&quot;&gt;The foreign key is used to link one or more tables together. It matches the primary key field of another table to link the two tables. It allows us to create a parent-child relationship with the tables. We can add a foreign key to a table in two ways:&lt;/p&gt;&lt;ul class=&quot;points&quot; style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 24px; list-style: circle; text-align: justify;&quot;&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;Using the CREATE TABLE Statement&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;Using the ALTER TABLE Statement&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;&quot;&gt;Following is the syntax to define a foreign key using CREATE TABLE OR ALTER TABLE statement:&lt;/p&gt;&lt;div class=&quot;codeblock&quot; style=&quot;background-color: rgba(214, 189, 189, 0.3); border-color: rgb(213, 221, 198) rgb(213, 221, 198) rgb(213, 221, 198) rgba(113, 136, 107, 0.67); border-image: initial; border-style: solid; border-width: 1px 1px 1px 4px; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; margin-bottom: 8px; padding-left: 0px; text-align: justify; width: 790px;&quot;&gt;&lt;div class=&quot;dp-highlighter&quot; style=&quot;margin: 8px 0px; overflow: scroll hidden; padding-top: 0px; width: 730px;&quot;&gt;&lt;div class=&quot;bar&quot; style=&quot;padding-left: 45px;&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot; style=&quot;border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;li class=&quot;alt&quot; style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px; width: 730px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;CONSTRAINT&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;constraint_name]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;FOREIGN&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;KEY&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;[foreign_key_name]&amp;nbsp;(col_name,&amp;nbsp;...)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot; style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px; width: 730px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;REFERENCES&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;parent_tbl_name&amp;nbsp;(col_name,...)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em; text-align: justify;&quot;&gt;How to change the MySQL password?&lt;/h3&gt;&lt;div class=&quot;codeblock&quot; style=&quot;background-color: rgba(214, 189, 189, 0.3); border-color: rgb(213, 221, 198) rgb(213, 221, 198) rgb(213, 221, 198) rgba(113, 136, 107, 0.67); border-image: initial; border-style: solid; border-width: 1px 1px 1px 4px; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; margin-bottom: 8px; padding-left: 0px; text-align: justify; width: 790px;&quot;&gt;&lt;div class=&quot;dp-highlighter&quot; style=&quot;margin: 8px 0px; overflow: scroll hidden; padding-top: 0px; width: 730px;&quot;&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot; style=&quot;border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;li class=&quot;alt&quot; style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px; width: 730px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;ALTER&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;func&quot; style=&quot;background-color: inherit; border: none; color: deeppink; margin: 0px; padding: 0px;&quot;&gt;USER&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&#39;root&#39;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&#39;localhost&#39;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;IDENTIFIED&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;BY&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&#39;NewPassword&#39;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em; text-align: justify;&quot;&gt;How to change the table name in MySQL?&lt;/h3&gt;&lt;div&gt;&lt;span face=&quot;inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: rgba(214, 189, 189, 0.3); border: none; font-size: 16px; margin: 0px; padding: 0px; text-align: justify;&quot;&gt;RENAME&amp;nbsp;old_table&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; face=&quot;inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: rgba(214, 189, 189, 0.3); border: none; color: #006699; font-size: 16px; font-weight: 700; margin: 0px; padding: 0px; text-align: justify;&quot;&gt;TO&lt;/span&gt;&lt;span face=&quot;inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: rgba(214, 189, 189, 0.3); border: none; font-size: 16px; margin: 0px; padding: 0px; text-align: justify;&quot;&gt;&amp;nbsp;new_table;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;background-color: rgba(214, 189, 189, 0.3); border: none; font-size: 16px; margin: 0px; padding: 0px; text-align: justify;&quot;&gt;&lt;p style=&quot;background-color: white; color: #333333;&quot;&gt;If we want to change more than one table name, use the below syntax:&lt;/p&gt;&lt;div class=&quot;codeblock&quot; style=&quot;border-color: rgb(213, 221, 198) rgb(213, 221, 198) rgb(213, 221, 198) rgba(113, 136, 107, 0.67); border-image: initial; border-style: solid; border-width: 1px 1px 1px 4px; color: #333333; margin-bottom: 8px; padding-left: 0px; width: 790px;&quot;&gt;&lt;div class=&quot;dp-highlighter&quot; style=&quot;margin: 8px 0px; overflow: scroll hidden; padding-top: 0px; width: 730px;&quot;&gt;&lt;div class=&quot;bar&quot; style=&quot;padding-left: 45px;&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot; style=&quot;border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;li class=&quot;alt&quot; style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px; width: 730px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;RENAME&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;TABLE&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;old_tab1&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;TO&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;new_tab1,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;old_tab2&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;TO&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;new_tab2,&amp;nbsp;old_tab3&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;TO&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;new_tab3;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em; text-align: justify;&quot;&gt;How to change the column name in MySQL?&lt;/h3&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em; text-align: justify;&quot;&gt;&lt;p style=&quot;color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;While creating a table, we have kept one of the column names incorrectly. To change or rename an existing column name in MySQL, we need to use the ALTER TABLE and CHANGE commands together. The following are the syntax used to rename a column in MySQL:&lt;/p&gt;&lt;div class=&quot;codeblock&quot; style=&quot;background-color: rgba(214, 189, 189, 0.3); border-color: rgb(213, 221, 198) rgb(213, 221, 198) rgb(213, 221, 198) rgba(113, 136, 107, 0.67); border-image: initial; border-style: solid; border-width: 1px 1px 1px 4px; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; margin-bottom: 8px; padding-left: 0px; width: 790px;&quot;&gt;&lt;div class=&quot;dp-highlighter&quot; style=&quot;margin: 8px 0px; overflow: scroll hidden; padding-top: 0px; width: 730px;&quot;&gt;&lt;div class=&quot;bar&quot; style=&quot;padding-left: 45px;&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot; style=&quot;border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;li class=&quot;alt&quot; style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px; width: 730px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;ALTER&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;TABLE&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;table_name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CHANGE&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;COLUMN&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;old_column_name&amp;nbsp;new_column_name&amp;nbsp;column_definition&amp;nbsp;[&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;FIRST&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;AFTER&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;existing_column];&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;Suppose the column&#39;s current name is S_ID, but we want to change this with a more appropriate title as Stud_ID. We will use the below statement to change its name:&lt;/p&gt;&lt;div class=&quot;codeblock&quot; style=&quot;background-color: rgba(214, 189, 189, 0.3); border-color: rgb(213, 221, 198) rgb(213, 221, 198) rgb(213, 221, 198) rgba(113, 136, 107, 0.67); border-image: initial; border-style: solid; border-width: 1px 1px 1px 4px; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; margin-bottom: 8px; padding-left: 0px; width: 790px;&quot;&gt;&lt;div class=&quot;dp-highlighter&quot; style=&quot;margin: 8px 0px; overflow: scroll hidden; padding-top: 0px; width: 730px;&quot;&gt;&lt;div class=&quot;bar&quot; style=&quot;padding-left: 45px;&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot; style=&quot;border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;li class=&quot;alt&quot; style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px; width: 730px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;ALTER&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;TABLE&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;Student&amp;nbsp;CHANGE&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;COLUMN&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;S_ID&amp;nbsp;Stud_ID&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;varchar&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;(10);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em; text-align: justify;&quot;&gt;How to delete columns in MySQL?&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;&quot;&gt;We can remove, drop, or delete one or more columns in an existing table using the ALTER TABLE statement as follows:&lt;/p&gt;&lt;div class=&quot;codeblock&quot; style=&quot;background-color: rgba(214, 189, 189, 0.3); border-color: rgb(213, 221, 198) rgb(213, 221, 198) rgb(213, 221, 198) rgba(113, 136, 107, 0.67); border-image: initial; border-style: solid; border-width: 1px 1px 1px 4px; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; margin-bottom: 8px; padding-left: 0px; text-align: justify; width: 790px;&quot;&gt;&lt;div class=&quot;dp-highlighter&quot; style=&quot;margin: 8px 0px; overflow: scroll hidden; padding-top: 0px; width: 730px;&quot;&gt;&lt;div class=&quot;bar&quot; style=&quot;padding-left: 45px;&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot; style=&quot;border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;li class=&quot;alt&quot; style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px; width: 730px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;ALTER&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;TABLE&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;table_name&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;DROP&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;COLUMN&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;column_name1,&amp;nbsp;column_name2....;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em; text-align: justify;&quot;&gt;How to insert data in MySQL?&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;&quot;&gt;We can insert data in a MySQL table using the INSERT STATEMENT. This statement allows us to insert single or multiple rows into a table. The following is the basic syntax to insert a record into a table:&lt;/p&gt;&lt;div class=&quot;codeblock&quot; style=&quot;background-color: rgba(214, 189, 189, 0.3); border-color: rgb(213, 221, 198) rgb(213, 221, 198) rgb(213, 221, 198) rgba(113, 136, 107, 0.67); border-image: initial; border-style: solid; border-width: 1px 1px 1px 4px; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; margin-bottom: 8px; padding-left: 0px; text-align: justify; width: 790px;&quot;&gt;&lt;div class=&quot;dp-highlighter&quot; style=&quot;margin: 8px 0px; overflow: scroll hidden; padding-top: 0px; width: 730px;&quot;&gt;&lt;div class=&quot;bar&quot; style=&quot;padding-left: 45px;&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot; style=&quot;border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;li class=&quot;alt&quot; style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px; width: 730px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;INSERT&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;INTO&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;table_name&amp;nbsp;(&amp;nbsp;field1,&amp;nbsp;field2,...fieldN&amp;nbsp;)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;VALUES&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;(&amp;nbsp;value1,&amp;nbsp;value2,...valueN&amp;nbsp;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;&quot;&gt;If we want to insert more than one rows into a table, use the below syntax:&lt;/p&gt;&lt;div class=&quot;codeblock&quot; style=&quot;background-color: rgba(214, 189, 189, 0.3); border-color: rgb(213, 221, 198) rgb(213, 221, 198) rgb(213, 221, 198) rgba(113, 136, 107, 0.67); border-image: initial; border-style: solid; border-width: 1px 1px 1px 4px; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; margin-bottom: 8px; padding-left: 0px; text-align: justify; width: 790px;&quot;&gt;&lt;div class=&quot;dp-highlighter&quot; style=&quot;margin: 8px 0px; overflow: scroll hidden; padding-top: 0px; width: 730px;&quot;&gt;&lt;div class=&quot;bar&quot; style=&quot;padding-left: 45px;&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot; style=&quot;border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;li class=&quot;alt&quot; style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px; width: 730px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;INSERT&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;INTO&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;(field1,&amp;nbsp;field2,...fieldN)&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;VALUES&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot; style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px; width: 730px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(value1,&amp;nbsp;value&amp;nbsp;2,&amp;nbsp;...),&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(value1,&amp;nbsp;value2,&amp;nbsp;...),&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot; style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px; width: 730px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(value1,&amp;nbsp;value2,&amp;nbsp;...);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em; text-align: justify;&quot;&gt;How to delete a row in MySQL?&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;&quot;&gt;We can delete a row from the MySQL table using the DELETE STATEMENT within the database. The following is the generic syntax of DELETE statement in MySQL to remove one or more rows from a table:&lt;/p&gt;&lt;div class=&quot;codeblock&quot; style=&quot;background-color: rgba(214, 189, 189, 0.3); border-color: rgb(213, 221, 198) rgb(213, 221, 198) rgb(213, 221, 198) rgba(113, 136, 107, 0.67); border-image: initial; border-style: solid; border-width: 1px 1px 1px 4px; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; margin-bottom: 8px; padding-left: 0px; text-align: justify; width: 790px;&quot;&gt;&lt;div class=&quot;dp-highlighter&quot; style=&quot;margin: 8px 0px; overflow: scroll hidden; padding-top: 0px; width: 730px;&quot;&gt;&lt;div class=&quot;bar&quot; style=&quot;padding-left: 45px;&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot; style=&quot;border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;li class=&quot;alt&quot; style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px; width: 730px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;DELETE&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;FROM&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;table_name&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;WHERE&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;Condition_specified;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;&quot;&gt;It is noted that if we have not specified the WHERE clause with the syntax, this statement will remove all the records from the given table.&lt;/p&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em; text-align: justify;&quot;&gt;How to join two tables in MySQL?&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;&quot;&gt;We can connect two or more tables in MySQL using the JOIN clause. MySQL allows various types of JOIN clauses. These clauses connect multiple tables and return only those records that match the same value and property in all tables. The following are the four easy ways to join two or more tables in MySQL:&lt;/p&gt;&lt;ul class=&quot;points&quot; style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 24px; list-style: circle; text-align: justify;&quot;&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;Inner Join&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;Left Join&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;Right Join&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;Cross Join&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;&quot;&gt;To read more information,&amp;nbsp;&lt;a href=&quot;https://www.javatpoint.com/mysql-inner-join&quot; style=&quot;color: green; text-decoration-line: none;&quot;&gt;click here&lt;/a&gt;.&lt;/p&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em; text-align: justify;&quot;&gt;How to create a new user in MySQL?&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;&quot;&gt;A USER in MySQL is a record in the USER-TABLE. It contains the login information, account privileges, and the host information for MySQL account to access and manage the databases. We can create a new user account in the database server using the MySQL Create User statement. It provides authentication, SSL/TLS, resource-limit, role, and password management properties for the new accounts.&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;&quot;&gt;The following is the basic syntax to create a new user in MySQL:&lt;/p&gt;&lt;div class=&quot;codeblock&quot; style=&quot;background-color: rgba(214, 189, 189, 0.3); border-color: rgb(213, 221, 198) rgb(213, 221, 198) rgb(213, 221, 198) rgba(113, 136, 107, 0.67); border-image: initial; border-style: solid; border-width: 1px 1px 1px 4px; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; margin-bottom: 8px; padding-left: 0px; text-align: justify; width: 790px;&quot;&gt;&lt;div class=&quot;dp-highlighter&quot; style=&quot;margin: 8px 0px; overflow: scroll hidden; padding-top: 0px; width: 730px;&quot;&gt;&lt;div class=&quot;bar&quot; style=&quot;padding-left: 45px;&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot; style=&quot;border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;li class=&quot;alt&quot; style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px; width: 730px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;CREATE&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;func&quot; style=&quot;background-color: inherit; border: none; color: deeppink; margin: 0px; padding: 0px;&quot;&gt;USER&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;[IF&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;op&quot; style=&quot;background-color: inherit; border: none; color: grey; margin: 0px; padding: 0px;&quot;&gt;NOT&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;EXISTS]&amp;nbsp;account_name&amp;nbsp;IDENTIFIED&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;BY&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&#39;password&#39;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;&quot;&gt;To read more information,&amp;nbsp;&lt;a href=&quot;https://www.javatpoint.com/mysql-create-user&quot; style=&quot;color: green; text-decoration-line: none;&quot;&gt;click here&lt;/a&gt;.&lt;/p&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em; text-align: justify;&quot;&gt;How does indexing works in MySQL?&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;&quot;&gt;Indexing is a process to find an unordered list into an ordered list. It helps in maximizing the query&#39;s efficiency while searching on tables in MySQL. The working of MySQL indexing is similar to the book index.&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;&quot;&gt;Suppose we have a book and want to get information about, say, searching. Without indexing, it is required to go through all pages one by one, until the specific topic was not found. On the other hand, an index contains a list of keywords to find the topic mentioned on pages. Then, we can flip to those pages directly without going through all pages.&lt;/p&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em; text-align: justify;&quot;&gt;How to view the database in MySQL?&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;&quot;&gt;Working with the MySQL server, it is a common task to view or list the available databases. We can view all the databases on the MySQL server host using the following command:&lt;/p&gt;&lt;div class=&quot;codeblock&quot; style=&quot;background-color: rgba(214, 189, 189, 0.3); border-color: rgb(213, 221, 198) rgb(213, 221, 198) rgb(213, 221, 198) rgba(113, 136, 107, 0.67); border-image: initial; border-style: solid; border-width: 1px 1px 1px 4px; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; margin-bottom: 8px; padding-left: 0px; text-align: justify; width: 790px;&quot;&gt;&lt;div class=&quot;dp-highlighter&quot; style=&quot;margin: 8px 0px; overflow: scroll hidden; padding-top: 0px; width: 730px;&quot;&gt;&lt;div class=&quot;bar&quot; style=&quot;padding-left: 45px;&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot; style=&quot;border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;li class=&quot;alt&quot; style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px; width: 730px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;mysql&amp;gt;&amp;nbsp;SHOW&amp;nbsp;DATABASES;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;&quot;&gt;To read more information,&amp;nbsp;&lt;a href=&quot;https://www.javatpoint.com/mysql-show-list-databases&quot; style=&quot;color: green; text-decoration-line: none;&quot;&gt;click here&lt;/a&gt;.&lt;/p&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em; text-align: justify;&quot;&gt;How to set auto increment in MySQL?&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;&quot;&gt;Auto Increment is a constraint that automatically generates a unique number while inserting a new record into the table. Generally, it is used for the primary key field in a table. In MySQL, we can set the value for an AUTO_INCREMENT column using the ALTER TABLE statement as follows:&lt;/p&gt;&lt;div class=&quot;codeblock&quot; style=&quot;background-color: rgba(214, 189, 189, 0.3); border-color: rgb(213, 221, 198) rgb(213, 221, 198) rgb(213, 221, 198) rgba(113, 136, 107, 0.67); border-image: initial; border-style: solid; border-width: 1px 1px 1px 4px; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; margin-bottom: 8px; padding-left: 0px; text-align: justify; width: 790px;&quot;&gt;&lt;div class=&quot;dp-highlighter&quot; style=&quot;margin: 8px 0px; overflow: scroll hidden; padding-top: 0px; width: 730px;&quot;&gt;&lt;div class=&quot;bar&quot; style=&quot;padding-left: 45px;&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://www.javatpoint.com/mysql-interview-questions#&quot; style=&quot;background: 0px 0px; border: none; color: green; margin: 0px; padding: 0px; text-decoration-line: none;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-sql&quot; start=&quot;1&quot; style=&quot;border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;li class=&quot;alt&quot; style=&quot;border: none; color: black; line-height: 25px; margin: 4px 0px 0px; padding: 0px 3px 0px 10px; width: 730px;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;ALTER&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: 700; margin: 0px; padding: 0px;&quot;&gt;TABLE&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;table_name&amp;nbsp;AUTO_INCREMENT&amp;nbsp;=&amp;nbsp;value;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em; text-align: justify;&quot;&gt;What is the difference between TRUNCATE and DELETE in MySQL?&lt;/h3&gt;&lt;ul class=&quot;points&quot; style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 24px; list-style: circle; text-align: justify;&quot;&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;TRUNCATE is a DDL command, and DELETE is a DML command.&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;It is not possible to use Where command with TRUNCATE QLbut you can use it with DELETE command.&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;TRUNCATE cannot be used with indexed views, whereas DELETE can be used with indexed views.&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;The DELETE command is used to delete data from a table. It only deletes the rows of data from the table while truncate is a very dangerous command and should be used carefully because it deletes every row permanently from a table.&lt;/li&gt;&lt;/ul&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span face=&quot;inter-regular, system-ui, -apple-system, system-ui, Segoe UI, Roboto, Helvetica Neue, Helvetica, Arial, sans-serif&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em;&quot;&gt;How many Triggers are possible in MySQL?&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;There are only six Triggers allowed to use in the MySQL database.&lt;/p&gt;&lt;ol class=&quot;points&quot; style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;Before Insert&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;After Insert&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;Before Update&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;After Update&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;Before Delete&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;After Delete&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em;&quot;&gt;What are the disadvantages of MySQL?&lt;/h3&gt;&lt;ol class=&quot;points&quot; style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;MySQL is not so efficient for large scale databases.&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;It does not support COMMIT and STORED PROCEDURES functions version less than 5.0.&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;Transactions are not handled very efficiently.&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;The functionality of MySQL is highly dependent on other addons.&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;Development is not community-driven.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;span face=&quot;inter-regular, system-ui, -apple-system, system-ui, Segoe UI, Roboto, Helvetica Neue, Helvetica, Arial, sans-serif&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em;&quot;&gt;What is the difference between CHAR and VARCHAR?&lt;/h3&gt;&lt;ol class=&quot;points&quot; style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;CHAR and VARCHAR have differed in storage and retrieval.&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;CHAR column length is fixed, while VARCHAR length is variable.&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;The maximum no. of character CHAR data types can hold is 255 characters, while VARCHAR can hold up to 4000 characters.&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;CHAR is 50% faster than VARCHAR.&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;CHAR uses static memory allocation, while VARCHAR uses dynamic memory allocation.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em;&quot;&gt;What is the difference between MySQL_connect and MySQL_pconnect?&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span face=&quot;inter-bold, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;font-weight: 700;&quot;&gt;Mysql_connect:&lt;/span&gt;&lt;/p&gt;&lt;ol class=&quot;points&quot; style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;It opens a new connection to the database.&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;Every time you need to open and close the database connection, depending on the request.&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;Opens page whenever it is loaded.&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span face=&quot;inter-bold, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;font-weight: 700;&quot;&gt;Mysql_pconnect:&lt;/span&gt;&lt;/p&gt;&lt;ol class=&quot;points&quot; style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;In Mysql_pconnect, &quot;p&quot; stands for persistent connection, so it opens the persistent connection.&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;The database connection cannot be closed.&lt;/li&gt;&lt;li style=&quot;color: black; line-height: 25px; margin-top: 4px; padding: 0.2em;&quot;&gt;It is more useful if your site has more traffic because there is no need to open and close connection frequently and whenever the page is loaded.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em;&quot;&gt;How to change a password for an existing user via mysqladmin?&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;Mysqladmin -u root -p password &quot;newpassword&quot;.&lt;/p&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em;&quot;&gt;How to display the nth highest salary from a table in a MySQL query?&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;Let us take a table named the employee.&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span face=&quot;inter-bold, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;font-weight: 700;&quot;&gt;To find Nth highest salary is:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;select distinct(salary)from employee order by salary desc limit n-1,1&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span face=&quot;inter-bold, system-ui, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif&quot; style=&quot;font-weight: 700;&quot;&gt;if you want to find 3rd largest salary:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;select distinct(salary)from employee order by salary desc limit 2,1&lt;/p&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em;&quot;&gt;How many columns can you create for an index?&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;You can a create maximum of 16 indexed columns for a standard table.&lt;/p&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em;&quot;&gt;What is the difference between NOW() and CURRENT_DATE()?&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;NOW() command is used to show current year, month, date with hours, minutes, and seconds while CURRENT_DATE() shows the current year with month and date only.&lt;/p&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em;&quot;&gt;What are the different column comparison operators in MySQL?&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;The =, &amp;lt;&amp;gt;, &amp;lt;=, &amp;lt;, &amp;gt;=, &amp;gt;, &amp;lt;&amp;lt;, &amp;gt;&amp;gt;, &amp;lt; = &amp;gt;, AND, OR or LIKE operator are the comparison operators in MySQL. These operators are generally used with SELECT statement.&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 class=&quot;h3&quot; style=&quot;background-color: white; color: #610b4b; font-family: erdana, helvetica, arial, sans-serif; font-size: 21px; font-weight: 400; line-height: 1.3em;&quot;&gt;What are DDL, DML, and DCL?&lt;/h3&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;Majorly SQL commands can be divided into three categories, i.e., DDL, DML &amp;amp; DCL. Data Definition Language (DDL) deals with all the database schemas, and it defines how the data should reside in the database. Commands like CreateTABLE and ALTER TABLE are part of DDL.&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;Data Manipulative Language (DML) deals with operations and manipulations on the data. The commands in DML are Insert, Select, etc.&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;Data Control Languages (DCL) are related to the Grant and permissions. In short, the authorization to access any part of the database is defined by these.&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; color: #333333; font-family: inter-regular, system-ui, -apple-system, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/3250516640285742446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/3250516640285742446' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/3250516640285742446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/3250516640285742446'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2022/08/basic-mysql-interview-questions-2.html' title='  Basic MySQL Interview Questions #2'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-265421757343889795</id><published>2022-08-14T00:21:00.013-07:00</published><updated>2022-08-14T01:43:33.916-07:00</updated><title type='text'>  Basic MySQL Interview Questions #1</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&lt;span face=&quot;-apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial&quot; style=&quot;background-color: white; color: #515151; letter-spacing: 0.1px;&quot;&gt;Basic MySQL Interview Questions #1&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;mysql-basic-questions&quot; style=&quot;background-color: white; box-sizing: inherit; color: #515151; font-family: -apple-system, system-ui, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5;&quot;&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;what-is-mysql&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;1. What is MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;MySQL is a database management system for web servers. It can grow with the website as it is highly scalable. Most of the websites today are powered by MySQL.&lt;/p&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-advantages&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;2. What are some of the advantages of using MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;ul style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; list-style-image: initial; list-style-position: initial; margin: 0px; padding: 0px 0px 0px 2em;&quot;&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;u style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;Flexibility:&lt;/u&gt;&amp;nbsp;MySQL runs on all operating systems&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;&lt;u style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;Power:&lt;/u&gt;&amp;nbsp;MySQL focuses on performance&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;&lt;u style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;Enterprise-Level SQL Features:&lt;/u&gt;&amp;nbsp;MySQL had for some time been lacking in advanced features such as subqueries, views, and stored procedures.&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;&lt;u style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;Full-Text Indexing and Searching&lt;/u&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;&lt;u style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;Query Caching:&lt;/u&gt;&amp;nbsp;This helps enhance the speed of MySQL greatly&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;&lt;u style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;Replication:&lt;/u&gt;&amp;nbsp;One MySQL server can be duplicated on another, providing numerous advantages&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;&lt;u style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;Configuration and Security&lt;/u&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;what-is-a-database&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;3. What do you mean by ‘databases’?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;A database is a structured collection of data stored in a computer system and organized in a way to be quickly searched. With databases, information can be rapidly retrieved.&lt;/p&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;&lt;span face=&quot;-apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial&quot; style=&quot;color: #515151; font-weight: bold; letter-spacing: 0.1px;&quot;&gt;4. What does SQL in MySQL stand for?&lt;/span&gt;&lt;/p&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;sql-in-mysql-stand-for&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;The SQL in MySQL stands for Structured Query Language. This language is also used in other databases such as Oracle and Microsoft SQL Server. &amp;nbsp;One can use commands such as the following to send requests from a database:&lt;/p&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;&lt;code style=&quot;background-color: rgba(29, 28, 29, 0.04); border-radius: 0.3rem; border: 0.1rem solid rgba(29, 28, 29, 0.13); box-sizing: inherit; color: #e01e5a; font-family: monospace, monospace; padding: 0.5rem 1rem;&quot;&gt;SELECT title FROM publications WHERE author = &#39; J. K. Rowling’;&lt;/code&gt;&lt;/p&gt;&lt;pre style=&quot;background-color: #f5f8ff; border: 0.1rem solid rgb(205, 213, 228); box-sizing: inherit; font-family: monospace, monospace; tab-size: 4;&quot;&gt;&lt;code class=&quot;language-plaintext hljs&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: inherit; color: #444444; display: block; font-family: monospace, monospace; overflow-x: auto; padding: 0.5rem 1rem;&quot;&gt;Note that SQL is not case sensitive. However, it is a good practice to write the SQL keywords in CAPS and other names and variables in a small case.&lt;/code&gt;&lt;/pre&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-database&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;5. What does a MySQL database contain?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;A MySQL database contains one or more tables, each of which contains records or rows. Within these rows are various columns or fields that contain the data itself.&lt;/p&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;interact-with-mysql&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;6. How can you interact with MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;There are three main ways you can interact with MySQL:&amp;nbsp;&lt;/p&gt;&lt;ul style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; list-style-image: initial; list-style-position: initial; margin: 0px; padding: 0px 0px 0px 2em;&quot;&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;using a command line&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;via a web interface&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;through a programming language&lt;/li&gt;&lt;/ul&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-database-queries&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;7. What are MySQL Database Queries?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;A query is a specific request or a question. One can query a database for specific information and have a record returned.&lt;/p&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-commands&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;8. What are some of the common MySQL commands?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;figure class=&quot;table&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; overflow: auto; position: relative;&quot;&gt;&lt;table style=&quot;border-spacing: 0px; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px auto;&quot;&gt;&lt;thead style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;th style=&quot;background-color: #cdd5e4; border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem; position: sticky; text-align: left; top: 0px; vertical-align: middle; white-space: nowrap; z-index: 10;&quot;&gt;Command&lt;/th&gt;&lt;th style=&quot;background-color: #cdd5e4; border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem; position: sticky; text-align: left; top: 0px; vertical-align: middle; white-space: nowrap; z-index: 10;&quot;&gt;Action&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;ALTER&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;To alter a database or table&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;BACKUP&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;To back-up a table&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;\c&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;To cancel Input&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;CREATE&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;To create a database&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;DELETE&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;To delete a row from a table&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;DESCRIBE&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;To describe a table&#39;s columns&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;DROP&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;To delete a database or table&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;EXIT(ctrl+c)&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;To exit&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;GRANT&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;To change user privileges&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;HELP (\h, \?)&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Display help&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;INSERT&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Insert data&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;LOCK&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Lock table(s)&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;QUIT(\q)&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Same as EXIT&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;RENAME&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Rename a Table&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;SHOW&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;List details about an object&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;SOURCE&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Execute a file&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;STATUS (\s)&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Display the current status&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;TRUNCATE&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Empty a table&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;UNLOCK&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Unlock table(s)&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;UPDATE&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Update an existing record&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;USE&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Use a database&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/figure&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;create-database-mysql&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;9. How do you create a database in MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;Use the following command to create a new database called ‘books’:&lt;/p&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;&lt;code style=&quot;background-color: rgba(29, 28, 29, 0.04); border-radius: 0.3rem; border: 0.1rem solid rgba(29, 28, 29, 0.13); box-sizing: inherit; color: #e01e5a; font-family: monospace, monospace; padding: 0.5rem 1rem;&quot;&gt;CREATE DATABASE books;&lt;/code&gt;&lt;/p&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-create-table&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;10. How do you create a table using MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;Use the following to create a table using MySQL:&lt;/p&gt;&lt;pre style=&quot;background-color: #f5f8ff; border: 0.1rem solid rgb(205, 213, 228); box-sizing: inherit; font-family: monospace, monospace; tab-size: 4;&quot;&gt;&lt;code class=&quot;language-plaintext hljs&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: inherit; color: #444444; display: block; font-family: monospace, monospace; overflow-x: auto; padding: 0.5rem 1rem;&quot;&gt;CREATE TABLE history (
author VARCHAR(128),
title VARCHAR(128),
type VARCHAR(16),
year CHAR(4)) ENGINE InnoDB;&lt;/code&gt;&lt;/pre&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-insert-data&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;11. How do you Insert Data Into MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;The INSERT INTO statement is used to add new records to a MySQL table:&lt;/p&gt;&lt;pre style=&quot;background-color: #f5f8ff; border: 0.1rem solid rgb(205, 213, 228); box-sizing: inherit; font-family: monospace, monospace; tab-size: 4;&quot;&gt;&lt;code class=&quot;language-plaintext hljs&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: inherit; color: #444444; display: block; font-family: monospace, monospace; overflow-x: auto; padding: 0.5rem 1rem;&quot;&gt;INSERT INTO table_name (column1, column2, column3,...)
VALUES (value1, value2, value3,...)&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;If we want to add values for all the columns of the table, we do not need to specify the column names in the SQL query. However, the order of the values should be in the same order as the columns in the table. The INSERT INTO syntax would be as follows:&lt;/p&gt;&lt;pre style=&quot;background-color: #f5f8ff; border: 0.1rem solid rgb(205, 213, 228); box-sizing: inherit; font-family: monospace, monospace; tab-size: 4;&quot;&gt;&lt;code class=&quot;language-plaintext hljs&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: inherit; color: #444444; display: block; font-family: monospace, monospace; overflow-x: auto; padding: 0.5rem 1rem;&quot;&gt;INSERT INTO table_name
VALUES (value1, value2, value3, ...);&lt;/code&gt;&lt;/pre&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;sql-drop-column&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;12. How do you remove a column from a database?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;You can remove a column by using the DROP keyword:&lt;/p&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;&lt;code style=&quot;background-color: rgba(29, 28, 29, 0.04); border-radius: 0.3rem; border: 0.1rem solid rgba(29, 28, 29, 0.13); box-sizing: inherit; color: #e01e5a; font-family: monospace, monospace; padding: 0.5rem 1rem;&quot;&gt;ALTER TABLE classics DROP pages;&lt;/code&gt;&lt;/p&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-create-index&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;13. How to create an Index in MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;In MySQL, there are different index types, such as a regular INDEX, a PRIMARY KEY, or a FULLTEXT index. You can achieve fast searches with the help of an index. Indexes speed up performance by either ordering the data on disk so it&#39;s quicker to find your result or, telling the SQL engine where to go to find your data.&lt;/p&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;Example: Adding indexes to the history table:&lt;/p&gt;&lt;pre style=&quot;background-color: #f5f8ff; border: 0.1rem solid rgb(205, 213, 228); box-sizing: inherit; font-family: monospace, monospace; tab-size: 4;&quot;&gt;&lt;code class=&quot;language-plaintext hljs&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: inherit; color: #444444; display: block; font-family: monospace, monospace; overflow-x: auto; padding: 0.5rem 1rem;&quot;&gt;ALTER TABLE history ADD INDEX(author(10));
ALTER TABLE history ADD INDEX(title(10));
ALTER TABLE history ADD INDEX(category(5));
ALTER TABLE history ADD INDEX(year);
DESCRIBE history;&lt;/code&gt;&lt;/pre&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-delete-query&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;14. How to Delete Data From a MySQL Table?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;In MySQL, the DELETE statement is used to delete records from a table:&lt;/p&gt;&lt;pre style=&quot;background-color: #f5f8ff; border: 0.1rem solid rgb(205, 213, 228); box-sizing: inherit; font-family: monospace, monospace; tab-size: 4;&quot;&gt;&lt;code class=&quot;language-plaintext hljs&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: inherit; color: #444444; display: block; font-family: monospace, monospace; overflow-x: auto; padding: 0.5rem 1rem;&quot;&gt;DELETE FROM table_name
WHERE column_name = value_name&lt;/code&gt;&lt;/pre&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;view-database-mysql&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;15. How do you view a database in MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;One can view all the databases on the MySQL server host using the following command:&lt;/p&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;&lt;code style=&quot;background-color: rgba(29, 28, 29, 0.04); border-radius: 0.3rem; border: 0.1rem solid rgba(29, 28, 29, 0.13); box-sizing: inherit; color: #e01e5a; font-family: monospace, monospace; padding: 0.5rem 1rem;&quot;&gt;mysql&amp;gt; SHOW DATABASES; &amp;nbsp;&lt;/code&gt;&lt;/p&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-numeric-data-types&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;16. What are the Numeric Data Types in MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;MySQL has numeric data types for integer, fixed-point, floating-point, and bit values, as shown in the table below. Numeric types can be signed or unsigned, except BIT. A special attribute enables the automatic generation of sequential integer or floating-point column values, which is useful for applications that require a series of unique identification numbers.&lt;/p&gt;&lt;figure class=&quot;table&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; overflow: auto; position: relative;&quot;&gt;&lt;table style=&quot;border-spacing: 0px; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px auto;&quot;&gt;&lt;thead style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;th style=&quot;background-color: #cdd5e4; border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem; position: sticky; text-align: left; top: 0px; vertical-align: middle; white-space: nowrap; z-index: 10;&quot;&gt;Type Name&lt;/th&gt;&lt;th style=&quot;background-color: #cdd5e4; border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem; position: sticky; text-align: left; top: 0px; vertical-align: middle; white-space: nowrap; z-index: 10;&quot;&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;TINYINT&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Very Small Integer&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;SMALLINT&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Small Integer&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;MEDIUMINT&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Medium-sized Integer&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;INT&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Standard Integer&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;BIGINT&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Large Integer&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;DECIMAL&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Fixed-point number&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;FLOAT&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Single-precision floating-point number&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;DOUBLE&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Double-precision floating-point number&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;BIT&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Bit-field&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/figure&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-string-data-types&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;17. What are the String Data Types in MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;figure class=&quot;table&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; overflow: auto; position: relative;&quot;&gt;&lt;table style=&quot;border-spacing: 0px; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px auto;&quot;&gt;&lt;thead style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;th style=&quot;background-color: #cdd5e4; border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem; position: sticky; text-align: left; top: 0px; vertical-align: middle; white-space: nowrap; z-index: 10;&quot;&gt;Type Name&lt;/th&gt;&lt;th style=&quot;background-color: #cdd5e4; border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem; position: sticky; text-align: left; top: 0px; vertical-align: middle; white-space: nowrap; z-index: 10;&quot;&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;CHAR&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;fixed-length nonbinary(character) string&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;VARCHAR&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;variable-length nonbinary string&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;BINARY&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;fixed-length binary string&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;VARBINARY&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;variable-length binary string&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;TINYBLOB&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Very small BLOB(binary large object)&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;BLOB&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Small BLOB&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;MEDIUMBLOB&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Medium-sized BLOB&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;LONGBLOB&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Large BLOB&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;TINYTEXT&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;A very small nonbinary string&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;TEXT&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Small nonbinary string&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;MEDIUMTEXT&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Medium-sized nonbinary string&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;LONGTEXT&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Large nonbinary string&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;ENUM&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;An enumeration; each column value is assigned, one enumeration member&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;SET&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;A set; each column value is assigned zero or more set members&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;NULL&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;NULL in SQL is the term used to represent a missing value. A NULL value in a table is a value in a field that appears to be blank. This value is different than a zero value or a field that contains spaces.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/figure&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-temporal-data-types&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;18. What are the Temporal Data Types in MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;figure class=&quot;table&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; overflow: auto; position: relative;&quot;&gt;&lt;table style=&quot;border-spacing: 0px; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px auto;&quot;&gt;&lt;thead style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;th style=&quot;background-color: #cdd5e4; border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem; position: sticky; text-align: left; top: 0px; vertical-align: middle; white-space: nowrap; z-index: 10;&quot;&gt;Type Name&lt;/th&gt;&lt;th style=&quot;background-color: #cdd5e4; border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem; position: sticky; text-align: left; top: 0px; vertical-align: middle; white-space: nowrap; z-index: 10;&quot;&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;DATE&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;A date value, in &#39; CCYY-MM-DD &#39; Format&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;TIME&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;A Time value, in &#39; hh : mm :ss &#39; format&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;DATETIME&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;Date and time value, in &#39; CCYY-MM-DD hh : mm :ss &#39; format&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #e4eeff; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;TIMESTAMP&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;A timestamp value, in &#39; CCYY-MM-DD hh : mm :ss &#39; format&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: #f2f6fd; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;YEAR&lt;/td&gt;&lt;td style=&quot;border: 0.2rem solid rgb(255, 255, 255); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding: 0.6rem 2rem;&quot;&gt;A year value, in CCYY or YY format&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/figure&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;Example: To select the records with an Order Date of &quot;2018-11-11&quot; from a table:&lt;/p&gt;&lt;pre style=&quot;background-color: #f5f8ff; border: 0.1rem solid rgb(205, 213, 228); box-sizing: inherit; font-family: monospace, monospace; tab-size: 4;&quot;&gt;&lt;code class=&quot;language-plaintext hljs&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: inherit; color: #444444; display: block; font-family: monospace, monospace; overflow-x: auto; padding: 0.5rem 1rem;&quot;&gt;SELECT * FROM Orders WHERE OrderDate=&#39;2018-11-11&#39;&lt;/code&gt;&lt;/pre&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-blob&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;19. What is BLOB in MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;BLOB is an acronym that stands for a binary large object. It is used to hold a variable amount of data.&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;There are four types of BLOB:&lt;/p&gt;&lt;ul style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; list-style-image: initial; list-style-position: initial; margin: 0px; padding: 0px 0px 0px 2em;&quot;&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;TINYBLOB&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;BLOB&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;MEDIUMBLOB&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;LONGBLOB&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;A BLOB can hold a very large amount of data. For example - documents, images, and even videos. You could store your complete novel as a file in a BLOB if needed.&lt;/p&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-add-users&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;20. How to add users in MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;You can add a User by using the CREATE command and specifying the necessary credentials. For example:&lt;/p&gt;&lt;pre style=&quot;background-color: #f5f8ff; border: 0.1rem solid rgb(205, 213, 228); box-sizing: inherit; font-family: monospace, monospace; tab-size: 4;&quot;&gt;&lt;code class=&quot;language-plaintext hljs&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: inherit; color: #444444; display: block; font-family: monospace, monospace; overflow-x: auto; padding: 0.5rem 1rem;&quot;&gt;CREATE USER ‘testuser’ IDENTIFIED BY ‘sample password’;&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;/article&gt;&lt;/section&gt;&lt;/div&gt;&lt;div id=&quot;mysql-intermediate-questions&quot; style=&quot;background-color: white; box-sizing: inherit; color: #515151; font-family: -apple-system, system-ui, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5;&quot;&gt;&lt;h2 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Intermediate MySQL Interview Questions&lt;/span&gt;&lt;/h2&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-views&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;21. What are MySQL “Views”?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;In MySQL, a view consists of a set of rows that is returned if a particular query is executed. This is also known as a ‘virtual table’. Views make it easy to retrieve the way of making the query available via an alias.&amp;nbsp;&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;The advantages of views are:&lt;/p&gt;&lt;ul style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; list-style-image: initial; list-style-position: initial; margin: 0px; padding: 0px 0px 0px 2em;&quot;&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;Simplicity&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;Security&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;Maintainability&lt;/li&gt;&lt;/ul&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;create-and-execute-views-mysql&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;22. How do you create and execute views in MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;Creating a view is accomplished with the CREATE VIEW statement. As an example:&lt;/p&gt;&lt;pre style=&quot;background-color: #f5f8ff; border: 0.1rem solid rgb(205, 213, 228); box-sizing: inherit; font-family: monospace, monospace; tab-size: 4;&quot;&gt;&lt;code class=&quot;language-plaintext hljs&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; box-sizing: inherit; color: #444444; display: block; font-family: monospace, monospace; overflow-x: auto; padding: 0.5rem 1rem;&quot;&gt;CREATE
   [OR REPLACE]
   [ALGORITHM = {MERGE | TEMPTABLE | UNDEFINED }]
   [DEFINER = { user | CURRENT_USER }]
   [SQL SECURITY { DEFINER | INVOKER }]
   VIEW view_name [(column_list)]
   AS select_statement
   [WITH [CASCADED | LOCAL] CHECK OPTION]&lt;/code&gt;&lt;/pre&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-triggers&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;23. What are MySQL Triggers?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;A trigger is a task that executes in response to some predefined database event, such as after a new row is added to a particular table. Specifically, this event involves inserting, modifying, or deleting table data, and the task can occur either prior to or immediately following any such event.&amp;nbsp;&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;Triggers have many purposes, including:&lt;/p&gt;&lt;ul style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; list-style-image: initial; list-style-position: initial; margin: 0px; padding: 0px 0px 0px 2em;&quot;&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;Audit Trails&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;Validation&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;Referential integrity enforcement&lt;/li&gt;&lt;/ul&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;how-many-triggers-are-allowed-in-mysql-table&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;24. How many Triggers are possible in MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;There are six Triggers allowed to use in the MySQL database:&lt;/p&gt;&lt;ul style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; list-style-image: initial; list-style-position: initial; margin: 0px; padding: 0px 0px 0px 2em;&quot;&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;Before Insert&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;After Insert&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;Before Update&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;After Update&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;Before Delete&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;After Delete&lt;/li&gt;&lt;/ul&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-server&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;25. What is the MySQL server?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;The server, mysqld, is the hub of a MySQL installation; it performs all manipulation of databases and tables.&lt;/p&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-clients-utilities&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;26. What are the MySQL clients and utilities?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;Several MySQL programs are available to help you communicate with the server. For administrative tasks, some of the most important ones are listed here:&lt;/p&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;•&amp;nbsp;&lt;span face=&quot;-apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial&quot; style=&quot;box-sizing: inherit; font-weight: bolder; line-height: 1.5;&quot;&gt;mysql&lt;/span&gt;—An interactive program that enables you to send SQL statements to the server and to view the results. You can also use mysql to execute batch scripts (text files containing SQL statements).&lt;/p&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;•&amp;nbsp;&lt;span face=&quot;-apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial&quot; style=&quot;box-sizing: inherit; font-weight: bolder; line-height: 1.5;&quot;&gt;mysqladmin&lt;/span&gt;—An administrative program for performing tasks such as shutting down the server, checking its configuration, or monitoring its status if it appears not to be functioning properly.&lt;/p&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;•&amp;nbsp;&lt;span face=&quot;-apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial&quot; style=&quot;box-sizing: inherit; font-weight: bolder; line-height: 1.5;&quot;&gt;mysqldump&lt;/span&gt;—A tool for backing up your databases or copying databases to another server.&lt;/p&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;•&amp;nbsp;&lt;span face=&quot;-apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial&quot; style=&quot;box-sizing: inherit; font-weight: bolder; line-height: 1.5;&quot;&gt;mysqlcheck and myisamchk&lt;/span&gt;—Programs that help you perform table checking, analysis, and optimization, as well as repairs if tables become damaged. mysqlcheck works with MyISAM tables and to some extent with tables for other storage engines. myisamchk is for use only with MyISAM tables.&lt;/p&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-relationships-types&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;27. What are the types of relationships used in MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;There are three categories of relationships in MySQL:&lt;/p&gt;&lt;ul style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; list-style-image: initial; list-style-position: initial; margin: 0px; padding: 0px 0px 0px 2em;&quot;&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;span face=&quot;-apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial&quot; style=&quot;box-sizing: inherit; font-weight: bolder; line-height: 1.5;&quot;&gt;One-to-One&lt;/span&gt;: Usually, when two items have a one-to-one relationship, you just include them as columns in the same table.&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;&lt;span face=&quot;-apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial&quot; style=&quot;box-sizing: inherit; font-weight: bolder; line-height: 1.5;&quot;&gt;One-to-Many&lt;/span&gt;: One-to-many (or many-to-one) relationships occur when one row in one table is linked to many rows in another table.&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;&lt;span face=&quot;-apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial&quot; style=&quot;box-sizing: inherit; font-weight: bolder; line-height: 1.5;&quot;&gt;Many-to-Many&lt;/span&gt;: In a many-to-many relationship, many rows in one table are linked to many rows in another table. To create this relationship, add a third table containing the same key column from each of the other tables&lt;/li&gt;&lt;/ul&gt;&lt;/article&gt;&lt;/section&gt;&lt;/div&gt;&lt;div id=&quot;mysql-advanced-questions&quot; style=&quot;background-color: white; box-sizing: inherit; color: #515151; font-family: -apple-system, system-ui, &amp;quot;system-ui&amp;quot;, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5;&quot;&gt;&lt;h2 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Advanced MySQL Interview Questions&lt;/span&gt;&lt;/h2&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-logical-architecture&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;28. Can you explain the logical architecture of MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;The top layer contains the services most network-based client/server tools or servers need such as connection handling, authentication, security, and so forth.&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;The second layer contains much of MySQL’s brains. This has the code for query parsing, analysis, optimization, caching, and all the built-in functions.&lt;/p&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;The third layer contains the storage engines that are responsible for storing and retrieving the data stored in MySQL.&lt;/p&gt;&lt;figure class=&quot;image image_resized&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 1rem; margin-left: auto; margin-right: auto; min-width: auto; text-align: center; width: 493px;&quot;&gt;&lt;img data-src=&quot;https://s3.ap-south-1.amazonaws.com/myinterviewtrainer-domestic/public_assets/assets/000/000/104/original/Artboard_28.png?1615216675&quot; src=&quot;https://s3.ap-south-1.amazonaws.com/myinterviewtrainer-domestic/public_assets/assets/000/000/104/original/Artboard_28.png?1615216675&quot; style=&quot;border-style: none; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; height: auto; line-height: 1.5; max-width: 100%;&quot; /&gt;&lt;/figure&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-scaling&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;29. What is Scaling in MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;In MySQL, scaling capacity is actually the ability to handle the load, and it’s useful to think of load from several different angles such as:&lt;/p&gt;&lt;ul style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; list-style-image: initial; list-style-position: initial; margin: 0px; padding: 0px 0px 0px 2em;&quot;&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;Quantity of data&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;Number of users&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;User activity&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; padding-top: 0.4rem;&quot;&gt;Size of related datasets&lt;/li&gt;&lt;/ul&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;what-is-sharding-in-sql&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;30. What is Sharding in SQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;The process of breaking up large tables into smaller chunks (called shards) that are spread across multiple servers is called Sharding.&amp;nbsp;&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;The advantage of Sharding is that since the sharded database is generally much smaller than the original; queries, maintenance, and all other tasks are much faster.&lt;/p&gt;&lt;/article&gt;&lt;/section&gt;&lt;section class=&quot;ibpage-article-header&quot; id=&quot;mysql-transaction-storage-engines&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin: 0px 0px 1rem;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;31. What are Transaction Storage Engines in MySQL?&lt;/span&gt;&lt;/h3&gt;&lt;article class=&quot;ibpage-article&quot; style=&quot;box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; line-height: 1.5; margin-bottom: 2rem;&quot;&gt;&lt;p style=&quot;box-sizing: inherit; color: #373e3f; font-family: -apple-system, system-ui, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, &amp;quot;Source Sans Pro&amp;quot;, Helvetica, Arial; letter-spacing: 0.1px; line-height: 1.5; margin: 0px 0px 2rem;&quot;&gt;To be able to use MySQL’s transaction facility, you have to be using MySQL’s InnoDB storage engine (which is the default from version 5.5 onward). If you are not sure which version of MySQL your code will be running on, rather than assuming InnoDB is the default engine you can force its use when creating a table, as follows.&lt;/p&gt;&lt;h1 style=&quot;box-sizing: border-box; color: #272c37; font-family: Roboto, sans-serif; letter-spacing: normal; line-height: 26px; margin-bottom: 24px; margin-top: 32px; text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;What are the advantages of using MySQL?&lt;/span&gt;&lt;/h1&gt;&lt;p style=&quot;box-sizing: border-box; color: #51565e; font-family: Roboto, sans-serif; letter-spacing: normal; line-height: 26px; margin-bottom: 26px; margin-top: 0px;&quot;&gt;MySQL is a fast, stable, and reliable solution that provides advantages like:&lt;/p&gt;&lt;ul style=&quot;box-sizing: border-box; color: #51565e; font-family: Roboto, sans-serif; letter-spacing: normal; list-style-image: initial; list-style-position: initial; margin-bottom: 1rem; margin-left: 20px; margin-top: 0px; padding: 0px;&quot;&gt;&lt;li aria-level=&quot;1&quot; style=&quot;box-sizing: border-box; line-height: 24px; margin-bottom: 14px;&quot;&gt;Data Security – most secure and reliable&amp;nbsp;&lt;a href=&quot;https://www.simplilearn.com/what-is-database-management-article&quot; rel=&quot;noopener&quot; style=&quot;box-sizing: border-box; color: #1179ef; cursor: pointer; text-decoration-line: none;&quot; target=&quot;_blank&quot; title=&quot;database management&quot;&gt;database management&lt;/a&gt;&amp;nbsp;system&lt;/li&gt;&lt;li aria-level=&quot;1&quot; style=&quot;box-sizing: border-box; line-height: 24px; margin-bottom: 14px;&quot;&gt;Flexibility – runs on all operating systems; features 24X7 support and enterprise indemnification&lt;/li&gt;&lt;li aria-level=&quot;1&quot; style=&quot;box-sizing: border-box; line-height: 24px; margin-bottom: 14px;&quot;&gt;High Performance – powerful, designed to meet highly demanding applications while maintaining optimum speed and high performance&lt;/li&gt;&lt;li aria-level=&quot;1&quot; style=&quot;box-sizing: border-box; line-height: 24px; margin-bottom: 14px;&quot;&gt;On-demand Scalability – offers on-demand scalability and complete customization&lt;/li&gt;&lt;li aria-level=&quot;1&quot; style=&quot;box-sizing: border-box; line-height: 24px; margin-bottom: 14px;&quot;&gt;Enterprise-level SQL Features – the enterprise edition includes advanced features and management tools, and technical support for enterprise&lt;/li&gt;&lt;li aria-level=&quot;1&quot; style=&quot;box-sizing: border-box; line-height: 24px; margin-bottom: 14px;&quot;&gt;Full-text Indexing and Searching – has support for full-text indexing and searching&lt;/li&gt;&lt;li aria-level=&quot;1&quot; style=&quot;box-sizing: border-box; line-height: 24px; margin-bottom: 14px;&quot;&gt;Query Caching – unique memory caches help enhance the speed of MySQL greatly&lt;/li&gt;&lt;li aria-level=&quot;1&quot; style=&quot;box-sizing: border-box; line-height: 24px; margin-bottom: 14px;&quot;&gt;Replication – one MySQL server can be duplicated on another, resulting in numerous benefits&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;2&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;What are a few benefits of utilising MySQL?&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;&lt;h3 id=&quot;20&quot; style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;MySQL is adaptable and available for all operating systems.&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;Strength: MySQL prioritises performance.&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;Enterprise-level SQL Capabilities: For a while, MySQL lacked sophisticated features like stored procedures, views, and subqueries.&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;Indexing and searching of full-text&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;Query Caching: This significantly speeds up MySQL.&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;Replication: Duplicating a MySQL server on another offers a number of benefits.&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;Settings and Security&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;3&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;What data is stored in a MySQL database?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;One or more tables, each containing records or rows, can be found in a MySQL database. Various columns or fields that house the actual data are contained within these rows.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;4&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;What does a system&#39;s traditional network library look like?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;The named pipes in both Windows and POSIX systems offer means of inter-process communication to link many processes running on the same machine. Data can be transferred without hurting performance because there is no longer a need to use the network stack. Named pipes are created by servers to receive requests. To transmit the request, the client process needs to be aware of the precise pipe name.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;5&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;What is MySQL Server&#39;s standard port?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;The MySQL Server&#39;s default port is 3306. Another common default port for SQL Server is 1433 in TCP/IP.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;6&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;How does MySQL construct an index?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;There are various index types in MySQL, including a standard INDEX, a PRIMARY KEY, and a FULLTEXT index. With the use of an index, quick searches can be accomplished. Indexes improve efficiency by either directing the SQL engine where to look for your data or by arranging the data on disc in a way that makes it easier to find your result.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Let&#39;s see an example:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;border: solid gray; box-sizing: border-box; overflow: auto; width: auto;&quot;&gt;&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 2px solid rgb(245, 245, 245); box-sizing: border-box; color: #333333; display: block; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; line-height: 16.25px; margin: 0px; overflow-wrap: break-word; overflow: scroll auto; padding: 10px; word-break: break-all;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;ALTER&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt; history &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;ADD&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;INDEX&lt;/span&gt;(&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;size&lt;/span&gt;(&lt;span style=&quot;box-sizing: border-box; color: #0000dd; font-weight: bold;&quot;&gt;10&lt;/span&gt;));
&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;ALTER&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt; history &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;ADD&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;INDEX&lt;/span&gt;(title(&lt;span style=&quot;box-sizing: border-box; color: #0000dd; font-weight: bold;&quot;&gt;10&lt;/span&gt;));
&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;ALTER&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt; history &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;ADD&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;INDEX&lt;/span&gt;(price(&lt;span style=&quot;box-sizing: border-box; color: #0000dd; font-weight: bold;&quot;&gt;5&lt;/span&gt;));
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;7&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;What kinds of tables are there in MySQL?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Numerous tables are always present by default. However, MySQL&#39;s default database engine is MyISAM. There are now five different kinds of tables:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;MYISAM&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;Heap&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;Merge&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;INNO DB&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;ISAM&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;8&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;How is the MySQL version checked?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Using the command listed below, we can determine the MySQL version on Linux:&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;mysql -v&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;When we launched the MySQL command-line tool on Windows, the version information was presented without the usage of any flags. Use the following phrase to learn more about the server information:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;border: solid gray; box-sizing: border-box; overflow: auto; width: 550px;&quot;&gt;&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 2px solid rgb(245, 245, 245); box-sizing: border-box; color: #333333; display: block; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; line-height: 16.25px; margin: 0px; overflow-wrap: break-word; overflow: scroll auto; padding: 10px; word-break: break-all;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;SHOW&lt;/span&gt; VARIABLES &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;LIKE&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #aa6600;&quot;&gt;&quot;%version%&quot;&lt;/span&gt;;
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;9&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;How can users be added in MySQL?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;By executing the CREATE command and providing the required information, you can add a User.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Let&#39;s see an example:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;border: solid gray; box-sizing: border-box; overflow: auto; width: auto;&quot;&gt;&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 2px solid rgb(245, 245, 245); box-sizing: border-box; color: #333333; display: block; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; line-height: 16.25px; margin: 0px; overflow-wrap: break-word; overflow: scroll auto; padding: 10px; word-break: break-all;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;CREATE&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;USER&lt;/span&gt; &lt;span style=&quot;background-color: #ffaaaa; box-sizing: border-box; color: red;&quot;&gt;‘&lt;/span&gt;testuser&lt;span style=&quot;background-color: #ffaaaa; box-sizing: border-box; color: red;&quot;&gt;’&lt;/span&gt; IDENTIFIED &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;BY&lt;/span&gt; &lt;span style=&quot;background-color: #ffaaaa; box-sizing: border-box; color: red;&quot;&gt;‘&lt;/span&gt;sample password&lt;span style=&quot;background-color: #ffaaaa; box-sizing: border-box; color: red;&quot;&gt;’&lt;/span&gt;;
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;10&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;How do MySQL &quot;Views&quot; work?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;A view in MySQL is a collection of rows that are returned by a certain query. It is frequently referred to as a &quot;virtual table.&quot; Accessing the method of making the query available via an alias is made simple by views.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Benefits of this are:&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;Simplicity&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;Security&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;Maintainability&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;11&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;How can I access a MySQL database?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;There are primarily two ways that MySQL enables us to connect to the database server:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;The bin directory of the MySQL installation folder contains the command-line client utility. To run this software, use the following command in the bin directory of the installation folder:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;mysql&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;To connect to the MySQL Server, we must next perform the command below:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: red; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;shell&amp;gt;mysql -u root -p&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Finally, key in the root user account password and hit Enter:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: red; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Enter password: ********&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Using the command below after a successful connection, we can use the:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: red; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;USE database_name;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;12&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;What do MySQL DDL, DML, and DCL mean?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;DDL&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Data Definition Language, abbreviated as DDL in MySQL, is used in database schemas and descriptions to specify how data should be stored in the database.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Some queries are:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;CREATE&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;ALTER&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;DROP&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;TRUNCATE&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;COMMENT&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;RENAME&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;DML&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Data Manipulation Language, or DML for short, is used to manipulate data and mostly consists of standard SQL statements that store, change, retrieve, remove, and update data in databases.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Some queries are:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;SELECT&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;INSERT&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;UPDATE&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;DELETE&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;MERGE&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;CALL&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;EXPLAIN PLAN&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;LOCK TABLE&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;DCL&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Data Control Language, or DCL for short, is a set of commands that deal with user rights, permissions, and other controls within the database system.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Some queries are:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;GRANT&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;REVOKE&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;13&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;In MySQL, what is a join?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;To query data from two or more tables in MySQL, utilise joins. The relationship between a few table columns is used to create the query. In MySQL, there are four different join kinds.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Joins in SQL&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;If there is at least one match in both tables, an inner join yields rows. Even if there is no match in the right table, a left join nevertheless returns every row from the left table. Even if there are no matches in the left table, a right join nevertheless returns all the rows from the right table. If there is at least one match between the tables, a full join would return rows.&lt;/span&gt;&lt;/p&gt;&lt;img class=&quot;center&quot; src=&quot;https://logicmojo.com/assets/dist/new_pages/images/joins-in-mysql.png&quot; style=&quot;border: 0px; box-sizing: border-box; display: block; height: auto; margin-left: auto; margin-right: auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;50%&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;14&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;Distinguish between CHAR and VARCHAR?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;CHAR is used to provide the fixed length of the table and columns when a table is constructed. The length value may fall between 1-255. The column and table lengths can be changed as needed by using the VARCHAR command.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;16&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;What does SQL sharding mean?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Sharding is the act of splitting up huge tables into smaller pieces that are dispersed among numerous servers (referred to as shards). Since the sharded database is typically significantly smaller than the original, searches, maintenance, and all other chores are substantially faster as a result of sharding.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;17&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;What do MySQL&#39;s Transaction Storage Engines do?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;You must be using MySQL&#39;s InnoDB storage engine in order to use the transaction function (which is the default from version 5.5 onward). Instead of assuming InnoDB is the default engine when establishing a table if you are unsure of the version of MySQL your code will be executing on, you can force its use by doing the following.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;18&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;What kinds of relationships are there in MySQL?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;In MySQL, there are three types of relationships:&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;One-to-One: Normally, you only add the two things as columns in the same table when they are related one-to-one.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;One-to-Many: One row in one table may be connected to numerous rows in another table in a one-to-many (or many-to-one) relationship.&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;Many-to-Many: Many rows in one table are connected to many rows in another table in a many-to-many relationship. Add a third table containing the identical key column from each of the other tables to establish this relationship.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;19&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;What are the clients and utilities for MySQL?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;You can communicate with the server using a variety of MySQL tools. Here is a list of some of the most significant administrative tasks:&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;• mysql – An interactive programme that lets you issue SQL commands to the server and view the responses. Mysql can also be used to run batch scripts (text files containing SQL statements).&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;• Mysqladmin is an administration tool that can be used to shut down the server, examine its settings, or check on its status if something doesn&#39;t seem right.&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;• Mysqldump is a programme for creating database backups and moving databases to different servers.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Programs that assist with table checking, analysis, and optimization as well as fixes when tables are destroyed include mysqlcheck and myisamchk. MyISAM tables and some tables for other storage engines are compatible with mysqlcheck. Only MyISAM tables should be used with myisamchk.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;20&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;Describe MySQL&#39;s logical architecture?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;The services needed by the majority of network-based client/server technologies, such as connection handling, security, authentication, etc., are included in the top layer.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Code for query parsing, optimization, analysis, caching, and other built-in functions are all contained in the second layer.&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;The third layer consists of storage engines, which are used to store and retrieve data from MySQL.&lt;/span&gt;&lt;/p&gt;&lt;img class=&quot;center&quot; src=&quot;https://logicmojo.com/assets/dist/new_pages/images/architect-mysql.png&quot; style=&quot;border: 0px; box-sizing: border-box; display: block; height: auto; margin-left: auto; margin-right: auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;50%&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;21&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;How can a table in MySQL be updated?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;The UPDATE statement, which includes the SET and WHERE clauses, can be used to update already-existing records in a table. The values of the designated column are modified by the SET clause. It is optional to use the WHERE clause, which is used to define the condition. This statement can also be used to modify values in a single row&#39;s or many rows&#39; worth of columns at once. The generic syntax for the UPDATE command to update data in the MySQL table is as follows:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;border: solid gray; box-sizing: border-box; overflow: auto; width: auto;&quot;&gt;&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 2px solid rgb(245, 245, 245); box-sizing: border-box; color: #333333; display: block; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; line-height: 16.25px; margin: 0px; overflow-wrap: break-word; overflow: scroll auto; padding: 10px; word-break: break-all;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;UPDATE&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;table_name&lt;/span&gt;     
&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;SET&lt;/span&gt; field1&lt;span style=&quot;box-sizing: border-box; color: #333333;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;box-sizing: border-box; color: #333333;&quot;&gt;-&lt;/span&gt;value1, field2&lt;span style=&quot;box-sizing: border-box; color: #333333;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;box-sizing: border-box; color: #333333;&quot;&gt;-&lt;/span&gt;value2, ...    
[&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; Clause]    
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;22&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;How to create a Trigger in MySQL?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;When specific events on a specific table or view in the database take place, a trigger is a procedural piece of code in the database that automatically runs. It can be run whenever records are added to a table or whenever any columns are modified.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;The syntax used to construct a trigger in MySQL is as follows:&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;Referential integrity rules and entity integrity rules are the two categories of integrity rules.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;border: solid gray; box-sizing: border-box; overflow: auto; width: auto;&quot;&gt;&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 2px solid rgb(245, 245, 245); box-sizing: border-box; color: #333333; display: block; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; line-height: 16.25px; margin: 0px; overflow-wrap: break-word; overflow: scroll auto; padding: 10px; word-break: break-all;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;CREATE&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;TRIGGER&lt;/span&gt; trigger_name    
    [&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;before&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #333333;&quot;&gt;|&lt;/span&gt; after]    
   &lt;span style=&quot;background-color: #ffaaaa; box-sizing: border-box; color: red;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;insert&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #333333;&quot;&gt;|&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;update&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #333333;&quot;&gt;|&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;delete&lt;/span&gt;&lt;span style=&quot;background-color: #ffaaaa; box-sizing: border-box; color: red;&quot;&gt;}&lt;/span&gt;    
    &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;ON&lt;/span&gt; table_name [&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;FOR&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;EACH&lt;/span&gt; ROW]    
    BEGIN    
        &lt;span style=&quot;box-sizing: border-box; color: #333333;&quot;&gt;--&lt;/span&gt;variable declarations    
        &lt;span style=&quot;box-sizing: border-box; color: #333333;&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;trigger&lt;/span&gt; code    
    END;   
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;23&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;How can a new user be created in MySQL?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;A record in the USER-TABLE in MySQL is known as a USER. It includes the login details, account permissions, and host details for the MySQL account needed to access and manage the databases. Using the MySQL Create User statement, we may add a new user account to the database server. It offers the new accounts authentication, SSL/TLS, resource-limit, role, and password management features.&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;The fundamental syntax for adding a new user in MySQL is as follows:&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;border: solid gray; box-sizing: border-box; overflow: auto; width: auto;&quot;&gt;&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 2px solid rgb(245, 245, 245); box-sizing: border-box; color: #333333; display: block; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; line-height: 16.25px; margin: 0px; overflow-wrap: break-word; overflow: scroll auto; padding: 10px; word-break: break-all;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;CREATE&lt;/span&gt; USER [&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;IF&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;EXISTS&lt;/span&gt;] account_name IDENTIFIED &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;BY&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0; box-sizing: border-box;&quot;&gt;&#39;password&#39;&lt;/span&gt;;   
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;24&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;How can I determine MySQL&#39;s second-highest salary?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;The LIMIT keyword is utilised by MySQL and can be used to restrict the result set. We can use it to get a range of rows, the first few rows, or the last few rows. Finding the second, third, or nth highest wage is another usage for it. It makes sure that you first sort the result set using the order by clause before printing the output that yields accurate results. The second-highest salary in MySQL may be obtained using the following query.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;border: solid gray; box-sizing: border-box; overflow: auto; width: auto;&quot;&gt;&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 2px solid rgb(245, 245, 245); box-sizing: border-box; color: #333333; display: block; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; line-height: 16.25px; margin: 0px; overflow-wrap: break-word; overflow: scroll auto; padding: 10px; word-break: break-all;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; salary   
&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; (&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; salary &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; employees &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;ORDER&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;BY&lt;/span&gt; salary &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;DESC&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;LIMIT&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #0000dd; font-weight: bold;&quot;&gt;2&lt;/span&gt;) &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;AS&lt;/span&gt; Emp &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;ORDER&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;BY&lt;/span&gt; salary &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;LIMIT&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;  
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;25&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;What distinguishes MySQL&#39;s TRUNCATE and DELETE operations?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;While DELETE is a DML operation, TRUNCATE is a DDL command.&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;The Where command can be used with the DELETE command but not the TRUNCATE QL.&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;DELETE may be used with indexed views whereas TRUNCATE cannot, and vice versa.&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;To remove data from a table, use the DELETE command. While truncate is a very risky operation that should be used carefully because it permanently deletes every row from a table, it merely removes the data rows from the table.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;26&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;How can I modify the MySQL database name?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Sometimes the database name needs to be changed or renamed due to the name&#39;s lack of meaning. We must first create a new database on the MySQL server before we can change the database name. The mysqldump shell command from MySQL is then available to make a dumped copy of the chosen database and import all the data into the newly made database. The syntax for the mysqldump command is as follows:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: red; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;mysqldump -u username -p &quot;password&quot; -R oldDbName &amp;gt; oldDbName.sql&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;To import the data into the just formed database, run the command below:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: red; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;mysql -u username -p&quot;password&quot; newDbName &amp;lt; oldDbName.sql&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;27&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;How can the MySQL primary key be deleted?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;A primary key in MySQL is a single field or a group of fields that are used to uniquely identify each record in a table. A column&#39;s primary key cannot be empty or null. Using the ALTER TABLE statement, a primary key can be eliminated from the table. The primary key can be deleted using the syntax shown below:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; color: red; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;ALTER TABLE table_name DROP PRIMARY KEY;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;28&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;In MySQL, how do you construct a stored procedure?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;A collection of SQL commands is known as a stored procedure, and it is saved in the database. The stored procedure may include SQL queries such as INSERT, UPDATE, DELETE, and others. By running a single statement, a procedure enables us to repeatedly employ the same code. It saves the data dictionary in the database.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;border: solid gray; box-sizing: border-box; overflow: auto; width: auto;&quot;&gt;&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 2px solid rgb(245, 245, 245); box-sizing: border-box; color: #333333; display: block; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; line-height: 16.25px; margin: 0px; overflow-wrap: break-word; overflow: scroll auto; padding: 10px; word-break: break-all;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;CREATE&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;PROCEDURE&lt;/span&gt; procedure_name [ (&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;parameter&lt;/span&gt; datatype [, &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;parameter&lt;/span&gt; datatype]) ]    
&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;BEGIN&lt;/span&gt;    
    Body_section &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;of&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;SQL&lt;/span&gt; statements  
&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;END&lt;/span&gt;;   
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;29&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;What does MySQL&#39;s &quot;i am a dummy flag&quot; do?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;If the WHERE clause is missing, the MySQL engine can reject any UPDATE or DELETE statement by setting the &quot;i am a dummy&quot; flag. Therefore, if the programmer does not use the WHERE clause, it can prevent him from accidentally removing the entire table.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;30&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;What security warnings do MySQL users receive?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Install antivirus software and set up the firewall in the operating system.&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;Never utilise the UNIX root user on the MySQL Server.&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;Change the root login information. Limit or turn off remote access.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;31&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;⌚&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;What other techniques can be used to optimise a MySQL query?&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Use &quot;sp_&quot; carefully when writing stored procedures.&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;When using the SELECT command, avoid using the symbol &quot;*&quot;. Also, don&#39;t include any extra columns in the SELECT clause.&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;When writing queries, table aliases are an option.&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;Don&#39;t use the % wildcard at the beginning of a predicate.&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;Only DISTINCT and UNION must be used, if necessary.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;32&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit; letter-spacing: 0.1px;&quot;&gt;⌚&lt;/span&gt;&lt;span style=&quot;box-sizing: border-box; font-family: inherit; font-weight: 700; letter-spacing: 0.1px;&quot;&gt;&amp;nbsp;Data and time are stored using both TIMESTAMP and DATETIME. What makes them different from one another, and when should each be used?&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Date and time are stored in the YYYY-MM-DD HH:MM:SS format by both TIMESTAMP and DATETIME. When TIMESTAMP first translates provided time to UTC while saving and then again changes it back to server time zone upon retrieval, DATETIME just stores provided date and time. Therefore, TIMESTAMP makes it possible to serve various users in various countries with the same data. Without doing any time zone-related conversions, DATETIME only records the specified date and time.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;34&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;What the MySQL GRANT command does&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: #04395e; display: flex; font-family: Raleway, sans-serif; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;A newly established MySQL user needs specific credentials to carry out different database actions. The GRANT command gives the user specific capabilities. The sample statement below authorises username@localhost to do SELECT and INSERT operations on TABLE customertable.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;border: solid gray; box-sizing: border-box; overflow: auto; width: auto;&quot;&gt;&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 2px solid rgb(245, 245, 245); box-sizing: border-box; color: #333333; display: block; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; line-height: 16.25px; margin: 0px; overflow-wrap: break-word; overflow: scroll auto; padding: 10px; word-break: break-all;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;GRANT&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt;, &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;INSERT&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;ON&lt;/span&gt; customertable &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;TO&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0; box-sizing: border-box;&quot;&gt;&#39;username&#39;&lt;/span&gt;&lt;span style=&quot;box-sizing: border-box; color: #333333;&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; box-sizing: border-box;&quot;&gt;&#39;localhost&#39;&lt;/span&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 id=&quot;35&quot; style=&quot;box-sizing: border-box; color: black; font-family: inherit; font-weight: 500; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Describe how to utilise FEDERATED tables in MySQL&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;&lt;h3 style=&quot;background-color: rgba(4, 57, 94, 0.1); box-sizing: border-box; color: black; font-family: Raleway, sans-serif; font-weight: 500; letter-spacing: normal; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;&quot;&gt;&lt;div class=&quot;contain&quot; style=&quot;box-sizing: border-box; color: #04395e; display: flex;&quot;&gt;&lt;div class=&quot;content col-sm-9&quot; style=&quot;box-sizing: border-box; flex: 10 1 0%; float: left; min-height: 1px; padding: 10px; position: relative; width: 991.422px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: black; font-family: Inter-SemiBold, Helvetica, sans-serif; line-height: 30px; margin: 0px 0px 10px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;FEDERATED tables are tables that MySQL uses to give users access to remote database servers&#39; tables. The table can be viewed like a local table even while the actual physical data actually resides on a faraway system. To utilise a federated table, provide ENGINE=FEDERATED in the CREATE TABLE command, and supply a connection string that includes the user, remote hostname, port, schema, and table name.&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;border: solid gray; box-sizing: border-box; overflow: auto; width: auto;&quot;&gt;&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 2px solid rgb(245, 245, 245); box-sizing: border-box; color: #333333; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; line-height: 16.25px; margin-bottom: 0px; margin-top: 0px; overflow-wrap: break-word; overflow: scroll auto; padding: 10px; word-break: break-all;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;CREATE&lt;/span&gt; &lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt; table_fed (
 ... 
)
ENGINE&lt;span style=&quot;box-sizing: border-box;&quot;&gt;=&lt;/span&gt;FEDERATED
&lt;span style=&quot;box-sizing: border-box; color: #008800; font-weight: bold;&quot;&gt;CONNECTION&lt;/span&gt;&lt;span style=&quot;box-sizing: border-box;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; box-sizing: border-box;&quot;&gt;&#39;mysql://user@remote_hostname:port/federated_schema/table&#39;&lt;/span&gt;;
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br style=&quot;box-sizing: border-box; color: #04395e; font-size: 14px;&quot; /&gt;&lt;/h3&gt;&lt;/article&gt;&lt;/section&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/265421757343889795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/265421757343889795' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/265421757343889795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/265421757343889795'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2022/08/basic-mysql-interview-questions.html' title='  Basic MySQL Interview Questions #1'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-902681324489296785</id><published>2021-02-01T10:09:00.001-08:00</published><updated>2021-02-01T10:09:47.254-08:00</updated><title type='text'>Drupal Interview Questions and Answers</title><content type='html'>&lt;h1 class=&quot;mb-10&quot;&gt;Drupal Interview Questions and Answers&lt;/h1&gt;&lt;h1&gt;&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;&lt;a href=&quot;https://www.bestinterviewquestion.com/drupal-interview-questions&quot;&gt;https://www.bestinterviewquestion.com/drupal-interview-questions&lt;/a&gt;&lt;/div&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;React js interview questions and Answers&lt;/b&gt;&lt;/h1&gt;&lt;p&gt;ReactJS is a &lt;a href=&quot;https://www.bestinterviewquestion.com/javascript-interview-questions&quot; title=&quot;JavaScript&quot;&gt;JavaScript&lt;/a&gt; library for building reusable User interface components. It is a template-based language combined with different functions that support the HTML. Our recently updated&lt;strong&gt; React Interview Questions&lt;/strong&gt; can help you crack your next interview. This means the result of any React&#39;s operation is an &lt;a href=&quot;https://www.bestinterviewquestion.com/html5-interview-questions&quot; title=&quot;HTML&quot;&gt;HTML&lt;/a&gt; code. You can use ReactJS to build all kinds of single-page applications.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;h2 class=&quot;mt-30 mb-10&quot; id=&quot;mostFrequentlyAskedQuestions&quot;&gt;
React Developer Interview Questions
&lt;/h2&gt;
&lt;p class=&quot;metaDescription&quot;&gt;Here in this article, we will be listing frequently asked &lt;strong&gt;React js interview questions and Answers&lt;/strong&gt; with the belief that they will be helpful for you to gain higher marks. Also, to let you know that this article has been written under the guidance of industry professionals and covered all the current competencies.&lt;/p&gt;&lt;p class=&quot;metaDescription&quot;&gt;&lt;a href=&quot;https://www.bestinterviewquestion.com/react-js-interview-questions&quot;&gt;https://www.bestinterviewquestion.com/react-js-interview-questions&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;metaDescription&quot;&gt;&lt;br /&gt;&lt;/p&gt;


&lt;h1 class=&quot;mb-10&quot;&gt;&lt;br /&gt;&lt;/h1&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;





</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/902681324489296785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/902681324489296785' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/902681324489296785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/902681324489296785'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2021/02/react-js-interview-questions-and.html' title='Drupal Interview Questions and Answers'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-2275860929625094630</id><published>2020-12-30T05:09:00.008-08:00</published><updated>2020-12-30T06:04:11.788-08:00</updated><title type='text'>Live Search Filter using Hooks &amp; Router in React JS Search.jsx</title><content type='html'>&lt;p&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;Search.jsx&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;import React, {useState} from &#39;react&#39;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;const Search&amp;nbsp;= () =&amp;gt; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const [keyword, setKeyword] = useState(&#39;&#39;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const inputEvent = (e) =&amp;gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;setKeyword(e.target.value);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;return(&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&amp;lt;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&amp;lt;div className=&quot;container&quot;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;&amp;lt;h1 className=&quot;mt-4&quot;&amp;gt; This is Search page &amp;lt;/h1&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;&amp;lt;input onChange={inputEvent} value={keyword} name=&quot;search&quot; type=&quot;text&quot; placeholder=&quot;Search keyword!&quot; /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;&amp;lt;div className=&quot;clr&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;&amp;lt;div className=&quot;row&quot;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;					&lt;/span&gt;{ (keyword === &quot;&quot;)?null:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;						&lt;/span&gt;&amp;lt;div className=&quot;col-sm-12&quot;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;							&lt;/span&gt;&amp;lt;img src={`https://source.unsplash.com/400x400?${keyword}`} /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;						&lt;/span&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;					&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&amp;lt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;export default Search;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Import above &lt;b&gt;Search.jsx&lt;/b&gt; component in your App.js file &quot;&lt;b&gt;import Search from &#39;./Search&#39;&lt;/b&gt; &quot; and display it &lt;b&gt;&amp;lt;Search /&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h1 class=&quot;title style-scope ytd-video-primary-info-renderer&quot; style=&quot;background: rgb(249, 249, 249); border: 0px; color: var(--ytd-video-primary-info-renderer-title-color, var(--yt-spec-text-primary)); font-family: Roboto, Arial, sans-serif; font-size: var(--ytd-video-primary-info-renderer-title-font-size, var(--yt-navbar-title-font-size, inherit)); font-weight: 400; line-height: var(--yt-navbar-title-line-height, 2.4rem); margin: 0px; max-height: calc(2 * var(--yt-navbar-title-line-height, 2.4rem)); overflow: hidden; padding: 0px; text-shadow: var(--ytd-video-primary-info-renderer-title-text-shadow, none); transform: var(--ytd-video-primary-info-renderer-title-transform, none);&quot;&gt;&lt;yt-formatted-string class=&quot;style-scope ytd-video-primary-info-renderer&quot; force-default-style=&quot;&quot; style=&quot;word-break: break-word;&quot;&gt;Live Search Filter using Hooks &amp;amp; Router in React JS&lt;/yt-formatted-string&gt;&lt;/h1&gt;&lt;div&gt;&lt;yt-formatted-string class=&quot;style-scope ytd-video-primary-info-renderer&quot; force-default-style=&quot;&quot; style=&quot;word-break: break-word;&quot;&gt;&lt;span face=&quot;Roboto, Arial, sans-serif&quot; style=&quot;background-color: #f9f9f9; color: #030303; font-size: 14px; white-space: pre-wrap;&quot;&gt;creating a Live Image Search filter in react js. We will use react hooks and react-router in our live search image filter in react js in Hindi.
&lt;/span&gt;&lt;/yt-formatted-string&gt;&lt;/div&gt;&lt;div&gt;&lt;yt-formatted-string class=&quot;style-scope ytd-video-primary-info-renderer&quot; force-default-style=&quot;&quot; style=&quot;word-break: break-word;&quot;&gt;&lt;span face=&quot;Roboto, Arial, sans-serif&quot; style=&quot;background-color: #f9f9f9; color: #030303; font-size: 14px; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/yt-formatted-string&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/2275860929625094630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/2275860929625094630' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/2275860929625094630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/2275860929625094630'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2020/12/live-search-filter-using-hooks-router.html' title='Live Search Filter using Hooks &amp; Router in React JS Search.jsx'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-2465570251571281080</id><published>2020-12-29T21:42:00.001-08:00</published><updated>2020-12-29T21:42:22.356-08:00</updated><title type='text'>Adding script tag to React/JSX | How to add script tag using ReactJS?</title><content type='html'>&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp;use React Helmet – it&#39;s a component that allows for easy manipulation of the document head in a way you&#39;re probably already used to.&lt;/p&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;e.g.&lt;/p&gt;&lt;pre class=&quot;lang-js s-code-block hljs javascript&quot; style=&quot;border-radius: 5px; border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: calc(var(--s-prose-spacing) + 0.4em); margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;import&lt;/span&gt; React &lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-variable); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;react&quot;&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;import&lt;/span&gt; {Helmet} &lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-variable); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;react-helmet&quot;&lt;/span&gt;;

&lt;span class=&quot;hljs-class&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-literal); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Application&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-literal); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;React&lt;/span&gt;.&lt;span class=&quot;hljs-title&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-literal); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Component&lt;/span&gt; &lt;/span&gt;{
  render () {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;return&lt;/span&gt; (
        &lt;span class=&quot;xml&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;hljs-attr&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-attribute); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;className&lt;/span&gt;=&lt;span class=&quot;hljs-string&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-variable); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;application&quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Helmet&lt;/span&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;hljs-attr&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-attribute); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;src&lt;/span&gt;=&lt;span class=&quot;hljs-string&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-variable); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;https://use.typekit.net/foobar.js&quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;script&lt;/span&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;script&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;javascript&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;try&lt;/span&gt;{Typekit.load({ &lt;span class=&quot;hljs-attr&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-attribute); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;async&lt;/span&gt;: &lt;span class=&quot;hljs-literal&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-literal); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;true&lt;/span&gt; });}&lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;catch&lt;/span&gt;(e){}&lt;/span&gt;&lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;script&lt;/span&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Helmet&lt;/span&gt;&amp;gt;&lt;/span&gt;
            ...
        &lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;div&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
    );
  }
};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;https://github.com/nfl/react-helmet&quot; rel=&quot;noreferrer&quot; style=&quot;border: 0px; box-sizing: inherit; cursor: pointer; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; user-select: auto; vertical-align: baseline;&quot;&gt;https://github.com/nfl/react-helmet&lt;/a&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;If you need to have&amp;nbsp;&lt;code style=&quot;background-color: var(--black-075); border-radius: 3px; border: 0px; box-sizing: inherit; color: var(--black-800); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 2px 4px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&amp;lt;script&amp;gt;&lt;/code&gt;&amp;nbsp;block in SSR (server-side rendering), an approach with&amp;nbsp;&lt;code style=&quot;background-color: var(--black-075); border-radius: 3px; border: 0px; box-sizing: inherit; color: var(--black-800); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 2px 4px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;componentDidMount&lt;/code&gt;&amp;nbsp;will not work.&lt;/p&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;You can use&amp;nbsp;&lt;a href=&quot;https://www.npmjs.com/package/react-safe&quot; rel=&quot;noreferrer&quot; style=&quot;border: 0px; box-sizing: inherit; cursor: pointer; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; user-select: auto; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;background-color: var(--black-075); border-radius: 3px; border: 0px; box-sizing: inherit; color: var(--black-800); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 2px 4px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;react-safe&lt;/code&gt;&lt;/a&gt;&amp;nbsp;library instead. The code in React will be:&lt;/p&gt;&lt;pre class=&quot;lang-js s-code-block hljs javascript&quot; style=&quot;border-radius: 5px; border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: 0px; margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-color: #fff2cc; border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;import&lt;/span&gt; Safe &lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-variable); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;react-safe&quot;&lt;/span&gt;

&lt;span class=&quot;hljs-comment&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-comment); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// in render &lt;/span&gt;
&amp;lt;Safe.script src=&lt;span class=&quot;hljs-string&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-variable); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;https://use.typekit.net/foobar.js&quot;&lt;/span&gt;&amp;gt;&amp;lt;/Safe.script&amp;gt;
&lt;span class=&quot;xml&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Safe.script&lt;/span&gt;&amp;gt;&lt;/span&gt;{
  `try{Typekit.load({ async: true });}catch(e){}`
}
&lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-namespace); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Safe.script&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;lang-js s-code-block hljs javascript&quot; style=&quot;border-radius: 5px; border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: 0px; margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-color: #fff2cc; border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;xml&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;hljs-tag&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Which makes it a great candidate for a custom hook (eg:&amp;nbsp;&lt;code style=&quot;background-color: var(--black-075); border-radius: 3px; border: 0px; box-sizing: inherit; color: var(--black-800); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 2px 4px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;hooks/useScript.js&lt;/code&gt;):&lt;/p&gt;&lt;pre class=&quot;lang-js s-code-block hljs javascript&quot; style=&quot;border-radius: 5px; border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: calc(var(--s-prose-spacing) + 0.4em); margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;import&lt;/span&gt; { useEffect } &lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-variable); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;react&#39;&lt;/span&gt;;

&lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;const&lt;/span&gt; useScript = &lt;span class=&quot;hljs-function&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;hljs-params&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;url&lt;/span&gt; =&amp;gt;&lt;/span&gt; {
  useEffect(&lt;span class=&quot;hljs-function&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;() =&amp;gt;&lt;/span&gt; {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;const&lt;/span&gt; script = &lt;span class=&quot;hljs-built_in&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-literal); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;document&lt;/span&gt;.createElement(&lt;span class=&quot;hljs-string&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-variable); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;script&#39;&lt;/span&gt;);

    script.src = url;
    script.async = &lt;span class=&quot;hljs-literal&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-literal); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;true&lt;/span&gt;;

    &lt;span class=&quot;hljs-built_in&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-literal); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;document&lt;/span&gt;.body.appendChild(script);

    &lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-function&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;() =&amp;gt;&lt;/span&gt; {
      &lt;span class=&quot;hljs-built_in&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-literal); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;document&lt;/span&gt;.body.removeChild(script);
    }
  }, [url]);
};

&lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;default&lt;/span&gt; useScript;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Which can be used like so:&lt;/p&gt;&lt;pre class=&quot;lang-js s-code-block hljs javascript&quot; style=&quot;border-radius: 5px; border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: 0px; margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-color: #fff2cc; border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;import&lt;/span&gt; useScript &lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-variable); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;hooks/useScript&#39;&lt;/span&gt;;

&lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;const&lt;/span&gt; MyComponent = &lt;span class=&quot;hljs-function&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;hljs-params&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;props&lt;/span&gt; =&amp;gt;&lt;/span&gt; {
  useScript(&lt;span class=&quot;hljs-string&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-variable); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;https://use.typekit.net/foobar.js&#39;&lt;/span&gt;);

  &lt;span class=&quot;hljs-comment&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-comment); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// rest of your component&lt;/span&gt;
}&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;lang-js s-code-block hljs javascript&quot; style=&quot;border-radius: 5px; border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: 0px; margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-color: #fff2cc; border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;span&gt;&lt;!--more--&gt;&lt;/span&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #ffe599;&quot;&gt;&amp;nbsp;&lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: var(--highlight-color); font-family: inherit; font-size: 13px; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit; font-weight: inherit; white-space: inherit;&quot;&gt; { useEffect } &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: var(--highlight-color); font-family: inherit; font-size: 13px; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit; font-weight: inherit; white-space: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-variable); font-family: inherit; font-size: 13px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&#39;react&#39;&lt;/span&gt;&lt;span style=&quot;color: var(--highlight-color); font-family: inherit; font-size: 13px; font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit; font-weight: inherit; white-space: inherit;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;lang-js s-code-block hljs javascript&quot; style=&quot;border-radius: 5px; border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: calc(var(--s-prose-spacing) + 0.4em); margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span style=&quot;background-color: #ffe599;&quot;&gt;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;const&lt;/span&gt; useScript = &lt;span class=&quot;hljs-function&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;url, position, &lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;async&lt;/span&gt;&lt;/span&gt;) =&amp;gt;&lt;/span&gt; {
  useEffect(&lt;span class=&quot;hljs-function&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;() =&amp;gt;&lt;/span&gt; {
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;const&lt;/span&gt; placement = &lt;span class=&quot;hljs-built_in&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-literal); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;document&lt;/span&gt;.querySelector(position);
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;const&lt;/span&gt; script = &lt;span class=&quot;hljs-built_in&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-literal); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;document&lt;/span&gt;.createElement(&lt;span class=&quot;hljs-string&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-variable); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;script&#39;&lt;/span&gt;);

    script.src = url;
    script.async = &lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;typeof&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;async&lt;/span&gt; === &lt;span class=&quot;hljs-string&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-variable); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;undefined&#39;&lt;/span&gt; ? &lt;span class=&quot;hljs-literal&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-literal); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;true&lt;/span&gt; : &lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;async&lt;/span&gt;;

    placement.appendChild(script);

    &lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-function&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;() =&amp;gt;&lt;/span&gt; {
      placement.removeChild(script);
    };
  }, [url]);
};

&lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-keyword); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;default&lt;/span&gt; useScript;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: var(--s-prose-spacing); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;The way to call it is exactly the same as shown in the accepted answer of this post but with two extra(again) parameters:&lt;/p&gt;&lt;pre class=&quot;lang-js s-code-block hljs javascript&quot; style=&quot;border-radius: 5px; border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: 0px; margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-color: #fff2cc; border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-comment); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// First string is your URL&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-comment); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// Second string can be head or body&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-comment); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// Third parameter is true or false.&lt;/span&gt;
useScript(&lt;span class=&quot;hljs-string&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-variable); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;string&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;border: 0px; box-sizing: inherit; color: var(--highlight-variable); font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;string&quot;&lt;/span&gt;, bool);&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;lang-js s-code-block hljs javascript&quot; style=&quot;border-radius: 5px; border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: 0px; margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-color: #fff2cc; border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;lang-js s-code-block hljs javascript&quot; style=&quot;border-radius: 5px; border: 0px; box-sizing: inherit; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: 0px; margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-color: #fff2cc; border: 0px; box-sizing: inherit; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif;&quot;&gt;script tag in react &lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif;&quot;&gt;including script tag in react react-helmet script  tag&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;lang-js s-code-block hljs javascript&quot; style=&quot;border-radius: 5px; border: 0px; box-sizing: inherit; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: 0px; margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-color: #fff2cc; border: 0px; box-sizing: inherit; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif;&quot;&gt;How to add &amp;lt;script&amp;gt; tag using ReactJS? &lt;/span&gt;&lt;/code&gt;How can I add tag using ReactJS?&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/2465570251571281080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/2465570251571281080' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/2465570251571281080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/2465570251571281080'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2020/12/adding-script-tag-to-reactjsx-how-to.html' title='Adding script tag to React/JSX | How to add script tag using ReactJS?'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-7532751870381702643</id><published>2020-12-15T03:48:00.000-08:00</published><updated>2020-12-15T03:48:00.384-08:00</updated><title type='text'>Object destructuring | For of iteration and destructuring | Computed object property names and destructuring | Rest in Object Destructuring | Combined Array and Object Destructuring</title><content type='html'>&lt;p&gt;&amp;nbsp;Object destructuring | For of iteration and destructuring | Computed object property names and destructuring | Rest in Object Destructuring | Combined Array and Object Destructuring&lt;/p&gt;&lt;h3 id=&quot;Object_destructuring&quot; style=&quot;background-color: #212121; box-sizing: border-box; color: white; font-family: zillaslab, palatino, &amp;quot;Palatino Linotype&amp;quot;, serif; font-size: 1.953rem; font-weight: 400; letter-spacing: -0.0444444px; line-height: 1.2; margin: 0px 0px 24px; max-width: max-content; padding: 0px 6px;&quot;&gt;Object destructuring&lt;/h3&gt;&lt;div style=&quot;background-color: white; box-sizing: border-box; color: #212121; font-family: arial, x-locale-body, sans-serif; font-size: 16px; letter-spacing: -0.0444444px; margin-top: 1em;&quot;&gt;&lt;h4 id=&quot;Basic_assignment&quot; style=&quot;box-sizing: border-box; font-size: 1.563rem; margin: 0px;&quot;&gt;Basic assignment&lt;/h4&gt;&lt;pre class=&quot;brush: js notranslate&quot; style=&quot;background-color: #eeeeee; border-left: 6px solid rgb(0, 69, 139); box-sizing: border-box; font-size: 1rem; line-height: 1.4; margin-bottom: 24px; margin-top: 0px; max-width: 100%; overflow: auto; padding: 24px; width: 1002px;&quot;&gt;&lt;code style=&quot;-webkit-box-decoration-break: clone; background-color: transparent; box-sizing: border-box; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; overflow-wrap: break-word; padding: 0px 3px;&quot;&gt;&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #00458b;&quot;&gt;const&lt;/span&gt; user &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;
    id&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt;
    is_verified&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token boolean&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;true&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #00458b;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;id&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt; is_verified&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;=&lt;/span&gt; user&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt;

console&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #b54248;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;(&lt;/span&gt;id&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #626262;&quot;&gt;// 42&lt;/span&gt;
console&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #b54248;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;(&lt;/span&gt;is_verified&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #626262;&quot;&gt;// true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h4 id=&quot;Assignment_without_declaration&quot; style=&quot;box-sizing: border-box; font-size: 1.563rem; margin: 0px;&quot;&gt;Assignment without declaration&lt;/h4&gt;&lt;p style=&quot;box-sizing: border-box; margin: 0px 0px 24px; max-width: 75ch;&quot;&gt;A variable can be assigned its value with destructuring separate from its declaration.&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin: 0px 0px 24px; max-width: 75ch;&quot;&gt;&lt;span class=&quot;token keyword&quot; style=&quot;background-color: #eeeeee; box-sizing: border-box; color: #00458b; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;let&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;background-color: #eeeeee; box-sizing: border-box; color: #999999; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;background-color: #eeeeee; box-sizing: border-box; color: #999999; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;background-color: #eeeeee; box-sizing: border-box; color: #999999; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;background-color: #eeeeee; box-sizing: border-box; color: #999999; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;background-color: #eeeeee; box-sizing: border-box; color: #999999; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;background-color: #eeeeee; box-sizing: border-box; color: #999999; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;background-color: #eeeeee; box-sizing: border-box; color: #999999; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;background-color: #eeeeee; box-sizing: border-box; color: #990055; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;background-color: #eeeeee; box-sizing: border-box; color: #999999; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;token number&quot; style=&quot;background-color: #eeeeee; box-sizing: border-box; color: #990055; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;background-color: #eeeeee; box-sizing: border-box; color: #999999; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;background-color: #eeeeee; box-sizing: border-box; color: #999999; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;background-color: #eeeeee; box-sizing: border-box; color: #999999; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; letter-spacing: -0.0444444px; white-space: pre;&quot;&gt;;&lt;/span&gt;&lt;/p&gt;&lt;h4 id=&quot;Assigning_to_new_variable_names&quot; style=&quot;box-sizing: border-box; font-size: 1.563rem; letter-spacing: -0.0444444px; margin: 0px;&quot;&gt;Assigning to new variable names&lt;/h4&gt;&lt;div&gt;&lt;pre class=&quot;brush: js notranslate&quot; style=&quot;background-color: #eeeeee; border-left: 6px solid rgb(0, 69, 139); box-sizing: border-box; font-size: 1rem; letter-spacing: -0.0444444px; line-height: 1.4; margin-bottom: 24px; margin-top: 0px; max-width: 100%; overflow: auto; padding: 24px; width: 1002px;&quot;&gt;&lt;code style=&quot;-webkit-box-decoration-break: clone; background-color: transparent; box-sizing: border-box; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; overflow-wrap: break-word; padding: 0px 3px;&quot;&gt;&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #00458b;&quot;&gt;const&lt;/span&gt; o &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;p&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt; q&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token boolean&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #00458b;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;p&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; foo&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt; q&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; bar&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;=&lt;/span&gt; o&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt;

console&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #b54248;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;(&lt;/span&gt;foo&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #626262;&quot;&gt;// 42&lt;/span&gt;
console&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #b54248;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;(&lt;/span&gt;bar&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #626262;&quot;&gt;// true&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;h4 id=&quot;Default_values_2&quot; style=&quot;box-sizing: border-box; font-size: 1.563rem; letter-spacing: -0.0444444px; margin: 0px;&quot;&gt;Default values&lt;/h4&gt;&lt;/div&gt;&lt;div&gt;&lt;pre class=&quot;brush: js notranslate&quot; style=&quot;background-color: #eeeeee; border-left: 6px solid rgb(0, 69, 139); box-sizing: border-box; font-size: 1rem; letter-spacing: -0.0444444px; line-height: 1.4; margin-bottom: 24px; margin-top: 0px; max-width: 100%; overflow: auto; padding: 24px; width: 1002px;&quot;&gt;&lt;code style=&quot;-webkit-box-decoration-break: clone; background-color: transparent; box-sizing: border-box; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; overflow-wrap: break-word; padding: 0px 3px;&quot;&gt;&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #00458b;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;a &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt; b &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;a&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt;

console&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #b54248;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;(&lt;/span&gt;a&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #626262;&quot;&gt;// 3&lt;/span&gt;
console&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #b54248;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;(&lt;/span&gt;b&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #626262;&quot;&gt;// 5&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;h4 id=&quot;Assigning_to_new_variables_names_and_providing_default_values&quot; style=&quot;box-sizing: border-box; font-size: 1.563rem; letter-spacing: -0.0444444px; margin: 0px;&quot;&gt;Assigning to new variables names and providing default values&lt;/h4&gt;&lt;/div&gt;&lt;div&gt;&lt;pre class=&quot;brush: js notranslate&quot; style=&quot;background-color: #eeeeee; border-left: 6px solid rgb(0, 69, 139); box-sizing: border-box; font-size: 1rem; letter-spacing: -0.0444444px; line-height: 1.4; margin-bottom: 24px; margin-top: 0px; max-width: 100%; overflow: auto; padding: 24px; width: 1002px;&quot;&gt;&lt;code style=&quot;-webkit-box-decoration-break: clone; background-color: transparent; box-sizing: border-box; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; overflow-wrap: break-word; padding: 0px 3px;&quot;&gt;&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #00458b;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;a&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; aa &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt; b&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; bb &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;a&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt;

console&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #b54248;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;(&lt;/span&gt;aa&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #626262;&quot;&gt;// 3&lt;/span&gt;
console&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #b54248;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;(&lt;/span&gt;bb&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #626262;&quot;&gt;// 5&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;h4 id=&quot;For_of_iteration_and_destructuring&quot; style=&quot;box-sizing: border-box; font-size: 1.563rem; letter-spacing: -0.0444444px; margin: 0px;&quot;&gt;For of iteration and destructuring&lt;/h4&gt;&lt;pre class=&quot;brush: js notranslate&quot; style=&quot;background-color: #eeeeee; border-left: 6px solid rgb(0, 69, 139); box-sizing: border-box; font-size: 1rem; letter-spacing: -0.0444444px; line-height: 1.4; margin-bottom: 24px; margin-top: 0px; max-width: 100%; overflow: auto; padding: 24px; width: 1002px;&quot;&gt;&lt;code style=&quot;-webkit-box-decoration-break: clone; background-color: transparent; box-sizing: border-box; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; overflow-wrap: break-word; padding: 0px 3px;&quot;&gt;&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #00458b;&quot;&gt;const&lt;/span&gt; people &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;[&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;
    name&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #276738;&quot;&gt;&#39;Mike Smith&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt;
    family&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;
      mother&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #276738;&quot;&gt;&#39;Jane Smith&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt;
      father&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #276738;&quot;&gt;&#39;Harry Smith&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt;
      sister&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #276738;&quot;&gt;&#39;Samantha Smith&#39;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt;
    age&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;35&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;
    name&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #276738;&quot;&gt;&#39;Tom Jones&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt;
    family&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;
      mother&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #276738;&quot;&gt;&#39;Norah Jones&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt;
      father&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #276738;&quot;&gt;&#39;Richard Jones&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt;
      brother&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #276738;&quot;&gt;&#39;Howard Jones&#39;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt;
    age&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;25&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #00458b;&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #00458b;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;name&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; n&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt; family&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;father&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; f&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #00458b;&quot;&gt;of&lt;/span&gt; people&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;
  console&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #b54248;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #276738;&quot;&gt;&#39;Name: &#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;+&lt;/span&gt; n &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #276738;&quot;&gt;&#39;, Father: &#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;+&lt;/span&gt; f&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #626262;&quot;&gt;// &quot;Name: Mike Smith, Father: Harry Smith&quot;&lt;/span&gt;
&lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #626262;&quot;&gt;// &quot;Name: Tom Jones, Father: Richard Jones&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;h4 id=&quot;Computed_object_property_names_and_destructuring&quot; style=&quot;box-sizing: border-box; font-size: 1.563rem; letter-spacing: -0.0444444px; margin: 0px;&quot;&gt;Computed object property names and destructuring&lt;/h4&gt;&lt;p style=&quot;box-sizing: border-box; letter-spacing: -0.0444444px; margin: 0px 0px 24px; max-width: 75ch;&quot;&gt;Computed property names, like on&amp;nbsp;object literals, can be used with destructuring.&lt;/p&gt;&lt;pre class=&quot;brush: js notranslate&quot; style=&quot;background-color: #eeeeee; border-left: 6px solid rgb(0, 69, 139); box-sizing: border-box; font-size: 1rem; letter-spacing: -0.0444444px; line-height: 1.4; margin-bottom: 24px; margin-top: 0px; max-width: 100%; overflow: auto; padding: 24px; width: 1002px;&quot;&gt;&lt;code style=&quot;-webkit-box-decoration-break: clone; background-color: transparent; box-sizing: border-box; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; overflow-wrap: break-word; padding: 0px 3px;&quot;&gt;&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #00458b;&quot;&gt;let&lt;/span&gt; key &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #276738;&quot;&gt;&#39;z&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #00458b;&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;[&lt;/span&gt;key&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; foo&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;z&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #276738;&quot;&gt;&#39;bar&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt;

console&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #b54248;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;(&lt;/span&gt;foo&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #626262;&quot;&gt;// &quot;bar&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h4 id=&quot;Rest_in_Object_Destructuring&quot; style=&quot;box-sizing: border-box; font-size: 1.563rem; letter-spacing: -0.0444444px; margin: 0px;&quot;&gt;Rest in Object Destructuring&lt;/h4&gt;&lt;p style=&quot;box-sizing: border-box; letter-spacing: -0.0444444px; margin: 0px 0px 24px; max-width: 75ch;&quot;&gt;The&amp;nbsp;Rest/Spread Properties for ECMAScript&amp;nbsp;proposal (stage 4) adds the&amp;nbsp;rest&amp;nbsp;syntax to destructuring. Rest properties collect the remaining own enumerable property keys that are not already picked off by the destructuring pattern.&lt;/p&gt;&lt;pre class=&quot;brush: js notranslate&quot; style=&quot;background-color: #eeeeee; border-left: 6px solid rgb(0, 69, 139); box-sizing: border-box; font-size: 1rem; letter-spacing: -0.0444444px; line-height: 1.4; margin-bottom: 24px; margin-top: 0px; max-width: 100%; overflow: auto; padding: 24px; width: 1002px;&quot;&gt;&lt;code style=&quot;-webkit-box-decoration-break: clone; background-color: transparent; box-sizing: border-box; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; overflow-wrap: break-word; padding: 0px 3px;&quot;&gt;&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #00458b;&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;a&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt; b&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;...&lt;/span&gt;rest&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt;a&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt; b&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt; c&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt; d&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;40&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt;
a&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #626262;&quot;&gt;// 10&lt;/span&gt;
b&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #626262;&quot;&gt;// 20&lt;/span&gt;
rest&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #626262;&quot;&gt;// { c: 30, d: 40 }&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h4 id=&quot;Invalid_JavaScript_identifier_as_a_property_name&quot; style=&quot;box-sizing: border-box; font-size: 1.563rem; letter-spacing: -0.0444444px; margin: 0px;&quot;&gt;Invalid JavaScript identifier as a property name&lt;/h4&gt;&lt;p style=&quot;box-sizing: border-box; letter-spacing: -0.0444444px; margin: 0px 0px 24px; max-width: 75ch;&quot;&gt;Destructuring can be used with property names that are not valid JavaScript&amp;nbsp;identifiers&amp;nbsp;by providing an alternative identifier&amp;nbsp;that is valid.&lt;/p&gt;&lt;pre class=&quot;brush: js notranslate&quot; style=&quot;background-color: #eeeeee; border-left: 6px solid rgb(0, 69, 139); box-sizing: border-box; font-size: 1rem; letter-spacing: -0.0444444px; line-height: 1.4; margin-bottom: 24px; margin-top: 0px; max-width: 100%; overflow: auto; padding: 24px; width: 1002px;&quot;&gt;&lt;code style=&quot;-webkit-box-decoration-break: clone; background-color: transparent; box-sizing: border-box; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; overflow-wrap: break-word; padding: 0px 3px;&quot;&gt;&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #00458b;&quot;&gt;const&lt;/span&gt; foo &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #276738;&quot;&gt;&#39;fizz-buzz&#39;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token boolean&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #00458b;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #276738;&quot;&gt;&#39;fizz-buzz&#39;&lt;/span&gt;&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; fizzBuzz &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;=&lt;/span&gt; foo&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt;

console&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #b54248;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;(&lt;/span&gt;fizzBuzz&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #626262;&quot;&gt;// &quot;true&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h4 id=&quot;Combined_Array_and_Object_Destructuring&quot; style=&quot;box-sizing: border-box; font-size: 1.563rem; letter-spacing: -0.0444444px; margin: 0px;&quot;&gt;Combined Array and Object Destructuring&lt;/h4&gt;&lt;p style=&quot;box-sizing: border-box; letter-spacing: -0.0444444px; margin: 0px 0px 24px; max-width: 75ch;&quot;&gt;Array and Object destructuring can be combined. Say you want the third element in the array&amp;nbsp;&lt;code style=&quot;-webkit-box-decoration-break: clone; background-color: #eeeeee; box-sizing: border-box; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; overflow-wrap: break-word; padding: 0px 3px;&quot;&gt;props&lt;/code&gt;&amp;nbsp;below, and then you want the&amp;nbsp;&lt;code style=&quot;-webkit-box-decoration-break: clone; background-color: #eeeeee; box-sizing: border-box; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; overflow-wrap: break-word; padding: 0px 3px;&quot;&gt;name&lt;/code&gt;&amp;nbsp;property in the object, you can do the following:&lt;/p&gt;&lt;pre class=&quot;brush: js notranslate&quot; style=&quot;background-color: #eeeeee; border-left: 6px solid rgb(0, 69, 139); box-sizing: border-box; font-size: 1rem; letter-spacing: -0.0444444px; line-height: 1.4; margin-bottom: 24px; margin-top: 0px; max-width: 100%; overflow: auto; padding: 24px; width: 1002px;&quot;&gt;&lt;code style=&quot;-webkit-box-decoration-break: clone; background-color: transparent; box-sizing: border-box; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; overflow-wrap: break-word; padding: 0px 3px;&quot;&gt;&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #00458b;&quot;&gt;const&lt;/span&gt; props &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;[&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt; id&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt; name&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #276738;&quot;&gt;&#39;Fizz&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt; id&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt; name&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #276738;&quot;&gt;&#39;Buzz&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt; id&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot; style=&quot;box-sizing: border-box; color: #990055;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt; name&lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot; style=&quot;box-sizing: border-box; color: #276738;&quot;&gt;&#39;FizzBuzz&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot; style=&quot;box-sizing: border-box; color: #00458b;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;{&lt;/span&gt; name &lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot; style=&quot;background: transparent; box-sizing: border-box;&quot;&gt;=&lt;/span&gt; props&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt;

console&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot; style=&quot;box-sizing: border-box; color: #b54248;&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;(&lt;/span&gt;name&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #999999;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #626262;&quot;&gt;// &quot;FizzBuzz&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;code style=&quot;-webkit-box-decoration-break: clone; background-color: transparent; box-sizing: border-box; font-family: consolas, &amp;quot;Liberation Mono&amp;quot;, courier, monospace; overflow-wrap: break-word; padding: 0px 3px;&quot;&gt;&lt;span class=&quot;token comment&quot; style=&quot;box-sizing: border-box; color: #626262;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/7532751870381702643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/7532751870381702643' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/7532751870381702643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/7532751870381702643'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2020/12/object-destructuring-for-of-iteration.html' title='Object destructuring | For of iteration and destructuring | Computed object property names and destructuring | Rest in Object Destructuring | Combined Array and Object Destructuring'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-1505309697583975883</id><published>2020-12-15T03:36:00.006-08:00</published><updated>2020-12-27T09:04:36.857-08:00</updated><title type='text'>The Practical Usages of JavaScript Spread Operator | Array Destructuring</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #262626; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: calc(1rem*var(--typescale)*var(--typescale)*var(--typescale)); font-weight: 400; line-height: calc(2.66667rem); margin-left: 0px; margin-right: 0px; margin-top: 0px; margin: 0px 0px calc(1.77778rem); padding: 0px;&quot;&gt;Introduction to the JavaScript spread operator &amp;amp; array destructuring&lt;/h2&gt;&lt;h3 id=&quot;Array_destructuring&quot; style=&quot;background-color: #212121; box-sizing: border-box; color: white; font-family: zillaslab, palatino, &amp;quot;Palatino Linotype&amp;quot;, serif; font-size: 1.953rem; font-weight: 400; letter-spacing: -0.0444444px; line-height: 1.2; margin: 0px 0px 24px; max-width: max-content; padding: 0px 6px;&quot;&gt;Spread Operator &amp;amp; Array destructuring&lt;/h3&gt;&lt;p style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px; padding: 0px;&quot;&gt;ES6 provides a new operator called spread operator that consists of three dots&amp;nbsp;&lt;code style=&quot;background-color: #fff6ea; border: none; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9rem; margin: 0px; padding: 0px 5px 2px;&quot;&gt;(...).&lt;/code&gt;&amp;nbsp;The spread operator allows you to spread out elements of an iterable object such as an&amp;nbsp;&lt;a href=&quot;http://www.javascripttutorial.net/javascript-array/&quot; style=&quot;background-color: transparent; text-decoration-line: none; transition: all 0.1s ease-in-out 0s;&quot;&gt;array&lt;/a&gt;, a&amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://www.javascripttutorial.net/es6/javascript-map/&quot; style=&quot;background-color: transparent; text-decoration-line: none; transition: all 0.1s ease-in-out 0s;&quot;&gt;map&lt;/a&gt;, or a&amp;nbsp;&lt;a href=&quot;https://www.javascripttutorial.net/es6/javascript-set/&quot; style=&quot;background-color: transparent; text-decoration-line: none; transition: all 0.1s ease-in-out 0s;&quot;&gt;set&lt;/a&gt;. For example:&lt;/p&gt;&lt;pre aria-describedby=&quot;shcb-language-1&quot; class=&quot;wp-block-code&quot; data-shcb-language-name=&quot;JavaScript&quot; data-shcb-language-slug=&quot;javascript&quot; style=&quot;background-color: white; border: 0px; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; padding: 0px;&quot;&gt;&lt;div class=&quot;code-badge-pre&quot; style=&quot;overflow: auto; position: relative;&quot;&gt;&lt;div class=&quot;code-badge&quot; style=&quot;background: transparent; border-radius: 0px 0px 0px 7px; display: flex; flex-direction: row; font-size: 0.875em; opacity: 0.5; padding: 5px 8px; position: absolute; right: 0px; top: 0px; transition: opacity 0.5s linear 0s; white-space: normal;&quot;&gt;&lt;div title=&quot;Copy to clipboard&quot;&gt;&lt;i class=&quot;icon-docs code-badge-copy-icon&quot; style=&quot;color: white; cursor: pointer; font-size: 1.2em; padding: 0px 7px;&quot;&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;code class=&quot;hljs language-javascript&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; color: #ebdbb2; display: block; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;const&lt;/span&gt; odd = [&lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;3&lt;/span&gt;,&lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;5&lt;/span&gt;];
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;const&lt;/span&gt; combined = [&lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;2&lt;/span&gt;,&lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;4&lt;/span&gt;,&lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;6&lt;/span&gt;, ...odd];
&lt;span class=&quot;hljs-built_in&quot; style=&quot;color: #83a598;&quot;&gt;console&lt;/span&gt;.log(combined);&lt;/code&gt;&lt;/div&gt;&lt;small class=&quot;shcb-language&quot; id=&quot;shcb-language-1&quot; style=&quot;border: 0px; clip-path: inset(50%); clip: rect(1px, 1px, 1px, 1px); font-size: 12.8px; height: 1px; margin: -1px; overflow-wrap: normal; overflow: hidden; padding: 0px; position: absolute; width: 1px; word-break: normal;&quot;&gt;&lt;span class=&quot;shcb-language__label&quot;&gt;Code language:&lt;/span&gt; &lt;span class=&quot;shcb-language__name&quot;&gt;JavaScript&lt;/span&gt; &lt;span class=&quot;shcb-language__paren&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;shcb-language__slug&quot;&gt;javascript&lt;/span&gt;&lt;span class=&quot;shcb-language__paren&quot;&gt;)&lt;/span&gt;&lt;/small&gt;&lt;/pre&gt;&lt;p style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px; padding: 0px;&quot;&gt;Output:&lt;/p&gt;&lt;pre aria-describedby=&quot;shcb-language-2&quot; class=&quot;wp-block-code&quot; data-shcb-language-name=&quot;JSON / JSON with Comments&quot; data-shcb-language-slug=&quot;json&quot; style=&quot;background-color: white; border: 0px; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; padding: 0px;&quot;&gt;&lt;div class=&quot;code-badge-pre&quot; style=&quot;overflow: auto; position: relative;&quot;&gt;&lt;div class=&quot;code-badge&quot; style=&quot;background: transparent; border-radius: 0px 0px 0px 7px; display: flex; flex-direction: row; font-size: 0.875em; opacity: 0.5; padding: 5px 8px; position: absolute; right: 0px; top: 0px; transition: opacity 0.5s linear 0s; white-space: normal;&quot;&gt;&lt;div title=&quot;Copy to clipboard&quot;&gt;&lt;i class=&quot;icon-docs code-badge-copy-icon&quot; style=&quot;color: white; cursor: pointer; font-size: 1.2em; padding: 0px 7px;&quot;&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;code class=&quot;hljs language-json&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; color: #ebdbb2; display: block; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;[ &lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;6&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;5&lt;/span&gt; ]&lt;/code&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre aria-describedby=&quot;shcb-language-2&quot; class=&quot;wp-block-code&quot; data-shcb-language-name=&quot;JSON / JSON with Comments&quot; data-shcb-language-slug=&quot;json&quot; style=&quot;background-color: white; border: 0px; padding: 0px;&quot;&gt;&lt;div class=&quot;code-badge-pre&quot; style=&quot;overflow: auto; position: relative;&quot;&gt;&lt;code class=&quot;hljs language-json&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; display: block; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;p style=&quot;color: #ebdbb2; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em;&quot;&gt;const num&amp;nbsp; = [1,2,3,4,5];&lt;/p&gt;&lt;p style=&quot;color: #ebdbb2; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em;&quot;&gt;const [a, b, ...c] = num;&lt;/p&gt;&lt;p style=&quot;color: #ebdbb2; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em;&quot;&gt;console.log(a); //1&lt;/p&gt;&lt;p style=&quot;color: #ebdbb2; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em;&quot;&gt;console.log(b); //2&lt;/p&gt;&lt;p style=&quot;color: #ebdbb2; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em;&quot;&gt;console.log(c); //[3, 4, 5]&lt;/p&gt;&lt;p style=&quot;color: #ebdbb2; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;color: #ebdbb2; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em;&quot;&gt;//Get First &amp;amp; Last value of Array&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #ebdbb2; font-family: Roboto Mono, monospace;&quot;&gt;&lt;span style=&quot;font-size: 14.4px;&quot;&gt;const [d,,,,e] = num;
console.log(d);  //1
console.log(e);  //5 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #ebdbb2; font-family: Roboto Mono, monospace;&quot;&gt;&lt;span style=&quot;font-size: 14.4px;&quot;&gt;If any is large then use LENGHT to get last value&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #ebdbb2; font-family: Roboto Mono, monospace;&quot;&gt;&lt;span style=&quot;font-size: 14.4px;&quot;&gt;const {[num.length-1] : last} = num;
console.log(last) //5 - last value&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #ebdbb2; font-family: Roboto Mono, monospace;&quot;&gt;&lt;span style=&quot;font-size: 14.4px;&quot;&gt;console.log(num[num.length-1]) //return last value of array =&amp;gt; 5
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #ebdbb2; font-family: Roboto Mono, monospace;&quot;&gt;&lt;span style=&quot;font-size: 14.4px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #ebdbb2; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 14.4px;&quot;&gt;console.log(num[0]) //return first value of array =&amp;gt; 1&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;color: #ebdbb2; font-family: Roboto Mono, monospace;&quot;&gt;&lt;span style=&quot;font-size: 14.4px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ebdbb2; font-family: Roboto Mono, monospace;&quot;&gt;&lt;span style=&quot;font-size: 14.4px;&quot;&gt;Using Reverse function in array&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ebdbb2; font-family: Roboto Mono, monospace;&quot;&gt;&lt;span style=&quot;font-size: 14.4px;&quot;&gt;const [last,] = [&#39;a&#39;, &#39;b&#39;, &#39;program&#39;].reverse();
console.log(last); //&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #ebdbb2; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 14.4px;&quot;&gt;program =&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #ebdbb2; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 14.4px;&quot;&gt; get last value&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ebdbb2; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 14.4px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;h2 style=&quot;background-color: white; color: #262626; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: calc(1rem*var(--typescale)*var(--typescale)*var(--typescale)); font-weight: 400; line-height: calc(2.66667rem); margin-left: 0px; margin-right: 0px; margin-top: 0px; margin: 0px 0px calc(1.77778rem); padding: 0px; white-space: normal;&quot;&gt;&lt;pre class=&quot;lang-js s-code-block hljs javascript&quot; style=&quot;background-color: var(--highlight-bg); border-radius: 5px; border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: 0px; margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-color: transparent; border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; color=&quot;var(--highlight-keyword)&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;let&lt;/span&gt; a = [&lt;span class=&quot;hljs-number&quot; color=&quot;var(--highlight-namespace)&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;hljs-number&quot; color=&quot;var(--highlight-namespace)&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;2&lt;/span&gt;,&lt;span class=&quot;hljs-number&quot; color=&quot;var(--highlight-namespace)&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;3&lt;/span&gt;]
&lt;span class=&quot;hljs-keyword&quot; color=&quot;var(--highlight-keyword)&quot; style=&quot;border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;let&lt;/span&gt; [b] = [...a].reverse()&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;lang-js s-code-block hljs javascript&quot; style=&quot;background-color: var(--highlight-bg); border-radius: 5px; border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: 0px; margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-color: transparent; border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;console.log(b); //3 &lt;/code&gt;&lt;/pre&gt;&lt;/h2&gt;&lt;/div&gt;&lt;p style=&quot;color: #ebdbb2; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em;&quot;&gt;&lt;br style=&quot;color: black; font-family: Times; font-size: medium; white-space: normal;&quot; /&gt;&lt;/p&gt;&lt;/code&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2 style=&quot;background-color: white; line-height: calc(2.66667rem); margin-left: 0px; margin-right: 0px; margin-top: 0px; margin: 0px 0px calc(1.77778rem); padding: 0px;&quot;&gt;&lt;pre class=&quot;lang-js s-code-block hljs javascript&quot; style=&quot;background-color: var(--highlight-bg); border-radius: 5px; border: 0px; box-sizing: inherit; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.30769; margin-bottom: 0px; margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px; vertical-align: baseline; width: auto;&quot;&gt;&lt;span face=&quot;Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif&quot; style=&quot;color: #262626;&quot;&gt;&lt;span style=&quot;font-size: 13px; font-weight: 400;&quot;&gt;const arr = [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;, &#39;last&#39;];
const arrDepth = arr.length - 1;

const allExceptTheLast = arr.filter( (dep, index) =&amp;gt; index !== arrDepth &amp;amp;&amp;amp; dep );
const [ theLastItem ] = arr.filter( (dep, index) =&amp;gt; index === arrDepth &amp;amp;&amp;amp; dep );
console.log(allExceptTheLast);
console.log(theLastItem);&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/h2&gt;&lt;h2 style=&quot;background-color: white; color: #262626; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: calc(1rem*var(--typescale)*var(--typescale)*var(--typescale)); font-weight: 400; line-height: calc(2.66667rem); margin-left: 0px; margin-right: 0px; margin-top: 0px; margin: 0px 0px calc(1.77778rem); padding: 0px;&quot;&gt;JavaScript spread operator and array manipulation&lt;/h2&gt;&lt;h3 style=&quot;background-color: white; color: #262626; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: calc(1rem*var(--typescale)*var(--typescale)); font-weight: 400; line-height: calc(1.77778rem); margin-left: 0px; margin-right: 0px; margin-top: 0px; margin: 0px 0px calc(0.888889rem); padding: 0px;&quot;&gt;1) Constructing array literal&lt;/h3&gt;&lt;p style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px; padding: 0px;&quot;&gt;The spread operator allows you to insert another array into the initialized array when you construct an array using the literal form. See the following example:&lt;/p&gt;&lt;pre aria-describedby=&quot;shcb-language-14&quot; class=&quot;wp-block-code&quot; data-shcb-language-name=&quot;JavaScript&quot; data-shcb-language-slug=&quot;javascript&quot; style=&quot;background-color: white; border: 0px; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; padding: 0px;&quot;&gt;&lt;div class=&quot;code-badge-pre&quot; style=&quot;overflow: auto; position: relative;&quot;&gt;&lt;div class=&quot;code-badge&quot; style=&quot;background: transparent; border-radius: 0px 0px 0px 7px; display: flex; flex-direction: row; font-size: 0.875em; opacity: 0.5; padding: 5px 8px; position: absolute; right: 0px; top: 0px; transition: opacity 0.5s linear 0s; white-space: normal;&quot;&gt;&lt;div title=&quot;Copy to clipboard&quot;&gt;&lt;i class=&quot;icon-docs code-badge-copy-icon&quot; style=&quot;color: white; cursor: pointer; font-size: 1.2em; padding: 0px 7px;&quot;&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;code class=&quot;hljs language-javascript&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; color: #ebdbb2; display: block; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;let&lt;/span&gt; initialChars = [&lt;span class=&quot;hljs-string&quot; style=&quot;color: #b8bb26;&quot;&gt;&#39;A&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;color: #b8bb26;&quot;&gt;&#39;B&#39;&lt;/span&gt;];
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;let&lt;/span&gt; chars = [...initialChars, &lt;span class=&quot;hljs-string&quot; style=&quot;color: #b8bb26;&quot;&gt;&#39;C&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;color: #b8bb26;&quot;&gt;&#39;D&#39;&lt;/span&gt;];
&lt;span class=&quot;hljs-built_in&quot; style=&quot;color: #83a598;&quot;&gt;console&lt;/span&gt;.log(chars); &lt;span class=&quot;hljs-comment&quot; style=&quot;color: #928374; font-style: italic;&quot;&gt;// [&quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;]&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;small class=&quot;shcb-language&quot; id=&quot;shcb-language-14&quot; style=&quot;border: 0px; clip-path: inset(50%); clip: rect(1px, 1px, 1px, 1px); font-size: 12.8px; height: 1px; margin: -1px; overflow-wrap: normal; overflow: hidden; padding: 0px; position: absolute; width: 1px; word-break: normal;&quot;&gt;&lt;span class=&quot;shcb-language__label&quot;&gt;Code language:&lt;/span&gt; &lt;span class=&quot;shcb-language__name&quot;&gt;JavaScript&lt;/span&gt; &lt;span class=&quot;shcb-language__paren&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;shcb-language__slug&quot;&gt;javascript&lt;/span&gt;&lt;span class=&quot;shcb-language__paren&quot;&gt;)&lt;/span&gt;&lt;/small&gt;&lt;/pre&gt;&lt;h3 style=&quot;background-color: white; color: #262626; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: calc(1rem*var(--typescale)*var(--typescale)); font-weight: 400; line-height: calc(1.77778rem); margin-left: 0px; margin-right: 0px; margin-top: 0px; margin: 0px 0px calc(0.888889rem); padding: 0px;&quot;&gt;2) Concatenating arrays&lt;/h3&gt;&lt;p style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px; padding: 0px;&quot;&gt;Also, you can use the spread operator to concatenate two or more arrays:&lt;/p&gt;&lt;pre aria-describedby=&quot;shcb-language-15&quot; class=&quot;wp-block-code&quot; data-shcb-language-name=&quot;JavaScript&quot; data-shcb-language-slug=&quot;javascript&quot; style=&quot;background-color: white; border: 0px; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; padding: 0px;&quot;&gt;&lt;div class=&quot;code-badge-pre&quot; style=&quot;overflow: auto; position: relative;&quot;&gt;&lt;div class=&quot;code-badge&quot; style=&quot;background: transparent; border-radius: 0px 0px 0px 7px; display: flex; flex-direction: row; font-size: 0.875em; opacity: 0.5; padding: 5px 8px; position: absolute; right: 0px; top: 0px; transition: opacity 0.5s linear 0s; white-space: normal;&quot;&gt;&lt;div title=&quot;Copy to clipboard&quot;&gt;&lt;i class=&quot;icon-docs code-badge-copy-icon&quot; style=&quot;color: white; cursor: pointer; font-size: 1.2em; padding: 0px 7px;&quot;&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;code class=&quot;hljs language-javascript&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; color: #ebdbb2; display: block; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;let&lt;/span&gt; numbers = [&lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;2&lt;/span&gt;];
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;let&lt;/span&gt; moreNumbers = [&lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;4&lt;/span&gt;];
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;let&lt;/span&gt; allNumbers = [...numbers, ...moreNumbers];
&lt;span class=&quot;hljs-built_in&quot; style=&quot;color: #83a598;&quot;&gt;console&lt;/span&gt;.log(allNumbers); &lt;span class=&quot;hljs-comment&quot; style=&quot;color: #928374; font-style: italic;&quot;&gt;// [1, 2, 3, 4]&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;small class=&quot;shcb-language&quot; id=&quot;shcb-language-15&quot; style=&quot;border: 0px; clip-path: inset(50%); clip: rect(1px, 1px, 1px, 1px); font-size: 12.8px; height: 1px; margin: -1px; overflow-wrap: normal; overflow: hidden; padding: 0px; position: absolute; width: 1px; word-break: normal;&quot;&gt;&lt;span class=&quot;shcb-language__label&quot;&gt;Code language:&lt;/span&gt; &lt;span class=&quot;shcb-language__name&quot;&gt;JavaScript&lt;/span&gt; &lt;span class=&quot;shcb-language__paren&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;shcb-language__slug&quot;&gt;javascript&lt;/span&gt;&lt;span class=&quot;shcb-language__paren&quot;&gt;)&lt;/span&gt;&lt;/small&gt;&lt;/pre&gt;&lt;h3 style=&quot;background-color: white; color: #262626; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: calc(1rem*var(--typescale)*var(--typescale)); font-weight: 400; line-height: calc(1.77778rem); margin-left: 0px; margin-right: 0px; margin-top: 0px; margin: 0px 0px calc(0.888889rem); padding: 0px;&quot;&gt;3) Copying an array&lt;/h3&gt;&lt;p style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px; padding: 0px;&quot;&gt;In addition, you can copy an array instance by using the spread operator:&lt;/p&gt;&lt;pre aria-describedby=&quot;shcb-language-16&quot; class=&quot;wp-block-code&quot; data-shcb-language-name=&quot;JavaScript&quot; data-shcb-language-slug=&quot;javascript&quot; style=&quot;background-color: white; border: 0px; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; padding: 0px;&quot;&gt;&lt;div class=&quot;code-badge-pre&quot; style=&quot;overflow: auto; position: relative;&quot;&gt;&lt;div class=&quot;code-badge&quot; style=&quot;background: transparent; border-radius: 0px 0px 0px 7px; display: flex; flex-direction: row; font-size: 0.875em; opacity: 0.5; padding: 5px 8px; position: absolute; right: 0px; top: 0px; transition: opacity 0.5s linear 0s; white-space: normal;&quot;&gt;&lt;div title=&quot;Copy to clipboard&quot;&gt;&lt;i class=&quot;icon-docs code-badge-copy-icon&quot; style=&quot;color: white; cursor: pointer; font-size: 1.2em; padding: 0px 7px;&quot;&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;code class=&quot;hljs language-javascript&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; color: #ebdbb2; display: block; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;let&lt;/span&gt; scores = [&lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;80&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;70&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;90&lt;/span&gt;];
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;let&lt;/span&gt; copiedScores = [...scores];
&lt;span class=&quot;hljs-built_in&quot; style=&quot;color: #83a598;&quot;&gt;console&lt;/span&gt;.log(copiedScores); &lt;span class=&quot;hljs-comment&quot; style=&quot;color: #928374; font-style: italic;&quot;&gt;// [80, 70, 90]&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;small class=&quot;shcb-language&quot; id=&quot;shcb-language-16&quot; style=&quot;border: 0px; clip-path: inset(50%); clip: rect(1px, 1px, 1px, 1px); font-size: 12.8px; height: 1px; margin: -1px; overflow-wrap: normal; overflow: hidden; padding: 0px; position: absolute; width: 1px; word-break: normal;&quot;&gt;&lt;span class=&quot;shcb-language__label&quot;&gt;Code language:&lt;/span&gt; &lt;span class=&quot;shcb-language__name&quot;&gt;JavaScript&lt;/span&gt; &lt;span class=&quot;shcb-language__paren&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;shcb-language__slug&quot;&gt;javascript&lt;/span&gt;&lt;span class=&quot;shcb-language__paren&quot;&gt;)&lt;/span&gt;&lt;/small&gt;&lt;/pre&gt;&lt;div class=&quot;note&quot; style=&quot;background-color: white; border-bottom-color: rgb(102, 194, 255); border-color: rgb(102, 194, 255); border-left-style: solid; border-left-width: 3px; border-left: 3px solid rgb(102, 194, 255); border-right-color: rgb(102, 194, 255); border-top-color: rgb(102, 194, 255); font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 16px 0px; padding: 0px 0px 0px 20px;&quot;&gt;Note that the spread operator only copies the array itself to the new one, not the elements, meaning that the copy is shallow, not deep.&lt;/div&gt;&lt;h3 style=&quot;background-color: white; color: #262626; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: calc(1rem*var(--typescale)*var(--typescale)); font-weight: 400; line-height: calc(1.77778rem); margin-left: 0px; margin-right: 0px; margin-top: 0px; margin: 0px 0px calc(0.888889rem); padding: 0px;&quot;&gt;JavaScript spread operator and strings&lt;/h3&gt;&lt;p style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px; padding: 0px;&quot;&gt;Consider the following example:&lt;/p&gt;&lt;pre aria-describedby=&quot;shcb-language-17&quot; class=&quot;wp-block-code&quot; data-shcb-language-name=&quot;JavaScript&quot; data-shcb-language-slug=&quot;javascript&quot; style=&quot;background-color: white; border: 0px; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; padding: 0px;&quot;&gt;&lt;div class=&quot;code-badge-pre&quot; style=&quot;overflow: auto; position: relative;&quot;&gt;&lt;div class=&quot;code-badge&quot; style=&quot;background: transparent; border-radius: 0px 0px 0px 7px; display: flex; flex-direction: row; font-size: 0.875em; opacity: 0.5; padding: 5px 8px; position: absolute; right: 0px; top: 0px; transition: opacity 0.5s linear 0s; white-space: normal;&quot;&gt;&lt;div title=&quot;Copy to clipboard&quot;&gt;&lt;i class=&quot;icon-docs code-badge-copy-icon&quot; style=&quot;color: white; cursor: pointer; font-size: 1.2em; padding: 0px 7px;&quot;&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;code class=&quot;hljs language-javascript&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; color: #ebdbb2; display: block; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;let&lt;/span&gt; chars = [&lt;span class=&quot;hljs-string&quot; style=&quot;color: #b8bb26;&quot;&gt;&#39;A&#39;&lt;/span&gt;, ...&lt;span class=&quot;hljs-string&quot; style=&quot;color: #b8bb26;&quot;&gt;&#39;BC&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;color: #b8bb26;&quot;&gt;&#39;D&#39;&lt;/span&gt;];
&lt;span class=&quot;hljs-built_in&quot; style=&quot;color: #83a598;&quot;&gt;console&lt;/span&gt;.log(chars); &lt;span class=&quot;hljs-comment&quot; style=&quot;color: #928374; font-style: italic;&quot;&gt;// [&quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;]&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;small class=&quot;shcb-language&quot; id=&quot;shcb-language-17&quot; style=&quot;border: 0px; clip-path: inset(50%); clip: rect(1px, 1px, 1px, 1px); font-size: 12.8px; height: 1px; margin: -1px; overflow-wrap: normal; overflow: hidden; padding: 0px; position: absolute; width: 1px; word-break: normal;&quot;&gt;&lt;span class=&quot;shcb-language__label&quot;&gt;Code language:&lt;/span&gt; &lt;span class=&quot;shcb-language__name&quot;&gt;JavaScript&lt;/span&gt; &lt;span class=&quot;shcb-language__paren&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;shcb-language__slug&quot;&gt;javascript&lt;/span&gt;&lt;span class=&quot;shcb-language__paren&quot;&gt;)&lt;/span&gt;&lt;/small&gt;&lt;/pre&gt;&lt;p style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px; padding: 0px;&quot;&gt;In this example, we constructed the&amp;nbsp;&lt;code style=&quot;background-color: #fff6ea; border: none; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9rem; margin: 0px; padding: 0px 5px 2px;&quot;&gt;chars&lt;/code&gt;&amp;nbsp;array from individual strings. When we applied the spread operator to the&amp;nbsp;&lt;code style=&quot;background-color: #fff6ea; border: none; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9rem; margin: 0px; padding: 0px 5px 2px;&quot;&gt;&#39;BC&#39;&lt;/code&gt;string, it spreads out each individual character of the string&amp;nbsp;&lt;code style=&quot;background-color: #fff6ea; border: none; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9rem; margin: 0px; padding: 0px 5px 2px;&quot;&gt;&#39;BC&#39;&lt;/code&gt;&amp;nbsp;into individual characters.&lt;/p&gt;&lt;p style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px; padding: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px; padding: 0px; text-align: left;&quot;&gt;&lt;b&gt;Delete Element from Array using FILTER&amp;nbsp;&lt;/b&gt;&lt;/h3&gt;&lt;pre aria-describedby=&quot;shcb-language-17&quot; class=&quot;wp-block-code&quot; data-shcb-language-name=&quot;JavaScript&quot; data-shcb-language-slug=&quot;javascript&quot; style=&quot;background-color: white; border: 0px; padding: 0px;&quot;&gt;&lt;div class=&quot;code-badge-pre&quot; style=&quot;overflow: auto; position: relative;&quot;&gt;&lt;code class=&quot;hljs language-javascript&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; display: block; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;span style=&quot;color: #fb4934; font-family: Roboto Mono, monospace;&quot;&gt;&lt;span style=&quot;font-size: 14.4px;&quot;&gt;const numbers = [&#39;Ram&#39;, &#39;Shyam&#39;, &#39;Virat&#39;, &#39;Dhoni&#39;, &#39;Sachin&#39;];

const listItems = numbers.filter( (arrayElem&lt;/span&gt;ent&lt;span style=&quot;font-size: 14.4px;&quot;&gt;, &lt;/span&gt;arrayI&lt;span style=&quot;font-size: 14.4px;&quot;&gt;ndex)=&amp;gt;{

		return &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #fb4934; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace;&quot;&gt;arrayI&lt;/span&gt;&lt;span style=&quot;color: #fb4934; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 14.4px;&quot;&gt;ndex&lt;/span&gt;&lt;span style=&quot;color: #fb4934; font-family: Roboto Mono, monospace;&quot;&gt;&lt;span style=&quot;font-size: 14.4px;&quot;&gt; !== 0;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;hljs language-javascript&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; display: block; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;span style=&quot;color: #fb4934; font-family: Roboto Mono, monospace;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Compare Array index and remove that index element from array &lt;/span&gt;

		});

console.log(&#39;After deleted item list.=&#39;+listItems);&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;hljs language-javascript&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; display: block; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;/code&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p style=&quot;background-color: white; margin: 0px 0px 26px; padding: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px; padding: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #262626; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: calc(1rem*var(--typescale)*var(--typescale)*var(--typescale)); font-weight: 400; line-height: calc(2.66667rem); margin-left: 0px; margin-right: 0px; margin-top: 0px; margin: 0px 0px calc(1.77778rem); padding: 0px;&quot;&gt;Summary&lt;/h2&gt;&lt;ul style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px 25px; padding: 0px;&quot;&gt;&lt;li style=&quot;list-style-type: none; margin-bottom: 1rem; margin-left: 10px;&quot;&gt;The spread operator is denoted by three dots (…).&lt;/li&gt;&lt;li style=&quot;list-style-type: none; margin-bottom: 1rem; margin-left: 10px;&quot;&gt;The spread operator unpacks elements of iterable objects such as arrays, sets, and maps into a list.&lt;/li&gt;&lt;li style=&quot;list-style-type: none; margin-bottom: 1rem; margin-left: 10px;&quot;&gt;The rest paramter is also denoted by three dots (…). However, it packs remaining arguments of a function into an array.&lt;/li&gt;&lt;li style=&quot;list-style-type: none; margin-bottom: 1rem; margin-left: 10px;&quot;&gt;The spread operator can be used to clone an iterable object or merge iterable objects into one.&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/1505309697583975883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/1505309697583975883' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/1505309697583975883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/1505309697583975883'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2020/12/the-practical-usages-of-javascript.html' title='The Practical Usages of JavaScript Spread Operator | Array Destructuring'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-724774572327290690</id><published>2020-12-15T02:43:00.000-08:00</published><updated>2020-12-15T02:43:34.057-08:00</updated><title type='text'>An Introduction to JavaScript Arrow Functions</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h2 style=&quot;background-color: white; color: #262626; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: calc(1rem*var(--typescale)*var(--typescale)*var(--typescale)); line-height: calc(2.66667rem); margin: 0px 0px calc(1.77778rem); padding: 0px; text-align: left;&quot;&gt;Introduction to JavaScript arrow functions&lt;/h2&gt;&lt;div&gt;&lt;p style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px; padding: 0px;&quot;&gt;ES6 arrow functions provide you with an alternative way to write a shorter syntax compared to the function expression.&lt;/p&gt;&lt;p style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px; padding: 0px;&quot;&gt;The following example defines a function expression that adds two numbers:&lt;/p&gt;&lt;pre aria-describedby=&quot;shcb-language-1&quot; class=&quot;wp-block-code&quot; data-shcb-language-name=&quot;JavaScript&quot; data-shcb-language-slug=&quot;javascript&quot; style=&quot;background-color: white; border: 0px; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; padding: 0px;&quot;&gt;&lt;div class=&quot;code-badge-pre&quot; style=&quot;overflow: auto; position: relative;&quot;&gt;&lt;div class=&quot;code-badge&quot; style=&quot;background: transparent; border-radius: 0px 0px 0px 7px; display: flex; flex-direction: row; font-size: 0.875em; opacity: 0.5; padding: 5px 8px; position: absolute; right: 0px; top: 0px; transition: opacity 0.5s linear 0s; white-space: normal;&quot;&gt;&lt;div title=&quot;Copy to clipboard&quot;&gt;&lt;i class=&quot;icon-docs code-badge-copy-icon&quot; style=&quot;color: rgb(255, 255, 255) !important; cursor: pointer; font-size: 1.2em; padding: 0px 7px;&quot;&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;code class=&quot;hljs language-javascript&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; color: #ebdbb2; display: block; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;let&lt;/span&gt; add = &lt;span class=&quot;hljs-function&quot; style=&quot;color: #8ec07c;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;function&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;color: #fabd2f;&quot;&gt;x,y&lt;/span&gt;) &lt;/span&gt;{
  &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;return&lt;/span&gt; x + y;
}
&lt;span class=&quot;hljs-built_in&quot; style=&quot;color: #83a598;&quot;&gt;console&lt;/span&gt;.log(add(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;10&lt;/span&gt;,&lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;20&lt;/span&gt;)); &lt;span class=&quot;hljs-comment&quot; style=&quot;color: #928374; font-style: italic;&quot;&gt;// 30&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;small class=&quot;shcb-language&quot; id=&quot;shcb-language-1&quot; style=&quot;border: 0px; clip-path: inset(50%); clip: rect(1px, 1px, 1px, 1px); font-size: 12.8px; height: 1px; margin: -1px; overflow-wrap: normal; overflow: hidden; padding: 0px; position: absolute; width: 1px; word-break: normal;&quot;&gt;&lt;span class=&quot;shcb-language__label&quot;&gt;Code language:&lt;/span&gt; &lt;span class=&quot;shcb-language__name&quot;&gt;JavaScript&lt;/span&gt; &lt;span class=&quot;shcb-language__paren&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;shcb-language__slug&quot;&gt;javascript&lt;/span&gt;&lt;span class=&quot;shcb-language__paren&quot;&gt;)&lt;/span&gt;&lt;/small&gt;&lt;/pre&gt;&lt;p style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px; padding: 0px;&quot;&gt;The following example uses an arrow function which is equivalent to the above&amp;nbsp;&lt;code style=&quot;background-color: #fff6ea; border: none; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9rem; margin: 0px; padding: 0px 5px 2px;&quot;&gt;add()&lt;/code&gt;&amp;nbsp;function expression:&lt;/p&gt;&lt;pre aria-describedby=&quot;shcb-language-2&quot; class=&quot;wp-block-code&quot; data-shcb-language-name=&quot;JavaScript&quot; data-shcb-language-slug=&quot;javascript&quot; style=&quot;background-color: white; border: 0px; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; padding: 0px;&quot;&gt;&lt;div class=&quot;code-badge-pre&quot; style=&quot;overflow: auto; position: relative;&quot;&gt;&lt;div class=&quot;code-badge&quot; style=&quot;background: transparent; border-radius: 0px 0px 0px 7px; display: flex; flex-direction: row; font-size: 0.875em; opacity: 0.5; padding: 5px 8px; position: absolute; right: 0px; top: 0px; transition: opacity 0.5s linear 0s; white-space: normal;&quot;&gt;&lt;div title=&quot;Copy to clipboard&quot;&gt;&lt;i class=&quot;icon-docs code-badge-copy-icon&quot; style=&quot;color: rgb(255, 255, 255) !important; cursor: pointer; font-size: 1.2em; padding: 0px 7px;&quot;&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;code class=&quot;hljs language-javascript&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; color: #ebdbb2; display: block; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;let&lt;/span&gt; add = &lt;span class=&quot;hljs-function&quot; style=&quot;color: #8ec07c;&quot;&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;color: #fabd2f;&quot;&gt;x, y&lt;/span&gt;) =&amp;gt;&lt;/span&gt; x + y;
&lt;span class=&quot;hljs-built_in&quot; style=&quot;color: #83a598;&quot;&gt;console&lt;/span&gt;.log(add(&lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;10&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;color: #d3869b;&quot;&gt;20&lt;/span&gt;)); &lt;span class=&quot;hljs-comment&quot; style=&quot;color: #928374; font-style: italic;&quot;&gt;// 30;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;Single parameter case:&lt;/div&gt;&lt;div&gt;&lt;pre aria-describedby=&quot;shcb-language-2&quot; class=&quot;wp-block-code&quot; data-shcb-language-name=&quot;JavaScript&quot; data-shcb-language-slug=&quot;javascript&quot; style=&quot;background-color: white; border: 0px; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; padding: 0px;&quot;&gt;&lt;div class=&quot;code-badge-pre&quot; style=&quot;overflow: auto; position: relative;&quot;&gt;&lt;div class=&quot;code-badge&quot; style=&quot;background: transparent; border-radius: 0px 0px 0px 7px; display: flex; flex-direction: row; font-size: 0.875em; opacity: 0.5; padding: 5px 8px; position: absolute; right: 0px; top: 0px; transition: opacity 0.5s linear 0s; white-space: normal;&quot;&gt;&lt;div title=&quot;Copy to clipboard&quot;&gt;&lt;i class=&quot;icon-docs code-badge-copy-icon&quot; style=&quot;color: rgb(255, 255, 255) !important; cursor: pointer; font-size: 1.2em; padding: 0px 7px;&quot;&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;code class=&quot;hljs language-javascript&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; color: #ebdbb2; display: block; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;let&lt;/span&gt; add = &lt;span class=&quot;hljs-function&quot; style=&quot;color: #8ec07c;&quot;&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;color: #fabd2f;&quot;&gt;x&lt;/span&gt;) =&amp;gt;&lt;/span&gt; x = x + 1;&lt;/code&gt;&lt;code class=&quot;hljs language-javascript&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; color: #ebdbb2; display: block; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;OR&lt;/code&gt;&lt;code class=&quot;hljs language-javascript&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; color: #ebdbb2; display: block; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934; font-size: 0.9em;&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;font-size: 0.9em;&quot;&gt; add = &lt;/span&gt;&lt;span class=&quot;hljs-function&quot; style=&quot;color: #8ec07c; font-size: 0.9em;&quot;&gt;&lt;span class=&quot;hljs-params&quot; style=&quot;color: #fabd2f;&quot;&gt;x&lt;/span&gt; =&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 0.9em;&quot;&gt; x = x + 1; &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//remove brackets (x)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px; padding: 0px;&quot;&gt;The &amp;nbsp;&lt;code style=&quot;background-color: #fff6ea; border: none; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9rem; margin: 0px; padding: 0px 5px 2px;&quot;&gt;typeof&lt;/code&gt;&amp;nbsp;operator&amp;nbsp;returns&amp;nbsp;&lt;code style=&quot;background-color: #fff6ea; border: none; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9rem; margin: 0px; padding: 0px 5px 2px;&quot;&gt;function&lt;/code&gt;&amp;nbsp;indicating the type of arrow function.&lt;/p&gt;&lt;pre aria-describedby=&quot;shcb-language-4&quot; class=&quot;wp-block-code&quot; data-shcb-language-name=&quot;JavaScript&quot; data-shcb-language-slug=&quot;javascript&quot; style=&quot;background-color: white; border: 0px; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; padding: 0px;&quot;&gt;&lt;div class=&quot;code-badge-pre&quot; style=&quot;overflow: auto; position: relative;&quot;&gt;&lt;div class=&quot;code-badge&quot; style=&quot;background: transparent; border-radius: 0px 0px 0px 7px; display: flex; flex-direction: row; font-size: 0.875em; opacity: 0.5; padding: 5px 8px; position: absolute; right: 0px; top: 0px; transition: opacity 0.5s linear 0s; white-space: normal;&quot;&gt;&lt;div title=&quot;Copy to clipboard&quot;&gt;&lt;i class=&quot;icon-docs code-badge-copy-icon&quot; style=&quot;color: rgb(255, 255, 255) !important; cursor: pointer; font-size: 1.2em; padding: 0px 7px;&quot;&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;code class=&quot;hljs language-javascript&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; color: #ebdbb2; display: block; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;span class=&quot;hljs-built_in&quot; style=&quot;color: #83a598;&quot;&gt;console&lt;/span&gt;.log(&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;typeof&lt;/span&gt; add); &lt;span class=&quot;hljs-comment&quot; style=&quot;color: #928374; font-style: italic;&quot;&gt;// function&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;small class=&quot;shcb-language&quot; id=&quot;shcb-language-4&quot; style=&quot;border: 0px; clip-path: inset(50%); clip: rect(1px, 1px, 1px, 1px); font-size: 12.8px; height: 1px; margin: -1px; overflow-wrap: normal; overflow: hidden; padding: 0px; position: absolute; width: 1px; word-break: normal;&quot;&gt;&lt;span class=&quot;shcb-language__label&quot;&gt;Code language:&lt;/span&gt; &lt;span class=&quot;shcb-language__name&quot;&gt;JavaScript&lt;/span&gt; &lt;span class=&quot;shcb-language__paren&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;shcb-language__slug&quot;&gt;javascript&lt;/span&gt;&lt;span class=&quot;shcb-language__paren&quot;&gt;)&lt;/span&gt;&lt;/small&gt;&lt;/pre&gt;&lt;p style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px; padding: 0px;&quot;&gt;The arrow function is also an instance of the&amp;nbsp;&lt;a href=&quot;http://www.javascripttutorial.net/javascript-function-type/&quot; style=&quot;background-color: transparent; text-decoration-line: none; transition: all 0.1s ease-in-out 0s;&quot;&gt;Function type&lt;/a&gt;&amp;nbsp;as shown in the following example:&lt;/p&gt;&lt;pre aria-describedby=&quot;shcb-language-5&quot; class=&quot;wp-block-code&quot; data-shcb-language-name=&quot;JavaScript&quot; data-shcb-language-slug=&quot;javascript&quot; style=&quot;background-color: white; border: 0px; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; padding: 0px;&quot;&gt;&lt;div class=&quot;code-badge-pre&quot; style=&quot;overflow: auto; position: relative;&quot;&gt;&lt;div class=&quot;code-badge&quot; style=&quot;background: transparent; border-radius: 0px 0px 0px 7px; display: flex; flex-direction: row; font-size: 0.875em; opacity: 0.5; padding: 5px 8px; position: absolute; right: 0px; top: 0px; transition: opacity 0.5s linear 0s; white-space: normal;&quot;&gt;&lt;div title=&quot;Copy to clipboard&quot;&gt;&lt;i class=&quot;icon-docs code-badge-copy-icon&quot; style=&quot;color: rgb(255, 255, 255) !important; cursor: pointer; font-size: 1.2em; padding: 0px 7px;&quot;&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;code class=&quot;hljs language-javascript&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; color: #ebdbb2; display: block; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;span class=&quot;hljs-built_in&quot; style=&quot;color: #83a598;&quot;&gt;console&lt;/span&gt;.log(add &lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;instanceof&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot; style=&quot;color: #83a598;&quot;&gt;Function&lt;/span&gt;); &lt;span class=&quot;hljs-comment&quot; style=&quot;color: #928374; font-style: italic;&quot;&gt;// true&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px; padding: 0px;&quot;&gt;The following example uses an arrow function as an argument of the&amp;nbsp;&lt;code style=&quot;background-color: #fff6ea; border: none; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9rem; margin: 0px; padding: 0px 5px 2px;&quot;&gt;&lt;a href=&quot;https://www.javascripttutorial.net/javascript-array-map/&quot; style=&quot;background-color: transparent; text-decoration-line: none; transition: all 0.1s ease-in-out 0s;&quot;&gt;map()&lt;/a&gt;&lt;/code&gt;&amp;nbsp;method that transforms an array of strings into an array of the string’s lengths.&lt;/p&gt;&lt;pre aria-describedby=&quot;shcb-language-13&quot; class=&quot;wp-block-code&quot; data-shcb-language-name=&quot;JavaScript&quot; data-shcb-language-slug=&quot;javascript&quot; style=&quot;background-color: white; border: 0px; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; padding: 0px;&quot;&gt;&lt;div class=&quot;code-badge-pre&quot; style=&quot;overflow: auto; position: relative;&quot;&gt;&lt;div class=&quot;code-badge&quot; style=&quot;background: transparent; border-radius: 0px 0px 0px 7px; display: flex; flex-direction: row; font-size: 0.875em; opacity: 0.5; padding: 5px 8px; position: absolute; right: 0px; top: 0px; transition: opacity 0.5s linear 0s; white-space: normal;&quot;&gt;&lt;div title=&quot;Copy to clipboard&quot;&gt;&lt;i class=&quot;icon-docs code-badge-copy-icon&quot; style=&quot;color: rgb(255, 255, 255) !important; cursor: pointer; font-size: 1.2em; padding: 0px 7px;&quot;&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;code class=&quot;hljs language-javascript&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; color: #ebdbb2; display: block; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;let&lt;/span&gt; names = [&lt;span class=&quot;hljs-string&quot; style=&quot;color: #b8bb26;&quot;&gt;&#39;John&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;color: #b8bb26;&quot;&gt;&#39;Mac&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;color: #b8bb26;&quot;&gt;&#39;Peter&#39;&lt;/span&gt;];
&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;let&lt;/span&gt; lengths = names.map(&lt;span class=&quot;hljs-function&quot; style=&quot;color: #8ec07c;&quot;&gt;&lt;span class=&quot;hljs-params&quot; style=&quot;color: #fabd2f;&quot;&gt;name&lt;/span&gt; =&amp;gt;&lt;/span&gt; name.length);

&lt;span class=&quot;hljs-built_in&quot; style=&quot;color: #83a598;&quot;&gt;console&lt;/span&gt;.log(lengths);&lt;/code&gt;&lt;/div&gt;&lt;small class=&quot;shcb-language&quot; id=&quot;shcb-language-13&quot; style=&quot;border: 0px; clip-path: inset(50%); clip: rect(1px, 1px, 1px, 1px); font-size: 12.8px; height: 1px; margin: -1px; overflow-wrap: normal; overflow: hidden; padding: 0px; position: absolute; width: 1px; word-break: normal;&quot;&gt;&lt;span class=&quot;shcb-language__label&quot;&gt;Code language:&lt;/span&gt; &lt;span class=&quot;shcb-language__name&quot;&gt;JavaScript&lt;/span&gt; &lt;span class=&quot;shcb-language__paren&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;shcb-language__slug&quot;&gt;javascript&lt;/span&gt;&lt;span class=&quot;shcb-language__paren&quot;&gt;)&lt;/span&gt;&lt;/small&gt;&lt;/pre&gt;&lt;h3 style=&quot;background-color: white; color: #262626; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: calc(1rem*var(--typescale)*var(--typescale)); font-weight: 400; line-height: calc(1.77778rem); margin: 0px 0px calc(0.888889rem); padding: 0px;&quot;&gt;JavaScript arrow functions with no parameter&lt;/h3&gt;&lt;p style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px; padding: 0px;&quot;&gt;If the arrow function has no parameter, you must use the parentheses, like this:&lt;/p&gt;&lt;pre aria-describedby=&quot;shcb-language-14&quot; class=&quot;wp-block-code&quot; data-shcb-language-name=&quot;PHP&quot; data-shcb-language-slug=&quot;php&quot; style=&quot;background-color: white; border: 0px; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; padding: 0px;&quot;&gt;&lt;div class=&quot;code-badge-pre&quot; style=&quot;overflow: auto; position: relative;&quot;&gt;&lt;div class=&quot;code-badge&quot; style=&quot;background: transparent; border-radius: 0px 0px 0px 7px; display: flex; flex-direction: row; font-size: 0.875em; opacity: 0.5; padding: 5px 8px; position: absolute; right: 0px; top: 0px; transition: opacity 0.5s linear 0s; white-space: normal;&quot;&gt;&lt;div title=&quot;Copy to clipboard&quot;&gt;&lt;i class=&quot;icon-docs code-badge-copy-icon&quot; style=&quot;color: rgb(255, 255, 255) !important; cursor: pointer; font-size: 1.2em; padding: 0px 7px;&quot;&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;code class=&quot;hljs language-php&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; color: #ebdbb2; display: block; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;() =&amp;gt; { statements }&lt;/code&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; font-family: -apple-system, system-ui, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 0px 0px 26px; padding: 0px;&quot;&gt;To fix this, you need to wrap the object literal in parentheses as follows:&lt;/p&gt;&lt;pre aria-describedby=&quot;shcb-language-25&quot; class=&quot;wp-block-code&quot; data-shcb-language-name=&quot;JavaScript&quot; data-shcb-language-slug=&quot;javascript&quot; style=&quot;background-color: white; border: 0px; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; padding: 0px;&quot;&gt;&lt;div class=&quot;code-badge-pre&quot; style=&quot;overflow: auto; position: relative;&quot;&gt;&lt;div class=&quot;code-badge&quot; style=&quot;background: transparent; border-radius: 0px 0px 0px 7px; display: flex; flex-direction: row; font-size: 0.875em; opacity: 0.5; padding: 5px 8px; position: absolute; right: 0px; top: 0px; transition: opacity 0.5s linear 0s; white-space: normal;&quot;&gt;&lt;div title=&quot;Copy to clipboard&quot;&gt;&lt;i class=&quot;icon-docs code-badge-copy-icon&quot; style=&quot;color: rgb(255, 255, 255) !important; cursor: pointer; font-size: 1.2em; padding: 0px 7px;&quot;&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;code class=&quot;hljs language-javascript&quot; style=&quot;background: rgb(40, 40, 40); box-sizing: border-box; color: #ebdbb2; display: block; font-family: &amp;quot;Roboto Mono&amp;quot;, monospace; font-size: 0.9em; overflow-wrap: break-word; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;color: #fb4934;&quot;&gt;let&lt;/span&gt; setColor = &lt;span class=&quot;hljs-function&quot; style=&quot;color: #8ec07c;&quot;&gt;&lt;span class=&quot;hljs-params&quot; style=&quot;color: #fabd2f;&quot;&gt;color&lt;/span&gt; =&amp;gt;&lt;/span&gt; ({&lt;span class=&quot;hljs-attr&quot; style=&quot;color: #fabd2f;&quot;&gt;value&lt;/span&gt;: &#39;red&#39; });&lt;/code&gt;&lt;/div&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/724774572327290690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/724774572327290690' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/724774572327290690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/724774572327290690'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2020/12/an-introduction-to-javascript-arrow.html' title='An Introduction to JavaScript Arrow Functions'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-5916720082296594826</id><published>2020-12-14T09:59:00.000-08:00</published><updated>2020-12-14T09:59:03.337-08:00</updated><title type='text'>Form Submit in React Js | useState in ReactJS | Event Handling  | ReactJS</title><content type='html'>&lt;p&gt;&amp;nbsp;//***&amp;nbsp;Form Submit in React Js | useState in ReactJS | Event Handling&amp;nbsp; | ReactJS&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;import React, {useState} from &#39;react&#39;;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;const App = () =&amp;gt; {&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;//Object&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const temp = {&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;fname : &#39;&#39;,&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;lname : &#39;&#39;,&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;email : &#39;&#39;,&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;phone : &#39;&#39;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;//set state&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const [data, setDataValue] = useState(temp);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;//Calling event function when we input value and get &amp;amp; set field values.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const inputEvent = (event) =&amp;gt;{&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;// name = event.target.name;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;// value = event.target.value;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;const {name, value} = event.target;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;setDataValue( (preValue)=&amp;gt;{&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;return {&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;...preValue,&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;[name]:value,&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;});&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;// upStateValue( (preValue)=&amp;gt;{&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;// &lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;return {&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;// &lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;name: event.target.value,&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;// &lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;fullname: preValue.fullname&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;// &lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;// });&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;console.log( data);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;};&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const onSubmit = (event) =&amp;gt;{&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;event.preventDefault();&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;alert(&#39;Form Successfully submitted.&#39;);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;// upStateValue( (preValue)=&amp;gt;{&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;// &lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;return {&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;// &lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;name: preValue.name,&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;// &lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;fullname: preValue.name&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;// &lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;// });&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;};&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;return(&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;&amp;lt;&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;&amp;lt;form onSubmit={onSubmit}&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&amp;lt;h1&amp;gt;Hello { data.fname } { data.lname }&amp;lt;/h1&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&amp;lt;p&amp;gt;{data.email}&amp;lt;/p&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&amp;lt;p&amp;gt;{data.phone}&amp;lt;/p&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&amp;lt;input type=&quot;text&quot; name=&quot;fname&quot; placeholder=&quot;Enter Your First Name&quot; onChange={inputEvent} value={data.fname}&amp;nbsp; &amp;nbsp; /&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&amp;lt;input type=&quot;text&quot; name=&quot;lname&quot; placeholder=&quot;Enter Your Last Name&quot; onChange={inputEvent}&amp;nbsp; value={data.lname}&amp;nbsp; /&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&amp;lt;input type=&quot;email&quot; name=&quot;email&quot; placeholder=&quot;Enter Your Email&quot; onChange={inputEvent}&amp;nbsp; &amp;nbsp;value={data.email} /&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&amp;lt;input type=&quot;number&quot; name=&quot;phone&quot; placeholder=&quot;Enter Your Phone&quot; onChange={inputEvent}&amp;nbsp; value={data.phone}&amp;nbsp; /&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&amp;lt;input type=&quot;submit&quot; /&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;&amp;lt;/form&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;&amp;lt;/&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;);&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;export default App;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/5916720082296594826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/5916720082296594826' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/5916720082296594826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/5916720082296594826'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2020/12/form-submit-in-react-js-usestate-in.html' title='Form Submit in React Js | useState in ReactJS | Event Handling  | ReactJS'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-4077058140394902352</id><published>2020-12-14T07:35:00.000-08:00</published><updated>2020-12-14T07:35:16.117-08:00</updated><title type='text'>Handling Event in ReactJS | Input field value get and display | useState in Hooks | Controlled Component | Form in ReactJS</title><content type='html'>&lt;p&gt;Event&amp;nbsp; Handling in ReactJS | Input field value get and display | useState in Hooks | Controlled Component | Form in ReactJS&lt;/p&gt;&lt;p&gt;Copy and paste below code&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;import React, {useState} from &#39;react&#39;;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;const App = () =&amp;gt; {&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const [value, upStateValue] = useState({&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;name : &#39;&#39;,&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;fullname : &#39;&#39;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;});&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const inputEvent = (event) =&amp;gt;{&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;upStateValue( (preValue)=&amp;gt;{&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;return {&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;name: event.target.value,&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;fullname: preValue.fullname&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;});&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;console.log( value);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;const inputValue = () =&amp;gt;{&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;upStateValue( (preValue)=&amp;gt;{&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;return {&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;name: preValue.name,&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;fullname: preValue.name&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;});&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;return(&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;&amp;lt;&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;&amp;lt;div&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&amp;lt;h1&amp;gt;Hello { value.fullname }&amp;lt;/h1&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&amp;lt;input type=&quot;text&quot; placeholder=&quot;Enter Your Name&quot; onChange={inputEvent}&amp;nbsp; &amp;nbsp; /&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&amp;lt;button onClick={inputValue} &amp;gt;Click Me &amp;lt;/button&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;&amp;lt;/&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;);&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;export default App;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/4077058140394902352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/4077058140394902352' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/4077058140394902352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/4077058140394902352'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2020/12/handling-event-in-reactjs-input-field.html' title='Handling Event in ReactJS | Input field value get and display | useState in Hooks | Controlled Component | Form in ReactJS'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-6712040590962632741</id><published>2016-10-09T02:06:00.002-07:00</published><updated>2016-10-09T02:06:15.659-07:00</updated><title type='text'>How to login programmatically into Drupal 8</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 16.25px; line-height: 1.1em; margin: 0px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 1.3em; margin: 0px 0px 0.75em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot; style=&quot;line-height: 1.3em; margin: 0px 0px 0.75em;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-1774030690449081527&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 1.3em; margin: 0px 0px 0.75em;&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.3em; margin: 0px 0px 0.75em;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 datatype=&quot;&quot; property=&quot;schema:name&quot; style=&quot;color: #3b3b3b; font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 1.171em; font-weight: inherit; margin: 0.94em 0px 0.45em;&quot;&gt;
&lt;span style=&quot;font-size: 13.9294px;&quot;&gt;Sometimes we need to login into our Drupal site not through the regular login form. For example if we have trouble with login form or maybe we just forgot our password... Here are few ways to login into your Drupal site not through login form.&lt;/span&gt;&lt;/h3&gt;
&lt;div class=&quot;clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item&quot; property=&quot;schema:text&quot; style=&quot;color: #3b3b3b; font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, Times, serif; line-height: 1.3em; margin: 0px 0px 0.75em;&quot;&gt;
&lt;div style=&quot;font-size: 13.9294px; line-height: 1.3em; margin: 0px 0px 1.2em;&quot;&gt;
For Drupal 8 you just need to create file your_auto_login.php in the Drupal root directory, put there the next code and open this file in your browser:&lt;/div&gt;
&lt;div style=&quot;font-size: 13.9294px; line-height: 1.3em; margin: 0px 0px 1.2em;&quot;&gt;
&lt;div style=&quot;font-size: 13.9294px; line-height: 1.3em; margin: 0px 0px 1.2em;&quot;&gt;
use Drupal\Core\DrupalKernel;&lt;br /&gt;use Symfony\Component\HttpFoundation\Request;&lt;/div&gt;
&lt;div style=&quot;font-size: 13.9294px; line-height: 1.3em; margin: 0px 0px 1.2em;&quot;&gt;
$autoloader = require_once &#39;autoload.php&#39;;&lt;/div&gt;
&lt;div style=&quot;font-size: 13.9294px; line-height: 1.3em; margin: 0px 0px 1.2em;&quot;&gt;
$kernel = new DrupalKernel(&#39;prod&#39;, $autoloader);&lt;/div&gt;
&lt;div style=&quot;font-size: 13.9294px; line-height: 1.3em; margin: 0px 0px 1.2em;&quot;&gt;
$request = Request::createFromGlobals();&lt;br /&gt;$response = $kernel-&amp;gt;handle($request);&lt;/div&gt;
&lt;div style=&quot;font-size: 13.9294px; line-height: 1.3em; margin: 0px 0px 1.2em;&quot;&gt;
// ID of the user.&lt;br /&gt;$uid = THE_AUTOMATIC_USER_ID; //&lt;strong&gt;Do not use 1 because it is the super admin&lt;/strong&gt;&lt;br /&gt;$user = Drupal\user\Entity\User::load($uid);&lt;br /&gt;user_login_finalize($user);&lt;/div&gt;
&lt;div style=&quot;font-size: 13.9294px; line-height: 1.3em; margin: 0px 0px 1.2em;&quot;&gt;
$response-&amp;gt;send();&lt;/div&gt;
&lt;div style=&quot;font-size: 13.9294px; line-height: 1.3em; margin: 0px 0px 1.2em;&quot;&gt;
$kernel-&amp;gt;terminate($request, $response);&lt;/div&gt;
&lt;div style=&quot;font-size: 13.9294px; line-height: 1.3em; margin: 0px 0px 1.2em;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.3em; margin: 0px 0px 1.2em;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Recover password u&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;sing Drush&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;h3 datatype=&quot;&quot; property=&quot;schema:name&quot; style=&quot;font-size: 1.171em; font-weight: inherit; margin: 0.94em 0px 0.45em;&quot;&gt;
&lt;a class=&quot;permalink&quot; href=&quot;http://www.drupal8.ovh/en/comment/56&quot; hreflang=&quot;en&quot; rel=&quot;bookmark&quot; style=&quot;background-color: transparent; border-bottom: 1px dotted; color: #0071b3; text-decoration: none;&quot;&gt;If Forget password&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item&quot; property=&quot;schema:text&quot; style=&quot;line-height: 1.3em; margin: 0px 0px 0.75em;&quot;&gt;
&lt;div style=&quot;font-size: 13.9294px; line-height: 1.3em; margin: 0px 0px 1.2em;&quot;&gt;
If you forget the password, use drush to recover&lt;/div&gt;
&lt;div style=&quot;font-size: 13.9294px; line-height: 1.3em; margin: 0px 0px 1.2em;&quot;&gt;
&lt;code style=&quot;font-family: monospace, monospace; font-size: 1em;&quot;&gt;drush uli&lt;/code&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 13.9294px; line-height: 1.3em; margin: 0px 0px 1.2em;&quot;&gt;
&lt;code style=&quot;font-family: monospace, monospace; font-size: 1em;&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 13.9294px; line-height: 1.3em; margin: 0px 0px 1.2em;&quot;&gt;
&lt;code style=&quot;font-family: monospace, monospace; font-size: 1em;&quot;&gt;&lt;/code&gt;&lt;/div&gt;
&lt;h3 class=&quot;r&quot; style=&quot;color: #222222; font-family: arial, sans-serif; margin: 0px; overflow: hidden; padding: 0px; text-overflow: ellipsis; white-space: nowrap;&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Login programmatically as a user | Drupal 8&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;div style=&quot;line-height: 1.3em; margin: 0px 0px 0.75em;&quot;&gt;
&lt;h3 class=&quot;r&quot; style=&quot;color: #222222; font-family: arial, sans-serif; margin: 0px; overflow: hidden; padding: 0px; text-overflow: ellipsis; white-space: nowrap;&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;How to login programmatically into Drupal&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 1.3em; margin: 0px 0px 0.75em;&quot;&gt;
&lt;ul class=&quot;field-items&quot; style=&quot;color: black; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Myriad Pro&amp;quot;, Myriad, Arial, Helvetica, sans-serif; margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;
&lt;li class=&quot;field-item even&quot; rel=&quot;dc:subject&quot; style=&quot;display: inline; list-style: none; padding: 0px 0.75em 0px 0px;&quot;&gt;Drupal 8&lt;/li&gt;
&amp;nbsp;
&lt;li class=&quot;field-item odd&quot; rel=&quot;dc:subject&quot; style=&quot;display: inline; list-style: none; padding: 0px 0.75em 0px 0px;&quot;&gt;Drupal&lt;/li&gt;
&amp;nbsp;
&lt;li class=&quot;field-item even&quot; rel=&quot;dc:subject&quot; style=&quot;display: inline; list-style: none; padding: 0px 0.75em 0px 0px;&quot;&gt;Create User&lt;/li&gt;
&amp;nbsp;
&lt;li class=&quot;field-item odd&quot; rel=&quot;dc:subject&quot; style=&quot;display: inline; list-style: none; padding: 0px 0.75em 0px 0px;&quot;&gt;PHP&lt;/li&gt;
&amp;nbsp;
&lt;li class=&quot;field-item even&quot; rel=&quot;dc:subject&quot; style=&quot;display: inline; list-style: none; padding: 0px 0.75em 0px 0px;&quot;&gt;User Object&lt;/li&gt;
&amp;nbsp;
&lt;li class=&quot;field-item odd&quot; rel=&quot;dc:subject&quot; style=&quot;display: inline; list-style: none; padding: 0px 0.75em 0px 0px;&quot;&gt;user_save&lt;/li&gt;
&amp;nbsp;
&lt;li class=&quot;field-item even&quot; rel=&quot;dc:subject&quot; style=&quot;display: inline; list-style: none; padding: 0px 0.75em 0px 0px;&quot;&gt;save_user&lt;/li&gt;
&lt;/span&gt;&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/6712040590962632741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/6712040590962632741' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/6712040590962632741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/6712040590962632741'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2016/10/how-to-login-programmatically-into.html' title='How to login programmatically into Drupal 8'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-1429306912644980917</id><published>2009-01-12T12:13:00.000-08:00</published><updated>2009-01-12T12:16:14.500-08:00</updated><title type='text'>Validate Integer Number using JavaScript and regular expression</title><content type='html'>function isValidNumber(num) {&lt;br /&gt; Regex = /(^[0-9]*$)/;&lt;br /&gt;    return Regex.test(num);&lt;br /&gt;}</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/1429306912644980917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/1429306912644980917' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/1429306912644980917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/1429306912644980917'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2009/01/validate-integer-number-using.html' title='Validate Integer Number using JavaScript and regular expression'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-4977752693199146251</id><published>2009-01-12T11:55:00.000-08:00</published><updated>2009-01-12T12:37:41.765-08:00</updated><title type='text'>Validate email address using JavaScript and regular expression</title><content type='html'>&lt;small&gt;Check Email Address with JavaScript and Regular Expressions&lt;/small&gt;&lt;br /&gt;&lt;div class=&quot;entry&quot;&gt;&lt;br /&gt;&lt;p&gt;Last month I wrote about &lt;a title=&quot;Java reg ex&quot; href=&quot;http://www.zparacha.com/java_regex_validation/&quot; target=&quot;_blank&quot;&gt;regular expressions in Java&lt;/a&gt;, today I’ll show you how to use regular expression in JavaScript to validate email address.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Here is the code to validate email address in JavaScript using regular expression.&lt;/p&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 255);&quot;&gt;function &lt;/span&gt;validateEmail(elementValue){      &lt;br&gt;var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 255);&quot;&gt;return &lt;/span&gt;emailPattern.test(elementValue); } &lt;/p&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4 id=&quot;toc-explanation&quot;&gt;Explanation:&lt;/h4&gt;&lt;br /&gt;&lt;p&gt;The argument to this method is the email address you want to validate.    &lt;br&gt;In the method body we define a variable (’emailPattern’) and assign a regular expression to it.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Email format&lt;/strong&gt;: The regular expression for email is     &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span id=&quot;more-66&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;br /&gt; &lt;strong&gt;/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;To understand the regular expression we will divide it into smaller components:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=&quot;border-bottom: 2px solid rgb(0, 255, 0); padding-right: 5px; font-weight: bold; font-size: 105%; color: rgb(128, 0, 128); text-decoration: none;&quot;&gt;/^[a-zA-Z0-9._-]+&lt;/span&gt;:&amp;nbsp; Means that the email address must begin with alpha-numeric characters (both lowercase and uppercase characters are allowed). It may have periods,underscores and hyphens.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=&quot;border-bottom: 2px solid rgb(0, 255, 0); padding-right: 5px; font-weight: bold; font-size: 105%; color: rgb(128, 0, 128); text-decoration: none;&quot;&gt;@&lt;/span&gt;:&amp;nbsp;&amp;nbsp; There must be a ‘@’ symbol after initial characters.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=&quot;border-bottom: 1px solid rgb(0, 255, 0); padding-right: 10px; font-weight: bold; font-size: 105%; color: rgb(128, 0, 128); text-decoration: none;&quot;&gt;[a-zA-Z0-9.-]+&lt;/span&gt;: After the ‘@’ sign there must be some alpha-numeric characters. It can also contain period (’.&#39;) and and hyphens(’-&#39;).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=&quot;border-bottom: 2px solid rgb(0, 255, 0); padding-right: 5px; font-weight: bold; font-size: 105%; color: rgb(128, 0, 128); text-decoration: none;&quot;&gt;\.&lt;/span&gt;: After the second group of characters there must be a period (’.&#39;). This is to separate domain and subdomain names.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=&quot;border-bottom: 2px solid rgb(0, 255, 0); padding-right: 5px; font-weight: bold; font-size: 105%; color: rgb(128, 0, 128); text-decoration: none;&quot;&gt;[a-zA-Z]{2,4}$/&lt;/span&gt;: Finally, the email address must end with two to four alphabets. Having a-z and A-Z means that both lowercase and uppercase letters are allowed.     &lt;br&gt;{2,4} indicates the minimum and maximum number of characters. This will allow domain names with 2, 3 and 4 characters e.g.; us, tx, org, com, net, wxyz).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;On the final line we call &lt;i&gt;test&lt;/i&gt; method for our regular expression and pass the email address as input. If the input email address satisfies our regular expression, ‘test’ will return &lt;i&gt;true&lt;/i&gt; otherwise it will return &lt;i&gt;false&lt;/i&gt;. We return this value to the calling method.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;You can call this method whenever you want to validate email address.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;div&gt;&lt;h2&gt;Check Email Address with JavaScript and Regular Expressions&lt;/h2&gt;&lt;/div&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;script language=&quot;javascript&quot;&amp;gt;&lt;br&gt;function checkEmail() {&lt;br&gt;var email = document.getElementById(’emailaddress’);&lt;br&gt;var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;&lt;br&gt;if (!filter.test(email.value)) {&lt;br&gt;alert(’Please provide a valid email address’);&lt;br&gt;email.focus&lt;br&gt;return false;&lt;br&gt;}&lt;br&gt;}&lt;br&gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Validate Email Addresses with a JavaScript Regular Expression&lt;br /&gt;Often, email validation code for web applications checks only for the position of @ and period characters, also assuming the @ character will be in the front of period. But we all know the &quot;a_b.c@gamil.com&quot; is valid.&lt;br /&gt;&lt;br /&gt;Did you know you can use a JavaScript Regular Expressions method to check email addresses? It is simple and efficient. Here&#39;s how:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;script language=&quot;javascript&quot;&gt;&lt;br /&gt;function checkEmail(inputvalue){	&lt;br /&gt;    var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;&lt;br /&gt;    if(pattern.test(inputvalue)){         &lt;br /&gt;		alert(&quot;true&quot;);   &lt;br /&gt;    }else{   &lt;br /&gt;		alert(&quot;false&quot;); &lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/4977752693199146251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/4977752693199146251' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/4977752693199146251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/4977752693199146251'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2009/01/validate-email-address-using-javascript.html' title='Validate email address using JavaScript and regular expression'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-3371039395385171974</id><published>2008-07-16T01:16:00.000-07:00</published><updated>2008-07-16T01:25:58.729-07:00</updated><title type='text'>Prevent browser window closing?</title><content type='html'>Try this Examples:&lt;br /&gt;Copy &amp; paste this code in your html page and run it... &lt;br /&gt;&lt;br /&gt;{script type=&quot;text/javascript&quot;}&lt;br /&gt;&lt;br /&gt;var needToConfirm = true;&lt;br /&gt;window.onbeforeunload = confirmExit;&lt;br /&gt;function confirmExit()&lt;br /&gt;{&lt;br /&gt;    if (needToConfirm)&lt;br /&gt;    return &quot;You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. Are you sure you want to exit this page?&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function windowclose(){&lt;br /&gt;    window.close();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;{/script}</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/3371039395385171974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/3371039395385171974' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/3371039395385171974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/3371039395385171974'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2008/07/prevent-browser-window-closing.html' title='Prevent browser window closing?'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-6897983358528026322</id><published>2008-06-25T23:01:00.000-07:00</published><updated>2008-06-25T23:04:06.290-07:00</updated><title type='text'>Difference between SAX and DOM parsers?</title><content type='html'>&lt;h1&gt;Difference between SAX and DOM parsers?&lt;/h1&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;DOM parser -&lt;/span&gt; Reads the whole XML document and returns a DOM tree representation of xml document. It provides a convenient way for reading, analyzing and manipulating XML files. It is not well suited for large xml files, as it always reads the whole file before processing.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SAX parser -&lt;/span&gt; Works incrementally and generate events that are passed to the application. It does not generate data representation of xml content so some programming is required. However, it provides stream processing and partial processing which cannot be done alone by DOM parser.&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;SAX Parser is the one which is developed to run the java programs especially. It uses a memory resident model. DOM is developed by w3c consortium so that it is an open standard. In DOM the xml file is arranged as a tree and backward and forward search is possible for searching the tags and evaluating the data which it holds. It depends upon the application and ease of data accessiblity. If we want to extract the data from a xml file once we have to move to SAX, which is one time top to bottom read approach and if we want ot randomly pick the data in an xml file then the tree reperesentation of DOM model is to be put into use. Thats all !&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Both SAX and DOM are used to parse the XML document. Both has advantages and disadvantages and can be used in our programming depending on the situation&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SAX parser: -&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. Parses node by node&lt;br /&gt;&lt;br /&gt;2. Doesnt store the XML in memory&lt;br /&gt;&lt;br /&gt;3. We cant insert or delete a node&lt;br /&gt;&lt;br /&gt;4. Top to bottom traversing&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;DOM parser: -&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. Stores the entire XML document into memory before processing&lt;br /&gt;&lt;br /&gt;2. Occupies more memory&lt;br /&gt;&lt;br /&gt;3. We can insert or delete nodes&lt;br /&gt;&lt;br /&gt;4. Traverse in any direction.&lt;br /&gt;&lt;br /&gt;If we need to find a node and doesnt need to insert or delete we can go with SAX itself otherwise DOM provided we have more memory.</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/6897983358528026322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/6897983358528026322' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/6897983358528026322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/6897983358528026322'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2008/06/difference-between-sax-and-dom-parsers.html' title='Difference between SAX and DOM parsers?'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-1141508246479586125</id><published>2008-06-25T22:58:00.000-07:00</published><updated>2008-06-25T23:00:47.702-07:00</updated><title type='text'>Application server &amp; Web server</title><content type='html'>&lt;h1&gt;Application server &amp; Web server&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;1. What is difference between web server and application server?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Answer 1:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Webserver:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A Web server handles the HTTP protocol. When the Web server receives an HTTP request, it responds with an HTTP response, such as sending back an HTML page. To process a request, a Web server may respond with a static HTML page or image, send a redirect, or delegate the dynamic response generation to some other program such as CGI scripts, JSPs (JavaServer Pages), servlets, ASPs (Active Server Pages), server-side JavaScripts, or some other server-side technology. Whatever their purpose, such server-side programs generate a response, most often in HTML, for viewing in a Web browser.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Application Server:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As for the application server, according to our definition, an application server exposes business logic to client applications through various protocols, possibly including HTTP. While a Web server mainly deals with sending HTML for display in a Web browser, an application server provides access to business logic for use by client application programs. The application program can use this logic just as it would call a method on an object&lt;br /&gt;&lt;br /&gt;2. A web server itself is an application deployed inside an Application Server.&lt;br /&gt;&lt;br /&gt;As explained in earlier response, a Web Server is a software that serves to access internet or intranet.&lt;br /&gt;&lt;br /&gt;It provides HTTP message handling for an application server ( J2EE like Web Sphere).&lt;br /&gt;&lt;br /&gt;Application Server is a system that provides the execution enviroment for the entire system.That is the core of network computing / Architechtures.&lt;br /&gt;&lt;br /&gt;3. Web Server &amp; Application Server are different in the following aspects. The Web Server does not support the concept of multi-threading. In Application Server we have features like connection pulling, isolation pulling, multi-threading, and majorly the Transaction feature which is not there in Web Server. An Application Server may include a Web Server inside it.&lt;br /&gt;&lt;br /&gt;4. Webserver:&lt;br /&gt;&lt;br /&gt;1. It will process all HTTP request&lt;br /&gt;&lt;br /&gt;2. It supports to deploy .war files only.&lt;br /&gt;&lt;br /&gt;3. It supports multithreading&lt;br /&gt;&lt;br /&gt;4. It doesn‘t support load balancing, clustering&lt;br /&gt;&lt;br /&gt;5. It doesn‘t support connection pooling and thread pooling. Developers have to write coding to support this features.&lt;br /&gt;&lt;br /&gt;Application Server:&lt;br /&gt;&lt;br /&gt;1. It supports HTTP request thro Webserver.&lt;br /&gt;&lt;br /&gt;2. It supports to deploy .war and .ear files&lt;br /&gt;&lt;br /&gt;3. It gives Load balancing, clustering, Performance, highly availability and scalability.&lt;br /&gt;&lt;br /&gt;4. It supports Multithreading, JNDI, Connection Pooling and Thread pooling&lt;br /&gt;&lt;br /&gt;5. There is a progression in servers.&lt;br /&gt;&lt;br /&gt;There is Apache, which is a &quot;web server&quot; or &quot;http server&quot;, and can only serve html pages, images, and you could also add intelligence to the website by adding cgi code (in perl or php). Otherwise its mostly a file server. But then sometimes a cluster of apache servers are used for load balancing at the front end, and requests could be redirected to different application servers based on some criteria.&lt;br /&gt;&lt;br /&gt;Then there is Tomcat, which is technically a &quot;servlet container&quot; - this can do all that apache does because it contains apache internally, and it can also support servlets and jsp pages.&lt;br /&gt;&lt;br /&gt;Then there are application servers like websphere, weblogic, etc.. which can do all that apache does and also support &quot;ejbs&quot;.. and since the support ejbs, they also support a variety of other things, like security, authentication, transaction, resource pooling..</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/1141508246479586125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/1141508246479586125' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/1141508246479586125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/1141508246479586125'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2008/06/application-server-web-server.html' title='Application server &amp; Web server'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-7630236681414661133</id><published>2007-09-12T06:51:00.000-07:00</published><updated>2007-09-12T06:52:17.300-07:00</updated><title type='text'>State and session tracking with Java servlets Part 1: Using cookies</title><content type='html'>&lt;span style=&quot;font-weight:bold;&quot;&gt;State and session tracking with Java servlets Part 1: Using cookies&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Go to page: 1  2  Next  &lt;br /&gt;&lt;br /&gt;When the Hyper-Text Transfer Protocol (HTTP) was developed, its designers chose to create a protocol which does not maintain a persistent connection. Each request made by a Web browser, for an image, an HTML page, or other Web object, is made via a new connection. It would have been handy if Web browsers established a single connection, through which multiple requests could be made. Indeed, this feature has been introduced in HTTP 1.1, with the keep-alive feature. This feature comes too late though for server-side programmers, as support for legacy browsers and Web servers must be maintained. Without an ongoing session, however, it is difficult for developers to maintain state across HTTP requests. This ability is critical though for all but the simplest of server-side applications. A shopping cart, for example, needs to maintain a list of items and have this list associated with a specific user.&lt;br /&gt;How can state be maintained across HTTP requests?&lt;br /&gt;&lt;br /&gt;Developers are an inventive bunch and quickly found solutions. The simplest of all was to encode hidden parameters inside an HTML form, such as the username and type of transaction being made. Though not evident to the user, additional state information has been added to the form, which will be passed when the form is submitted. If every form included a hidden field indicating the user, then it would be possible to track user actions across HTTP requests. Of course, additional information can also be included, such as the type of operation being performed, as well as the focus of the operation. The following HTML code illustrates the use of hidden fields:&lt;br /&gt;&lt;br /&gt;&lt;form action=&quot;/servlet/order&quot; method=post&gt;&lt;br /&gt;&lt;input type=&quot;hidden&quot; name=userid value=&quot;5532211&quot;&gt;&lt;br /&gt;&lt;input type=&quot;hidden&quot; name=operation  value=&quot;add&quot;&gt;&lt;br /&gt;&lt;input type=&quot;hidden&quot; name=product_id value=&quot;4432A&quot;&gt;&lt;br /&gt;Product ID : 4432A&lt;br /&gt;Quantity   : &lt;input type=&quot;quantity&quot; value=1&gt;&lt;br /&gt;&lt;input type=submit&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;br /&gt;A variation on this theme is to use hyperlinks, which generate HTTP GET requests. Often a hyperlink is better than an HTML form, as most users are more comfortable with hyperlinks than buttons. Parameters can be added to the end of each URL, so that state information is passed when the next connection is made. For example, every hyperlink on the page could contain a userID code to allow user activity to be tracked. This information can be fetched by a servlet using&lt;br /&gt;&lt;br /&gt;javax.servlet.http.HttpServletRequest.getParameter(String)&lt;br /&gt;&lt;br /&gt;just as a standard CGI parameter would.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;/servlet/shopping?userID=5532211&gt;View Shopping Cart&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Whether a hyperlink or an HTML form is used, this state information must be included every time a request is made, so that subsequent requests can gain access to it. If your servlet misses a URL or a hidden variable is missed from a form, the state information is lost. Such solutions are crude but effective. They do the job but are an inelegant and overly complex way of maintaining state across HTTP requests. A better way of maintaining state information is to use persistent client state cookies.&lt;br /&gt;Did you say cookies?&lt;br /&gt;&lt;br /&gt;To solve the problem of maintaining persistence across HTTP connections, Netscape Communications developed a specification for &quot;cookies&quot;. Cookies are state objects stored by a Web browser (or other HTTP client) and can be used by server-side applications to store and retrieve information. Cookies can be created by servlets (or CGI scripts) and sent to the browser. For every subsequent request made by the browser, the cookie is sent as part of the HTTP request. This allows server-side applications to access state information, without the effort of encoding it in a hyperlink or HTML form. Figure 1 shows an example transaction between a server-side application and a browser where a cookie is stored and then returned.&lt;br /&gt;&lt;br /&gt;Figure 1. A cookie sent to an HTTP client is returned on subsequent requests.&lt;br /&gt;&lt;br /&gt;To understand how cookies work, let&#39;s consider the analogy of a bank. When signing up for an account, most customers will be given a card that contains identification information. Every time the customer uses an ATM, he or she presents the card. State information (the user&#39;s account number) persists across each transaction, even though transactions may be days, weeks, or even months apart. Cookies are no different — the state information issued by a server-side application is presented later, when the next HTTP request is made.&lt;br /&gt;&lt;br /&gt;Each cookie is named and contains a single value. The cookie is effectively a mapping between a single key and a single value. If developers need to store multiple values, they can use more than one cookie or can encode multiple values using some sort of separator character for the cookie data. Remember, however, that the number of cookies per domain name varies from browser to browser. Netscape imposes a limit of 20 cookies per domain, and a maximum size of 4096 bytes per cookie. As a general rule, cookies should only contain small pieces of data (to identify a user or a session). You have the option of using an identifier stored in a cookie to look up larger pieces of data stored server-side.&lt;br /&gt;Storing cookies from a Java servlet&lt;br /&gt;&lt;br /&gt;Support for cookies has been included in the Servlet API and provides an extremely easy interface for storing and retrieving cookies. Cookies are represented by the&lt;br /&gt;&lt;br /&gt;javax.servlet.http.Cookie&lt;br /&gt;&lt;br /&gt;class. The constructor takes two strings as parameters — the name of the cookie (which is fixed) and the value (which can be changed at a later date). &lt;br /&gt;&lt;br /&gt;// Create a new cookie&lt;br /&gt;Cookie myCookie = new Cookie ( &quot;accountID&quot; , &quot;212994234&quot;);&lt;br /&gt;&lt;br /&gt;Servlets that wish to set cookies must add their cookie to the response sent back to the browser.&lt;br /&gt;&lt;br /&gt;HttpServletResponse&lt;br /&gt;&lt;br /&gt;offers an&lt;br /&gt;&lt;br /&gt;addCookie(Cookie)&lt;br /&gt;&lt;br /&gt;method, which can be invoked once or multiple times to add additional cookies.&lt;br /&gt;&lt;br /&gt;public void doGet(HttpServletRequest req, HttpServletResponse res)&lt;br /&gt;{&lt;br /&gt; // Store state information in browser cookies&lt;br /&gt; res.addCookie (new Cookie (&quot;thecounter&quot;, &quot;1&quot;);&lt;br /&gt;&lt;br /&gt; // Additional servlet code would go here.....&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Reading cookies from a Java servlet&lt;br /&gt;&lt;br /&gt;Accessing stored cookies from a servlet is also easy. Cookies are sent each time a request is made, so that if a cookie is already stored in the browser, it can be accessed by invoking the&lt;br /&gt;&lt;br /&gt;Cookies[] getCookies()&lt;br /&gt;&lt;br /&gt;method of&lt;br /&gt;&lt;br /&gt;javax.servlet.http.HttpServletRequest&lt;br /&gt;&lt;br /&gt;. This returns an array of Cookie objects, or&lt;br /&gt;&lt;br /&gt;null&lt;br /&gt;&lt;br /&gt;if no cookies are present.&lt;br /&gt;&lt;br /&gt;// Get cookie array from HttpServletRequest&lt;br /&gt;Cookie[] cookieArray = request.getCookies();&lt;br /&gt;&lt;br /&gt;// Guard statement to check for missing cookies&lt;br /&gt;if (cookieArray != null)&lt;br /&gt;{&lt;br /&gt; // Print a list of all cookies sent by browser&lt;br /&gt; for (int i =0; i&lt; cookieArray.length; i++)&lt;br /&gt; {&lt;br /&gt;  Cookie c = cookieArray[i];&lt;br /&gt;  pout.println (&quot;Name : &quot; + c.getName());&lt;br /&gt;  pout.println (&quot;Value: &quot; + c.getValue());&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;pout.println (&quot;No cookies present, or browser does not support cookies&quot;);&lt;br /&gt;&lt;br /&gt;Putting cookies to work&lt;br /&gt;&lt;br /&gt;To demonstrate cookies in action, let&#39;s look at a simple example that tracks the number of times a user has visited a site. Though no unique identifier is to be stored as a cookie, the number of visits made by the user will persist over time. This shows that state has been maintained across connections.&lt;br /&gt;&lt;br /&gt;We start by checking for the presence of any cookies, and then a specific cookie named &quot;count.&quot; If the cookie exists, we read the value and then display it to the user. Since the idea of a counter is to increase on every visit, we increment the counter value and send it back to the user as a cookie. As you reload the page, the cookie is incremented, and state information persists across connections. Note too that, by default, the cookie will persist only while the browser remains open, unless a specific time period is assigned to the cookie (see Listing 1).&lt;br /&gt;Listing 1 (See page 2)&lt;br /&gt;Summary&lt;br /&gt;&lt;br /&gt;Cookies provide an easy mechanism for maintaining state information across HTTP requests. The Servlet API provides an easy-to-use implementation of cookies, which requires a minimal amount of code. In the second part of this article (State and session tracking with Java servlets Part 2: Securing data), we&#39;ll cover more-advanced uses of cookies and enhanced session tracking features offered by the Servlet API.&lt;br /&gt;About the author&lt;br /&gt;&lt;br /&gt;David Reilly is a software engineer and freelance technical writer living in Australia. A Sun Certified Java 1.1 Programmer, his research interests include the Java programming language and networking &amp; distributed systems. He can be reached via e-mail at java@davidreilly.com.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Go to page: 1  2  Next &lt;br /&gt;&lt;br /&gt;Go to page: Prev  1  2  &lt;br /&gt;&lt;br /&gt;   Listing 1&lt;br /&gt;Putting cookies to work&lt;br /&gt;by David Reilly.&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// Import io package&lt;br /&gt;import java.io.*;&lt;br /&gt;&lt;br /&gt;// Import servlet packages&lt;br /&gt;import javax.servlet.*;&lt;br /&gt;import javax.servlet.http.*;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class CookieCounter extends HttpServlet&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt; // GET request handler&lt;br /&gt; public void doGet (HttpServletRequest request, HttpServletResponse response) throws IOException&lt;br /&gt; {&lt;br /&gt;  // Define content type&lt;br /&gt;  response.setContentType(&quot;text/html&quot;);&lt;br /&gt; &lt;br /&gt;  PrintStream pout = new PrintStream(response.getOutputStream());&lt;br /&gt;&lt;br /&gt;  // Check to see if there are any cookies&lt;br /&gt;  Cookie[] cookieArray = request.getCookies();&lt;br /&gt;&lt;br /&gt;  // Default value&lt;br /&gt;  int count = 0;&lt;br /&gt;&lt;br /&gt;  // Check for cookies&lt;br /&gt;  if (cookieArray != null)&lt;br /&gt;  {&lt;br /&gt;   for (int i =0; i&lt; cookieArray.length; i++)&lt;br /&gt;   {&lt;br /&gt;    Cookie c = cookieArray[i];&lt;br /&gt;&lt;br /&gt;    // Check for the count cookie&lt;br /&gt;    if (c.getName().equals(&quot;count&quot;))&lt;br /&gt;    {&lt;br /&gt;     // Parse cookie value and assign to count&lt;br /&gt;     try&lt;br /&gt;     {&lt;br /&gt;      Integer num = new Integer (c.getValue());&lt;br /&gt;      count = num.intValue();&lt;br /&gt;     }&lt;br /&gt;     catch (NumberFormatException nfe) {}&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  // Increment counter&lt;br /&gt;  count++;&lt;br /&gt;&lt;br /&gt;  // Send updated cookie&lt;br /&gt;  response.addCookie(new Cookie (&quot;count&quot;, String.valueOf(count)));&lt;br /&gt;&lt;br /&gt;  // Output message&lt;br /&gt;  pout.println (&quot;You have visited this page &quot; + count +&lt;br /&gt;   &quot; times since your web browser started&quot;);&lt;br /&gt;  pout.flush();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; // POST request handler calls GET request handler&lt;br /&gt; public void doPost (HttpServletRequest request, HttpServletResponse response) throws IOException&lt;br /&gt; {&lt;br /&gt;  doGet(request,response);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Go to page: Prev  1  2</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/7630236681414661133/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/7630236681414661133' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/7630236681414661133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/7630236681414661133'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2007/09/state-and-session-tracking-with-java.html' title='State and session tracking with Java servlets Part 1: Using cookies'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-4923091454026091640</id><published>2007-09-12T06:49:00.000-07:00</published><updated>2007-09-12T06:50:34.160-07:00</updated><title type='text'>Questions and Answers - Session state in the client tier</title><content type='html'>Questions and Answers - Session state in the client tier&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;Guidelines, Patterns, and code for end-to-end Java applications.&lt;br /&gt;Questions and Answers - Session state in the client tier&lt;br /&gt;&lt;br /&gt;   1. How can session state be maintained in the client tier?&lt;br /&gt;&lt;br /&gt;   2. What are the client-tier mechanisms for storing session state?&lt;br /&gt;&lt;br /&gt;   3. What are the advantages and disadvantages of storing state in the client tier?&lt;br /&gt;&lt;br /&gt;   4. How do I use cookies to store session state on the client?&lt;br /&gt;&lt;br /&gt;   5. What are some advantages of storing session state in cookies?&lt;br /&gt;&lt;br /&gt;   6. What are some disadvantages of storing session state in cookies?&lt;br /&gt;&lt;br /&gt;   7. How do I use URL rewriting to store session state on the client?&lt;br /&gt;&lt;br /&gt;   8. What are some advantages of using URL rewriting?&lt;br /&gt;&lt;br /&gt;   9. What are some disadvantages of using URL rewriting?&lt;br /&gt;&lt;br /&gt;1.  How can session state be maintained in the client tier?&lt;br /&gt;&lt;br /&gt;A session is a sequence of service requests by a single user using a single client to access a server. The information maintained in the session across requests is called session state. Session state may include both information visible to the user (shopping cart contents, for example) and invisible application control information (such as user preferences).&lt;br /&gt;&lt;br /&gt;We recommend that:&lt;br /&gt;&lt;br /&gt;    * for applications using enterprise beans: manage session state in the EJB tier using a stateful session bean.&lt;br /&gt;    * for applications not using enterprise beans: manage session state in the web tier using interface HttpSession.&lt;br /&gt;&lt;br /&gt;We do not recommend maintaining session state in the client tier.&lt;br /&gt;&lt;br /&gt;Most web applications store at least a session ID in the client tier, and extract the session ID from the service request to identify the session and thereby the session state. Some applications store all client session state in the client tier, which allows the server to be completely stateless. The discussions below describe the mechanisms for storing state in the client tier, discuss the choice of how much state to store there, and point out the tradeoffs involved in each approach.&lt;br /&gt;&lt;br /&gt;Either of the techniques recommended above may result in the server storing a session id in the client tier in some way, but that&#39;s an implementation detail that the developer should leave to the server. Using server facilities like HttpSession or stateful session beans frees the developer from having to deal with cookies, URL rewriting, hidden form variables, and so on; and lets the developer concentrate on creating business functionality.&lt;br /&gt;&lt;br /&gt;2.  What are the client-tier mechanisms for storing session state?&lt;br /&gt;&lt;br /&gt;At least three mechanisms can store session state in the client tier of a J2EE web application:&lt;br /&gt;&lt;br /&gt;    * Store the state in a cookie. A cookie is a small chunk of data that a server can include in a response for storage by the client. (See RFC2109 at http://www.ietf.org/rfc/rfc2109.txt for the cookie specification.) Each time the client sends information to a server, it includes in the request HTTP headers all of the previously-stored cookies it has received from that server. Session state can be stored in a cookie on the client tier for use by the server when formulating responses.&lt;br /&gt;    * Rewrite URLs to include the encoded state. URL rewriting is the technique of encoding every URL on a served page to include client-side session state. Any time such a URL is dereferenced, the browser performs an HTTP GET to the server, which receives the client-side state as an argument, which the server may then parse and use to perform the requested service.&lt;br /&gt;    * Keep the state in hidden form variables. A server can encode client-side session state in &quot;hidden&quot; form variables; that is, tags of the form &lt;INPUT TYPE=&quot;HIDDEN&quot; ... &gt;. These values are included in subsequent HTTP requests from the client, and used by the server as the session state. This mechanism can be encapsulated in a JSP tag to make the programming easier. The Java Pet Store sample application contains a sample implementation of such a tag, called ClientStateTag.&lt;br /&gt;&lt;br /&gt;3.  What are the advantages and disadvantages of storing state in the client tier?&lt;br /&gt;&lt;br /&gt;Storing session state in the client tier allows servers to be stateless, which provides the following advantages over servers that maintain state:&lt;br /&gt;&lt;br /&gt;    * Potentially lower server resource usage. Stateless servers don&#39;t need to allocate and maintain resources to track session state.&lt;br /&gt;    * Improved scalability and easy failover in clusters. Stateless servers are easier to cluster, since any server can service any client. Clustered servers maintaining session state on the server (&quot;stateful&quot; servers) will typically require either &quot;server affinity&quot; (assigning a particular server to a particular client) or some form of distributed server-side session state replication. Both of these solutions, as well as failover, are complicated to implement, and imply more back-end processing. Stateless servers avoid these problems by not requiring the server to know anything about session state.&lt;br /&gt;    * client sessions can survive a server crash.Stateless servers lose no session information when they go down, since they maintain no such information. Failover techniques can redirect clients to any other available server to complete the request. Alternately, user retries of the same URL will typically succeed.&lt;br /&gt;&lt;br /&gt;Client-side session state has disadvantages, as well:&lt;br /&gt;&lt;br /&gt;    * Persistent cookies may be readable by unauthorized users. Browsers commonly write cookies to a &quot;cookie file&quot;, which remains on the user&#39;s hard drive. Sensitive information (passwords, contact information, credit card numbers, etc.) unwisely stored in cookie files is vulnerable to abuse by anyone else who uses that computer (or who has access to the computer&#39;s drives). This vulnerability is especially a concern at public terminals, where a naive or careless user might leave sensitive information in cookies. Encrypting the data stored on the client might solve this problem, as long as the data in the client-side session state is not intended for display.&lt;br /&gt;    * Client-side data can be modified. Cookie files can be edited; URLs can be modified by hand; and HTML forms can be saved as source, edited, reloaded, and posted to the server. A malicious user could change any of these data to gain access to another user&#39;s resources. Including a digital signature in the client-side data can greatly lessen this risk.&lt;br /&gt;    * Greatly increased communication overhead. When session state is stored on the client, it must be transmitted to the server for each request. Often the server response includes yet another copy of the state, changed or otherwise. Most of this communication is redundant.&lt;br /&gt;    * Complex implementation. Maintaining client-side session state can be a tricky business. The mechanisms for maintaining session state outlined in the previous section all have peculiarities that make them difficult to use reliably and consistently. (These issues are expanded upon in other sections below.)&lt;br /&gt;    * Limited data size. There is no standardization among all browsers currently in use for the minimum size for a cookie. Trying to store all session state in a cookie could run up against a cookie size constraint for some browsers. URL length can also be an issue when using URL rewriting.&lt;br /&gt;&lt;br /&gt;One of the major goals of J2EE technology is to allow application developers to concentrate on implementing application functionality. An application server frees developers of messy system implementation details such as client session state mechanisms. In your J2EE application, it&#39;s usually better to allow the application server to handle the details of where and how session state is stored. Using either enterprise beans or a web container&#39;s HttpSession implementation can provide reliable, scalable access to client-side session state through a portable interface, and saves the developer the trouble of implementing a custom solution.&lt;br /&gt;&lt;br /&gt;4.  How do I use cookies to store session state on the client?&lt;br /&gt;&lt;br /&gt;We do not recommend storing session state directly on the client using cookies. See our recommendations for how to store session state. This section describes how to store session state directly on the client for those who choose to ignore these guidelines.&lt;br /&gt;&lt;br /&gt;In a servlet, the HttpServletResponse and HttpServletRequest objects passed to method HttpServlet.service() can be used to create cookies on the client and use cookie information transmitted during client requests. JSPs can also use cookies, in scriptlet code or, preferably, from within custom tag code.&lt;br /&gt;&lt;br /&gt;    * To set a cookie on the client, use the addCookie() method in class HttpServletResponse. Multiple cookies may be set for the same request, and a single cookie name may have multiple values.&lt;br /&gt;    * To get all of the cookies associated with a single HTTP request, use the getCookies() method of class HttpServletRequest&lt;br /&gt;    * The Using Cookies section in the Java Servlets trail of Java Tutorial provides detailed sample code. Read it at http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets11.html.&lt;br /&gt;&lt;br /&gt;5.  What are some advantages of storing session state in cookies?&lt;br /&gt;&lt;br /&gt;    * Cookies are usually persistent, so for low-security sites, user data that needs to be stored long-term (such as a user ID, historical information, etc.) can be maintained easily with no server interaction.&lt;br /&gt;    * For small- and medium-sized session data, the entire session data (instead of just the session ID) can be kept in the cookie.&lt;br /&gt;&lt;br /&gt;6.  What are some disadvantages of storing session state in cookies?&lt;br /&gt;&lt;br /&gt;    * Cookies are controlled by programming a low-level API, which is more difficult to implement than some other approaches.&lt;br /&gt;    * All data for a session are kept on the client. Corruption, expiration or purging of cookie files can all result in incomplete, inconsistent, or missing information.&lt;br /&gt;    * Size limitations on cookies differ by browser type and version, but a least-common-denominator approach mandates a maximum cookie size of 4,096 bytes. This limitation can be eliminated by storing just references to data (session ids, user ids, etc.) in cookies, and retrieving the data as necessary from another tier (at the cost of increased server complexity and resource usage). In fact, this is equivalent to the recommended practice of storing session state in the web tier.&lt;br /&gt;    * Cookies may not be available for many reasons: the user may have disabled them, the browser version may not support them, the browser may be behind a firewall that filters cookies, and so on. Servlets and JSP pages that rely exclusively on cookies for client-side session state will not operate properly for all clients. Using cookies, and then switching to an alternate client-side session state strategy in cases where cookies aren&#39;t available, complicates development and maintenance.&lt;br /&gt;    * Since web clients transmit to a server only those cookies created by that server, servers with different domain names can&#39;t share cookie data. For example, JavaPetStore.com may want to allow the user to shop from its own shopping site, as well as from JavaPetFood.com. Since JavaPetFood.com can&#39;t access JavaPetStore.com&#39;s cookies, there&#39;s no easy way to unify the shopping sessions between the two servers.&lt;br /&gt;    * Historically, cookie implementations in both browsers and servers have tended to be buggy, and/or vary in their conformance to standards. While you may have control of your servers, buggy or nonconformant browser versions are still in use by many people.&lt;br /&gt;    * Browser instances share cookies, so users cannot have multiple simultaneous sessions.&lt;br /&gt;    * Cookie-based solutions work only for HTTP clients. This is because cookies are a feature of the HTTP protocol. Notice that the while package javax.servlet.http supports session management (via class HttpSession), package javax.servlet has no such support.&lt;br /&gt;&lt;br /&gt;For these reasons, we do not recommend a cookie-based solution for storing client session state in most cases.&lt;br /&gt;&lt;br /&gt;7.  How do I use URL rewriting to store session state on the client?&lt;br /&gt;&lt;br /&gt;We do not recommend storing session state directly on the client using URL rewriting. See our recommendations for how to store session state. This section describes how to store session state directly on the client for those who choose to ignore these guidelines.&lt;br /&gt;&lt;br /&gt;Every URL on the page must be encoded using method HttpServletResponse.encodeURL(). Each time a URL is output, the servlet passes the URL to encodeURL(), which encodes session ID in the URL if the browser isn&#39;t accepting cookies, or if the session tracking is turned off.&lt;br /&gt;&lt;br /&gt;8.  What are some advantages of using URL rewriting?&lt;br /&gt;&lt;br /&gt;    * URL rewriting works just about everywhere, especially when cookies are turned off.&lt;br /&gt;    * Multiple simultaneous sessions are possible for a single user. Session information is local to each browser instance, since it&#39;s stored in URLs in each page being displayed. This scheme isn&#39;t foolproof, though, since users can start a new browser instance using a URL for an active session, and confuse the server by interacting with the same session through two instances.&lt;br /&gt;    * Entirely static pages cannot be used with URL rewriting, since every link must be dynamically written with the session state. It is possible to combine static and dynamic content, using (for example) templating or server-side includes. This limitation is also a barrier to integrating legacy web pages with newer, servlet-based pages.&lt;br /&gt;&lt;br /&gt;9.  What are some disadvantages of using URL rewriting?&lt;br /&gt;&lt;br /&gt;    * Every URL on a page which needs the session information must be rewritten each time a page is served. Not only is this expensive computationally, but it can greatly increase communication overhead.&lt;br /&gt;    * URL rewriting limits the client&#39;s interaction with the server to HTTP GETs, which can result in awkward restrictions on the page.&lt;br /&gt;    * URL rewriting does not work well with JSP technology.&lt;br /&gt;    * If a client workstation crashes, all of the URLs (and therefore all of the data for that session) are lost.&lt;br /&gt;&lt;br /&gt;For these reasons, J2EE BluePrints does not recommend URL rewriting for storing client session state in most cases.</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/4923091454026091640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/4923091454026091640' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/4923091454026091640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/4923091454026091640'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2007/09/questions-and-answers-session-state-in.html' title='Questions and Answers - Session state in the client tier'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-8518951198456343777</id><published>2007-09-12T00:09:00.000-07:00</published><updated>2007-09-12T00:16:28.428-07:00</updated><title type='text'>My Personal Link</title><content type='html'>&lt;a href=&quot;http://webapps.6te.net/java/&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Krack Java&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.jroller.com/vindesh/&quot;&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Interview Questions&lt;/span&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/8518951198456343777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/8518951198456343777' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/8518951198456343777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/8518951198456343777'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2007/09/my-personal-link.html' title='My Personal Link'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-6589386357114635047</id><published>2007-09-11T22:49:00.001-07:00</published><updated>2007-09-11T22:56:29.235-07:00</updated><title type='text'>Servlet&amp;Jsp</title><content type='html'>From the Author ........................................................................... 5&lt;br /&gt;Career Path Institute .................................................................... 6&lt;br /&gt;Servlets and JSP.........................................................7&lt;br /&gt;What are Servlets? ............................................................................................................................... 7&lt;br /&gt;What are advantages of servlets over CGI? ......................................................................................... 7&lt;br /&gt;Can you explain Servlet life cycle? ...................................................................................................... 7&lt;br /&gt;What are the two important API’s in for Servlets? ............................................................................... 7&lt;br /&gt;Can you explain in detail “javax.servlet” package? ............................................................................. 8&lt;br /&gt;What’s the use of ServletContext? ....................................................................................................... 9&lt;br /&gt;How do we define an application level scope for servlet? ................................................................. 11&lt;br /&gt;What&#39;s the difference between GenericServlet and HttpServlet? ....................................................... 12&lt;br /&gt;Can you explain in detail javax.servlet.http package? ....................................................................... 12&lt;br /&gt;What’s the architecture of a Servlet package? ................................................................................... 18&lt;br /&gt;Why is HTTP protocol called as a stateless protocol? ...................................................................... 18&lt;br /&gt;What are the different ways we can maintain state between requests? ............................................. 19&lt;br /&gt;What is URL rewriting? ..................................................................................................................... 19&lt;br /&gt;What are cookies? .............................................................................................................................. 20&lt;br /&gt;What are sessions in Servlets? ............................................................................................................ 22&lt;br /&gt;What’s the difference between getSession(true) and getSession(false) ? .......................................... 22&lt;br /&gt;What’s the difference between “doPost” and “doGet” methods? ...................................................... 23&lt;br /&gt;Which are the different ways you can communicate between servlets? ............................................ 23&lt;br /&gt;What is functionality of “RequestDispatcher” object? ....................................................................... 24&lt;br /&gt;How do we share data using “getServletContext ()”? ........................................................................ 25&lt;br /&gt;Explain the concept of SSI? ............................................................................................................... 25&lt;br /&gt;What are filters in JAVA? ................................................................................................................... 26&lt;br /&gt;Can you explain in short how do you go about implementing filters using Apache Tomcat? ........... 27&lt;br /&gt;Twist: - Explain step by step of how to implement filters? ................................................................ 27&lt;br /&gt;what’s the difference between Authentication and authorization? ..................................................... 29&lt;br /&gt;Explain in brief the directory structure of a web application? ........................................................... 30&lt;br /&gt;Can you explain JSP page life cycle? ................................................................................................. 30&lt;br /&gt;What is EL? ....................................................................................................................................... 31&lt;br /&gt;how does EL search for an attribute? ................................................................................................ 31&lt;br /&gt;What are the implicit EL objects in JSP? .......................................................................................... 32&lt;br /&gt;How can we disable EL? .................................................................................................................... 33&lt;br /&gt;what is JSTL? ................................................................................................................................... 33&lt;br /&gt;Can you explain in short what the different types of JSTL tags are? ................................................. 33&lt;br /&gt;How can we use beans in JSP? ........................................................................................................... 36&lt;br /&gt;What is &lt;jsp:forward&gt; tag for ?.......................................................................................................... 37&lt;br /&gt;What are JSP directives? .................................................................................................................... 38&lt;br /&gt;what are Page directives? ................................................................................................................... 38&lt;br /&gt;what are include directives? ............................................................................................................... 39&lt;br /&gt;Can you explain taglib directives? ..................................................................................................... 39&lt;br /&gt;How does JSP engines instantiate tag handler classes instances? ...................................................... 41&lt;br /&gt;what’s the difference between JavaBeans and taglib directives? ....................................................... 41&lt;br /&gt;what are the different scopes an object can have in a JSP page? ....................................................... 41&lt;br /&gt;what are different implicit objects of JSP? ......................................................................................... 42&lt;br /&gt;what are different Authentication Options available in servlets? ....................................................... 43&lt;br /&gt;Can you explain how do we practically implement security on a resource? ..................................... 44&lt;br /&gt;How do we practically implement form based authentication? ......................................................... 44&lt;br /&gt;How do we authenticate using JDBC? ............................................................................................... 46&lt;br /&gt;Can you explain JDBCRealm? ........................................................................................................... 46&lt;br /&gt;Can you explain how do you configure JNDIRealm? ........................................................................ 47&lt;br /&gt;How did you implement caching in JSP? ........................................................................................... 47&lt;br /&gt;What is the difference between Servletcontext and ServletConfig ? ................................................. 48&lt;br /&gt;How do we prevent browser from caching output of my JSP pages? ................................................ 48&lt;br /&gt;Can we explicitly destroy a servlet object? ........................................................................................ 49&lt;br /&gt;Distribution Partner ................................................................... 50&lt;br /&gt;From the Author&lt;br /&gt;First thing thanks to all those who have sent me complaints and also appreciation for what ever titles&lt;br /&gt;i have written till today. But interview question series is very near to my heart as i can understand&lt;br /&gt;the pain of searching a job. Thanks to my publishers (BPB) , readers and reviewers to always excuse&lt;br /&gt;all my stupid things which i always do.&lt;br /&gt;So why is this PDF free ?. Well i always wanted to distribute things for free specially when its a&lt;br /&gt;interview question book which can fetch a job for a developer. But i am also bounded with publishers&lt;br /&gt;rules and regulations. And why not they have a whole team of editor, printing guys, designers,&lt;br /&gt;distributors, shopkeepers and including me. But again the other aspect, readers should know of what&lt;br /&gt;they are buying , the quality and is it really useful to buy this book. So here are sample free questions&lt;br /&gt;which i am giving out free to the readers to see the worth of the book.&lt;br /&gt;I can be contacted at shiv_koirala@yahoo.com its bit difficult to answer all answers but as i get time&lt;br /&gt;i do it.&lt;br /&gt;We have recently started a career counselling drive absolutely free for new comers and experienced&lt;br /&gt;guys. So i have enlisted the following guys on the panel. Thanks to all these guys to accept the panel&lt;br /&gt;job of consulting. Feel free to shoot them questions just put a title in the mail saying “Question about&lt;br /&gt;Career”. I have always turned up to them when i had some serious career decision to take.&lt;br /&gt;Shivprasad Koirala :- Not a great guy but as i have done the complete book i have to take up one of&lt;br /&gt;the positions. You can contact me at shiv_koirala@yahoo.com for technical career aspect.&lt;br /&gt;Tapan Das :- If you think you are aiming at becoming a project manager he is the right person to&lt;br /&gt;consult. He can answer all your questions regarding how to groom your career as a project manager&lt;br /&gt;tapand@vsnl.com.&lt;br /&gt;Kapil Siddharth :- If you are thinking to grow as architect in a company then he is a guy. When it&lt;br /&gt;comes to role model as architect i rate this guy at the top. You can contact him at&lt;br /&gt;kapilsiddharth@hotmail.com&lt;br /&gt;Second if you think you can help the developers mail me at shiv_koirala@yahoo.com and if i find&lt;br /&gt;you fitting in the panel i will display your mail address. Please note there are no financial rewards as&lt;br /&gt;such but i am sure you will be proud of the work you are doing and whos knows what can come up.&lt;br /&gt;Lets make Software Industry a better place to work ..... Happy Job Hunting and Best of Luck&lt;br /&gt;Career Path Institute&lt;br /&gt;Author runs the “Softwar Career Path Insitute” personally in mumbai. If you are interested you can&lt;br /&gt;contact him regarding admissions at shiv_koirala@yahoo.com. Our courses are mainly targetting&lt;br /&gt;from how to get a job perspective.&lt;br /&gt;Below are some of the courses offered :-&lt;br /&gt;-- Interview preparation course two days ( Saturday and Sunday Batch). ( C# , SQL Server)&lt;br /&gt;-- Full one year course for C# , SQL Server&lt;br /&gt;www.questpond.com&lt;br /&gt;www.questpond.com&lt;br /&gt;7&lt;br /&gt;4.Servlets and JSP&lt;br /&gt;(B) What are Servlets?&lt;br /&gt;Servlets are small program which execute on the web server. They run under web server&lt;br /&gt;environment exploiting the functionalities of the web server.&lt;br /&gt;(B) What are advantages of servlets over CGI?&lt;br /&gt;In CGI for every request there is a new process started which is quiet an overhead. In&lt;br /&gt;servlets JVM stays running and handles each request using a light weight thread. In CGI&lt;br /&gt;if there are 1000 request then 1000 CGI program is loaded in memory while in servlets&lt;br /&gt;there are 1000 thread and only one copy of the servlet class.&lt;br /&gt;(B) Can you explain Servlet life cycle?&lt;br /&gt;Figure 4.1 : - Servlet Life cycle&lt;br /&gt;There are three methods which are very important in servlet life cycle i.e. &quot;init”, &quot;service&quot;&lt;br /&gt;and &quot;destroy&quot;. Server invokes &quot;init ()&quot; method when servlet is first loaded in to the web&lt;br /&gt;server memory. Servlet reads HTTP data provided in HTTP request in the &quot;service ()&quot;&lt;br /&gt;method. Once initialized servlet remains in memory to process subsequent request. So&lt;br /&gt;for every HTTP request &quot;service ()&quot; method of the servlet is called. Finally when server&lt;br /&gt;unloads the &quot;servlet ()&quot; from the memory it calls the &quot;destroy&quot; method which can be used&lt;br /&gt;to clean up any resource the servlet is consuming.&lt;br /&gt;(B) What are the two important API’s in for Servlets?&lt;br /&gt;8&lt;br /&gt;Two important packages are required to build servlet &quot;javax.servlet&quot; and&lt;br /&gt;&quot;javax.servlet.http&quot;. They form the core of Servlet API. Servlets are not part of core&lt;br /&gt;Java but are standard extensions provided by Tomcat.&lt;br /&gt;(B) Can you explain in detail “javax.servlet” package?&lt;br /&gt;javax.servlet package has interfaces and classes which define a framework in which servlets&lt;br /&gt;can operate. Let’s first make a walk through of all the interfaces and methods and its&lt;br /&gt;description.&lt;br /&gt;Interfaces in javax.servlet&lt;br /&gt;Servlet Interface&lt;br /&gt;This interface has the init( ), service( ), and destroy( ) methods that are called by the&lt;br /&gt;server during the life cycle of a servlet.&lt;br /&gt;Following are the method in Servlet interface :-&lt;br /&gt;void destroy( ):- Executed when servlet is unloaded from the web server memory.&lt;br /&gt;ServletConfig getServletConfig() :- Returns back a ServletConfig object that contains&lt;br /&gt;initialization data.&lt;br /&gt;String getServletInfo( ):- Returns a string describing the servlet.&lt;br /&gt;init method :- Called for first time when the servlet is initialized by the web server.&lt;br /&gt;void service() method :- Called to process a request from a client.&lt;br /&gt;ServletConfig Interface&lt;br /&gt;This interface is implemented by the servlet container. Servlet can access any configuration&lt;br /&gt;data when its loaded. The methods declared by this interface are summarized here:&lt;br /&gt;Following are the methods in ServletConfig interface:-&lt;br /&gt;ServletContext getServletContext():- Gives the servlet context.&lt;br /&gt;String getInitParameter(String param):- Returns the value of the initialization parameter&lt;br /&gt;named param.&lt;br /&gt;Enumeration getInitParameterNames() :- Returns an enumeration of all initialization&lt;br /&gt;parameter names.&lt;br /&gt;9&lt;br /&gt;String getServletName( ) :- Returns the name of the invoking servlet.&lt;br /&gt;(I)What’s the use of ServletContext?&lt;br /&gt;ServletContext Interface&lt;br /&gt;It gives information about the environment. It represents a Servlet&#39;s view of the Web&lt;br /&gt;Application.Using this interface servlet can access raw input streams to Web Application&lt;br /&gt;resources, virtual directory translation, a common mechanism for logging information,&lt;br /&gt;and an application scope for binding objects.&lt;br /&gt;Following are the methods defined in ServletContext Interface&lt;br /&gt;Object getAttribute(String attr) :- Returns the value of the server attribute named attr.&lt;br /&gt;String getMimeType(String file) :- Gives MIME type for a file.&lt;br /&gt;String getRealPath(String vpath) :- Gives the actual physical path for a virtual path.&lt;br /&gt;String getServerInfo( ) :- You can get the server information using this function.&lt;br /&gt;void log(String s) :- Used to write to server log.&lt;br /&gt;void log(String s, Throwable e) :- Writes s and the stack trace for e to the servlet log.&lt;br /&gt;void setAttribute(String attr, Object val) :- Sets the attribute specified by attr to the&lt;br /&gt;value passed in val.&lt;br /&gt;ServletRequest Interface&lt;br /&gt;The ServletRequest interface is implemented by the servlet container. It gives data regarding&lt;br /&gt;client request.&lt;br /&gt;Following are the methods defined in ServletRequest Interface&lt;br /&gt;Object getAttribute(String attr) :- Returns the value of the attribute named attr.&lt;br /&gt;String getCharacterEncoding( ) :- Returns the character encoding of the request.&lt;br /&gt;int getContentLength( ) :- Gives the size of the request. If no size is there then it returns&lt;br /&gt;-1.&lt;br /&gt;10&lt;br /&gt;String getContentType( ) :- Returns the type of the request. A null value is returned if the&lt;br /&gt;type cannot be determined.&lt;br /&gt;ServletInputStream getInputStream( ) :- Returns a ServletInputStream that can be used&lt;br /&gt;to read binary data from the request.&lt;br /&gt;String getParameter(String pname) :- Returns the value of the parameter named pname.&lt;br /&gt;Enumeration getParameterNames( ) :- Returns an enumeration of the parameter names&lt;br /&gt;for this request.&lt;br /&gt;String[ ] getParameterValues(String name) :- Returns an array containing values associated&lt;br /&gt;with the parameter specified by name.&lt;br /&gt;String getProtocol( ) :- Gives back protocol description.&lt;br /&gt;BufferedReader getReader( ) :- Returns a buffered reader that can be used to read text&lt;br /&gt;from the request.&lt;br /&gt;String getRemoteAddr() :-Returns client IP address.&lt;br /&gt;String getRemoteHost() :- Returns client host name.&lt;br /&gt;String getScheme( ) :- Return what’s the transmission protocol HTTP , FTP etc.&lt;br /&gt;String getServerName() :- Returns the name of the server.&lt;br /&gt;int getServerPort() :- Returns the port number.&lt;br /&gt;ServletResponse Interface&lt;br /&gt;The ServletResponse interface is implemented by the servlet containerUsed to give&lt;br /&gt;response back to the client.&lt;br /&gt;Following are the methods defined in ServletResponse Interface&lt;br /&gt;String getCharacterEncoding() :- Returns back character encoding.&lt;br /&gt;ServletOutputStream getOutputStream() :- Returns a ServletOutputStream that can be&lt;br /&gt;used to write binary data to the response.&lt;br /&gt;PrintWriter getWriter() :- Returns a PrintWriter that can be used to write character data to&lt;br /&gt;the response.&lt;br /&gt;void setContentLength(int size) :- Sets the content length for the response to size.&lt;br /&gt;11&lt;br /&gt;void setContentType(String type) :- Sets the content type for the response to type.&lt;br /&gt;GenericServlet Class&lt;br /&gt;The GenericServlet class provides implementations of the basic life cycle methods for a&lt;br /&gt;servlet. GenericServlet implements the Servlet and ServletConfig interfaces.&lt;br /&gt;void log(String s)&lt;br /&gt;void log(String s, Throwable e)&lt;br /&gt;Here, s is the string to be appended to the log, and e is an exception that occurred.&lt;br /&gt;Now let’s revise through different classes.&lt;br /&gt;ServletInputStream Class&lt;br /&gt;This class extends InputStream. It is implemented by the servlet container and provides&lt;br /&gt;an input stream that a servlet developer can use to read the data from a client request. It&lt;br /&gt;defines the default constructor. In addition, a method is provided to read bytes from the&lt;br /&gt;stream.&lt;br /&gt;int readLine(byte[ ] buffer, int offset, int size) :- Here, buffer is the array into which size&lt;br /&gt;bytes are placed starting at offset. The method returns the actual number of bytes read or&lt;br /&gt;–1 if an end-of-stream condition is encountered.&lt;br /&gt;ServletOutputStream Class&lt;br /&gt;The ServletOutputStream class extends OutputStream. It is implemented by the servlet&lt;br /&gt;container and provides an output stream that a servlet developer can use to write data to&lt;br /&gt;a client response. A default constructor is defined. It also defines the “print()” and&lt;br /&gt;“println()” methods, which output data to the stream.&lt;br /&gt;Servlet Exception Classes&lt;br /&gt;javax.servlet defines two exceptions. The first is ServletException, which indicates that a&lt;br /&gt;servlet problem has occurred. The second is unavailableException, which extends&lt;br /&gt;ServletException. It indicates that a servlet is unavailable.&lt;br /&gt;(I) How do we define an application level scope for servlet?&lt;br /&gt;12&lt;br /&gt;(B) What&#39;s the difference between GenericServlet and HttpServlet?&lt;br /&gt;HttpServlet class extends GenericServlet class which is an abstract class to provide HTTP&lt;br /&gt;protocol-specific functionalities. Most of the java application developers extend&lt;br /&gt;HttpServlet class as it provides more HTTP protocol-specific functionalities. You can&lt;br /&gt;see in HttpServlet class doGet (), doPOst () methods which are more targeted towards&lt;br /&gt;HTTP protocol specific functionalities. For instance we can inherit from GenericServlet&lt;br /&gt;class to make something like MobileServlet. So GenericServlet class should be used when&lt;br /&gt;we want to write protocol specific implementation which is not available. But when we&lt;br /&gt;know we are making an internet application where HTTP is the major protocol its better&lt;br /&gt;to use HttpServlet.&lt;br /&gt;(B) Can you explain in detail javax.servlet.http package?&lt;br /&gt;The javax.servlet.http package inherits from “javax.servlet” package and supplies HTTP&lt;br /&gt;protocol specific functionalities for JAVA developers. If you are aiming at developing&lt;br /&gt;HTTP application you will find “javax.servlet.HTTP” more comfortable than&lt;br /&gt;“javax.servlet”.&lt;br /&gt;So let’s revisit through the interfaces and methods&lt;br /&gt;HttpServletRequest Interface&lt;br /&gt;Below are the lists of methods in HttpServletRequest Interface:-&lt;br /&gt;String getAuthType( ):- Returns the type of authentication.&lt;br /&gt;Cookie[ ] getCookies( ) :- Returns the collection of cookies for the request.&lt;br /&gt;long getDateHeader(String field) :- Returns the value of the date header field named&lt;br /&gt;field.&lt;br /&gt;String getHeader(String field) :- Returns the value of the header field named field.&lt;br /&gt;Enumeration getHeaderNames( ) :- Returns an enumeration of the header names.&lt;br /&gt;int getIntHeader(String field) :- Returns the int equivalent of the header field named&lt;br /&gt;field.&lt;br /&gt;String getMethod( ) :- What type of method does this request have POST , GET etc.&lt;br /&gt;13&lt;br /&gt;String getPathInfo( ) :- Returns any path information that is located after the servlet path&lt;br /&gt;and before a query string of the URL.&lt;br /&gt;String getPathTranslated( ) :- Returns any path information that is located after the servlet&lt;br /&gt;path and before a query string of the URL after translating it to a real path.&lt;br /&gt;String getQueryString( ) :- Returns any query string in the URL.&lt;br /&gt;String getRemoteUser( ) :- Returns the name of the user who issued this request.&lt;br /&gt;String getRequestedSessionId( ) :- Returns the ID of the session.&lt;br /&gt;String getRequestURI( ) :- Returns the URI.&lt;br /&gt;StringBuffer getRequestURL( ) :- Returns the URL.&lt;br /&gt;String getServletPath( ) :- Returns that part of the URL that identifies the servlet.&lt;br /&gt;HttpSession getSession( ) :- Returns the session for this request. If a session does not&lt;br /&gt;exist, one is created and then returned.&lt;br /&gt;HttpSession getSession(boolean new) :- If new is true and no session exists, creates and&lt;br /&gt;returns a session for this request. Otherwise, returns the existing session for this request.&lt;br /&gt;This section is explained in more detail in further questions.&lt;br /&gt;boolean isRequestedSessionIdFromCookie( ) :- Returns true if the cookie has the session&lt;br /&gt;id.&lt;br /&gt;boolean isRequestedSessionIdFromURL( ) :- Gives true if the URL has session id.&lt;br /&gt;boolean isRequestedSessionIdValid( ) :- Return true if the session is valid in the current&lt;br /&gt;context.&lt;br /&gt;HttpServletResponse Interface&lt;br /&gt;The HttpServletResponse interface is implemented by the servlet container. It enables a&lt;br /&gt;servlet to formulate an HTTP response to a client. Several constants are defined. These&lt;br /&gt;correspond to the different status codes that can be assigned to an HTTP response.&lt;br /&gt;Below are the methods and functions for the interface&lt;br /&gt;void addCookie(Cookie cookie) :-Adds cookie to the HTTP response.&lt;br /&gt;14&lt;br /&gt;String encodeURL(String url) :- Determines if the session ID must be encoded in the&lt;br /&gt;URL identified as url. If so, returns the modified version of URL. Otherwise, returns&lt;br /&gt;URL. All URLs generated by a servlet should be processed by this method.&lt;br /&gt;String encodeRedirectURL(String url) :- Determines if the session ID must be encoded in&lt;br /&gt;the URL identified as url. If so, returns the modified version of URL. Otherwise, returns&lt;br /&gt;URL. All URLs passed to sendRedirect( ) should be processed by this method.&lt;br /&gt;void sendError(int c) :- Sends the error code c to the client.&lt;br /&gt;void sendError(int c, String s) :- Sends the error code c and message s to the client.&lt;br /&gt;void sendRedirect(String url) :- Redirects the client to url.&lt;br /&gt;void setDateHeader(String field, long msec) :- Adds field to the header with date value&lt;br /&gt;equal to msec (milliseconds since midnight, January 1, 1970, GMT).&lt;br /&gt;void setHeader(String field, String value) :- Adds field to the header with value equal to&lt;br /&gt;value.&lt;br /&gt;void setIntHeader(String field, int value) :- Adds field to the header with value equal to&lt;br /&gt;value.&lt;br /&gt;void setStatus(int code) :- Sets the status code for this response to code.&lt;br /&gt;HttpSession Interface&lt;br /&gt;HTTP protocol is a stateless protocol and this interface enables to maintain sessions&lt;br /&gt;between requests.&lt;br /&gt;Object getAttribute(String attr) :- Returns the value associated with the name passed in&lt;br /&gt;attr. Returns null if attr is not found.&lt;br /&gt;Enumeration getAttributeNames( ) :- Returns an enumeration of the attribute names&lt;br /&gt;associated with the session.&lt;br /&gt;long getCreationTime( ) :- Returns the time (in milliseconds since midnight, January 1,&lt;br /&gt;1970, GMT) when this session was created.&lt;br /&gt;String getId( ) :- Returns the session ID.&lt;br /&gt;long getLastAccessedTime( ) :- Returns the time (in milliseconds since midnight, January&lt;br /&gt;1, 1970, GMT) when the client last made a request for this session.&lt;br /&gt;15&lt;br /&gt;void invalidate() :- Invalidates this session and removes it from the context.&lt;br /&gt;boolean isNew( ) :- Returns true if the server created the session and it has not yet been&lt;br /&gt;accessed by the client.&lt;br /&gt;void removeAttribute(String attr) :- Removes the attribute specified by attr from the&lt;br /&gt;session.&lt;br /&gt;void setAttribute(String attr, Object val) :- Associates the value passed in val with the&lt;br /&gt;attribute name passed in attr.&lt;br /&gt;HttpSessionBindingListener&lt;br /&gt;The HttpSessionBindingListener interface is implemented by objects that need to be&lt;br /&gt;notified when they are bound to or unbound from an HTTP session. The methods that&lt;br /&gt;are invoked when an object is bound or unbound are&lt;br /&gt;void valueBound(HttpSessionBindingEvent e)&lt;br /&gt;void valueUnbound(HttpSessionBindingEvent e)&lt;br /&gt;Here, e is the event object that describes the binding.&lt;br /&gt;Cookie Class&lt;br /&gt;The Cookie class encapsulates a cookie. A cookie is stored on a client and contains state&lt;br /&gt;information. Cookies are valuable for tracking user activities. For example, assume that a&lt;br /&gt;user visits an online store. A cookie can save the user&#39;s name, address, and other&lt;br /&gt;information. The user does not need to enter this data each time he or she visits the store.&lt;br /&gt;A servlet can write a cookie to a user&#39;s machine via the addCookie( ) method of the&lt;br /&gt;HttpServletResponse interface. The data for that cookie is then included in the header of&lt;br /&gt;the HTTP response that is sent to the browser.&lt;br /&gt;The names and values of cookies are stored on the user&#39;s machine. Some of the information&lt;br /&gt;that is saved for each cookie includes name of the cookie, value of the cookie, expiration&lt;br /&gt;date of the cookie and domain/path of the cookie.&lt;br /&gt;The expiration date determines when this cookie is deleted from the user&#39;s machine. If an&lt;br /&gt;expiration date is not explicitly assigned to a cookie, it is deleted when the current browser&lt;br /&gt;session ends. Otherwise, the cookie is saved in a file on the user&#39;s machine.&lt;br /&gt;16&lt;br /&gt;The domain and path of the cookie determine when it is included in the header of an&lt;br /&gt;HTTP request. If the user enters a URL whose domain and path match these values, the&lt;br /&gt;cookie is then supplied to the Web server. Otherwise, it is not. There is one constructor&lt;br /&gt;for Cookie. It has the signature shown here:&lt;br /&gt;Cookie(String name, String value) :- Here, the name and value of the cookie are supplied&lt;br /&gt;as arguments to the constructor. The methods of the Cookie class are&lt;br /&gt;Object clone( ) :- Returns a copy of this object.&lt;br /&gt;String getComment( ) :- Returns the comment.&lt;br /&gt;String getDomain( ) :- Returns the domain.&lt;br /&gt;int getMaxAge( ) :- Returns the maximum age (in seconds).&lt;br /&gt;String getName( ) :- Returns the name.&lt;br /&gt;String getPath( ) :- Returns the path.&lt;br /&gt;boolean getSecure( ) :- Returns true if the cookie is secure. Otherwise, returns false.&lt;br /&gt;String getValue( ) :- Returns the value.&lt;br /&gt;int getVersion( ) :- Returns the version.&lt;br /&gt;void setComment(String c) :- Sets the comment to c.&lt;br /&gt;void setDomain(String d) :- Sets the domain to d.&lt;br /&gt;void setMaxAge(int secs) :- Sets the maximum age of the cookie to secs. This is the&lt;br /&gt;number of seconds after which the cookie is deleted.&lt;br /&gt;void setPath(String p) :- Sets the path to p.&lt;br /&gt;void setSecure(boolean secure) :- Sets the security flag to secure.&lt;br /&gt;void setValue(String v) :- Sets the value to v.&lt;br /&gt;void setVersion(int v) :- Sets the version to v.&lt;br /&gt;HttpServlet Class&lt;br /&gt;The HttpServlet class extends GenericServlet. It is commonly used when developing&lt;br /&gt;servlets that receive and process HTTP requests.&lt;br /&gt;17&lt;br /&gt;void doDelete(HttpServletRequest req, HttpServletResponse res) throws IOException,&lt;br /&gt;ServletException :- Handles an HTTP DELETE.&lt;br /&gt;void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException,&lt;br /&gt;ServletException :- Handles an HTTP GET.&lt;br /&gt;void doOptions(HttpServletRequest req, HttpServletResponse res) throws IOException,&lt;br /&gt;ServletException :- Handles an HTTP OPTIONS.&lt;br /&gt;void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException,&lt;br /&gt;ServletException :- Handles an HTTP POST.&lt;br /&gt;void doPut(HttpServletRequest req, HttpServletResponse res) throws IOException,&lt;br /&gt;ServletException :- Handles an HTTP PUT.&lt;br /&gt;void doTrace(HttpServletRequest req, HttpServletResponse res) throws IOException,&lt;br /&gt;ServletException :- Handles an HTTP TRACE.&lt;br /&gt;long getLastModified(HttpServletRequest req) :- Returns the time (in milliseconds since&lt;br /&gt;midnight, January 1, 1970, GMT) when the requested resource was last modified.&lt;br /&gt;void service(HttpServletRequest req, HttpServletResponse res) throws IOException,&lt;br /&gt;ServletException :- Called by the server when an HTTP request arrives for this servlet.&lt;br /&gt;The arguments provide access to the HTTP request and response, respectively.&lt;br /&gt;HttpSessionEvent Class&lt;br /&gt;HttpSessionEvent encapsulates session events. It extends EventObject and is generated&lt;br /&gt;when a change occurs to the session.&lt;br /&gt;HttpSession getSession( )&lt;br /&gt;It returns the session in which the event occurred.&lt;br /&gt;The HttpSessionBindingEvent Class&lt;br /&gt;The HttpSessionBindingEvent class extends HttpSessionEvent. It is generated when a&lt;br /&gt;listener is bound to or unbound from a value in an HttpSession object. It is also generated&lt;br /&gt;when an attribute is bound or unbound. Here are its constructors:&lt;br /&gt;HttpSessionBindingEvent(HttpSession session, String name)&lt;br /&gt;HttpSessionBindingEvent(HttpSession session, String name, Object val)&lt;br /&gt;18&lt;br /&gt;Here, session is the source of the event, and name is the name associated with the object&lt;br /&gt;that is being bound or unbound. If an attribute is being bound or unbound, its value is&lt;br /&gt;passed in Val.&lt;br /&gt;String getName( ) :- The getName( ) method obtains the name that is being bound or&lt;br /&gt;unbound. Its constructor is shown here:&lt;br /&gt;HttpSession getSession( ) :- The getSession( ) method, shown next, obtains the session to&lt;br /&gt;which the listener is being bound or unbound:&lt;br /&gt;Object getValue( ) :- The getValue( ) method obtains the value of the attribute that is&lt;br /&gt;being bound or unbound. It is shown here:&lt;br /&gt;(B) What’s the architecture of a Servlet package?&lt;br /&gt;In the previous questions we saw all the servlet packages. But the basic architecture of&lt;br /&gt;the servlet packages is as shown below.&lt;br /&gt;Figure 4.2 : - Servlet package in action&lt;br /&gt;At the top of all is the main servlet interface which is implemented by the generic servlet.&lt;br /&gt;But generic servlet does not provide implementation specific to any protocol. HTTP&lt;br /&gt;servlet further inherits from the generic servlet and provides HTTP implementation like&lt;br /&gt;“Get” and “Post”. Finally comes our custom servlet which inherits from HTTP Servlet.&lt;br /&gt;(B) Why is HTTP protocol called as a stateless protocol?&lt;br /&gt;19&lt;br /&gt;A protocol is stateless if it can remember difference between one client request and the&lt;br /&gt;other. HTTP is a stateless protocol because each request is executed independently without&lt;br /&gt;any knowledge of the requests that came before it.&lt;br /&gt;Figure 4.3 : - HTTP Protocol in action&lt;br /&gt;Above is a pictorial presentation of how a stateless protocol operates. User first sends&lt;br /&gt;“request1” and server responds with “response1”. When the same user comes back with&lt;br /&gt;“request2” server treats this as new user and has no idea that it’s the same user who has&lt;br /&gt;come with the request. In short every request is a new request for the HTTP protocol so&lt;br /&gt;it’s called as a stateless protocol.&lt;br /&gt;(B) What are the different ways we can maintain state between requests?&lt;br /&gt;Following are the different ways of maintaining state’s between stateless requests:-&lt;br /&gt;√ URL rewriting&lt;br /&gt;√ Cookies&lt;br /&gt;√ Hidden fields&lt;br /&gt;√ Sessions&lt;br /&gt;(B) What is URL rewriting?&lt;br /&gt;It’s based on the concept of attaching a unique ID (which is generated by the server) in&lt;br /&gt;the URL of response from the server. So the server attaches this unique ID in each URL.&lt;br /&gt;20&lt;br /&gt;When the client sends a requests it sends back this ID with the request also which helps&lt;br /&gt;the server to identify the client uniquely.&lt;br /&gt;Note: - A sample code for URL rewriting is in the CD in “URLRewriting” folder.&lt;br /&gt;Below is a snippet which is extracted from the code which is provided in the CD.&lt;br /&gt;Figure 4.4 : - URLRewriting in Action&lt;br /&gt;In this sample we have generated a unique ID using the random class of java. This unique&lt;br /&gt;ID is then sent in the query string (see step 3 of the above snippet) back to the client.&lt;br /&gt;When the client comes back to the server the server first gets the token value from the&lt;br /&gt;query string and thus identifying the client uniquely.&lt;br /&gt;(B) What are cookies?&lt;br /&gt;Cookies are piece of data which are stored at the client’s browser to track information&lt;br /&gt;regarding the user usage and habits. Servlets sends cookies to the browser client using the&lt;br /&gt;HTTP response headers. When client gets the cookie information it’s stored by the browser&lt;br /&gt;21&lt;br /&gt;in the client’s hard disk. Similarly client returns the cookie information using the HTTP&lt;br /&gt;request headers.&lt;br /&gt;Figure 4.5 : - Cookies in action&lt;br /&gt;22&lt;br /&gt;Figure 4.6 : - Cookies code walkthrough&lt;br /&gt;Above is a simple snippet which shows how to use cookies. To create a cookie you need&lt;br /&gt;to use the “Cookie” class. In the above snippet step1 creates a cookie using the “Cookie”&lt;br /&gt;class. In this case “favoritecookiebook” is the name of the cookie. In Step 2 you can see&lt;br /&gt;how a cookie has been added to the response. Step 3 code shows how to get all the&lt;br /&gt;cookies which has come in the current request header. Step 4 shows the way to get a&lt;br /&gt;cookie from a collection in this case we wanted to retrieve “favoritecookiebook” from&lt;br /&gt;the cookies collection.&lt;br /&gt;Note: - You can get the above code in “cookies” folder.&lt;br /&gt;(B)What are sessions in Servlets?&lt;br /&gt;(B)What’s the difference between getSession(true) and getSession(false)&lt;br /&gt;?&lt;br /&gt;Session&#39;s can be considered as a series of related interactions between client and the&lt;br /&gt;server that take place over a period of time. Because HTTP is a stateless protocol these&lt;br /&gt;series of interactions are difficult to track. That’s where we can use HttpSession object to&lt;br /&gt;save in between of these interactions so that server can co-relate between interactions&lt;br /&gt;between clients.&lt;br /&gt;23&lt;br /&gt;Figure 4.7 : - Session code walkthrough&lt;br /&gt;Above is the code snippet which displays session data. Step1 returns an HttpSession&lt;br /&gt;object from the request object. “true” parameter in the “getsession” function ensures that&lt;br /&gt;we get a session object if there is no current session object in request which ensures that&lt;br /&gt;we never get a null session object. In Step 2 we are using the “getattribute” function to&lt;br /&gt;return the session value. In step 3 we are setting the session value with “Name” key.&lt;br /&gt;Note: - In source code folder we have a sample project “sessions” which can make your&lt;br /&gt;concept clearer.&lt;br /&gt;(I)What’s the difference between “doPost” and “doGet” methods?&lt;br /&gt;When we invoke a servlet the servlet engine passes information to service () method of&lt;br /&gt;the servlet. Service method evaluates whether it’s a GET or a POST request type. GET&lt;br /&gt;and POST differ from the way data is passed to the server. In GET data is passed as a&lt;br /&gt;query string attached to the URL for instance http://www.xyz.com/x.asp?Name=Shiv.&lt;br /&gt;So when you pass data through get method you can see the data in your browser URL&lt;br /&gt;which can be bad thing for critical data like password. In POST method data is passed&lt;br /&gt;through normal input stream. You will not be able to view data like how we get for GET&lt;br /&gt;method.&lt;br /&gt;So for POST method below is the HTML code.&lt;br /&gt;&lt;form name=&#39;MyServlet&#39; method=&#39;POST&#39; &gt;&lt;br /&gt;For GET method below is the HTML code&lt;br /&gt;&lt;form name=&#39;MyServlet&#39; method=&#39;GET&#39;&gt;&lt;br /&gt;(I)Which are the different ways you can communicate between servlets?&lt;br /&gt;Below are the different ways of communicating between servlets:-&lt;br /&gt;√ Using RequestDispatcher object.&lt;br /&gt;√ Sharing resource using “ServletContext ()” object.&lt;br /&gt;√ Include response of the resource in the response of the servlet.&lt;br /&gt;√ Calling public methods of the resource.&lt;br /&gt;√ Servlet chaining.&lt;br /&gt;24&lt;br /&gt;(I)What is functionality of “RequestDispatcher” object?&lt;br /&gt;Figure 4.8 : - RequestDispatcher in action&lt;br /&gt;Above is the code snippet for “requestdispatcher”. Code snippet&lt;br /&gt;“getServletContext().getRequestDispatcher(&quot;/servlet/clsAdd&quot;); “gets the&lt;br /&gt;“requestdisptacherobject”. In order to call the other servlet class we call the forward&lt;br /&gt;method which in turn invokes the service method of the other servlets.&lt;br /&gt;Note: - There is a sample project “requestdispatcher” which you can open and see. In order&lt;br /&gt;to see how the dispatcher will work you can pass the “WhattoDo” as either “A” or “M” as&lt;br /&gt;shown in the figure below. Corresponding servlets are called depending on this value.&lt;br /&gt;25&lt;br /&gt;Figure 4.9 : - Running the dispatcher project through URL&lt;br /&gt;(I) How do we share data using “getServletContext ()”?&lt;br /&gt;Using the “getServletContext ()” we can make data available at application level. So&lt;br /&gt;servlets which lie in the same application can get the data. Below are important snippets&lt;br /&gt;which you will need to add, get and remove data which can be shared across servlets.&lt;br /&gt;Figure 4.10 : - Sharing data using “getServletContext ()”&lt;br /&gt;You can see in Step1 how “getServletContext().setAttribute()” method can be used add&lt;br /&gt;new objects to the “getServletContext” collection. Step2 shows how we can get the object&lt;br /&gt;back using “getAttribute()” and manipulate the same. Step3 shows how to remove an&lt;br /&gt;already shared application object from the collection. “getServletContext()” object is&lt;br /&gt;shared across servlets with in a application and thus can be used to share data between&lt;br /&gt;servlets.&lt;br /&gt;(B) Explain the concept of SSI?&lt;br /&gt;Server Side Includes (SSI) are commands and directives placed in Web pages that are&lt;br /&gt;evaluated by the Web server when the Web page is being served. SSI are not supported by&lt;br /&gt;all web servers. So before using SSI read the web server documentation for the support.&lt;br /&gt;SSI is useful when you want a small part of the page to be dynamically generated rather&lt;br /&gt;than loading the whole page again.&lt;br /&gt;Below is the code for SSI which needs to be inserted in between the HTML tags.&lt;br /&gt;&lt;SERVLET CODE=MyServlet CODEBASE=path&lt;br /&gt;initparam1=initvalue1 initparam2=initvalue2&gt;&lt;br /&gt;26&lt;br /&gt;&lt;PARAM NAME=param1 VALUE=value1&gt;&lt;br /&gt;&lt;PARAM NAME=param2 VALUE=value2&gt;&lt;br /&gt;&lt;/SERVLET&gt;&lt;br /&gt;Here the CODE attribute specifies the servlet name. The CODEBASE attribute indicates&lt;br /&gt;the servlet location. If you are using a servlet deployed in the same Web server, you can&lt;br /&gt;omit the CODEBASE attribute. You can pass any request parameters to the servlet&lt;br /&gt;using the PARAM tags.&lt;br /&gt;Below is the code how the SSI looks in the HTML&lt;br /&gt;&lt;HTML&gt;&lt;br /&gt;&lt;HEAD&gt;&lt;br /&gt;&lt;TITLE&gt;Using SSL&lt;/TITLE&gt;&lt;br /&gt;&lt;BODY&gt;&lt;br /&gt;&lt;SERVLET CODE=MyServlet CODEBASE=path&lt;br /&gt;initparam1=initvalue1 initparam2=initvalue2&gt;&lt;br /&gt;&lt;PARAM NAME=param1 VALUE=value1&gt;&lt;br /&gt;&lt;PARAM NAME=param2 VALUE=value2&gt;&lt;br /&gt;&lt;/SERVLET&gt;&lt;br /&gt;&lt;/BODY&gt;&lt;br /&gt;&lt;/HTML&gt;&lt;br /&gt;(I) What are filters in JAVA?&lt;br /&gt;Filters are nothing but simple java classes which can manipulate request before it reaches&lt;br /&gt;the resource on the web server. Resource can be a HTML file, servlet class, JSP etc. It can&lt;br /&gt;also intercept responses sent back to client and thus can manipulate the response before&lt;br /&gt;they reach the client browser.&lt;br /&gt;27&lt;br /&gt;Figure 4.11 : - Filter in action&lt;br /&gt;(A)Can you explain in short how do you go about implementing filters&lt;br /&gt;using Apache Tomcat?&lt;br /&gt;Twist: - Explain step by step of how to implement filters?&lt;br /&gt;In order to make a class as a filter we need to inherit from the “Filter” class. You can see&lt;br /&gt;the same in the code sample below in Step1.&lt;br /&gt;28&lt;br /&gt;Figure 4.12 : - Filter code walkthrough&lt;br /&gt;Above class “clsTimeFilter” logs the time required for resource to load. You can see in&lt;br /&gt;the above code in Step2 we have taken beforetime and aftertime values. In between of&lt;br /&gt;them we have called the “dofilter” (Which is Step 3). Finally at Step4 we send the difference&lt;br /&gt;of the aftertime and beforetime to the log file.&lt;br /&gt;29&lt;br /&gt;Figure 4.13 : - Filter mapped to URL&lt;br /&gt;Once we compile the class file we need to do two important steps one is define the filter&lt;br /&gt;and map the filter to the URL. As we are using tomcat we need to define the same in&lt;br /&gt;“web.xml” file. Above is a snippet of “web.xml” file with both the entries. The first entry&lt;br /&gt;defines the filter name and second maps it to a URL. Currently the URL pattern is “*”&lt;br /&gt;that means any servlet requested will invoke the “clsTimeFilter” filter.&lt;br /&gt;Once you have deployed the filter and you request a URL you can see the output sent by&lt;br /&gt;the filter to the LOG of tomcat.&lt;br /&gt;Figure 4.14 : - Log file entry&lt;br /&gt;Note:-You can get the source code for the filter in “Filters” folder.&lt;br /&gt;Note: - Running JSP is a breeze if the web server supports it. In CD we have provided&lt;br /&gt;Tomcat 5.5 installation. Tomcat 5.5 support JSP. You only need to create a folder for your&lt;br /&gt;project in webapps folder and put in your JSP files.&lt;br /&gt;(I) what’s the difference between Authentication and authorization?&lt;br /&gt;30&lt;br /&gt;Authentication is the process the application identifies that you are who. For example&lt;br /&gt;when a user logs into an application with a username and password, application checks&lt;br /&gt;that the entered credentials against its user data store and responds with success or failure.&lt;br /&gt;Authorization, on the other hand, is when the application checks to see if you&#39;re allowed&lt;br /&gt;to do something. For instance are you allowed to do delete or modify a resource.&lt;br /&gt;(B) Explain in brief the directory structure of a web application?&lt;br /&gt;Below is the directory structure of a web application:-&lt;br /&gt;webapp/&lt;br /&gt;WEB-INF/web.xml&lt;br /&gt;WEB-INF/classes&lt;br /&gt;WEB-INF/lib&lt;br /&gt;√ The webapp directory contains the JSP files, images, and HTML files. The webapp&lt;br /&gt;directory can also contain subdirectories such as images or html or can be organized&lt;br /&gt;by function, such as public or private.&lt;br /&gt;√ The WEB-INF/web.xml file is called the deployment descriptor for the Web&lt;br /&gt;application. This file contains configuration information for the Web application,&lt;br /&gt;including the mappings of URLs to servlets and filters. The web.xml file also contains&lt;br /&gt;configuration information for security, MIME type mapping, error pages, and locale&lt;br /&gt;settings&lt;br /&gt;√ The WEB-INF/classes directory contains the class files for the servlets, JSP files,&lt;br /&gt;tag libraries, and any other utility classes that are used in the Web application.&lt;br /&gt;√ The WEB-INF/lib directory contains JAR files for libraries that are used by the Web&lt;br /&gt;application. These are generally third-party libraries or classes for any tag libraries&lt;br /&gt;used by the Web application.&lt;br /&gt;(B) Can you explain JSP page life cycle?&lt;br /&gt;When first time a JSP page is request necessary servlet code is generated and loaded in&lt;br /&gt;the servlet container. Now until the JSP page is not changed the compiled servlet code&lt;br /&gt;serves any request which comes from the browser. When you again change the JSP page&lt;br /&gt;the JSP engine again compiles a servlet code for the same.&lt;br /&gt;31&lt;br /&gt;Figure 4.15 : - JSP page life cycle&lt;br /&gt;√ JSP page is first initialized by jspInit() method. This initializes the JSP in much the&lt;br /&gt;same way as servlets are initialized, when the first request is intercepted and just&lt;br /&gt;after translation.&lt;br /&gt;√ Every time a request comes to the JSP, the container generated _jspService() method&lt;br /&gt;is invoked, the request is processed, and response generated.&lt;br /&gt;√ When the JSP is destroyed by the server, the jspDestroy() method is called and this&lt;br /&gt;can be used for clean up purposes.&lt;br /&gt;(B) What is EL?&lt;br /&gt;EL stands for expression language. An expression language makes it possible to easily&lt;br /&gt;access application data.In the below expression amountofwine variable value will be&lt;br /&gt;rendered.&lt;br /&gt;&lt;b&gt;There are ${amountofwine} litres of wine in the bottle. &lt;/b&gt;&lt;br /&gt;(I) how does EL search for an attribute?&lt;br /&gt;EL parser searches the attribute in following order:&lt;br /&gt;√ Page&lt;br /&gt;√ Request&lt;br /&gt;√ Session (if it exists)&lt;br /&gt;32&lt;br /&gt;√ Application&lt;br /&gt;If no match is found for then it displays empty string.&lt;br /&gt;(B) What are the implicit EL objects in JSP?&lt;br /&gt;Following are the implicit EL objects:-&lt;br /&gt;PageContext: The context for the JSP page.&lt;br /&gt;Provides access to various objects for instance:-&lt;br /&gt;servletContext: The context for the JSP page&#39;s servlet and any web components contained&lt;br /&gt;in the same application.&lt;br /&gt;session: The session object for the client.&lt;br /&gt;request: The request triggering the execution of the JSP page.&lt;br /&gt;response: The response returned by the JSP page. See Constructing Responses.&lt;br /&gt;In addition, several implicit objects are available that allow easy access to the following&lt;br /&gt;objects:&lt;br /&gt;param: Maps a request parameter name to a single value&lt;br /&gt;paramValues: Maps a request parameter name to an array of values&lt;br /&gt;header: Maps a request header name to a single value&lt;br /&gt;headerValues: Maps a request header name to an array of values&lt;br /&gt;cookie: Maps a cookie name to a single cookie&lt;br /&gt;initParam: Maps a context initialization parameter name to a single value&lt;br /&gt;Finally, there are objects that allow access to the various scoped variables described in&lt;br /&gt;Using Scope Objects.&lt;br /&gt;pageScope: Maps page-scoped variable names to their values&lt;br /&gt;requestScope: Maps request-scoped variable names to their values&lt;br /&gt;sessionScope: Maps session-scoped variable names to their values&lt;br /&gt;applicationScope: Maps application-scoped variable names to their values&lt;br /&gt;33&lt;br /&gt;For instance the below snippet will indentify the browser used by the client.&lt;br /&gt;&lt;b&gt;Browser:&lt;/b&gt; ${header[&quot;user-agent&quot;]}&lt;br/&gt;&lt;br /&gt;(I) How can we disable EL?&lt;br /&gt;You can disable using isELIgnored attribute of the page directive:&lt;br /&gt;&lt;%@ page isELIgnored =&quot;true|false&quot; %&gt;&lt;br /&gt;(I) what is JSTL?&lt;br /&gt;JSTL is also called as JSP tag libraries. They are collection of custom actions which can&lt;br /&gt;be accessed as JSP tags.&lt;br /&gt;Note: - In CD we have Jakarta tag libs jakarta-taglibs-standard-1.1.2.zip which you can&lt;br /&gt;use to practice sample tags and see how it works. When you unzip the file there are two files&lt;br /&gt;jstl.jar and standard.jar which you need to copy it in to your application&#39;s WEB-INF/lib&lt;br /&gt;directory.&lt;br /&gt;(A) Can you explain in short what the different types of JSTL tags are?&lt;br /&gt;Tags are classified in to four groups:-&lt;br /&gt;√ Core tags&lt;br /&gt;√ Formatting tags&lt;br /&gt;√ XML tags&lt;br /&gt;√ SQL tags&lt;br /&gt;Core tags&lt;br /&gt;&lt;c:if&gt; for conditional flow&lt;br /&gt;&lt;c:forEach&gt; and &lt;c:forTokens&gt; for iteration&lt;br /&gt;&lt;c:choose&gt;...&lt;c:when&gt;....&lt;c:otherwise&gt; for selective flow between mutually exclusive&lt;br /&gt;code&lt;br /&gt;&lt;c:set&gt; and &lt;c:remove&gt; for working with scoped variables&lt;br /&gt;&lt;c:out&gt; for rendering the value of variables and expressions&lt;br /&gt;34&lt;br /&gt;&lt;c:catch&gt; for working with Java exceptions&lt;br /&gt;&lt;c:url&gt; for creating and working with URLs&lt;br /&gt;Formatting tags&lt;br /&gt;Used to format and display text, the date, the time, and numbers. Below are some frequently&lt;br /&gt;used tags:-&lt;br /&gt;&lt;fmt:formatNumber&gt;: To render numerical value with specific precision or format&lt;br /&gt;&lt;fmt:formatDate&gt;: To render date and time values in a specific format (and according to&lt;br /&gt;international locale-specific conventions)&lt;br /&gt;&lt;fmt:message&gt;: To display an internationalized message (for example, a message in a&lt;br /&gt;different language using a different character set)&lt;br /&gt;XML tags&lt;br /&gt;XML tags are meant to process XML data. It supports data-parsing, transforming XML,&lt;br /&gt;plus data and flow control based on XPath expressions. These tags are used only when&lt;br /&gt;you need to work directly, within the JSP, with XML data.&lt;br /&gt;SQL tags&lt;br /&gt;They are designed to work directly with SQL tags. But most of the time you will see they&lt;br /&gt;are used for prototyping and not for final product.&lt;br /&gt;Just before we move ahead with some other questions. Let’s how do we install JSTL so&lt;br /&gt;that everything works. Below are three installation steps:-&lt;br /&gt;√ Unzip &quot;jakarta-taglibs-standard-1.1.2.zip&quot; and you will see two files jstl.jar and&lt;br /&gt;standard.jar in lib directory.&lt;br /&gt;√ Copy both jstl.jar and standard.jar to &quot;\webapps\ROOT\WEB-INF\lib&quot; directory&lt;br /&gt;in tomcat.&lt;br /&gt;√ Copy all tld files from the unzipped location to \webapps\ROOT\WEB-INF&quot;&lt;br /&gt;directory.&lt;br /&gt;√ Modify the web.xml file to include all TLD files. Below is snippet of some tld&#39;s&lt;br /&gt;included in web.xml file.&lt;br /&gt;35&lt;br /&gt;&lt;taglib&gt;&lt;br /&gt;&lt;taglib-uri&gt;http://java.sun.com/jstl/fmt&lt;/taglib-uri&gt;&lt;br /&gt;&lt;taglib-location&gt;/WEB-INF/fmt.tld&lt;/taglib-location&gt;&lt;br /&gt;&lt;/taglib&gt;&lt;br /&gt;&lt;taglib&gt;&lt;br /&gt;&lt;taglib-uri&gt;http://java.sun.com/jstl/fmt-rt&lt;/taglib-uri&gt;&lt;br /&gt;&lt;taglib-location&gt;/WEB-INF/fmt-rt.tld&lt;/taglib-location&gt;&lt;br /&gt;&lt;/taglib&gt;&lt;br /&gt;&lt;taglib&gt;&lt;br /&gt;&lt;taglib-uri&gt;http://java.sun.com/jstl/core&lt;/taglib-uri&gt;&lt;br /&gt;&lt;taglib-location&gt;/WEB-INF/c.tld&lt;/taglib-location&gt;&lt;br /&gt;&lt;/taglib&gt;&lt;br /&gt;&lt;taglib&gt;&lt;br /&gt;&lt;taglib-uri&gt;http://java.sun.com/jstl/core-rt&lt;/taglib-uri&gt;&lt;br /&gt;&lt;taglib-location&gt;/WEB-INF/c-rt.tld&lt;/taglib-location&gt;&lt;br /&gt;&lt;/taglib&gt;&lt;br /&gt;&lt;taglib&gt;&lt;br /&gt;&lt;taglib-uri&gt;http://java.sun.com/jstl/sql&lt;/taglib-uri&gt;&lt;br /&gt;&lt;taglib-location&gt;/WEB-INF/sql.tld&lt;/taglib-location&gt;&lt;br /&gt;&lt;/taglib&gt;&lt;br /&gt;&lt;taglib&gt;&lt;br /&gt;36&lt;br /&gt;&lt;taglib-uri&gt;http://java.sun.com/jstl/sql-rt&lt;/taglib-uri&gt;&lt;br /&gt;&lt;taglib-location&gt;/WEB-INF/sql-rt.tld&lt;/taglib-location&gt;&lt;br /&gt;&lt;/taglib&gt;&lt;br /&gt;&lt;taglib&gt;&lt;br /&gt;&lt;taglib-uri&gt;http://java.sun.com/jstl/x&lt;/taglib-uri&gt;&lt;br /&gt;&lt;taglib-location&gt;/WEB-INF/x.tld&lt;/taglib-location&gt;&lt;br /&gt;&lt;/taglib&gt;&lt;br /&gt;&lt;taglib&gt;&lt;br /&gt;&lt;taglib-uri&gt;http://java.sun.com/jstl/x-rt&lt;/taglib-uri&gt;&lt;br /&gt;&lt;taglib-location&gt;/WEB-INF/x-rt.tld&lt;/taglib-location&gt;&lt;br /&gt;&lt;/taglib&gt;&lt;br /&gt;(I) How can we use beans in JSP?&lt;br /&gt;JSP provides three tags to work with beans:-&lt;br /&gt;√ &lt;jsp:useBean id=“bean name” class=“bean class” scope = “page | request | session&lt;br /&gt;|application ”/&gt;&lt;br /&gt;Bean name = the name that refers to the bean.&lt;br /&gt;Bean class = name of the java class that defines the bean.&lt;br /&gt;√ &lt;jsp:setProperty name = “id” property = “someProperty” value = “someValue” /&lt;br /&gt;&gt;&lt;br /&gt;id = the name of the bean as specified in the useBean tag.&lt;br /&gt;property = name of the property to be passed to the bean.&lt;br /&gt;value = value of that particular property .&lt;br /&gt;√ &lt;jsp:getProperty name = “id” property = “someProperty” /&gt;&lt;br /&gt;37&lt;br /&gt;Here the property is the name of the property whose value is to be obtained from the&lt;br /&gt;bean.Below is a code snippet which shows how MyUserClass is used and the values&lt;br /&gt;accessed.&lt;br /&gt;&lt;jsp:useBean id=&quot;user&quot; class=&quot;MyUserClass&quot; scope=&quot;session&quot;/&gt;&lt;br /&gt;&lt;HTML&gt;&lt;br /&gt;&lt;BODY&gt;&lt;br /&gt;You entered&lt;BR&gt;&lt;br /&gt;Name: &lt;%= user.getUsername() %&gt;&lt;BR&gt;&lt;br /&gt;Email: &lt;%= user.getEmail() %&gt;&lt;BR&gt;&lt;br /&gt;&lt;/BODY&gt;&lt;br /&gt;&lt;/HTML&gt;&lt;br /&gt;(I) What is the use of &lt;jsp:include&gt; ?&lt;br /&gt;It includes the output of one JSP in to other JSP file at the location of the tag.&lt;br /&gt;Below is the syntax for the same:-&lt;br /&gt;&lt;jsp:include page=&quot;...url..&quot; flush=&quot;true or false&quot;/&gt;&lt;br /&gt;page: A URL that is relative to the current JSP page at request time&lt;br /&gt;flush: Determines if the buffer for the output is flushed immediately, before the included&lt;br /&gt;page&#39;s output.&lt;br /&gt;(I) What is &lt;jsp:forward&gt; tag for ?&lt;br /&gt;It forwards the current request to another JSP page. Below is the syntax for the same:-&lt;br /&gt;&lt;jsp:forward page=&quot;...url...&quot; /&gt;&lt;br /&gt;We can also forward parameter to the other page using the param tag&lt;br /&gt;&lt;jsp:forward page=&quot;..url...&quot;&gt;&lt;br /&gt;&lt;jsp:param ..../&gt;&lt;br /&gt;&lt;/jsp:forward&gt;&lt;br /&gt;38&lt;br /&gt;(B) What are JSP directives?&lt;br /&gt;JSP directives do not produce any output. They are used to set global values like class&lt;br /&gt;declaration, content type etc. Directives have scope for entire JSP file. They start with&lt;br /&gt;&lt;%@ and ends with %&gt;. There are three main directives that can be used in JSP:-&lt;br /&gt;√ page directive&lt;br /&gt;√ include directive&lt;br /&gt;√ taglib directive&lt;br /&gt;(I) what are Page directives?&lt;br /&gt;Page directive is used to define page attributes the JSP file. Below is a sample of the&lt;br /&gt;same:-&lt;br /&gt;&lt;%@ page language=&quot;Java&quot; import=&quot;java.rmi.*,java.util.*&quot; session=&quot;true&quot;&lt;br /&gt;buffer=&quot;12kb&quot; autoFlush=&quot;true&quot; errorPage=&quot;error.jsp&quot; %&gt;&lt;br /&gt;To summarize some of the important page attributes:-&lt;br /&gt;import :- Comma separated list of packages or classes, just like import statements in&lt;br /&gt;usual Java code.&lt;br /&gt;session :- Specifies whether this page can use HTTP session. If set &quot;true&quot; session (which&lt;br /&gt;refers to the javax.servlet.http.HttpSession) is available and can be used to access the&lt;br /&gt;current/new session for the page. If &quot;false&quot;, the page does not participate in a session and&lt;br /&gt;the implicit session object is unavailable.&lt;br /&gt;buffer :- If a buffer size is specified (such as &quot;50kb&quot;) then output is buffered with a buffer&lt;br /&gt;size not less than that value.&lt;br /&gt;isThreadSafe :- Defines the level of thread safety implemented in the page. If set &quot;true&quot;&lt;br /&gt;the JSP engine may send multiple client requests to the page at the same time. If &quot;false&quot;&lt;br /&gt;then the JSP engine queues up client requests sent to the page for processing, and processes&lt;br /&gt;them one request at a time, in the order they were received. This is the same as&lt;br /&gt;implementing the javax.servlet.SingleThreadModel interface in a servlet.&lt;br /&gt;errorPage: - Defines a URL to another JSP page, which is invoked if an unchecked runtime&lt;br /&gt;exception is thrown. The page implementation catches the instance of the Throwable&lt;br /&gt;object and passes it to the error page processing.&lt;br /&gt;39&lt;br /&gt;(I) what are include directives?&lt;br /&gt;The include directive informs the JSP engine to include the content of the resource in the&lt;br /&gt;current JSP page. Below is the syntax for include statement.&lt;br /&gt;&lt;%@ include file=&quot;Filename&quot; %&gt;&lt;br /&gt;Below is a code snippet which shows include directive in action&lt;br /&gt;&lt;html&gt;&lt;br /&gt;&lt;head&gt;&lt;br /&gt;&lt;title&gt;Directive in action&lt;/title&gt;&lt;br /&gt;&lt;/head&gt;&lt;br /&gt;&lt;%@ include file=&quot;/companyname.html&quot; %&gt;&lt;br /&gt;&lt;body&gt;&lt;br /&gt;&lt;h1&gt;Directive in action&lt;/h1&gt;&lt;br /&gt;&lt;/body&gt;&lt;br /&gt;&lt;/html&gt;&lt;br /&gt;companyname.html contains the following:&lt;br /&gt;&lt;p&gt;Koirala and Koirala Limited&lt;/p&gt;&lt;br /&gt;(I) Can you explain taglib directives?&lt;br /&gt;Taglib are also termed as JSP tag extensions. They provide a way of encapsulating reusable&lt;br /&gt;functionality on JSP pages. One of the biggest drawbacks of scripting environments such&lt;br /&gt;as JSP is that it&#39;s easy to get carried away without thinking about how it will be maintained&lt;br /&gt;and grown in the future. For example, the ability to generate dynamic content by using&lt;br /&gt;Java code embedded in the page is a very powerful feature of the JSP specification.&lt;br /&gt;Custom tags allow such functionality to be encapsulated into reusable components. You&lt;br /&gt;can make write your reusable class in JAVA and call the same using XML tag.&lt;br /&gt;There are four files which play an important role:-&lt;br /&gt;√ Main class file which encapsulates the logic.&lt;br /&gt;√ Tag library descriptor file.&lt;br /&gt;40&lt;br /&gt;√ Web.xml file which has the tag library descriptor file location.&lt;br /&gt;√ Finally the JSP file which calls it.&lt;br /&gt;Below is the image which shows the four files in one go.&lt;br /&gt;Figure 4.16 : - taglib directive in action&lt;br /&gt;41&lt;br /&gt;The first file is the class file which will has the reusable code which will be called in the&lt;br /&gt;JSP file. The above class is also called as tag handler class. One of the important things to&lt;br /&gt;note is doStartTag() and doEndTag(). doStartTag is called when the JSP engine encounters&lt;br /&gt;an open tag and doEndTag is called when it encounters a closed tag.&lt;br /&gt;The second important file is the tag descriptor file. This file maps the class name with a&lt;br /&gt;name which will be used to call this class.&lt;br /&gt;The third file is the web.xml file. We need to define the tag library descriptor file location&lt;br /&gt;in web.xml file.&lt;br /&gt;Finally is the JSP file which calls the class. There are two things to be noted in the JSP file&lt;br /&gt;first is the taglib which refers to the URI. Second is the custom tag which calls the datetime&lt;br /&gt;class.&lt;br /&gt;Note: - You can find the above code sample in “JspTag” folder. Both the class as well as the&lt;br /&gt;JSP file is in the same folder. It displays date and time.&lt;br /&gt;(A) How does JSP engines instantiate tag handler classes instances?&lt;br /&gt;JSP engines will always instantiate a new tag handler instance every time a tag is encountered&lt;br /&gt;in a JSP page. A pool of tag instances are maintained and reusing them where possible.&lt;br /&gt;When a tag is encountered, the JSP engine will try to find a Tag instance that is not being&lt;br /&gt;used and use the same and then release it.&lt;br /&gt;(I) what’s the difference between JavaBeans and taglib directives?&lt;br /&gt;JavaBeans and taglib fundamentals were introduced for reusability. But following are the&lt;br /&gt;major differences between them:-&lt;br /&gt;√ Taglib are for generating presentation elements while JavaBeans are good for storing&lt;br /&gt;information and state.&lt;br /&gt;√ Use custom tags to implement actions and JavaBeans to present information.&lt;br /&gt;(I) what are the different scopes an object can have in a JSP page?&lt;br /&gt;There are four scope which an object can have in a JSP page:-&lt;br /&gt;42&lt;br /&gt;Page Scope&lt;br /&gt;Objects with page scope are accessible only within the page. Data only is valid for the&lt;br /&gt;current response. Once the response is sent back to the browser then data is no more&lt;br /&gt;valid. Even if request is passed from one page to other the data is lost.&lt;br /&gt;Request Scope&lt;br /&gt;Objects with request scope are accessible from pages processing the same request in&lt;br /&gt;which they were created. Once the container has processed the request data is invalid.&lt;br /&gt;Even if the request is forwarded to another page, the data is still available though not if&lt;br /&gt;a redirect is required.&lt;br /&gt;Session Scope&lt;br /&gt;Objects with session scope are accessible in same session. Session is the time users spend&lt;br /&gt;using the application, which ends when they close their browser or when they go to&lt;br /&gt;another Web site. So, for example, when users log in, their username could be stored in&lt;br /&gt;the session and displayed on every page they access. This data lasts until they leave the&lt;br /&gt;Web site or log out.&lt;br /&gt;Application Scope&lt;br /&gt;Application scope objects are basically global object and accessible to all JSP pages which&lt;br /&gt;lie in the same application. This creates a global object that&#39;s available to all pages.&lt;br /&gt;Application scope variables are typically created and populated when an application starts&lt;br /&gt;and then used as read-only for the rest of the application.&lt;br /&gt;(I) what are different implicit objects of JSP?&lt;br /&gt;pageContext :- The PageContext object.&lt;br /&gt;pageScope :- A Map of all the objects that have page scope.&lt;br /&gt;requestScope :- A Map of all the objects that have request scope.&lt;br /&gt;sessionScope :- A Map of all the objects that have session scope.&lt;br /&gt;applicationScope :- A Map of all the objects that have application scope.&lt;br /&gt;43&lt;br /&gt;param :- A Map of all the form parameters that were passed to your JSP page (for example,&lt;br /&gt;the HTML &lt;input name=&quot;ourName&quot; type=&quot;text&quot;/&gt; is passed to your JSP page as a&lt;br /&gt;form parameter).&lt;br /&gt;paramValues :- HTML allows for multiple values for a single form parameter. This is a&lt;br /&gt;Map of all the parameters, just like param, but in this object the values are an array&lt;br /&gt;containing all of the values for a given parameter in the event that there&#39;s more than one.&lt;br /&gt;header :- A Map of all the request headers.&lt;br /&gt;headerValues :- For the same reasons as paramValues, a headerValues object is provided.&lt;br /&gt;cookie :- A Map of all the cookies passed to your JSP. The value returned is a Cookie&lt;br /&gt;object.&lt;br /&gt;initParam :- A Map that maps context initialization parameter names to their parameter&lt;br /&gt;values.&lt;br /&gt;(I) what are different Authentication Options available in servlets?&lt;br /&gt;There are four ways of authentication:-&lt;br /&gt;√ HTTP basic authentication&lt;br /&gt;√ HTTP digest authentication&lt;br /&gt;√ HTTPS client authentication&lt;br /&gt;√ Form-based authentication&lt;br /&gt;Let’s try to understand how the above four ways work.&lt;br /&gt;HTTP basic authentication&lt;br /&gt;In HTTP basic authentication the server uses the username and password send by the&lt;br /&gt;client. The password is sent using simple base64 encoding but it’s not encrypted.&lt;br /&gt;HTTP digest authentication&lt;br /&gt;HTTP digest authentication is same as HTTP basic authentication but the biggest&lt;br /&gt;difference is password is encrypted and transmitted using SHA or MD5.&lt;br /&gt;44&lt;br /&gt;HTTPS client authentication&lt;br /&gt;HTTPS client authentication is based on HTTP over SSL. It requires that the end client&lt;br /&gt;should possess a PKC (Public Key Certificate). This verifies the browsers identity.&lt;br /&gt;Form-based authentication&lt;br /&gt;In FORM-based the web container invokes a login page. The invoked login page is used&lt;br /&gt;to collect username and password.&lt;br /&gt;We will be seeing how to implement the above four using tomcat.&lt;br /&gt;(A) Can you explain how do we practically implement security on a&lt;br /&gt;resource?&lt;br /&gt;(A) How do we practically implement form based authentication?&lt;br /&gt;Note: - We will answer this question from the perspective of tomcat server.&lt;br /&gt;Below are the five important steps to implement security on a resource.&lt;br /&gt;√ Define the URL pattern on which security will be applied.&lt;br /&gt;√ Define the roles which are allowed to access the resource.&lt;br /&gt;√ Define all the roles in the web application.&lt;br /&gt;√ Define the authentication method.&lt;br /&gt;√ Relate the users with roles.&lt;br /&gt;We will try to understand the above steps in more detail using the figure below. In the&lt;br /&gt;below figure you can see the sequence of steps.&lt;br /&gt;45&lt;br /&gt;Figure 4.17 : - Authentication steps in Web.xml&lt;br /&gt;46&lt;br /&gt;Define the URL pattern on which security will be applied&lt;br /&gt;In this step we define the resource which we want to protect. This is defined in the&lt;br /&gt;web.xml file as shown in the figure above. In the &lt;url-pattern&gt; we have defined secure as&lt;br /&gt;the web application.&lt;br /&gt;Define the roles which are allowed to access the resource&lt;br /&gt;In step 2 we define which roles are allowed to access the resource. You can see in the&lt;br /&gt;above figure it’s done by using &lt;auth-constraint&gt; tag in web.xml.&lt;br /&gt;Define all the roles in the web application&lt;br /&gt;In step 3 we define roles for the web application. We also need to mention the security&lt;br /&gt;role in &lt;security-role&gt;. Just a note the &lt;auth-constraint&gt; element specifies that application&lt;br /&gt;users must also be in the role of &quot;Admin&quot;, and the &lt;security-role&gt; element defines that&lt;br /&gt;role.&lt;br /&gt;Define the authentication method&lt;br /&gt;This is the most important part defining which type of authentication we want to use. It’s&lt;br /&gt;defined by using the &lt;auth-method&gt; tag. In this scenario we are using FORM&lt;br /&gt;authentication. You can also see sub tags &lt;form-login-config&gt; which define the main&lt;br /&gt;login page and the error page.&lt;br /&gt;Relate the users with roles&lt;br /&gt;Finally we need to define the actual users which can be attached to the roles. In the above&lt;br /&gt;figure you can see we have “interviewer” as user which is attached to admin role. Users&lt;br /&gt;can be defined in tomcat-users.xml file.&lt;br /&gt;Note: - We have a sample application in formlogin folder which demonstrates how to&lt;br /&gt;execute the above steps practically. Copy the folder and paste it in webapps folder and&lt;br /&gt;execute the same to see how it works.&lt;br /&gt;(I) How do we authenticate using JDBC?&lt;br /&gt;(I) Can you explain JDBCRealm?&lt;br /&gt;A realm is a &quot;database&quot; of usernames, passwords, and user roles. When we say JDBCrealm&lt;br /&gt;we mean all these attributes are stored in table. In order to connect to JDBC you need to&lt;br /&gt;47&lt;br /&gt;make a context.xml and save the same in “META-INF “folder of the web application.&lt;br /&gt;Below is the context.xml snippet.&lt;br /&gt;&lt;Context path=&quot;/security&quot; docBase=&quot;security&quot; debug=&quot;0&quot;&gt;&lt;br /&gt;&lt;Realm className=&quot;org.apache.catalina.realm.JDBCRealm&quot; debug=&quot;99&quot;&lt;br /&gt;driverName=&quot;com.mysql.jdbc.Driver&quot;&lt;br /&gt;connectionURL=&quot;jdbc:mysql://localhost:3306/security?autoReconnect=true&quot;&lt;br /&gt;connectionName=&quot;MyConn&quot;&lt;br /&gt;connectionPassword=&quot;Password1&quot;&lt;br /&gt;userTable=&quot;tblusers&quot;&lt;br /&gt;userNameCol=&quot;username&quot;&lt;br /&gt;userCredCol=&quot;password&quot;&lt;br /&gt;userRoleTable=&quot;user_roles&quot;&lt;br /&gt;roleNameCol=&quot;role_name&quot; /&gt;&lt;br /&gt;&lt;/Context&gt;&lt;br /&gt;(A) Can you explain how do you configure JNDIRealm?&lt;br /&gt;Left to the users ? . That’s because it’s rarely asked but yes it’s asked.&lt;br /&gt;(I) How did you implement caching in JSP?&lt;br /&gt;OSCache is an open-source caching library that&#39;s available free of charge from the&lt;br /&gt;OpenSymphony organization (for more details visit http://www.opensymphony.com/&lt;br /&gt;oscache). OSCache has a set of JSP tags that make it easy to implement page caching in&lt;br /&gt;your JSP application.&lt;br /&gt;Following are some Cache techniques it fulfills:-&lt;br /&gt;Cache entry&lt;br /&gt;An object that&#39;s stored into a page cache is known as a cache entry. In a JSP application,&lt;br /&gt;a cache entry is typically the output of a JSP page, a portion of a JSP page, or a servlet.&lt;br /&gt;48&lt;br /&gt;Cache key&lt;br /&gt;A page cache is like a hash table. When you save a cache entry in a page cache, you must&lt;br /&gt;provide a cache key to identify the cache data. You can use keys like URI, other parameters&lt;br /&gt;like username, ipaddress to indentify cache data.&lt;br /&gt;Cache duration&lt;br /&gt;This is the period of time that a cache entry will remain in a page cache before it expires.&lt;br /&gt;When a cache entry expires, it&#39;s removed from the cache and will be regenerated again.&lt;br /&gt;Cache scope&lt;br /&gt;This defines at what scope the data is stored application or session scope.&lt;br /&gt;&lt;os:cache time=&quot;60&quot;&gt;&lt;br /&gt;&lt;%= new java.util.Date().toString() %&gt;&lt;/p&gt;&lt;br /&gt;&lt;/os:cache&gt;&lt;br /&gt;The above tag says that refresh after every 60 seconds the user requests data. So if user1&lt;br /&gt;is requesting the page it will display fresh date and if an other user requests with in 60&lt;br /&gt;seconds it will show same data. If any other user requests the page after 60 second he will&lt;br /&gt;again see refreshed date.&lt;br /&gt;(B) What is the difference between Servletcontext and ServletConfig ?&lt;br /&gt;ServletConfig contains configuration data for the servlet in the form of name and value&lt;br /&gt;pairs.Using the ServletConfigwe get reference to the ServletContext object. ServletContext&lt;br /&gt;gives the servlet access to information about its runtime environment such as web server&lt;br /&gt;logging facilities, version info, URL details, web server attributes etc.&lt;br /&gt;(I) How do we prevent browser from caching output of my JSP pages?&lt;br /&gt;You can prevent pages from caching JSP pages output using the below code snippet.&lt;br /&gt;&lt;%response.setHeader(&quot;Cache-Control&quot;,&quot;no-cache&quot;); //HTTP 1.1&lt;br /&gt;response.setHeader(&quot;Pragma&quot;,&quot;no-cache&quot;); //HTTP 1.0&lt;br /&gt;response.setDateHeader (&quot;Expires&quot;, 0); //prevents caching at the proxy server&lt;br /&gt;%&gt;&lt;br /&gt;49&lt;br /&gt;(I) Can we explicitly destroy a servlet object?&lt;br /&gt;No we can not destroy a servlet explicitly its all done by the container. Even if you try&lt;br /&gt;calling the destroy method container does not respond to it.&lt;br /&gt;Distribution Partner&lt;br /&gt;Do you have a news group or website where you want to&lt;br /&gt;distribute this PDF free. Contact at shiv_koirala@yahoo.com&lt;br /&gt;we will put your logo and send you a complete zipped file&lt;br /&gt;which you can host at your site to increase user visits. Be our&lt;br /&gt;partner and increase your user visits in your website. We do&lt;br /&gt;not take any charge from our partner to distrubute these&lt;br /&gt;sample copies. But yes the contents of this PDF can not be&lt;br /&gt;modified. If you are our partner you get regular updates of&lt;br /&gt;our interview question releases.&lt;br /&gt;Illegal distributions of this PDF will be taken seriously. Just&lt;br /&gt;send a mail and be our distribution partner with your website&lt;br /&gt;logo proudly do not distribute illegally.&lt;br /&gt;www.questpond.com</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/6589386357114635047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/6589386357114635047' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/6589386357114635047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/6589386357114635047'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2007/09/servlet.html' title='Servlet&amp;Jsp'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-7873927471717723566</id><published>2007-05-08T22:17:00.000-07:00</published><updated>2007-05-08T22:19:35.911-07:00</updated><title type='text'>Core Java-Part - I</title><content type='html'>1.what  is a transient variable?&lt;br /&gt;A transient variable is a variable that may not be serialized.&lt;br /&gt;&lt;br /&gt;2.which containers use a border Layout as their default layout?&lt;br /&gt;The window, Frame and Dialog classes use a border layout as their default layout.&lt;br /&gt;&lt;br /&gt;3.Why do threads block on I/O?&lt;br /&gt;Threads block on i/o (that is enters the waiting state) so that other threads may execute while the i/o Operation is performed.&lt;br /&gt;&lt;br /&gt;4. How are Observer and Observable used?&lt;br /&gt;Objects that subclass the Observable class maintain a list of observers. When an Observable object is updated it invokes the update() method of each of its observers to notify the observers that it has changed state. The Observer interface is implemented by objects that observe Observable objects.&lt;br /&gt;&lt;br /&gt;5. What is synchronization and why is it important?&lt;br /&gt;With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object&#39;s value. This often leads to significant errors.&lt;br /&gt;&lt;br /&gt;6. Can a lock be acquired on a class?&lt;br /&gt;Yes, a lock can be acquired on a class. This lock is acquired on the class&#39;s Class object..&lt;br /&gt;&lt;br /&gt;7. What&#39;s new with the stop(), suspend() and resume() methods in JDK 1.2?&lt;br /&gt;The stop(), suspend() and resume() methods have been deprecated in JDK 1.2.&lt;br /&gt;&lt;br /&gt;8. Is null a keyword?&lt;br /&gt;The null value is not a keyword.&lt;br /&gt;&lt;br /&gt;9. What is the preferred size of a component?&lt;br /&gt;The preferred size of a component is the minimum component size that will allow the component to display normally.&lt;br /&gt;&lt;br /&gt;10. What method is used to specify a container&#39;s layout?&lt;br /&gt;The setLayout() method is used to specify a container&#39;s layout.&lt;br /&gt;&lt;br /&gt;11. Which containers use a FlowLayout as their default layout?&lt;br /&gt;The Panel and Applet classes use the FlowLayout as their default layout.&lt;br /&gt;&lt;br /&gt;12. What state does a thread enter when it terminates its processing?&lt;br /&gt;When a thread terminates its processing, it enters the dead state.&lt;br /&gt;&lt;br /&gt;13. What is the Collections API?&lt;br /&gt;The Collections API is a set of classes and interfaces that support operations on collections of objects.&lt;br /&gt;&lt;br /&gt;14. Which characters may be used as the second character of an identifier,&lt;br /&gt;but not as the first character of an identifier?&lt;br /&gt;The digits 0 through 9 may not be used as the first character of an identifier but they may be used after the first character of an identifier.&lt;br /&gt;&lt;br /&gt;15. What is the List interface?&lt;br /&gt;The List interface provides support for ordered collections of objects.&lt;br /&gt;&lt;br /&gt;16. How does Java handle integer overflows and underflows?&lt;br /&gt;It uses those low order bytes of the result that can fit into the size of the type allowed by the operation.&lt;br /&gt;&lt;br /&gt;17. What is the Vector class?&lt;br /&gt;The Vector class provides the capability to implement a growable array of objects&lt;br /&gt;&lt;br /&gt;18. What modifiers may be used with an inner class that is a member of an outer class?&lt;br /&gt;A (non-local) inner class may be declared as public, protected, private, static, final, or abstract.&lt;br /&gt;&lt;br /&gt;19. What is an Iterator interface?&lt;br /&gt;The Iterator interface is used to step through the elements of a Collection.&lt;br /&gt;&lt;br /&gt;20. What is the difference between the &gt;&gt; and &gt;&gt;&gt; operators?&lt;br /&gt;The &gt;&gt; operator carries the sign bit when shifting right. The &gt;&gt;&gt; zero-fills bits that have been shifted out.&lt;br /&gt;&lt;br /&gt;21. Which method of the Component class is used to set the position and&lt;br /&gt;size of a component?&lt;br /&gt;setBounds()&lt;br /&gt;&lt;br /&gt;22. How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters?&lt;br /&gt;Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set uses only 7 bits, it is usually represented as 8 bits. UTF-8 represents characters using 8, 16, and 18 bit patterns. UTF-16 uses 16-bit and larger bit patterns.&lt;br /&gt;&lt;br /&gt;23What is the difference between yielding and sleeping?&lt;br /&gt;When a task invokes its yield() method, it returns to the ready state. When a task invokes its sleep() method, it returns to the waiting state.&lt;br /&gt;&lt;br /&gt;24. Which java.util classes and interfaces support event handling?&lt;br /&gt;The EventObject class and the EventListener interface support event processing.&lt;br /&gt;&lt;br /&gt;25. Is sizeof a keyword?&lt;br /&gt;The sizeof operator is not a keyword.&lt;br /&gt;&lt;br /&gt;26. What are wrapped classes?&lt;br /&gt;Wrapped classes are classes that allow primitive types to be accessed as objects.&lt;br /&gt;&lt;br /&gt;27. Does garbage collection guarantee that a program will not run out of memory?&lt;br /&gt;Garbage collection does not guarantee that a program will not run out of memory. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection&lt;br /&gt;&lt;br /&gt;28. What restrictions are placed on the location of a package statement&lt;br /&gt;within a source code file?&lt;br /&gt;A package statement must appear as the first line in a source code file (excluding blank lines and comments).&lt;br /&gt;&lt;br /&gt;29. Can an object&#39;s finalize() method be invoked while it is reachable?&lt;br /&gt;An object&#39;s finalize() method cannot be invoked by the garbage collector while the object is still reachable. However, an object&#39;s finalize() method may be invoked by other objects.&lt;br /&gt;&lt;br /&gt;30. What is the immediate superclass of the Applet class?&lt;br /&gt;Panel&lt;br /&gt;&lt;br /&gt;31. What is the difference between preemptive scheduling and time slicing?&lt;br /&gt;Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and&lt;br /&gt;other factors.&lt;br /&gt;&lt;br /&gt;32. Name three Component subclasses that support painting.&lt;br /&gt;The Canvas, Frame, Panel, and Applet classes support painting.&lt;br /&gt;&lt;br /&gt;33. What value does readLine() return when it has reached the end of a file?&lt;br /&gt;The readLine() method returns null when it has reached the end of a file.&lt;br /&gt;&lt;br /&gt;34. What is the immediate superclass of the Dialog class?&lt;br /&gt;Window&lt;br /&gt;&lt;br /&gt;35. What is clipping?&lt;br /&gt;Clipping is the process of confining paint operations to a limited area or shape.&lt;br /&gt;&lt;br /&gt;36. What is a native method?&lt;br /&gt;A native method is a method that is implemented in a language other than Java.&lt;br /&gt;&lt;br /&gt;37. Can a for statement loop indefinitely?&lt;br /&gt;Yes, a for statement can loop indefinitely. For example, consider the following:&lt;br /&gt;for(;Wink ;&lt;br /&gt;&lt;br /&gt;38. What are order of precedence and associativity, and how are they used?&lt;br /&gt;Order of precedence determines the order in which operators are evaluated in expressions. Associatity determines whether an expression is evaluated left-to-right or right-to-left&lt;br /&gt;&lt;br /&gt;39. When a thread blocks on I/O, what state does it enter?&lt;br /&gt;A thread enters the waiting state when it blocks on I/O.&lt;br /&gt;&lt;br /&gt;40. To what value is a variable of the String type automatically initialized?&lt;br /&gt;The default value of an String type is null.&lt;br /&gt;&lt;br /&gt;41. What is the catch or declare rule for method declarations?&lt;br /&gt;If a checked exception may be thrown within the body of a method, the method must either catch the exception or declare it in its throws clause.&lt;br /&gt;&lt;br /&gt;42. What is the difference between a MenuItem and a CheckboxMenuItem?&lt;br /&gt;The CheckboxMenuItem class extends the MenuItem class to support a menu item that may be checked or unchecked.&lt;br /&gt;&lt;br /&gt;43. What is a task&#39;s priority and how is it used in scheduling?&lt;br /&gt;A task&#39;s priority is an integer value that identifies the relative order in which it should be executed with respect to other tasks. The scheduler attempts to schedule higher priority tasks before lower priority tasks.&lt;br /&gt;&lt;br /&gt;44. What class is the top of the AWT event hierarchy?&lt;br /&gt;The java.awt.AWTEvent class is the highest-level class in the AWT event-class hierarchy.&lt;br /&gt;&lt;br /&gt;45. When a thread is created and started, what is its initial state?&lt;br /&gt;A thread is in the ready state after it has been created and started.&lt;br /&gt;&lt;br /&gt;46. Can an anonymous class be declared as implementing an interface and extending a class?&lt;br /&gt;An anonymous class may implement an interface or extend a superclass, but may not be declared to do both.&lt;br /&gt;&lt;br /&gt;47. What is the range of the short type?&lt;br /&gt;The range of the short type is -(2^15) to 2^15 - 1.&lt;br /&gt;&lt;br /&gt;48. What is the range of the char type?&lt;br /&gt;The range of the char type is 0 to 2^16 - 1.&lt;br /&gt;&lt;br /&gt;49. In which package are most of the AWT events that support the event-delegation&lt;br /&gt;model defined?&lt;br /&gt;Most of the AWT-related events of the event-delegation model are defined in the java.awt.event package. The AWTEvent class is defined in the java.awt package.&lt;br /&gt;&lt;br /&gt;50. What is the immediate superclass of Menu?&lt;br /&gt;MenuItem&lt;br /&gt;&lt;br /&gt;CLICK HERE FOR PART 2 Questions&lt;br /&gt;http://www.careerenclave.com/info/index.php?topic=443.0&lt;br /&gt;&lt;br /&gt;CORE JAVA Interview Questions - Part 2&lt;br /&gt;&lt;br /&gt;51. What is the purpose of finalization?&lt;br /&gt;The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected.&lt;br /&gt;&lt;br /&gt;52. Which class is the immediate superclass of the MenuComponent class.&lt;br /&gt;Object&lt;br /&gt;&lt;br /&gt;53. What invokes a thread&#39;s run() method?&lt;br /&gt;After a thread is started, via its start() method or that of the Thread class, the JVM invokes the thread&#39;s run() method when the thread is initially executed.&lt;br /&gt;&lt;br /&gt;54. What is the difference between the Boolean &amp; operator and the &amp;&amp; operator?&lt;br /&gt;If an expression involving the Boolean &amp; operator is evaluated, both operands are evaluated. Then the &amp; operator is applied to the operand. When an expression involving the &amp;&amp; operator is evaluated, the first operand is evaluated. If the first operand returns a value of true then the second operand is evaluated. The &amp;&amp; operator is then applied to the first and second operands. If the first operand evaluates to false, the evaluation of the second operand is skipped.&lt;br /&gt;&lt;br /&gt;55. Name three subclasses of the Component class.&lt;br /&gt;Box.Filler, Button, Canvas, Checkbox, Choice, Container, Label, List, Scrollbar, or TextComponent&lt;br /&gt;&lt;br /&gt;56. What is the GregorianCalendar class?&lt;br /&gt;The GregorianCalendar provides support for traditional Western calendars.&lt;br /&gt;&lt;br /&gt;57. Which Container method is used to cause a container to be laid out and redisplayed?&lt;br /&gt;validate()&lt;br /&gt;&lt;br /&gt;58. What is the purpose of the Runtime class?&lt;br /&gt;The purpose of the Runtime class is to provide access to the Java runtime system.&lt;br /&gt;&lt;br /&gt;59. How many times may an object&#39;s finalize() method be invoked by the&lt;br /&gt;garbage collector?&lt;br /&gt;An object&#39;s finalize() method may only be invoked once by the garbage collector.&lt;br /&gt;&lt;br /&gt;60. What is the purpose of the finally clause of a try-catch-finally statement?&lt;br /&gt;The finally clause is used to provide the capability to execute code no matter whether or not an exception is thrown or caught.&lt;br /&gt;&lt;br /&gt;61. What is the argument type of a program&#39;s main() method?&lt;br /&gt;A program&#39;s main() method takes an argument of the String[] type.&lt;br /&gt;&lt;br /&gt;62. Which Java operator is right associative?&lt;br /&gt;The = operator is right associative.&lt;br /&gt;&lt;br /&gt;63. What is the Locale class?&lt;br /&gt;The Locale class is used to tailor program output to the conventions of a particular geographic, political, or cultural region.&lt;br /&gt;&lt;br /&gt;64. Can a double value be cast to a byte?&lt;br /&gt;Yes, a double value can be cast to a byte.&lt;br /&gt;&lt;br /&gt;65. What is the difference between a break statement and a continue statement?&lt;br /&gt;A break statement results in the termination of the statement to which it applies (switch, for, do, or while). A continue statement is used to end the current loop iteration and return control to the loop statement.&lt;br /&gt;&lt;br /&gt;66. What must a class do to implement an interface?&lt;br /&gt;It must provide all of the methods in the interface and identify the interface in its implements clause.&lt;br /&gt;&lt;br /&gt;67. What method is invoked to cause an object to begin executing as a separate thread?&lt;br /&gt;The start() method of the Thread class is invoked to cause an object to begin executing as a separate thread.&lt;br /&gt;&lt;br /&gt;68. Name two subclasses of the TextComponent class.&lt;br /&gt;TextField and TextArea&lt;br /&gt;&lt;br /&gt;69. What is the advantage of the event-delegation model over the earlier event-inheritance model?&lt;br /&gt;The event-delegation model has two advantages over the event-inheritance model. First, it enables event handling to be handled by objects other than the ones that generate the events (or their containers). This allows a clean separation between a component&#39;s design and its use. The other advantage of the event-delegation model is that it performs much better in applications where many events are generated. This performance improvement is due to the fact that the event-delegation model does not have to repeatedly process unhandled events, as is the case of the event-inheritance model.&lt;br /&gt;&lt;br /&gt;70. Which containers may have a MenuBar?&lt;br /&gt;Frame&lt;br /&gt;&lt;br /&gt;71. How are commas used in the intialization and iteration  parts of a for statement?&lt;br /&gt;Commas are used to separate multiple statements within the initialization and iteration parts of a for statement.&lt;br /&gt;&lt;br /&gt;72. What is the purpose of the wait(), notify(), and notifyAll() methods?&lt;br /&gt;The wait(),notify(), and notifyAll() methods are used to provide an efficient way for threads to wait for a shared resource. When a thread executes an object&#39;s wait() method, it enters the waiting state. It only enters the ready state after another thread invokes the object&#39;s notify() or notifyAll() methods..&lt;br /&gt;&lt;br /&gt;73. What is an abstract method?&lt;br /&gt;An abstract method is a method whose implementation is deferred to a subclass.&lt;br /&gt;&lt;br /&gt;74. How are Java source code files named?&lt;br /&gt;A Java source code file takes the name of a public class or interface that is defined within the file. A source code file may contain at most one public class or interface. If a public class or interface is defined within a source code file, then the source code file must take the name of the public class or interface. If no public class or interface is defined within a source code file, then the file must take on a name that is different than its classes and interfaces. Source code files use the .java extension.&lt;br /&gt;&lt;br /&gt;75. What is the relationship between the Canvas class and the Graphics class?&lt;br /&gt;A Canvas object provides access to a Graphics object via its paint() method.&lt;br /&gt;&lt;br /&gt;76. What are the high-level thread states?&lt;br /&gt;The high-level thread states are ready, running, waiting, and dead.&lt;br /&gt;&lt;br /&gt;77. What value does read() return when it has reached the end of a file?&lt;br /&gt;The read() method returns -1 when it has reached the end of a file.&lt;br /&gt;&lt;br /&gt;78. Can a Byte object be cast to a double value?&lt;br /&gt;No, an object cannot be cast to a primitive value.&lt;br /&gt;&lt;br /&gt;79. What is the difference between a static and a non-static inner class?&lt;br /&gt;A non-static inner class may have object instances that are associated with instances of the class&#39;s outer class. A static inner class does not have any object instances&lt;br /&gt;&lt;br /&gt;80. What is the difference between the String and StringBuffer classes?&lt;br /&gt;String objects are constants. StringBuffer objects are not.&lt;br /&gt;&lt;br /&gt;81. If a variable is declared as private, where may the variable be accessed?&lt;br /&gt;A private variable may only be accessed within the class in which it is declared.&lt;br /&gt;&lt;br /&gt;82. What is an object&#39;s lock and which object&#39;s have locks?&lt;br /&gt;An object&#39;s lock is a mechanism that is used by multiple threads to obtain synchronized access to the object. A thread may execute a synchronized method of an object only after it has acquired the object&#39;s lock. All objects and classes have locks. A class&#39;s lock is acquired on the class&#39;s Class object.&lt;br /&gt;&lt;br /&gt;83. What is the Dictionary class?&lt;br /&gt;The Dictionary class provides the capability to store key-value pairs.&lt;br /&gt;&lt;br /&gt;84. How are the elements of a BorderLayout organized?&lt;br /&gt;The elements of a BorderLayout are organized at the borders (North, South, East, and West) and the center of a container.&lt;br /&gt;&lt;br /&gt;85. What is the % operator?&lt;br /&gt;It is referred to as the modulo or remainder operator. It returns the remainder of dividing the first operand by the second operand.&lt;br /&gt;&lt;br /&gt;86. When can an object reference be cast to an interface reference?&lt;br /&gt;An object reference be cast to an interface reference when the object implements the referenced interface.&lt;br /&gt;&lt;br /&gt;87. What is the difference between a Window and a Frame?&lt;br /&gt;The Frame class extends Window to define a main application window that can have a menu bar.&lt;br /&gt;&lt;br /&gt;88. Which class is extended by all other classes?&lt;br /&gt;The Object class is extended by all other classes.&lt;br /&gt;&lt;br /&gt;89. Can an object be garbage collected while it is still reachable?&lt;br /&gt;A reachable object cannot be garbage collected. Only unreachable objects may be garbage collected..&lt;br /&gt;&lt;br /&gt;90. Is the ternary operator written x : y ? z or x ? y : z ?&lt;br /&gt;It is written x ? y : z.&lt;br /&gt;&lt;br /&gt;91. What is the difference between the Font and FontMetrics classes?&lt;br /&gt;The FontMetrics class is used to define implementation-specific properties, such as ascent and descent, of a Font object.&lt;br /&gt;&lt;br /&gt;92. How is rounding performed under integer division?&lt;br /&gt;The fractional part of the result is truncated. This is known as rounding toward zero.&lt;br /&gt;&lt;br /&gt;93. What happens when a thread cannot acquire a lock on an object?&lt;br /&gt;If a thread attempts to execute a synchronized method or synchronized statement and is unable to acquire an object&#39;s lock, it enters the waiting state until the lock becomes available.&lt;br /&gt;&lt;br /&gt;94. What is the difference between the Reader/Writer class hierarchy and the&lt;br /&gt;InputStream/OutputStream class hierarchy?&lt;br /&gt;The Reader/Writer class hierarchy is character-oriented, and the InputStream/OutputStream class hierarchy is byte-oriented.&lt;br /&gt;&lt;br /&gt;95. What classes of exceptions may be caught by a catch clause?&lt;br /&gt;A catch clause can catch any exception that may be assigned to the Throwable type. This includes the Error and Exception types.&lt;br /&gt;&lt;br /&gt;96. If a class is declared without any access modifiers, where may the class be accessed?&lt;br /&gt;A class that is declared without any access modifiers is said to have package access. This means that the class can only be accessed by other classes and interfaces that are defined within the same package.&lt;br /&gt;&lt;br /&gt;97. What is the SimpleTimeZone class?&lt;br /&gt;The SimpleTimeZone class provides support for a Gregorian calendar.&lt;br /&gt;&lt;br /&gt;98. What is the Map interface?&lt;br /&gt;The Map interface replaces the JDK 1.1 Dictionary class and is used associate keys with values.&lt;br /&gt;&lt;br /&gt;99. Does a class inherit the constructors of its superclass?&lt;br /&gt;A class does not inherit constructors from any of its superclasses.&lt;br /&gt;&lt;br /&gt;100. For which statements does it make sense to use a label?&lt;br /&gt;The only statements for which it makes sense to use a label are those statements that can enclose a break or continue statement.</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/7873927471717723566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/7873927471717723566' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/7873927471717723566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/7873927471717723566'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2007/05/core-java-part-i.html' title='Core Java-Part - I'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-1253644019974666235</id><published>2007-04-09T00:42:00.000-07:00</published><updated>2007-09-14T03:09:41.823-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java Interview Questions"/><title type='text'>Core Java Interview Questions</title><content type='html'>&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: rgb(255, 0, 0);font-size:180%;&quot; &gt;Core Java Interview Questions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Question:&lt;/b&gt; What is transient variable?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; Transient variable can&#39;t be serialize. For example if a     variable is declared as transient in a Serializable class and the class is     written to an ObjectStream, the value of the variable can&#39;t be written to     the stream instead when the class is retrieved from the ObjectStream the     value of the variable becomes &lt;b&gt;null&lt;/b&gt;.&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; Name the containers which uses     Border Layout as their default layout?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; Containers which uses Border Layout as their default are:     window, Frame and Dialog classes.&lt;br /&gt;        &lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What do you understand by     Synchronization?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; Synchronization is a process of controlling the access of     shared resources by the multiple threads in such a manner that only one     thread can access one resource at a time. In non synchronized multithreaded     application, it is possible for one thread to modify a shared object while     another thread is in the process of using or updating the object&#39;s value.     Synchronization prevents such type of data corruption.&lt;br /&gt;    &lt;b&gt;E.g. Synchronizing a function:&lt;/b&gt;&lt;br /&gt;    public synchronized void Method1 () {&lt;br /&gt;         // Appropriate method-related code.&lt;br /&gt;    }&lt;br /&gt;    &lt;b&gt;E.g. Synchronizing a block of code inside a function:&lt;br /&gt;    &lt;/b&gt;public myFunction (){&lt;br /&gt;        synchronized (this) {&lt;br /&gt;                //     Synchronized code here.&lt;br /&gt;             }&lt;br /&gt;    }&lt;br /&gt;      &lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What is Collection API?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; The Collection API is a set of classes and interfaces that     support operation on collections of objects. These classes and interfaces     are more flexible, more powerful, and more regular than the vectors, arrays,     and hashtables if effectively replaces.&lt;br /&gt;    &lt;b&gt;Example of classes&lt;/b&gt;: &lt;code&gt;HashSet&lt;/code&gt;, &lt;code&gt;HashMap&lt;/code&gt;, &lt;code&gt;ArrayList&lt;/code&gt;,     &lt;code&gt;LinkedList&lt;/code&gt;, &lt;code&gt;TreeSet&lt;/code&gt; and &lt;code&gt;TreeMap&lt;/code&gt;.&lt;br /&gt;    &lt;b&gt;Example of interfaces&lt;/b&gt;: &lt;code&gt;Collection&lt;/code&gt;, &lt;code&gt;Set&lt;/code&gt;, &lt;code&gt;List&lt;/code&gt;     and &lt;code&gt;Map.&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; Is Iterator a Class or Interface?     What is its use?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; Iterator is an interface which is used to step through the     elements of a Collection.&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What is similarities/difference     between an Abstract class and Interface?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  Differences are as follows:&lt;/span&gt;     &lt;/p&gt; &lt;ul type=&quot;disc&quot;&gt;&lt;li&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Interfaces provide a form of multiple         inheritance. A class can extend only one other class.&lt;/span&gt;       &lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Interfaces are limited to public methods and         constants with no implementation. Abstract classes can have a partial         implementation, protected parts, static methods, etc.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color:#000000;&quot;&gt;A Class may implement several interfaces. But in         case of abstract class, a class may extend only one abstract class.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Interfaces are slow as it requires extra         indirection to to find corresponding method in in the actual class.         Abstract classes are fast. &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;       &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Similarities:&lt;/span&gt;     &lt;/p&gt; &lt;ul type=&quot;disc&quot;&gt;&lt;li&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Neither Abstract classes or Interface can be         instantiated.&lt;br /&gt;          &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; How to define an Abstract class?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; A class containing abstract method is called Abstract class.     An Abstract class can&#39;t be instantiated.&lt;br /&gt;    Example of Abstract class:&lt;br /&gt;    abstract class testAbstractClass {&lt;br /&gt;        protected String myString;&lt;br /&gt;        public String getMyString() {&lt;br /&gt;            return myString;&lt;br /&gt;            }&lt;br /&gt;        public abstract string anyAbstractFunction();&lt;br /&gt;    }&lt;br /&gt;         &lt;/span&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; How to define an Interface?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; In Java Interface defines the methods but does not implement     them. Interface can include constants. A class that implements the     interfaces is bound to implement all the methods defined in Interface.&lt;br /&gt;    Emaple of Interface:&lt;br /&gt;   &lt;br /&gt;    public interface sampleInterface {&lt;br /&gt;        public void functionOne();&lt;br /&gt;   &lt;br /&gt;        public long CONSTANT_ONE = 1000;&lt;br /&gt;    }&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; Explain the user defined     Exceptions?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; User defined Exceptions are the separate Exception classes     defined by the user for specific purposed. An user defined can created by     simply sub-classing it to the Exception class. This allows custom exceptions     to be generated (using throw) and caught in the same way as normal     exceptions.&lt;br /&gt;    Example:&lt;br /&gt;    class myCustomException extends Exception {&lt;br /&gt;         // The class simply has to exist to be an exception    &lt;br /&gt;    }&lt;br /&gt;      &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; Explain the new Features of JDBC     2.0 Core API?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; The JDBC 2.0 API includes the complete JDBC API, which     includes both core and Optional Package API, and provides inductrial-strength     database computing capabilities.&lt;br /&gt;    New Features in JDBC 2.0 Core API:&lt;br /&gt;    &lt;/span&gt;       &lt;/p&gt; &lt;ul type=&quot;disc&quot;&gt;&lt;li&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Scrollable result sets- using new methods in the         ResultSet interface allows programmatically move the to particular row         or to a position relative to its current position&lt;/span&gt;       &lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color:#000000;&quot;&gt;JDBC 2.0 Core API provides the Batch Updates functionality         to the java applications.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Java applications can now use the         ResultSet.updateXXX methods.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color:#000000;&quot;&gt;New data types - interfaces mapping the SQL3         data types&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Custom  mapping of user-defined types (UTDs)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Miscellaneous features, including performance         hints, the use of character streams, full precision for         java.math.BigDecimal values, additional security, and support for time         zones in date, time, and timestamp values. &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;          &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;    &lt;/span&gt;    &lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt;  Explain garbage collection?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  Garbage collection is one of the most important feature of     Java. Garbage collection is also called automatic memory management as JVM automatically     removes the unused variables/objects (value is null) from the memory. User     program cann&#39;t directly free the object from memory, instead it is the job     of the garbage collector to automatically free the objects that are no     longer referenced by a program. Every class inherits &lt;b&gt;finalize()&lt;/b&gt;     method from &lt;b&gt;java.lang.Object&lt;/b&gt;, the finalize() method is called by     garbage collector when it determines no more references to the object     exists. In Java, it is good idea to explicitly assign &lt;b&gt;null&lt;/b&gt; into a     variable when no more in use. I Java on calling &lt;b&gt;System.gc()&lt;/b&gt; and &lt;b&gt;Runtime.gc(), &lt;/b&gt;     JVM tries to recycle the unused objects, but there is no guarantee when all     the objects will garbage collected.&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt;  How you can force the garbage     collection?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  Garbage collection automatic process and can&#39;t be forced.  &lt;br /&gt;     &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt;  What is OOPS?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  OOP is the common abbreviation for Object-Oriented Programming.  &lt;br /&gt; &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt;  Describe the principles of OOPS.&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  There are three main principals of oops which are called Polymorphism, Inheritance and Encapsulation.  &lt;br /&gt; &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt;  Explain the Encapsulation principle.&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; Encapsulation is a process of binding or wrapping the data and the codes that operates on the data into a single entity. This keeps the data safe from outside interface and misuse. One way to think about encapsulation is as a protective wrapper that prevents code and data from being arbitrarily accessed by other code defined outside the wrapper. &lt;br /&gt;   &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt;  Explain the Inheritance principle.&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  Inheritance is the process by which one object acquires the properties of another object.  &lt;br /&gt;   &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt;  Explain the Polymorphism principle.&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; The meaning of Polymorphism is something like one name many forms. Polymorphism enables one entity to be used as as general category for different types of actions. The specific action is determined by the exact nature of the situation. The concept of polymorphism can be explained as &quot;one interface, multiple methods&quot;. &lt;br /&gt;   &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt;  Explain the different forms of Polymorphism.&lt;br /&gt; &lt;b&gt;Answer:&lt;/b&gt;    From a practical programming viewpoint, polymorphism exists in three distinct forms in Java:   &lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;span style=&quot;color:#000000;&quot;&gt;    &lt;li&gt;Method overloading     &lt;/li&gt;&lt;li&gt;Method overriding through inheritance     &lt;/li&gt;&lt;li&gt;Method overriding through the Java interface&lt;/li&gt;   &lt;/span&gt;&lt;/ul&gt;  &lt;span style=&quot;color:#000000;&quot;&gt; &lt;br /&gt;   &lt;/span&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt;  What are Access Specifiers available in Java?&lt;br /&gt; &lt;b&gt;Answer:&lt;/b&gt;    Access specifiers are keywords that determines the type of access to the member of a class. These are:   &lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;span style=&quot;color:#000000;&quot;&gt;    &lt;li&gt;Public&lt;/li&gt;     &lt;li&gt;Protected&lt;/li&gt;     &lt;li&gt;Private&lt;/li&gt;     &lt;li&gt;Defaults&lt;/li&gt;   &lt;/span&gt;&lt;/ul&gt;  &lt;span style=&quot;color:#000000;&quot;&gt; &lt;br /&gt;   &lt;/span&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt;  Describe the wrapper classes in Java.&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; Wrapper class is wrapper around a primitive data type. An instance of a wrapper class contains, or wraps, a primitive value of the corresponding type.&lt;br /&gt;  &lt;p align=&quot;left&quot;&gt;Following table lists the primitive types and the corresponding   wrapper classes:&lt;/p&gt;     &lt;table bg border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; width=&quot;43%&quot; style=&quot;color:#ffffcc;&quot;&gt;    &lt;tbody&gt;      &lt;tr align=&quot;center&quot; valign=&quot;center&quot;&gt;     &lt;td bg width=&quot;13%&quot; style=&quot;color:#ffff99;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Primitive&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align=&quot;center&quot; bg width=&quot;23%&quot; style=&quot;color:#ffff99;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Wrapper&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;      &lt;tr align=&quot;center&quot; valign=&quot;center&quot;&gt;     &lt;td width=&quot;13%&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;boolean&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align=&quot;left&quot; width=&quot;23%&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;  java.lang.Boolean&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;      &lt;tr align=&quot;center&quot; valign=&quot;center&quot;&gt;     &lt;td width=&quot;13%&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;byte&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align=&quot;left&quot; width=&quot;23%&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;  java.lang.Byte&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;      &lt;tr align=&quot;center&quot; valign=&quot;center&quot;&gt;     &lt;td width=&quot;13%&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;char&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align=&quot;left&quot; width=&quot;23%&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;  java.lang.Character&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;      &lt;tr align=&quot;center&quot; valign=&quot;center&quot;&gt;     &lt;td width=&quot;13%&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;double&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align=&quot;left&quot; width=&quot;23%&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;  java.lang.Double&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;      &lt;tr align=&quot;center&quot; valign=&quot;center&quot;&gt;     &lt;td width=&quot;13%&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;float&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align=&quot;left&quot; width=&quot;23%&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;  java.lang.Float&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;      &lt;tr align=&quot;center&quot; valign=&quot;center&quot;&gt;     &lt;td width=&quot;13%&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;int&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align=&quot;left&quot; width=&quot;23%&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;  java.lang.Integer&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;      &lt;tr align=&quot;center&quot; valign=&quot;center&quot;&gt;     &lt;td width=&quot;13%&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;long&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align=&quot;left&quot; width=&quot;23%&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;  java.lang.Long&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;      &lt;tr align=&quot;center&quot; valign=&quot;center&quot;&gt;     &lt;td width=&quot;13%&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;short&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align=&quot;left&quot; width=&quot;23%&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;  java.lang.Short&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;      &lt;tr align=&quot;center&quot; valign=&quot;center&quot;&gt;     &lt;td width=&quot;13%&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;void&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align=&quot;left&quot; width=&quot;23%&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;  java.lang.Void&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;    &lt;/tbody&gt;     &lt;/table&gt;    &lt;br /&gt;   &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt;  Read the following program:&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;public class test {&lt;br /&gt; public static void main(String [] args) {&lt;br /&gt;    int x = 3;&lt;br /&gt;    int y = 1;&lt;br /&gt;   if (x = y)&lt;br /&gt;     System.out.println(&quot;Not equal&quot;);&lt;br /&gt;  else&lt;br /&gt;    System.out.println(&quot;Equal&quot;);&lt;br /&gt; }&lt;br /&gt; }&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;What is the result?&lt;br /&gt;   A. The output is “Equal”&lt;br /&gt;   B. The output in “Not Equal”&lt;br /&gt;   C. An error at &quot;  if (x = y)&quot; causes compilation to fall.&lt;br /&gt;   D. The program executes but no output is show on console.&lt;br /&gt;  &lt;b&gt;Answer: C&lt;br /&gt;   &lt;br /&gt;    Question:&lt;/b&gt;&lt;b&gt; &lt;/b&gt;what is the class variables ?&lt;br /&gt;&lt;b&gt;Answer: &lt;/b&gt;When we create a number of objects of the same class, then each object will share a common copy of variables. That means that there is only one copy per class, no matter how many objects are created from it. Class variables or static variables are declared with the static keyword in a class, but mind it that it should be declared outside outside a class. These variables are stored in static memory. Class variables are mostly used for constants, variable that never change its initial value. Static variables are always called by the class name. This variable is created when the program starts i.e. it is created before the instance is created of class by using new operator and gets destroyed when the programs stops. The scope of the class variable is same a instance variable. The class variable can be defined anywhere at class level with the keyword static. It initial value is same as instance variable. When the class variable is defined as int then it&#39;s initial value is by default zero, when declared boolean its default value is false and null for object references. Class variables are associated with the class, rather than with any object.  &lt;/span&gt;&lt;/p&gt; &lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What is the difference between the instanceof and getclass, these two are same or not ?&lt;br /&gt;&lt;b&gt;Answer: &lt;/b&gt;instanceof is a operator, not a function while getClass is a method of java.lang.Object class. Consider a condition where we use&lt;br /&gt;if(o.getClass().getName().equals(&quot;java.lang.Math&quot;)){  }&lt;br /&gt;This method only checks if the classname we have passed is equal to java.lang.Math. The class java.lang.Math is loaded by the bootstrap ClassLoader. This class is an abstract class.This class loader is responsible for loading classes. Every Class object contains a reference to the ClassLoader that defines. getClass() method returns the runtime class of an object. It fetches the java instance of the given fully qualified type name. The code we have written is not necessary, because we should not compare getClass.getName(). The reason behind it is that if the two different class loaders load the same class but for the JVM, it will consider both classes as different classes so, we can&#39;t compare their names. It can only gives the implementing class but can&#39;t compare a interface, but instanceof operator can.&lt;br /&gt;The instanceof operator compares an object to a specified type. We can use it to test if an object is an instance of a class, an instance of a subclass, or an instance of a class that implements a particular interface. We should try to use instanceof operator in place of getClass() method. Remember instanceof opeator and getClass are not same. Try this example, it will help you to better understand the difference between the two.&lt;br /&gt;Interface one{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Class Two implements one {&lt;br /&gt;}&lt;br /&gt;Class Three implements one {&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class Test {&lt;br /&gt;public static void main(String args[]) {&lt;br /&gt;one test1 = new Two();&lt;br /&gt;one test2 = new Three();&lt;br /&gt;System.out.println(test1 instanceof one); //true&lt;br /&gt;System.out.println(test2 instanceof one); //true&lt;br /&gt;System.out.println(Test.getClass().equals(test2.getClass()));   //false&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;h1 align=&quot;left&quot;&gt;Jakarta Struts Interview Questions&lt;/h1&gt;&lt;br /&gt;&lt;p align=&quot;center&quot;&gt;           &lt;span style=&quot;color:#000000;&quot;&gt;           &lt;a href=&quot;http://www.roseindia.net/interviewquestions/corejava.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/previous.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;                    &lt;a href=&quot;http://www.roseindia.net/interviewquestions/index.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/bt_home.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;                    &lt;a href=&quot;http://www.roseindia.net/interviewquestions/strutsinterviewquestions.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/next.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Q: What is Jakarta Struts Framework?&lt;br /&gt;    A: &lt;/b&gt;Jakarta Struts is open source implementation of MVC     (Model-View-Controller) pattern for the development of web based     applications. Jakarta Struts is robust architecture and can be used for the     development of application of any size. Struts framework makes it much     easier to design scalable, reliable Web applications with Java.&lt;br /&gt;       &lt;/span&gt;  &lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Q: What is ActionServlet?&lt;br /&gt;    A: &lt;/b&gt;The class &lt;i&gt;org.apache.struts.action.ActionServlet &lt;/i&gt;is the called     the ActionServlet. In the the Jakarta Struts Framework this class plays the     role of controller. All the requests to the server goes through the     controller. Controller is responsible for handling all the requests.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Q: How you will make available any Message     Resources Definitions file to the Struts Framework Environment?&lt;br /&gt;    A: &lt;/b&gt;Message Resources Definitions file are simple .properties files and     these files contains the messages that can be used in the struts project. Message     Resources Definitions files can be added to the struts-config.xml file     through &lt;b&gt;&lt;message-resources&gt;&lt;/b&gt;     tag.&lt;br /&gt;    &lt;b&gt;Example:&lt;/b&gt;&lt;br /&gt;    &lt;message-resources parameter=&quot;MessageResources&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Q: What is Action Class?&lt;br /&gt;    A: &lt;/b&gt;The Action is part of the controller. The purpose of Action Class is to translate the HttpServletRequest to the business logic. To use the Action, we need to  Subclass and overwrite the execute()  method. The ActionServlet (commad) passes the parameterized class to Action Form using the execute() method. There should be no database interactions in the action. The action should receive the request, call business objects (which then handle database, or interface with J2EE, etc) and then determine where to go next. Even better, the business objects could be handed to the action at runtime (IoC style) thus removing any dependencies on the model.   The return type of the execute method is ActionForward which is used by the Struts Framework to forward the request to the file as per the value of the returned ActionForward object.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Q: Write code of any Action Class?&lt;br /&gt;    A: &lt;/b&gt;Here is the code of Action Class that returns the &lt;i&gt;ActionForward&lt;/i&gt; object.&lt;br /&gt;    &lt;b&gt;TestAction.java&lt;/b&gt;     &lt;/span&gt;   &lt;table bg border=&quot;1&quot; cellspacing=&quot;1&quot; width=&quot;554&quot; style=&quot;color:#ffff99;&quot;&gt;     &lt;tbody&gt;       &lt;tr&gt;         &lt;td width=&quot;544&quot;&gt;                    &lt;div class=&quot;java&quot; align=&quot;left&quot;&gt; &lt;table bg border=&quot;0&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; width=&quot;544&quot; style=&quot;color:#ffff99;&quot;&gt;    &lt;tbody&gt;&lt;tr&gt;   &lt;!-- start source code --&gt;    &lt;td align=&quot;left&quot; nowrap=&quot;nowrap&quot; valign=&quot;top&quot;&gt;     &lt;code&gt; &lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;package &lt;/b&gt;roseindia.net;&lt;br /&gt;&lt;br /&gt; &lt;b&gt;import &lt;/b&gt;javax.servlet.http.HttpServletRequest;&lt;br /&gt; &lt;b&gt;import &lt;/b&gt;javax.servlet.http.HttpServletResponse;&lt;br /&gt;&lt;br /&gt; &lt;b&gt;import &lt;/b&gt;org.apache.struts.action.Action;&lt;br /&gt; &lt;b&gt;import &lt;/b&gt;org.apache.struts.action.ActionForm;&lt;br /&gt; &lt;b&gt;import &lt;/b&gt;org.apache.struts.action.ActionForward;&lt;br /&gt; &lt;b&gt;import &lt;/b&gt;org.apache.struts.action.ActionMapping;&lt;br /&gt;&lt;br /&gt; &lt;b&gt;public class &lt;/b&gt;TestAction &lt;b&gt;extends &lt;/b&gt;Action&lt;br /&gt; {&lt;br /&gt;   &lt;b&gt;public &lt;/b&gt;ActionForward execute(&lt;br /&gt;     ActionMapping mapping,&lt;br /&gt;     ActionForm form,&lt;br /&gt;     HttpServletRequest request,&lt;br /&gt;     HttpServletResponse response) &lt;b&gt;throws &lt;/b&gt;Exception{&lt;br /&gt;       &lt;b&gt;return &lt;/b&gt;mapping.findForward(&quot;testAction&quot;);&lt;br /&gt;   }&lt;br /&gt; }&lt;/span&gt;&lt;/code&gt;         &lt;/td&gt;     &lt;/tr&gt;  &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt; &lt;!-- =       END of automatically generated HTML code       = --&gt; &lt;!-- ======================================================== --&gt;      &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Q: What is ActionForm?&lt;br /&gt;    A: &lt;/b&gt;An ActionForm is a JavaBean that extends &lt;code&gt;org.apache.struts.action.ActionForm&lt;/code&gt;.     ActionForm maintains the session state for web application and the     ActionForm object is automatically populated on the server side with data     entered from a form on the client side.&lt;br /&gt;       &lt;/span&gt;  &lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Q: What is Struts Validator Framework?&lt;br /&gt;    A: &lt;/b&gt;Struts Framework provides the functionality to validate the form data. It can be use to validate the data on the users browser as well as on the server side. Struts Framework emits the java scripts and it can be used validate the form data on the client browser. Server side validation of form can be accomplished by sub classing your From Bean with &lt;b&gt;DynaValidatorForm&lt;/b&gt; class. &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;The Validator framework was developed by David Winterfeldt as third-party add-on to Struts. Now the Validator framework is a part of Jakarta Commons project and it can be used with or without Struts. The Validator framework comes integrated with the Struts Framework and can be used without doing any extra settings.&lt;br /&gt;   &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Q. Give the Details of XML files used in Validator Framework?&lt;br /&gt;A: &lt;/b&gt;The Validator Framework uses two XML configuration files &lt;b&gt;validator-rules.xml&lt;/b&gt; and &lt;b&gt;validation.xml&lt;/b&gt;. The &lt;b&gt;validator-rules.xml&lt;/b&gt; defines the standard validation routines, these are reusable and used in &lt;b&gt;validation.xml&lt;/b&gt;. to define the form specific validations. The &lt;b&gt;validation.xml&lt;/b&gt; defines the validations applied to a form bean.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Q. How you will display validation fail errors on jsp page?&lt;br /&gt;A: &lt;/b&gt;Following tag displays all the errors:&lt;br /&gt;&lt;html:errors/&gt;&lt;br /&gt;  &lt;/span&gt;&lt;/p&gt; &lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Q. How you will enable front-end validation based on the xml in validation.xml?&lt;br /&gt;A: &lt;/b&gt;The &lt;html:javascript&gt; tag to allow front-end validation based on the xml in validation.xml. For  example the code: &lt;html:javascript formname=&quot;logonForm&quot; dynamicjavascript=&quot;true&quot; staticjavascript=&quot;true&quot;&gt; generates the client side java script for the form &quot;logonForm&quot; as defined in the validation.xml file. The &lt;html:javascript&gt; when added in the jsp file generates the client site validation script.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;h1 align=&quot;left&quot;&gt;Struts Interview Questions&lt;/h1&gt;&lt;br /&gt;&lt;p align=&quot;center&quot;&gt;           &lt;span style=&quot;color:#000000;&quot;&gt;           &lt;a href=&quot;http://www.roseindia.net/interviewquestions/jakartastrutsinterviewquestions.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/previous.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;                    &lt;a href=&quot;http://www.roseindia.net/interviewquestions/index.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/bt_home.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;                    &lt;a href=&quot;http://www.roseindia.net/interviewquestions/struts-interviewquestion-1.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/next.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;&lt;br /&gt;Question: What is RequestProcessor and RequestDispatcher?&lt;br /&gt;    Answer:&lt;/b&gt;  The controller is responsible for intercepting and translating user input into actions to be performed by the model. The controller is responsible for selecting the next view based on user input and the outcome of model operations. The Controller receives the request from the browser, invoke a business operation and coordinating the view to return to the client.&lt;br /&gt;   &lt;br /&gt;The controller is implemented by a java servlet, this servlet is centralized point of control for the web application. In struts framework the controller responsibilities are implemented by several different components like&lt;br /&gt;    &lt;b&gt;The ActionServlet Class&lt;br /&gt;    The RequestProcessor Class&lt;br /&gt;    The Action Class&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;     The ActionServlet extends the&lt;b&gt; javax.servlet.http.httpServlet&lt;/b&gt; class. The ActionServlet class is not abstract and therefore can be used as a concrete controller by your application.&lt;br /&gt;The controller is implemented by the ActionServlet class. All incoming requests are mapped to the central controller in the deployment descriptor as follows.&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&lt;servlet&gt;&lt;br /&gt;                &lt;servlet-name&gt;action&lt;/servlet-name&gt;&lt;br /&gt;                &lt;servlet-class&gt;org.apache.struts.action.ActionServlet&lt;/servlet-class&gt;&lt;br /&gt;    &lt;/servlet&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    All request URIs with the pattern *.do are mapped to this servlet in the deployment descriptor as follows.&lt;br /&gt;   &lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&lt;servlet-mapping&gt;&lt;br /&gt;   &lt;servlet-name&gt;action&lt;/servlet-name&gt;&lt;br /&gt;            &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;&lt;br /&gt;            &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;    A request URI that matches this pattern will have the following form.&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;http://www.my_site_name.com/mycontext/actionName.do&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;   &lt;br /&gt;The preceding mapping is called extension mapping, however, you can also specify path mapping where a pattern ends with /* as shown below.&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&lt;servlet-mapping&gt;&lt;br /&gt;        &lt;servlet-name&gt;action&lt;/servlet-name&gt;&lt;br /&gt;        &lt;url-pattern&gt;/do/*&lt;/url-pattern&gt;&lt;br /&gt;    &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;    A request URI that matches this pattern will have the following form.&lt;br /&gt;    http://www.my_site_name.com/mycontext/do/action_Name&lt;br /&gt;    The class &lt;b&gt; org.apache.struts.action.requestProcessor&lt;/b&gt; process the request from the controller. You can sublass the RequestProcessor with your own version and modify how the request is processed.&lt;br /&gt;   &lt;br /&gt;Once the controller receives a client request, it delegates the handling of the request to a helper class. This helper knows how to execute the business operation associated with the requested action. In the Struts framework this helper class is descended of org.apache.struts.action.Action class. It acts as a bridge between a client-side user action and business operation. The Action class decouples the client request from the business model. This decoupling allows for more than one-to-one mapping between the user request and an action. The Action class also can perform other functions such as authorization, logging before invoking business operation. the Struts Action class contains several methods, but most important method is the execute() method.&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;public ActionForward execute(ActionMapping mapping,&lt;br /&gt;                ActionForm form, HttpServletRequest request, HttpServletResponse response)        throws Exception; &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;The execute() method is called by the controller when a request is received from a client. The controller creates an instance of the Action class if one doesn’t already exist. The strut framework will create only a single instance of each Action class in your application.&lt;br /&gt;   &lt;br /&gt;Action are mapped in the struts configuration file and this configuration is loaded into memory at startup and made available to the framework at runtime. Each Action element is represented in memory by an instance of the org.apache.struts.action.ActionMapping class . The ActionMapping object contains a path attribute that is matched against a portion of the URI of the incoming request.&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&lt;action&gt;&lt;br /&gt;            path= &quot;/somerequest&quot;&lt;br /&gt;            type=&quot;com.somepackage.someAction&quot;&lt;br /&gt;            scope=&quot;request&quot;&lt;br /&gt;            name=&quot;someForm&quot;&lt;br /&gt;            validate=&quot;true&quot;&lt;br /&gt;            input=&quot;somejsp.jsp&quot;&lt;br /&gt;        &lt;forward name=&quot;Success&quot; path=&quot;/action/xys&quot; redirect=&quot;true&quot;&gt;&lt;br /&gt;        &lt;forward name=&quot;Failure&quot; path=&quot;/somejsp.jsp&quot; redirect=&quot;true&quot;&gt;&lt;br /&gt;    &lt;/action&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;Once this is done the controller should determine which view to return to the client. The execute method signature in Action class has a return type org.apache.struts.action.ActionForward class. The ActionForward class represents a destination to which the controller may send control once an action has completed. Instead of specifying an actual JSP page in the code, you can declaratively associate as action forward through out the application. The action forward are specified in the configuration file.&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&lt;action&gt;&lt;br /&gt;            path= &quot;/somerequest&quot;&lt;br /&gt;            type=&quot;com.somepackage.someAction&quot;&lt;br /&gt;            scope=&quot;request&quot;&lt;br /&gt;            name=&quot;someForm&quot;&lt;br /&gt;            validate=&quot;true&quot;&lt;br /&gt;            input=&quot;somejsp.jsp&quot;&lt;br /&gt;        &lt;forward name=&quot;Success&quot; path=&quot;/action/xys&quot; redirect=&quot;true&quot;&gt;&lt;br /&gt;        &lt;forward name=&quot;Failure&quot; path=&quot;/somejsp.jsp&quot; redirect=&quot;true&quot;&gt;&lt;br /&gt;    &lt;/action&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;    The action forward mappings also can be specified in a global section, independent of any specific action mapping.&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&lt;global-forwards&gt;&lt;br /&gt;        &lt;forward name=&quot;Success&quot; path=&quot;/action/somejsp.jsp&quot;&gt;&lt;br /&gt;        &lt;forward name=&quot;Failure&quot; path=&quot;/someotherjsp.jsp&quot;&gt;&lt;br /&gt;    &lt;/global-forwards&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;   &lt;br /&gt;    &lt;b&gt;public interface RequestDispatcher&lt;/b&gt;&lt;br /&gt;   &lt;br /&gt;Defines an object that receives requests from the client and sends them to any resource (such as a servlet, HTML file, or JSP file) on the server. The servlet container creates the RequestDispatcher object, which is used as a wrapper around a server resource located at a particular path or given by a particular name.&lt;br /&gt;This interface is intended to wrap servlets, but a servlet container can create RequestDispatcher objects to wrap any type of resource.&lt;br /&gt;   &lt;br /&gt;    &lt;b&gt;getRequestDispatcher&lt;/b&gt;&lt;br /&gt;   &lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;public RequestDispatcher getRequestDispatcher(java.lang.String path)&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;   &lt;br /&gt;Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path. A RequestDispatcher object can be used to forward a request to the resource or to include the resource in a response. The resource can be dynamic or static.&lt;br /&gt;The pathname must begin with a &quot;/&quot; and is interpreted as relative to the current context root. Use getContext to obtain a RequestDispatcher for resources in foreign contexts. This method returns null if the ServletContext cannot return a RequestDispatcher.&lt;br /&gt;   &lt;br /&gt;    &lt;b&gt;    Parameters:&lt;br /&gt;        path - a String specifying the pathname to the resource&lt;br /&gt;    Returns:&lt;br /&gt;        a RequestDispatcher object that acts as a wrapper for the resource at the specified path&lt;br /&gt;    See Also:&lt;br /&gt;        RequestDispatcher, getContext(java.lang.String)&lt;/b&gt;&lt;br /&gt;   &lt;br /&gt;    getNamedDispatcher&lt;br /&gt;   &lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;public RequestDispatcher getNamedDispatcher(java.lang.String name)&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;   &lt;br /&gt;    Returns a RequestDispatcher object that acts as a wrapper for the named servlet.&lt;br /&gt;Servlets (and JSP pages also) may be given names via server administration or via a web application deployment descriptor. A servlet instance can determine its name using ServletConfig.getServletName().&lt;br /&gt;    This method returns null if the ServletContext cannot return a RequestDispatcher for any reason.&lt;br /&gt;   &lt;br /&gt;    &lt;b&gt;        Parameters:&lt;br /&gt;        name - a String specifying the name of a servlet to wrap&lt;br /&gt;        Returns:&lt;br /&gt;        a RequestDispatcher object that acts as a wrapper for the named servlet&lt;br /&gt;        See Also:&lt;br /&gt;        RequestDispatcher, getContext(java.lang.String), ServletConfig.getServletName()&lt;br /&gt;      &lt;/b&gt;&lt;/span&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question: Why cant we overide create method in StatelessSessionBean?&lt;br /&gt;    Answer:&lt;/b&gt;  &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;From the EJB Spec : - A Session bean&#39;s home interface defines one or morecreate(...) methods. Each create method must be named create and must match one of the ejbCreate methods defined in the enterprise Bean class. The return type of a create method must be the enterprise Bean&#39;s remote interface type. The home interface of a stateless session bean must have one create method that takes no arguments.&lt;br /&gt;      &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question: Is struts threadsafe?Give an example?&lt;br /&gt;    Answer:&lt;/b&gt;  &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Struts is not only thread-safe but thread-dependant. The response to a request is handled by a light-weight Action object, rather than an individual servlet. Struts instantiates each Action class once, and allows other requests to be threaded through the original object. This core strategy conserves resources and provides the best possible throughput. A properly-designed application will exploit this further by routing related operations through a single Action.&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question: Can we Serialize static variable?&lt;br /&gt;    Answer:  &lt;/b&gt;Serialization is the process of converting a set of object         instances that contain references to each other into a linear stream of         bytes, which can then be sent through a socket, stored to a file, or         simply manipulated as a stream of data. Serialization is the mechanism         used by RMI to pass objects between JVMs, either as arguments in a         method invocation from a client to a server or as return values from a         method invocation. In the first section of this book, There are         three exceptions in which serialization doesnot necessarily read and         write to the stream. These are&lt;br /&gt;        1. Serialization ignores static fields, because they are not part of any         particular object&#39;s state.&lt;br /&gt;        2. Base class fields are only handled if the base class itself is     serializable.&lt;br /&gt;        3. Transient fields.         There are four basic things       you must do when you are making a class serializable. They are:&lt;/span&gt;      &lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Implement the Serializable interface.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Make sure that instance-level, locally defined state is serialized         properly.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Make sure that superclass state is serialized properly.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Override equals( )and hashCode(         ).&lt;br /&gt;it is possible to have control over serialization process. The class       should implement Externalizable interface. This interface contains two       methods namely readExternal and writeExternal. You should implement these       methods and write the logic for customizing the serialization process ....         (Source: &lt;a href=&quot;http://www.oreilly.com/catalog/javarmi/chapter/ch10.html&quot;&gt;http://www.oreilly.com/catalog/javarmi/chapter/ch10.html&lt;/a&gt;)&lt;br /&gt;          &lt;/span&gt;                 &lt;/li&gt;&lt;/ol&gt; &lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question: What are the uses of tiles-def.xml file, resourcebundle.properties file, validation.xml file?&lt;br /&gt;    Answer:  &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;tiles-def.xml is is an xml file used to configure tiles with the struts application. You can define the layout / header / footer / body content for your View. See more at &lt;a href=&quot;http://www.roseindia.net/struts/using-tiles-defs-xml.shtml&quot;&gt;http://www.roseindia.net/struts/using-tiles-defs-xml.shtml&lt;/a&gt;.&lt;br /&gt;   &lt;br /&gt;    The &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt; resourcebundle.properties &lt;/b&gt;file is     used to configure the message (error/ other messages) for the struts     applications.&lt;br /&gt;   &lt;br /&gt;    The file validation.xml is used to declare sets of validations that should be applied to Form Beans.     Fpr more information please visit &lt;a href=&quot;http://www.roseindia.net/struts/address_struts_validator.shtml&quot;&gt;http://www.roseindia.net/struts/address_struts_validator.shtml&lt;/a&gt;.&lt;br /&gt;       &lt;/span&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question: What is the difference between     perform() and execute() methods?&lt;br /&gt;    Answer:  &lt;/b&gt;Perform method is the method which was deprecated in the     Struts Version 1.1.  &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;In Struts 1.x, Action.perform() is the method called by the ActionServlet. This is typically where your business logic resides, or at least the flow control to your JavaBeans and EJBs that handle your business logic. As we already mentioned, to support declarative exception handling, the method signature changed in perform. Now execute just throws Exception. Action.perform() is now deprecated; however, the Struts v1.1 ActionServlet is smart enough to know whether or not it should call perform or execute in the Action, depending on which one is available.&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question: What are the various Struts tag libraries?&lt;br /&gt;    Answer:  &lt;/b&gt;Struts is very rich framework and it provides very good     and user friendly way to develop web application forms. Struts provide many     tag libraries to ease the development of web applications. These tag     libraries are:&lt;br /&gt; * Bean tag library - Tags for accessing JavaBeans and their properties.&lt;br /&gt;    * HTML tag library - Tags to output standard HTML, including forms, text     boxes, checkboxes, radio buttons etc..&lt;br /&gt;    * Logic tag library - Tags for generating conditional output, iteration capabilities and flow management&lt;br /&gt;    * Tiles or Template tag library - For the application using tiles&lt;br /&gt;    * Nested tag library - For using the nested beans in the application&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question: What do you understand by     DispatchAction?&lt;br /&gt;    Answer:  &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;DispatchAction is an action that comes with Struts 1.1     or later, that lets you combine Struts actions into one class, each with their own method.     The org.apache.struts.action.DispatchAction class allows multiple operation     to mapped to the different functions in the same Action class.&lt;br /&gt;    &lt;b&gt;For example: &lt;/b&gt;&lt;br /&gt;    A package might include separate RegCreate, RegSave, and RegDelete Actions,     which just perform different operations on the same RegBean object. Since     all of these operations are usually handled by the same JSP page, it would     be handy to also have them handled by the same Struts Action.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;A very simple way to do this is to have the submit     button modify a field in the form which indicates which operation to     perform.&lt;/span&gt;&lt;/p&gt;     &lt;blockquote&gt;       &lt;p&gt;&lt;code&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;html:hidden property=&quot;dispatch&quot; value=&quot;error&quot;&gt;&lt;br /&gt;      &lt;script&gt;function set(target)       {document.forms[0].dispatch.value=target;}&lt;/script&gt;&lt;br /&gt;      &lt;html:submit onclick=&quot;set(&#39;save&#39;);&quot;&gt;SAVE&lt;/html:submit&gt;&lt;br /&gt;      &lt;html:submit onclick=&quot;set(&#39;create&#39;);&quot;&gt;SAVE AS NEW&lt;/html:submitl&gt;&lt;br /&gt;      &lt;html:submit onclick=&quot;set(&#39;delete);&quot;&gt;DELETE&lt;/html:submit&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;     &lt;/blockquote&gt;     &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Then, in the Action you can setup different methods     to handle the different operations, and branch to one or the other depending     on which value is passed in the dispatch field.&lt;/span&gt;&lt;/p&gt;     &lt;blockquote&gt;       &lt;p&gt;&lt;code&gt;&lt;span style=&quot;color:#000000;&quot;&gt;String dispatch = myForm.getDispatch();&lt;br /&gt;      if (&quot;create&quot;.equals(dispatch)) { ...&lt;br /&gt;      if (&quot;save&quot;.equals(dispatch)) { ...&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;     &lt;/blockquote&gt;     &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;The Struts Dispatch Action [org.apache.struts.actions]     is designed to do exactly the same thing, but without messy branching logic.     The base perform method will check a dispatch field for you, and invoke the     indicated method. The only catch is that the dispatch methods must use the     same signature as perform. This is a very modest requirement, since in     practice you usually end up doing that anyway.&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;To convert an Action that was switching on a     dispatch field to a DispatchAction, you simply need to create methods like     this&lt;/span&gt;&lt;/p&gt;     &lt;blockquote&gt;       &lt;p&gt;&lt;code&gt;&lt;span style=&quot;color:#000000;&quot;&gt;public ActionForward create(&lt;br /&gt;          ActionMapping mapping,&lt;br /&gt;          ActionForm form,&lt;br /&gt;          HttpServletRequest request,&lt;br /&gt;          HttpServletResponse response)&lt;br /&gt;        throws IOException, ServletException { ...&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;       &lt;p&gt;&lt;code&gt;&lt;span style=&quot;color:#000000;&quot;&gt;public ActionForward save(&lt;br /&gt;          ActionMapping mapping,&lt;br /&gt;          ActionForm form,&lt;br /&gt;          HttpServletRequest request,&lt;br /&gt;          HttpServletResponse response)&lt;br /&gt;        throws IOException, ServletException { ...&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;     &lt;/blockquote&gt;     &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Cool. But do you have to use a property named     dispatch? No, you don&#39;t. The only other step is to specify the name of of     the dispatch property as the &quot;parameter&quot; property of the     action-mapping. So a mapping for our example might look like this:&lt;/span&gt;&lt;/p&gt;     &lt;blockquote&gt;       &lt;p&gt;&lt;code&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;action&lt;br /&gt;        path=&quot;/reg/dispatch&quot;&lt;br /&gt;        type=&quot;app.reg.RegDispatch&quot;&lt;br /&gt;        name=&quot;regForm&quot;&lt;br /&gt;        scope=&quot;request&quot;&lt;br /&gt;        validate=&quot;true&quot;&lt;br /&gt;        parameter=&quot;dispatch&quot;/&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;     &lt;/blockquote&gt;     &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;If you wanted to use the property &quot;o&quot;     instead, as in o=create, you would change the mapping to&lt;/span&gt;&lt;/p&gt;     &lt;blockquote&gt;       &lt;p&gt;&lt;code&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;action&lt;br /&gt;        path=&quot;/reg/dispatch&quot;&lt;br /&gt;        type=&quot;app.reg.RegDispatch&quot;&lt;br /&gt;        name=&quot;regForm&quot;&lt;br /&gt;        scope=&quot;request&quot;&lt;br /&gt;        validate=&quot;true&quot;&lt;br /&gt;        parameter=&quot;o&quot;/&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;     &lt;/blockquote&gt;     &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Again, very cool. But why use a JavaScript button     in the first place? Why not use several buttons named &quot;dispatch&quot;     and use a different value for each?&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;You can, but the value of the button is also its     label. This means if the page designers want to label the button something     different, they have to coordinate the Action programmer. Localization     becomes virtually impossible. (Source: &lt;a href=&quot;http://husted.com/struts/tips/002.html&quot; target=&quot;_blank&quot;&gt;http://husted.com/struts/tips/002.html&lt;/a&gt;).&lt;br /&gt;        &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question: How Struts relates to J2EE?&lt;br /&gt;    Answer: &lt;/b&gt;Struts framework  is built on J2EE technologies (JSP,     Servlet, Taglibs), but it is itself not part of the J2EE standard.&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question: What is Struts actions and action mappings?&lt;br /&gt;    Answer: &lt;/b&gt;A Struts action is an instance of a subclass of an Action class, which implements a portion of a Web application and whose perform or execute method returns a forward.&lt;br /&gt;   &lt;br /&gt;    An action can perform tasks such as validating a user name and password.&lt;br /&gt;   &lt;br /&gt;An action mapping is a configuration file entry that, in general, associates an action name with an action. An action mapping can contain a reference to a form bean that the action can use, and can additionally define a list of local forwards that is visible only to this action.&lt;br /&gt;   &lt;br /&gt;An action servlet is a servlet that is started by the servlet container of a Web server to process a request that invokes an action. The servlet receives a forward from the action and asks the servlet container to pass the request to the forward&#39;s URL. An action servlet must be an instance of an org.apache.struts.action.ActionServlet class or of a subclass of that class. An action servlet is the primary component of the controller.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;h1 align=&quot;left&quot;&gt;Struts Interview Questions&lt;/h1&gt;&lt;br /&gt;&lt;p align=&quot;center&quot;&gt;           &lt;span style=&quot;color:#000000;&quot;&gt;           &lt;a href=&quot;http://www.roseindia.net/interviewquestions/strutsinterviewquestions.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/previous.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;                    &lt;a href=&quot;http://www.roseindia.net/interviewquestions/index.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/bt_home.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;                    &lt;a href=&quot;http://www.roseindia.net/interviewquestions/jsp-interview-questions.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/next.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; Can I setup Apache Struts to use multiple configuration files?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; Yes Struts can use multiple configuration files. Here is the configuration example:&lt;br /&gt;&lt;servlet&gt;&lt;br /&gt;        &lt;servlet-name&gt;banking&lt;/servlet-name&gt;&lt;br /&gt;        &lt;servlet-class&gt;org.apache.struts.action.ActionServlet&lt;br /&gt;        &lt;/servlet-class&gt;&lt;br /&gt;        &lt;init-param&gt;&lt;br /&gt;        &lt;param-name&gt;config&lt;/param-name&gt;&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;        &lt;param-value&gt;/WEB-INF/struts-config.xml,&lt;br /&gt;                /WEB-INF/struts-authentication.xml,&lt;br /&gt;                /WEB-INF/struts-help.xml&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&lt;/param-value&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;    &lt;/init-param&gt;&lt;br /&gt;    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;&lt;br /&gt;&lt;/servlet&gt;&lt;br /&gt;&lt;/span&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What are the disadvantages of &lt;/span&gt;Struts&lt;span style=&quot;color:#000000;&quot;&gt;?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; Struts is very robust framework and is being used extensively in the industry. But there are some disadvantages of the Struts:&lt;br /&gt;&lt;b&gt;a) High Learning Curve&lt;br /&gt;&lt;/b&gt;Struts requires lot of efforts to learn and master it. For any small project less experience developers could spend more time on learning the Struts.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;b) Harder to learn&lt;/b&gt;&lt;br /&gt;Struts are harder to learn, benchmark and optimize.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What is Struts Flow?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; Struts Flow is a port of Cocoon&#39;s Control Flow to Struts to allow complex workflow, like multi-form wizards, to be easily implemented using continuations-capable JavaScript. It provides the ability to describe the order of Web pages that have to be sent to the client, at any given point in time in an application. The code is based on a proof-of-concept Dave Johnson put together to show how the Control Flow could be extracted from Cocoon. (Ref: &lt;a href=&quot;http://struts.sourceforge.net/struts-flow/index.html&quot; target=&quot;_blank&quot;&gt;http://struts.sourceforge.net/struts-flow/index.html&lt;/a&gt; )&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt;  What are the difference between &lt;bean:message&gt; and &lt;bean:write&gt;?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt;  &lt;b&gt;&lt;bean:message&gt;&lt;/b&gt;: This tag is used to output locale-specific text (from the properties files) from a MessageResources bundle.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;bean:write&gt;&lt;/b&gt;: This tag is used to output property values from a bean. &lt;bean:write&gt; is a commonly used tag which enables the programmers to easily present the data.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What is LookupDispatchAction?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; An abstract Action that dispatches to the subclass mapped execute method. This is useful in cases where an HTML form has multiple submit buttons with the same name. The button name is specified by the parameter property of the corresponding ActionMapping. (Ref. &lt;a href=&quot;http://struts.apache.org/1.2.7/api/org/apache/struts/actions/LookupDispatchAction.html&quot; target=&quot;_blank&quot;&gt;http://struts.apache.org/1.2.7/api/org/apache/struts/actions/LookupDispatchAction.html&lt;/a&gt;).&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What are the components of Struts?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt;  Struts is based on the MVC design pattern. Struts components can be categories into &lt;b&gt;Model&lt;/b&gt;, &lt;b&gt;View&lt;/b&gt; and &lt;b&gt;Controller&lt;/b&gt;.&lt;br /&gt;&lt;b&gt;Model: &lt;/b&gt;Components like business logic / business processes and data are the part of Model.&lt;br /&gt;&lt;b&gt;View:&lt;/b&gt; JSP, HTML etc. are part of View&lt;br /&gt;&lt;b&gt;Controller:&lt;/b&gt; Action Servlet of Struts is part of Controller components which works as front controller to handle all the requests.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What are Tag Libraries provided with Struts?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt;  Struts provides a number of tag libraries that helps to create view components easily. These tag libraries are:&lt;br /&gt;&lt;b&gt;a) Bean Tags:&lt;/b&gt; Bean Tags are used to access the beans and their properties.&lt;br /&gt;&lt;b&gt;b) HTML Tags:&lt;/b&gt; HTML Tags provides tags for creating the view components like forms, buttons, etc..&lt;br /&gt;&lt;b&gt;c) Logic Tags:&lt;/b&gt; Logic Tags provides presentation logics that eliminate the need for scriptlets.&lt;br /&gt;&lt;b&gt;d) Nested Tags:&lt;/b&gt; Nested Tags helps to work with the nested context.&lt;/span&gt;&lt;/p&gt; &lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What are the core classes of the Struts Framework?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Answer:&lt;/b&gt;  &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Core classes of Struts Framework are ActionForm, Action, ActionMapping, ActionForward, ActionServlet etc.&lt;/span&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What are difference between ActionErrors and ActionMessage?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt;  &lt;b&gt;ActionMessage:&lt;/b&gt; A class that encapsulates messages. Messages can be either global or they are specific to a particular bean property.&lt;br /&gt;Each individual message is described by an ActionMessage object, which contains a message key (to be looked up in an appropriate message resources database), and up to four placeholder arguments used for parametric substitution in the resulting message.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;ActionErrors:&lt;/b&gt; A class that encapsulates the error messages being reported by the validate() method of an ActionForm. Validation errors are either global to the entire ActionForm bean they are associated with, or they are specific to a particular bean property (and, therefore, a particular input field on the corresponding form).&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt;  How you will handle exceptions in Struts?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt;  In Struts you can handle the exceptions in two ways:&lt;br /&gt;&lt;b&gt;a) Declarative Exception Handling: &lt;/b&gt;You can either define global exception handling tags in your struts-config.xml or define the exception handling tags within &lt;action&gt;..&lt;/action&gt; tag.&lt;br /&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;exception&gt; &lt;/o:p&gt; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;      key=&quot;database.error.duplicate&quot;&lt;o:p&gt; &lt;/o:p&gt; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;      path=&quot;/UserExists.jsp&quot;&lt;o:p&gt; &lt;/o:p&gt; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;      type=&quot;mybank.account.DuplicateUserException&quot;/&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;b) Programmatic Exception Handling:&lt;/b&gt; Here you can use try{}catch{} block to handle the exception.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h1 align=&quot;left&quot;&gt;JSP Interview Questions&lt;/h1&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What do you understand by JSP     Actions?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; JSP actions are XML tags that direct the server to use existing components or control the behavior of the JSP engine. JSP Actions consist of a typical (XML-based) prefix of &quot;jsp&quot; followed by a colon, followed by the action name followed by one or more attribute parameters.&lt;br /&gt;    There are six JSP Actions:&lt;/span&gt; &lt;p&gt;&lt;code&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;jsp:include/&gt;&lt;/span&gt;&lt;/code&gt; &lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;jsp:forward/&gt;&lt;/span&gt;&lt;/code&gt; &lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;jsp:plugin/&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;jsp:usebean/&gt;&lt;/span&gt;&lt;/code&gt; &lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;jsp:setproperty/&gt;&lt;/span&gt;&lt;/code&gt; &lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;jsp:getproperty/&gt; &lt;/span&gt;&lt;/code&gt; &lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;   &lt;code&gt;   &lt;/code&gt;&lt;/span&gt;&lt;/p&gt; &lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What is the difference between &lt;code&gt;&lt;jsp:include page =&quot; ...&quot;&gt;&lt;/code&gt; and &lt;code&gt;&lt;br /&gt;    &lt;%@ include file = ... &gt;&lt;/code&gt;?.&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  Both the tag includes the     information from one page in another. The differences are as follows:&lt;br /&gt;    &lt;code&gt;&lt;b&gt;&lt;jsp:include page =&quot; ...&quot;&gt;:&lt;/b&gt; This is like a function call     from one jsp to another jsp. It is executed ( the included page is     executed  and the generated html content is included in the content of     calling jsp) each time the client page is accessed by the client. This     approach is useful to for modularizing the web application. If the included     file changed then the new content will be included in the output.&lt;br /&gt;   &lt;br /&gt;    &lt;b&gt;&lt;%@ include file = ... &gt;&lt;/b&gt;: In this case the content     of the included file is textually embedded in the page that have &lt;%@     include file=&quot;..&quot;&gt; directive. In this case in the included file     changes, the changed content will not included in the output. This approach     is used when the code from one jsp file required to include in multiple jsp     files.&lt;br /&gt;           &lt;/code&gt;&lt;/span&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What is the difference between &lt;code&gt;&lt;jsp:forward page =&quot; ...&quot;&gt;&lt;/code&gt; and &lt;code&gt;&lt;br /&gt;    &lt;/code&gt;response.sendRedirect(url),?.&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;   &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;The &lt;jsp:forward&gt;     element forwards the request object containing the client request     information from one JSP file to another file. The target file can be an     HTML file, another JSP file, or a servlet, as long as it is in the same     application context as the forwarding JSP file.&lt;br /&gt;    &lt;b&gt;&lt;i&gt;sendRedirect&lt;/i&gt;&lt;/b&gt; sends HTTP temporary redirect response to the     browser, and browser creates a new request to go the redirected page.     The  response.sendRedirect kills the session variables.&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question: &lt;/b&gt;Identify the advantages of JSP over     Servlet.&lt;br /&gt;   &lt;br /&gt;    a) Embedding of Java code in HTML pages&lt;br /&gt;    b) Platform independence&lt;br /&gt;    c) Creation of database-driven Web applications&lt;br /&gt;    d) Server-side programming capabilities&lt;br /&gt;   &lt;br /&gt;    &lt;b&gt;Answer :- Embedding of Java code in HTML pages&lt;br /&gt;      &lt;/b&gt;&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Write the following code for a JSP page:&lt;br /&gt;    &lt;%@ page language = &quot;java&quot; %&gt;&lt;br /&gt;   &lt;br /&gt;    &lt;html&gt;&lt;br /&gt;    &lt;head&gt;&lt;title&gt;RESULT PAGE&lt;/title&gt;&lt;/head&gt;&lt;br /&gt;    &lt;body&gt;&lt;br /&gt;    &lt;%&lt;br /&gt;   &lt;br /&gt;    PrintWriter print = request.getWriter();&lt;br /&gt;    print.println(&quot;Welcome&quot;);&lt;br /&gt;   &lt;br /&gt;    %&gt;&lt;br /&gt;    &lt;/body&gt;&lt;br /&gt;    &lt;/html&gt;&lt;br /&gt;    &lt;span style=&quot;font-family: Times New Roman;&quot;&gt;Suppose     you access this JSP file, Find out your answer.&lt;br /&gt;    a) A blank page will be displayed.&lt;br /&gt;    b) A page with the text Welcome is displayed&lt;br /&gt;    c) An exception will be thrown because the implicit out object is not used&lt;br /&gt;    d) An exception will be thrown because PrintWriter can be used in servlets only&lt;br /&gt;   &lt;br /&gt;    &lt;b&gt;Answer :- A page with the text Welcome is displayed&lt;br /&gt;       &lt;/b&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question: &lt;/b&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;What     are implicit Objects available to the JSP Page?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Answer: &lt;/b&gt;Implicit objects are the objects     available to the JSP page. These objects are created by Web container and     contain information related to a particular request, page, or application.     The JSP implicit objects are:&lt;br /&gt;    &lt;/span&gt;     &lt;table bg border=&quot;1&quot; border cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;654&quot; style=&quot;color:#800000;&quot;&gt;       &lt;tbody&gt;&lt;tr&gt;         &lt;th bg width=&quot;78&quot; style=&quot;color:#ffff00;&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Variable&lt;br /&gt;          &lt;/span&gt;&lt;/th&gt;         &lt;th bg width=&quot;187&quot; style=&quot;color:#ffff00;&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Class&lt;br /&gt;          &lt;/span&gt;&lt;/th&gt;         &lt;th bg width=&quot;381&quot; style=&quot;color:#ffff00;&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Description&lt;br /&gt;          &lt;/span&gt;&lt;/th&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td width=&quot;78&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;application&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width=&quot;187&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;javax.servlet.ServletContext&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width=&quot;381&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;The context for the JSP page&#39;s servlet and any Web           components contained in the same application.&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td width=&quot;78&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;config&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width=&quot;187&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;javax.servlet.ServletConfig&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width=&quot;381&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Initialization information for the JSP page&#39;s           servlet.&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td width=&quot;78&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;exception&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width=&quot;187&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;java.lang.Throwable&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width=&quot;381&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Accessible only from an error page.&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td width=&quot;78&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;out&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width=&quot;187&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;javax.servlet.jsp.JspWriter&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width=&quot;381&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;The output stream.&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td width=&quot;78&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;page&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width=&quot;187&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;java.lang.Object&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width=&quot;381&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;The instance of the JSP page&#39;s servlet processing the           current request. Not typically used by JSP page authors.&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td width=&quot;78&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;pageContext&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width=&quot;187&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;javax.servlet.jsp.PageContext&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width=&quot;381&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;The context for the JSP page. Provides a single API           to manage the various scoped attributes.&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td width=&quot;78&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;request&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width=&quot;187&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Subtype of javax.servlet.ServletRequest&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width=&quot;381&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;The request triggering the execution of the JSP page.&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td width=&quot;78&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;response&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width=&quot;187&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Subtype of javax.servlet.ServletResponse&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width=&quot;381&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;The response to be returned to the client. Not typically           used by JSP page authors.&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td width=&quot;78&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;session&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width=&quot;187&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;javax.servlet.http.HttpSession&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width=&quot;381&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;The session object for the client.&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt;  &lt;span style=&quot;color:#000000;&quot;&gt;     &lt;span style=&quot;font-family: Times New Roman;&quot;&gt;     &lt;b&gt;            &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question: &lt;/b&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;What     are all the different scope values for the &lt;jsp:usebean&gt; tag?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Answer:&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;jsp:usebean&gt;     tag is used to use any java object in the jsp page. Here are the scope     values for &lt;jsp:usebean&gt; tag:&lt;br /&gt;    a) page&lt;br /&gt;    b) request&lt;br /&gt;    c) session and&lt;br /&gt;    d) application&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;       &lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question: &lt;/b&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;What     is JSP Output Comments?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; JSP Output Comments are the comments that can be viewed in     the HTML source file.&lt;br /&gt;    Example:&lt;br /&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&lt;!--     This file displays the user login screen --&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;    and&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&lt;!-- This page was loaded on&lt;br /&gt; &lt;%= (new java.util.Date()).toLocaleString() %&gt; --&gt;&lt;br /&gt;       &lt;/span&gt;&lt;/span&gt; &lt;/p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question: &lt;/b&gt;What is expression in JSP?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; Expression tag is used to insert Java values directly into     the output. Syntax for the Expression tag is:&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;%= expression %&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;An expression tag contains a scripting language expression that is evaluated, converted to a String, and inserted where the expression appears in the JSP file. The following expression tag displays time on the output:&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;%=new     java.util.Date()%&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question: &lt;/b&gt;What types of comments are     available in the JSP?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; There are two types of comments are allowed in the JSP. These     are &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&lt;i&gt;hidden&lt;/i&gt; &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;and     &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&lt;i&gt;output&lt;/i&gt; &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;comments.     A hidden comments does not appear in the generated output in the html, while     output comments appear in the generated output.&lt;br /&gt;    Example of hidden comment:&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&lt;%-- This is hidden comment --%&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;    Example of output comment:&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&lt;!-- This is output comment --&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question: &lt;/b&gt;What is JSP declaration?&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Answer:&lt;/b&gt; JSP Decleratives are the JSP tag used to declare variables.     Declaratives are enclosed in the &lt;%! %&gt; tag and ends in semi-colon.     You declare variables and functions in the declaration tag and can use     anywhere in the JSP. Here is the example of declaratives:&lt;br /&gt;    &lt;/span&gt;     &lt;p&gt;&lt;span style=&quot;font-size:85%;color:#ff0000;&quot;&gt;&lt;%@page contentType=&quot;text/html&quot;     %&gt;&lt;/span&gt;     &lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:85%;color:#0000ff;&quot;&gt;&lt;html&gt;&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;&lt;span style=&quot;font-size:85%;color:#0000ff;&quot;&gt;&lt;body&gt;&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;&lt;span style=&quot;font-size:85%;color:#ff0000;&quot;&gt;&lt;%!&lt;br /&gt;    int cnt=0;&lt;br /&gt;    private int getCount(){&lt;br /&gt;    //increment cnt and return the value&lt;br /&gt;    cnt++;&lt;br /&gt;    return cnt;&lt;br /&gt;    }&lt;br /&gt;    %&gt;&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;&lt;span style=&quot;font-size:85%;color:#0000ff;&quot;&gt;&lt;p&gt;Values of Cnt are:&lt;/p&gt;&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;&lt;span style=&quot;font-size:85%;color:#0000ff;&quot;&gt;&lt;p&gt;&lt;/span&gt;&lt;span style=&quot;font-size:85%;color:#ff0000;&quot;&gt;&lt;%=getCount()%&gt;&lt;/span&gt;&lt;span style=&quot;font-size:85%;color:#0000ff;&quot;&gt;&lt;/p&gt;&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;&lt;span style=&quot;font-size:85%;color:#0000ff;&quot;&gt;&lt;/body&gt;&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;&lt;span style=&quot;font-size:85%;color:#0000ff;&quot;&gt;&lt;/html&gt;&lt;br /&gt;         &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question: &lt;/b&gt;What is JSP Scriptlet?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; JSP Scriptlet is jsp tag which is used to enclose java code     in the JSP pages. Scriptlets begins with &lt;b&gt;&lt;% &lt;/b&gt;tag and ends with&lt;b&gt;     %&gt; &lt;/b&gt;tag. Java code written inside scriptlet executes every time the     JSP is invoked.&lt;br /&gt;    Example:&lt;br /&gt;    &lt;span style=&quot;color:#ff0000;&quot;&gt;  &lt;%&lt;br /&gt;      //java codes&lt;br /&gt;       String userName=null;&lt;br /&gt;       userName=request.getParameter(&quot;userName&quot;);&lt;br /&gt;       %&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:#ff0000;&quot;&gt;&gt;&lt;br /&gt;        &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question: &lt;/b&gt;What are the life-cycle methods of JSP?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  Life-cycle methods of the JSP are:&lt;br /&gt;    a) &lt;b&gt;jspInit()&lt;/b&gt;: The container calls the jspInit() to initialize the     servlet instance. It is called before any other method, and is called only     once for a servlet instance.&lt;br /&gt;    b)&lt;b&gt;_jspService(): &lt;/b&gt;The container calls the _jspservice() for each     request and it passes the request and the response objects. _jspService()     method cann&#39;t be overridden.&lt;br /&gt;    c) &lt;b&gt;jspDestroy(): &lt;/b&gt;The container calls this when its instance is about     to destroyed.&lt;br /&gt;    The jspInit() and jspDestroy() methods can be overridden within a JSP page.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;           &lt;span style=&quot;color:#000000;&quot;&gt;           &lt;a href=&quot;http://www.roseindia.net/interviewquestions/struts-interviewquestion-1.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/previous.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;                    &lt;a href=&quot;http://www.roseindia.net/interviewquestions/index.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/bt_home.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;                    &lt;a href=&quot;http://www.roseindia.net/interviewquestions/jsp-interview-questions2.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/next.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;h1 align=&quot;left&quot;&gt;JSP Interview Questions -2&lt;/h1&gt;&lt;br /&gt;&lt;p align=&quot;center&quot;&gt;           &lt;span style=&quot;color:#000000;&quot;&gt;           &lt;a href=&quot;http://www.roseindia.net/interviewquestions/jsp-interview-questions.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/previous.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;                    &lt;a href=&quot;http://www.roseindia.net/interviewquestions/index.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/bt_home.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;                    &lt;a href=&quot;http://www.roseindia.net/interviewquestions/j2ee-interview-questions.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/next.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Page of the JSP Interview Questions.&lt;/span&gt;&lt;/p&gt; &lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What is JSP Custom tags?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;   JSP Custom tags are user defined JSP language element. JSP     custom tags are user defined tags that can encapsulate common functionality.     For example you can write your own tag to access the database and performing     database operations. You can also write custom tag for &lt;span name=&quot;intelliTxt&quot; id=&quot;intelliTxt&quot;&gt;encapsulate     both simple and complex behaviors in an easy to use syntax and greatly     simplify the readability of JSP pages.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt; &lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What is JSP?&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Answer:&lt;/b&gt;  JavaServer Pages (JSP) technology is the Java platform     technology for delivering dynamic content to web clients in a portable,     secure and well-defined way. The JavaServer Pages specification extends the     Java Servlet API to provide web application developers&lt;/span&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What is the role of JSP in MVC Model?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; JSP is mostly used to develop the user interface, It plays are role of View in the MVC Model.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What do you understand by context initialization parameters?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; The context-param element contains the declaration of a web application&#39;s servlet context initialization parameters.&lt;br /&gt;&lt;context-param&gt;&lt;br /&gt;    &lt;param-name&gt;name&lt;/param-name&gt;&lt;br /&gt;    &lt;param-value&gt;value&lt;/param-value&gt;&lt;br /&gt;&lt;/context-param&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;The Context Parameters page lets you manage parameters that are accessed through the ServletContext.getInitParameterNames and ServletContext.getInitParameter methods.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; Can you extend JSP technology?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; JSP technology lets the programmer to extend the jsp to make the programming more easier. JSP can be extended and custom actions and tag libraries can be developed.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What do you understand by JSP translation?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; JSP translators generate standard Java code for a JSP page implementation class. This class is essentially a servlet class wrapped with features for JSP functionality.&lt;/span&gt;&lt;/p&gt; &lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What you can stop the browser to cash your page?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; Instead of deleting a cache, you can force the browser not to catch the page.&lt;br /&gt;&lt;%&lt;br /&gt;          response.setHeader(&quot;pragma&quot;,&quot;no-cache&quot;);//HTTP 1.1&lt;br /&gt;          response.setHeader(&quot;Cache-Control&quot;,&quot;no-cache&quot;);&lt;br /&gt;          response.setHeader(&quot;Cache-Control&quot;,&quot;no-store&quot;);&lt;br /&gt;          response.addDateHeader(&quot;Expires&quot;, -1);&lt;br /&gt;          response.setDateHeader(&quot;max-age&quot;, 0);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;           //response.setIntHeader (&quot;Expires&quot;, -1); //prevents caching at the proxy server&lt;br /&gt;          response.addHeader(&quot;cache-Control&quot;, &quot;private&quot;);&lt;br /&gt;&lt;br /&gt;        %&gt;&lt;br /&gt;put the above code in your page.&lt;/span&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What you will handle the runtime exception in your jsp page?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; The &lt;b&gt; errorPage&lt;/b&gt; attribute of the page directive can be used to catch run-time exceptions automatically and then forwarded to an error processing page. &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt; For example:&lt;br /&gt;&lt;%@ page errorPage=&quot;customerror.jsp&quot; %&gt;&lt;br /&gt;above code forwards the request to &quot;customerror.jsp&quot;  page if an uncaught exception is encountered during request processing. Within &quot;customerror.jsp&quot;, you must indicate that it is an error-processing page, via the directive: &lt;%@ page isErrorPage=&quot;true&quot; %&gt;.&lt;/span&gt;&lt;/p&gt; &lt;p&gt; &lt;/p&gt;        &lt;p align=&quot;center&quot;&gt;           &lt;span style=&quot;color:#000000;&quot;&gt;           &lt;a href=&quot;http://www.roseindia.net/interviewquestions/jsp-interview-questions.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/previous.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;                    &lt;a href=&quot;http://www.roseindia.net/interviewquestions/index.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/bt_home.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;                    &lt;a href=&quot;http://www.roseindia.net/interviewquestions/j2ee-interview-questions.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/next.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;h1 align=&quot;left&quot;&gt;J2EE Interview Questions&lt;/h1&gt;&lt;br /&gt;&lt;p align=&quot;center&quot;&gt;           &lt;span style=&quot;color:#000000;&quot;&gt;           &lt;a href=&quot;http://www.roseindia.net/interviewquestions/jsp-interview-questions2.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/previous.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;                    &lt;a href=&quot;http://www.roseindia.net/interviewquestions/index.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/bt_home.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;                    &lt;a href=&quot;http://www.roseindia.net/interviewquestions/j2ee-interview-questions-2.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/next.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;    &lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What is J2EE?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; J2EE Stands for Java 2 Enterprise Edition. J2EE is an environment for developing and deploying enterprise     applications. J2EE specification is defined by Sun Microsystems Inc. The J2EE platform     is one of the best platform for the development and deployment of enterprise     applications. The J2EE platform is consists of a set of services, application programming interfaces (APIs), and protocols,     which provides the functionality necessary for developing multi-tiered, web-based applications.     You can download the J2EE SDK and development tools from &lt;a href=&quot;http://java.sun.com/&quot;&gt;http://java.sun.com/&lt;/a&gt;.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt; What     do you understand by a J2EE module?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; A J2EE module is a software unit that consists of one or more J2EE components of the same container type     along with one deployment descriptor of that type. J2EE specification     defines four types of modules:&lt;br /&gt;    a) EJB&lt;br /&gt;    b) Web&lt;br /&gt;    c) application client and&lt;br /&gt;    d) resource adapter&lt;br /&gt;      &lt;br /&gt;    In the J2EE applications modules can be deployed as stand-alone units. Modules     can also be assembled into J2EE applications.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt; Tell     me something about J2EE component?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; J2EE component is&lt;/span&gt; &lt;span style=&quot;color:#000000;&quot;&gt;a     self-contained functional software unit supported by a &lt;a href=&quot;http://java.sun.com/j2ee/1.4/docs/glossary.html#88608&quot; target=&quot;_blank&quot;&gt;container&lt;/a&gt;     and configurable at deployment time. The J2EE specification defines the     following J2EE components:&lt;/span&gt;     &lt;/p&gt;&lt;ul&gt;&lt;a name=&quot;114209&quot;&gt;&lt;/a&gt;&lt;li&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;a href=&quot;http://java.sun.com/j2ee/1.4/docs/glossary.html#108715&quot; target=&quot;_blank&quot;&gt;Application         clients&lt;/a&gt; and &lt;a href=&quot;http://java.sun.com/j2ee/1.4/docs/glossary.html#88499&quot; target=&quot;_blank&quot;&gt;applets&lt;/a&gt;         are components that run on the client.&lt;br /&gt;        &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Java servlet and JavaServer Pages (JSP)         technology components are &lt;a href=&quot;http://java.sun.com/j2ee/1.4/docs/glossary.html#89333&quot; target=&quot;_blank&quot;&gt;Web         components&lt;/a&gt; that run on the server.&lt;br /&gt;        &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Enterprise JavaBeans (EJB) components (&lt;a href=&quot;http://java.sun.com/j2ee/1.4/docs/glossary.html#109200&quot; target=&quot;_blank&quot;&gt;enterprise         beans&lt;/a&gt;) are business components that run on the server. &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;J2EE components are written in the Java             programming language and are compiled in the same way as any program             in the language. The difference between J2EE components and &quot;standard&quot; Java classes is that J2EE components are             assembled into a J2EE application, verified to be well formed and in             compliance with the J2EE specification, and deployed to production,             where they are run and managed by the J2EE server or client             container.&lt;/span&gt;         &lt;dl&gt;&lt;dt&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Source: &lt;a href=&quot;http://java.sun.com/j2ee/1.4/docs/glossary.html&quot; target=&quot;_blank&quot;&gt;J2EE v1.4 Glossar&lt;/a&gt;&lt;/span&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt; What     are the contents of web module?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; A web module may contain:&lt;br /&gt;    a) JSP files&lt;br /&gt;    b) Java classes&lt;br /&gt;    c) gif and html files and&lt;br /&gt;    d) web component deployment descriptors&lt;br /&gt;      &lt;/span&gt; &lt;p&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;     Differentiate between .ear,  .jar and .war files.&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; These files are simply zipped file using java jar tool. These     files are created for different purposes. Here is the description of these     files:&lt;br /&gt;    &lt;b&gt;.jar files:&lt;/b&gt; These files are with the .jar extenstion. The .jar files     contains the libraries, resources and accessories files like property files.&lt;br /&gt;    &lt;b&gt;.war files:&lt;/b&gt; These files are with the .war extension. The war file     contains the web application that can be deployed on the any servlet/jsp     container. The .war file contains jsp, html, javascript and other files for     necessary for the development of web applications.&lt;br /&gt;    &lt;b&gt;.ear files:&lt;/b&gt; The .ear file contains the EJB modules of the     application.&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;     What is the difference between Session Bean and Entity Bean?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  &lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Session Bean:&lt;/b&gt; Session is one of the EJBs and it represents a single client inside the Application Server. Stateless session is easy to develop and its efficient. As compare to entity beans session beans require few server resources.&lt;br /&gt;   &lt;br /&gt;A session bean is similar to an interactive session and is not shared; it can have only one client, in the same way that an interactive session can have only one user. A session bean is not persistent and it is destroyed once the session terminates.&lt;br /&gt;     &lt;br /&gt;    &lt;b&gt;Entity Bean:&lt;/b&gt; An entity bean represents persistent global data from the     database. Entity beans data are stored into database.&lt;br /&gt;        &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt; Why     J2EE is suitable for the development distributed multi-tiered enterprise     applications?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; The J2EE platform consists of multi-tiered distributed application model.     J2EE applications allows the developers to design and implement the business     logic into components according to business requirement. J2EE architecture     allows the development of multi-tired applications and the developed     applications can be installed on different machines depending on the tier in the     multi-tiered J2EE environment . The J2EE application parts are:&lt;br /&gt;   &lt;br /&gt;    a) Client-tier components run on the client machine.&lt;br /&gt;    b) Web-tier components run on the J2EE server.&lt;br /&gt;    c) Business-tier components run on the J2EE server and the&lt;br /&gt;    d) Enterprise information system (EIS)-tier software runs on the EIS servers&lt;br /&gt;        &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt; Why do     understand by a container?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; Normally, thin-client multi-tiered applications are hard to write because they involve many lines of intricate code to handle transaction and state management, multithreading, resource pooling, and other complex low-level details. The component-based and platform-independent J2EE architecture makes J2EE applications easy to write because business logic is organized into reusable components. In addition, the J2EE server provides &lt;b&gt; underlying services in the form of a container&lt;/b&gt; for every component type. Because you do not have to develop these services yourself, you are free to concentrate on solving the business problem at hand (Source: &lt;a href=&quot;http://java.sun.com/j2ee/1.3/docs/tutorial/doc/Overview4.html&quot;&gt;http://java.sun.com/j2ee/1.3/docs/tutorial/doc/Overview4.html&lt;/a&gt;     ).&lt;br /&gt;   &lt;br /&gt;In short containers are the interface between a component and the low-level platform specific functionality that supports the component. The application like Web, enterprise bean, or application client component must be assembled and deployed on the J2EE container before executing.&lt;br /&gt;      &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt; What     are the services provided by a container?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  The services provided by container are as follows:&lt;br /&gt;    a) Transaction management for the bean&lt;br /&gt;    b) Security for the bean&lt;br /&gt;    c) Persistence of the bean&lt;br /&gt;    d) Remote access to the bean&lt;br /&gt;    e) Lifecycle management of the bean&lt;br /&gt;    f) Database-connection pooling&lt;br /&gt;    g) Instance pooling for the bean&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt; What     are types of J2EE clients?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  J2EE clients are the software that access the services     components installed on the J2EE container. Following are the J2EE clients:&lt;br /&gt;    a) Applets&lt;br /&gt;    b) Java-Web Start clients&lt;br /&gt;    c) Wireless clients&lt;br /&gt;    d) Web applications&lt;br /&gt;       &lt;/span&gt;      &lt;/p&gt;&lt;p align=&quot;center&quot;&gt;           &lt;span style=&quot;color:#000000;&quot;&gt;           &lt;a href=&quot;http://www.roseindia.net/interviewquestions/jsp-interview-questions2.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/previous.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;                    &lt;a href=&quot;http://www.roseindia.net/interviewquestions/index.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/bt_home.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;                    &lt;a href=&quot;http://www.roseindia.net/interviewquestions/j2ee-interview-questions-2.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/next.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Question:&lt;/b&gt; What is Deployment Descriptor?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; A deployment descriptor is simply an XML(Extensible Markup Language) file with the extension of .xml. Deployment descriptor describes the component deployment settings. Application servers reads the deployment descriptor to deploy the components contained in the deployment unit. For example ejb-jar.xml file is used to describe the setting of the EJBs.&lt;br /&gt;   &lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt; What do you understand by JTA and JTS?&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;b&gt;Answer:&lt;/b&gt; JTA stands for Java Transaction API and JTS stands for Java Transaction Service. JTA provides a standard interface which allows the developers to demarcate transactions in a manner that is independent of the transaction manager implementation. The J2EE SDK uses the JTA transaction manager to implement the  transaction. The code developed by developers does not calls the JTS methods directly, but only invokes the JTA methods. Then JTA internally invokes the JTS routines. JTA is a high level transaction interface used by the application code to control the transaction.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt; What is JAXP?&lt;br /&gt;      &lt;b&gt;Answer:&lt;/b&gt; The Java API for XML Processing (JAXP) enables applications to parse and transform XML documents independent of a particular XML processing implementation. JAXP or Java API for XML Parsing is an optional API provided by Javasoft. It provides basic functionality for reading, manipulating, and generating XML documents through pure Java APIs. It is a thin and lightweight API that provides a standard way to seamlessly integrate any XML-compliant parser with a Java application.&lt;br /&gt;  More at &lt;a href=&quot;http://java.sun.com/xml/&quot; target=&quot;_blank&quot;&gt;http://java.sun.com/xml/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt; What is J2EE Connector architecture?&lt;br /&gt;      &lt;b&gt;Answer:&lt;/b&gt; J2EE Connector Architecture (JCA) is a Java-based technology solution for connecting application servers and enterprise information systems (EIS) as part of enterprise application integration (EAI) solutions. While JDBC is specifically used to connect Java EE applications to databases, JCA is a more generic architecture for connection to legacy systems (including databases). JCA was developed under the Java Community Process as JSR 16 (JCA 1.0) and JSR 112 (JCA 1.5). As of 2006, the current version of JCA is version 1.5. &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;The J2EE Connector API is used by J2EE tools developers and system integrators to create resource adapters. Home page for J2EE Connector architecture &lt;a href=&quot;http://java.sun.com/j2ee/connector/&quot; target=&quot;_blank&quot;&gt;http://java.sun.com/j2ee/connector/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;What is difference between Java Bean and Enterprise Java Bean?&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;      &lt;b&gt;Answer:&lt;/b&gt; Java Bean as is a plain java class with member variables and getter setter methods. Java Beans are defined under JavaBeans specification as Java-Based software component model which includes the features like introspection, customization,  events,  properties and  persistence.&lt;br /&gt;Enterprise JavaBeans or EJBs for short are Java-based software components that comply with Java&#39;s  EJB specification. EJBs are delpoyed on the EJB container and executes in the EJB container. EJB is not that simple,  it is used for building distributed applications. Examples of EJB are Session Bean, Entity Bean and Message Driven Bean. EJB is used for server side programming whereas java bean is a client side. Bean is only development but the EJB is developed and then deploy on EJB Container.&lt;br /&gt;   &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt; What is the difference between JTS and JTA?&lt;br /&gt;      &lt;b&gt;Answer:&lt;/b&gt; In any J2EE application &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;transaction management is one of the most crucial requirements of the application. Given the complexity of today&#39;s business requirements, transaction processing occupies one of the most complex segments of enterprise level distributed applications to build, deploy and maintain.  JTS specifies the implementation of a Java transaction manager. JTS specifies the implementation of a Transaction Manager which supports the Java Transaction API (JTA) 1.0 This transaction manager supports the JTA, using which application servers can be built to support transactional Java applications. Internally the JTS implements the Java mapping of the OMG OTS 1.1 specifications. The Java mapping is specified in two packages: org.omg.CosTransactions and org.omg.CosTSPortability. The JTS thus provides a new architecture for transactional application servers and applications, while complying to the OMG OTS 1.1 interfaces internally. This allows the JTA compliant applications to interoperate with other OTS 1.1 complaint applications through the standard IIOP. Java-based applications and Java-based application servers access transaction management functionality via the JTA interfaces. The JTA interacts with a transaction management implementation via JTS. Similarly, the JTS can access resources via the JTA XA interfaces or can access OTS-enabled non-XA resources. JTS implementations can interoperate via CORBA OTS interfaces.&lt;br /&gt;     &lt;br /&gt;The JTA specifies an architecture for building transactional application servers and defines a set of interfaces for various components of this architecture. The components are: the application, resource managers, and the application server. The JTA specifies standard interfaces for Java-based applications and application servers to interact with transactions, transaction managers, and resource managers JTA transaction management provides a set of interfaces utilized by an application server to manage the beginning and completion of transactions. Transaction synchronization and propagation services are also provided under the domain of transaction management.&lt;br /&gt; &lt;br /&gt;In the Java transaction model, the Java application components can conduct transactional operations on JTA compliant resources via the JTS. The JTS acts as a layer over the OTS. The applications can therefore initiate global transactions to include other OTS transaction managers, or participate in global transactions initiated by other OTS compliant transaction managers.&lt;br /&gt;   &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt; Can Entity Beans have no create() methods?&lt;br /&gt;      &lt;b&gt;Answer:&lt;/b&gt; &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Entity Beans can have no create() methods. Entity Beans have no create() method, when entity bean is not used to store the data in the database. In this case entity bean is used to retrieve the data from database.&lt;br /&gt;  &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt; What are the call back methods in Session bean?&lt;br /&gt;      &lt;b&gt;Answer:&lt;/b&gt; &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Callback methods are called by the container to notify the important events to the beans in its life cycle&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;.  The callback methods are defined in the javax.ejb.EntityBean interface.The callback methods example are ejbCreate(), ejbPassivate(), and ejbActivate().&lt;br /&gt;  &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt; What is bean managed transaction?&lt;br /&gt;      &lt;b&gt;Answer:&lt;/b&gt; &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;In EJB transactions can be maintained by the container or developer can write own code to maintain the transaction. &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;If a developer doesn’t want a Container to manage transactions, developer can write own code to maintain the database transaction.&lt;br /&gt;   &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color:#000000;&quot;&gt; What are transaction isolation levels in EJB?&lt;br /&gt;      &lt;b&gt;Answer:&lt;/b&gt; Thre are four levels of transaction isolation are:&lt;br /&gt;  * Uncommitted Read&lt;br /&gt;  * Committed Read&lt;br /&gt;  * Repeatable Read&lt;br /&gt;  * Serializable&lt;br /&gt;  &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;The four transaction isolation levels and the corresponding behaviors are described below:&lt;br /&gt;  &lt;/span&gt; &lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;537&quot;&gt;   &lt;tbody&gt;     &lt;tr valign=&quot;top&quot;&gt;       &lt;td width=&quot;147&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span class=&quot;GUI&quot;&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Isolation Level&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width=&quot;88&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span class=&quot;GUI&quot;&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Dirty Read&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width=&quot;179&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span class=&quot;GUI&quot;&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Non-Repeatable Read&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width=&quot;113&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span class=&quot;GUI&quot;&gt;&lt;b&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Phantom Read&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr valign=&quot;top&quot;&gt;       &lt;td width=&quot;147&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span style=&quot;font-style: normal; font-weight: bold; text-decoration: none; text-transform: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Read Uncommitted&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width=&quot;88&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width=&quot;179&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width=&quot;113&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr valign=&quot;top&quot;&gt;       &lt;td width=&quot;147&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span style=&quot;font-style: normal; font-weight: bold; text-decoration: none; text-transform: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Read Committed&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width=&quot;88&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Not possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width=&quot;179&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width=&quot;113&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr valign=&quot;top&quot;&gt;       &lt;td width=&quot;147&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span style=&quot;font-style: normal; font-weight: bold; text-decoration: none; text-transform: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Repeatable Read&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width=&quot;88&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Not possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width=&quot;179&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Not possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width=&quot;113&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr valign=&quot;top&quot;&gt;       &lt;td width=&quot;147&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span style=&quot;font-style: normal; font-weight: bold; text-decoration: none; text-transform: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Serializable&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width=&quot;88&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Not possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width=&quot;179&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Not possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width=&quot;113&quot;&gt;&lt;p class=&quot;Body&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Not possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt; &lt;/table&gt;  &lt;/p&gt;&lt;p align=&quot;center&quot;&gt; &lt;span style=&quot;color:#000000;&quot;&gt; &lt;a href=&quot;http://www.roseindia.net/interviewquestions/jsp-interview-questions.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/previous.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;                &lt;a href=&quot;http://www.roseindia.net/interviewquestions/index.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/bt_home.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;          &lt;a href=&quot;http://www.roseindia.net/interviewquestions/index.shtml&quot;&gt;&lt;img src=&quot;http://www.roseindia.net/images/next.gif&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;                 &lt;!-- Bottom --&gt;            &lt;h3 class=&quot;formtitle&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align=&quot;center&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;         &lt;/p&gt;&lt;br /&gt;&lt;p&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;     &lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;************************************************************************************&lt;br /&gt;Here we are.. this time with a small Java tip.. being Java fans..we just cant wait to post on Java. So, decided to start of with something which most of us might not be aware of.&lt;br /&gt;&lt;br /&gt;You can write a runnable Java program which does not have main method at all. This can be done using the static block of the class.&lt;br /&gt;&lt;br /&gt;The reason this works is that static initialization blocks get executed as soon as the class is loaded, even before the main method is called. During run time JVM will search for the main method after exiting from this block. If it does not find the main method, it throws an exception. To avoid the exception System.exit(0); statement is used which terminates the program at the end of the static block itself.&lt;br /&gt;&lt;br /&gt;class MainMethodNot&lt;br /&gt;{&lt;br /&gt;static&lt;br /&gt;{&lt;br /&gt;System.out.println(“This java program has run without the main method”);&lt;br /&gt;System.exit(0);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/1253644019974666235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/1253644019974666235' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/1253644019974666235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/1253644019974666235'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2007/04/core-java-interview-questions.html' title='Core Java Interview Questions'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-3892700784250057526</id><published>2007-03-29T05:23:00.000-07:00</published><updated>2007-03-29T05:39:36.698-07:00</updated><title type='text'>DataBase Questions For Interview?</title><content type='html'>&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What is SQL?&lt;/span&gt;&lt;br /&gt;SQL stands for ‘Structured Query Language‘.&lt;/p&gt;   &lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What is SELECT statement?&lt;/span&gt;&lt;br /&gt;The &lt;span class=&quot;caps&quot;&gt;SELECT&lt;/span&gt; statement lets you select a set of values from a table in a database. The values selected from the database table would depend on the various conditions that are specified in the &lt;span class=&quot;caps&quot;&gt;SQL&lt;/span&gt; query.&lt;/p&gt;   &lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;How can you compare a part of the name rather than the entire name?&lt;/span&gt;&lt;br /&gt;SELECT * &lt;span class=&quot;caps&quot;&gt;FROM&lt;/span&gt; people &lt;span class=&quot;caps&quot;&gt;WHERE&lt;/span&gt; empname &lt;span class=&quot;caps&quot;&gt;LIKE &lt;/span&gt;‘%ab%‘&lt;br /&gt;&lt;/p&gt;&lt;p&gt;would return a recordset with records consisting empname the sequence ‘ab‘ in empname.&lt;/p&gt;   &lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What is the INSERT statement? &lt;/span&gt;&lt;br /&gt;The &lt;span class=&quot;caps&quot;&gt;INSERT&lt;/span&gt; statement lets you insert information into a database.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;-&gt;&lt;span class=&quot;caps&quot;&gt;INSERT INTO EMP &lt;/span&gt;(empname, age, city) &lt;span class=&quot;caps&quot;&gt;VALUES &lt;/span&gt;(?VINDESH?, 25, ?INDORE?);&lt;/p&gt;   &lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;How do you delete a record from a database?&lt;/span&gt;&lt;br /&gt;Use the &lt;span class=&quot;caps&quot;&gt;DELETE&lt;/span&gt; statement to remove records or any particular column values from a database.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Example: &lt;span class=&quot;caps&quot;&gt;DELETE FROM &lt;/span&gt;?EMPNAME? &lt;span class=&quot;caps&quot;&gt;WHERE&lt;/span&gt; id=420;&lt;/p&gt;   &lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;How could I get distinct entries from a table?&lt;/span&gt;&lt;br /&gt;The &lt;span class=&quot;caps&quot;&gt;SELECT&lt;/span&gt; statement in conjunction with &lt;span class=&quot;caps&quot;&gt;DISTINCT&lt;/span&gt; lets you select a set of distinct values from a table in a database. The values selected from the database table would of course depend on the various conditions that are specified in the &lt;span class=&quot;caps&quot;&gt;SQL&lt;/span&gt; query.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Example: &lt;span class=&quot;caps&quot;&gt;SELECT DISTINCT&lt;/span&gt; empname &lt;span class=&quot;caps&quot;&gt;FROM&lt;/span&gt; emptable&lt;/p&gt;   &lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;How to get the results of a Query sorted in any order?&lt;/span&gt;&lt;br /&gt;You can sort the results and return the sorted results to your program by using &lt;span class=&quot;caps&quot;&gt;ORDER BY&lt;/span&gt; keyword thus saving you the pain of carrying out the sorting yourself. The &lt;span class=&quot;caps&quot;&gt;ORDER BY&lt;/span&gt; keyword is used for sorting.&lt;br /&gt;&lt;br /&gt;Example: &lt;span class=&quot;caps&quot;&gt;SELECT&lt;/span&gt; empname, age, city &lt;span class=&quot;caps&quot;&gt;FROM&lt;/span&gt; emptable &lt;span class=&quot;caps&quot;&gt;ORDER BY&lt;/span&gt; empname&lt;/p&gt;   &lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;How can I find the total number of records in a table?&lt;/span&gt;&lt;br /&gt;You could use the &lt;span class=&quot;caps&quot;&gt;COUNT&lt;/span&gt; keyword, example&lt;/p&gt;   &lt;p&gt;SELECT COUNT(*) FROM emp WHERE age&gt;40&lt;/p&gt;   &lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What is GROUP BY?&lt;/span&gt;&lt;br /&gt;The &lt;span class=&quot;caps&quot;&gt;GROUP BY&lt;/span&gt; keywords has been added to &lt;span class=&quot;caps&quot;&gt;SQL&lt;/span&gt; because aggregate functions (like &lt;span class=&quot;caps&quot;&gt;SUM&lt;/span&gt;) return the aggregate of all column values every time they are called. Without the &lt;span class=&quot;caps&quot;&gt;GROUP BY&lt;/span&gt; functionality, finding the sum for each individual group of column values was not possible.&lt;/p&gt;   &lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What is the difference among &quot;dropping a table&quot;, &quot;truncating a table&quot; and &quot;deleting all records&quot; from a table?&lt;/span&gt;&lt;br /&gt;Dropping :  (Table structure  + Data are deleted), Invalidates the dependent objects ,Drops the indexes&lt;br /&gt;&lt;br /&gt;Truncating:  (Data alone deleted), Performs an automatic commit, Faster than delete&lt;br /&gt;&lt;br /&gt;Delete : (Data alone deleted), Doesn?t perform automatic commit&lt;/p&gt;   &lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What are the Large object types suported by Oracle?&lt;/span&gt;&lt;br /&gt;Blob and Clob.&lt;/p&gt;   &lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Difference between a &quot;where&quot; clause and a &quot;having&quot; clause ?&lt;/span&gt;&lt;br /&gt;Having clause is used only with group functions whereas Where is not used with.&lt;/p&gt;   &lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What&#39;s the difference between a primary key and a unique key?&lt;/span&gt;&lt;br /&gt;Both primary key and unique enforce uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key doesn‘t allow &lt;span class=&quot;caps&quot;&gt;NUL&lt;/span&gt;Ls, but unique key allows one &lt;span class=&quot;caps&quot;&gt;NULL&lt;/span&gt; only.&lt;/p&gt;   &lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors?&lt;/span&gt;&lt;br /&gt;Cursors allow row-by-row processing of the resultsets.&lt;/p&gt;   &lt;p&gt;Types of cursors: Static, Dynamic, Forward-only, Keyset-driven. See books online for more information.&lt;/p&gt;   &lt;p&gt;Disadvantages of cursors: Each time you fetch a row from the cursor, it results in a network roundtrip; where as a normal SELECT query makes only one roundtrip, however large the resultset is. Cursors are also costly because they require more resources and temporary storage (results in more IO operations). Further, there are restrictions on the SELECT statements that can be used with some types of cursors.&lt;/p&gt;   &lt;p&gt;Most of the times, set based operations can be used instead of cursors.&lt;/p&gt;   &lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What are triggers? How to invoke a trigger on demand?&lt;/span&gt;&lt;br /&gt;Triggers are special kind of stored procedures that get executed automatically when an &lt;span class=&quot;caps&quot;&gt;INSERT&lt;/span&gt;, UPDATE or &lt;span class=&quot;caps&quot;&gt;DELETE&lt;/span&gt; operation takes place on a table.&lt;br /&gt;&lt;br /&gt;Triggers can‘t be invoked on demand. They get triggered only when an associated action (INSERT, &lt;span class=&quot;caps&quot;&gt;UPDATE&lt;/span&gt;, and &lt;span class=&quot;caps&quot;&gt;DELETE&lt;/span&gt;) happens on the table on which they are defined.&lt;br /&gt;&lt;br /&gt;Triggers are generally used to implement business rules, auditing. Triggers can also be used to extend the referential integrity checks, but wherever possible, use constraints for this purpose, instead of triggers, as constraints are much faster.&lt;/p&gt;   &lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What is a join and explain different types of joins?&lt;/span&gt;&lt;br /&gt;Joins are used in queries to explain how different tables are related. Joins also let you select data from a table depending upon data from another table.&lt;br /&gt;&lt;br /&gt;Types of joins: &lt;span class=&quot;caps&quot;&gt;INNER JOI&lt;/span&gt;Ns, &lt;span class=&quot;caps&quot;&gt;OUTER JOI&lt;/span&gt;Ns, &lt;span class=&quot;caps&quot;&gt;CROSS JOI&lt;/span&gt;Ns. &lt;span class=&quot;caps&quot;&gt;OUTER JOI&lt;/span&gt;Ns are further classified as &lt;span class=&quot;caps&quot;&gt;LEFT OUTER JOINS&lt;/span&gt;, RIGHT &lt;span class=&quot;caps&quot;&gt;OUTER JOINS&lt;/span&gt; and &lt;span class=&quot;caps&quot;&gt;FULL OUTER JOINS&lt;/span&gt;.&lt;/p&gt;   &lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What is a self join?&lt;/span&gt;&lt;br /&gt;Self join is just like any other join, except that two instances of the same table will be joined in the query.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/3892700784250057526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/3892700784250057526' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/3892700784250057526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/3892700784250057526'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2007/03/database-questions-for-interview.html' title='DataBase Questions For Interview?'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-664651663704607214.post-1844698968584823680</id><published>2007-03-29T05:09:00.000-07:00</published><updated>2022-08-14T03:20:29.193-07:00</updated><title type='text'>OOPS-Object Oriented programming?</title><content type='html'>&lt;p&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What is OOPS?&lt;/span&gt;
OOP is the common abbreviation for Object-Oriented Programming.

&lt;span style=&quot;font-weight: bold;&quot;&gt; Describe the principles of &lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot; class=&quot;caps&quot;&gt;OOPS&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;?&lt;/span&gt;
There are three main principals of oops which are called Polymorphism, Inheritance and Encapsulation.

&lt;span style=&quot;font-weight: bold;&quot;&gt; Explain the Encapsulation principle?&lt;/span&gt;
Encapsulation is a process of binding or wrapping the data and the codes that operates on the data into a single entity. This keeps the data safe from outside interface and misuse. One way to think ab…

&lt;span style=&quot;font-weight: bold;&quot;&gt; Explain the Inheritance principle?  &lt;/span&gt;
Inheritance is the process by which one object acquires the properties of another object.

&lt;span style=&quot;font-weight: bold;&quot;&gt; Explain the Polymorphism principle?&lt;/span&gt;
The meaning of Polymorphism is something like one name many forms. Polymorphism enables one entity to be used as general category for different types of actions. The specific action is determined b…

&lt;span style=&quot;font-weight: bold;&quot;&gt; Explain the different forms of Polymorphism?&lt;/span&gt;
From a practical programming viewpoint, polymorphism exists in three distinct forms in Java:

Method overloading

Method overriding through inheritance

Method overriding through the Java int…&lt;/p&gt;   &lt;p&gt;Ans-2: The ability of a superclass reference to denote object of its own class and its subclasses at runtime is called polymorphism.

&lt;span style=&quot;font-weight: bold;&quot;&gt; What is Class?&lt;/span&gt;
PHP: A class is a collection of variables and functions working with these variables.&lt;/p&gt;   &lt;p&gt;JAVA: A class denotes a category of objects, and acts as a blueprint for creating such objects. A class models an abstraction by defining the properties and behaviors for the objects representing the abstraction. The properties of an object of a class are called attributes, and are defined by field in java. A field in a class definition is a variable which can store a value that represents a particular property. The behavior of an objects of a class are also known as operations, and are defined using methods in java. Fields and methods in a class definition are collectively called members.

&lt;span style=&quot;font-weight: bold;&quot;&gt; What is method overriding? &lt;/span&gt;
Same signature (i.e. method name &amp; parameters) and the same return type this is called method overriding.

&lt;span style=&quot;font-weight: bold;&quot;&gt; What is method overloading?&lt;/span&gt;
The method names are same, but the parameter list must be different. (Parameter must diff. in type, order &amp;amp; number) return type is not a part of the signature.&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;



</content><link rel='replies' type='application/atom+xml' href='http://vindeshmohariya.blogspot.com/feeds/1844698968584823680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/664651663704607214/1844698968584823680' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/1844698968584823680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/664651663704607214/posts/default/1844698968584823680'/><link rel='alternate' type='text/html' href='http://vindeshmohariya.blogspot.com/2007/03/oops-object-oriented-programming.html' title='OOPS-Object Oriented programming?'/><author><name>Vindesh</name><uri>http://www.blogger.com/profile/07018541982625221823</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>