Posts

Showing posts from September, 2024

Switch Case Statement

Switch Case Statement The JavaScript  switch...case  statement executes different blocks of code based on the value of a given expression.   The  switch  statement is used to perform different actions based on different conditions. Syntax switch ( expression ) {    case   x :      // code block      break ;    case   y :      // code block      break ;    default :      //  code block } This is how it works: The switch expression is evaluated once. The value of the expression is compared with the values of each case. If there is a match, the associated block of code is executed. If there is no match, the default code block is executed. The break Keyword When JavaScript reaches a  break  keyword, it breaks out of the switch block. This will stop the execution inside the switch block. EXAMPLE: < script >  ...

Relationship In Database

Image
  To answer "What is a relationship in database?", it is  an association between tables .  A relational database collects different types of data sets that use tables, records, and columns. It is used to create a well-defined relationship between database tables so that relational databases can be easily stored. For example of relational databases such as Microsoft SQL Server, Oracle Database, MYSQL, etc One to One relationship One to many or many to one relationship Many to many relationships One to One Relationship (1:1):  It is used to create a relationship between two tables in which a single row of the first table can only be related to one and only one records of a second table. Similarly, the row of a second table can also be related to anyone row of the first table. Following is the example to show a relational database, as shown below. One to Many Relationship:  It is used to create a relationship between two tables. Any single rows of the first table c...