HTML Table Colspan & Rowspan


HTML tables can have cells that span over multiple rows and/or columns.


NAME  
     
     
     
     
APRIL    
   
   
     
     
2022
     
FIESTA  
 
     

HTML Table - Colspan

To make a cell span over multiple columns, use the colspan attribute:

Example

<table>
  <tr>
    <th colspan="2">Name</th>
    <th>Age</th>
  </tr>
  <tr>
    <td>Jill</td>
    <td>Smith</td>
    <td>43</td>
  </tr>
  <tr>
    <td>Eve</td>
    <td>Jackson</td>
    <td>57</td>
  </tr>
</table>

Note: The value of the colspan attribute represents the number of columns to span.


HTML Table - Rowspan

To make a cell span over multiple rows, use the rowspan attribute:

Example

<table>
  <tr>
    <th>Name</th>
    <td>Jill</td>
  </tr>
  <tr>
    <th rowspan="2">Phone</th>
    <td>555-1234</td>
  </tr>
  <tr>
    <td>555-8745</td>
</tr>
</table>

Note: The value of the rowspan attribute represents the number of rows to span.



HTML Exercises

Test Yourself With Exercises

Exercise:

Use the correct HTML attribute to make the first TH element span two columns.

<table>
  <tr>
    <th >Name</th>
    <th>Age</th>
  </tr>
  <tr>
    <td>Jill</td>
    <td>Smith</td>
    <td>50</td>
  </tr>
  <tr>
    <td>Eve</td>
    <td>Jackson</td>
    <td>94</td>
  </tr>
</table>



Mastering SQL: A Comprehensive Guide to DQL Commands and All Possible SELECT Statements

Structured Query Language (SQL) is a powerful tool for managing and manipulating relational databases. One of the fundamental aspects of SQL is the Data Query Language (DQL), which focuses on retrieving and manipulating data within a database. In this blog post, we will explore the various SELECT statements available in SQL, offering a comprehensive overview and practical examples to help you master DQL commands.

1. The Basic SELECT Statement

SELECT column1, column2, ...
FROM table_name;

This statement selects specific columns from a table, allowing you to retrieve the desired data.

2. Retrieving All Columns

SELECT *
FROM table_name;

This statement fetches all columns from the specified table.

3. Filtering Rows with WHERE

SELECT column1, column2, ...
FROM table_name
WHERE condition;

You can use operators such as =, <>, >, <, >=, <=, LIKE, IN, BETWEEN, and more to define conditions.

4. Sorting Data with ORDER BY

SELECT column1, column2, ...
FROM table_name
ORDER BY column1 ASC, column2 DESC;

This statement sorts the data in ascending (ASC) or descending (DESC) order.

5. Limiting Rows with LIMIT

SELECT column1, column2, ...
FROM table_name
LIMIT 10;

This statement limits the output to the first 10 rows.

6. Joining Tables

SELECT column1, column2, ...
FROM table1
JOIN table2 ON table1.column = table2.column;

This statement joins rows from two tables based on a specified column.

7. Aggregating Data with GROUP BY

SELECT column1, COUNT(column2)
FROM table_name
GROUP BY column1;

This statement groups rows by column1 and applies an aggregate function (COUNT in this case) to column2.

8. Filtering Groups with HAVING

SELECT column1, COUNT(column2)
FROM table_name
GROUP BY column1
HAVING COUNT(column2) > 10;

This statement filters groups with a count greater than 10.

In conclusion, understanding and utilizing these SELECT statements effectively will enable you to retrieve, filter, sort, join, and aggregate data within a relational database. By mastering DQL, you'll become proficient in manipulating data and extracting valuable insights from your database systems. So go ahead, practice these SELECT statements, and enhance your SQL skills today!

Data Query Language (SELECT)

SQL DML Commands: A Comprehensive Guide to Data Manipulation

Structured Query Language (SQL) provides a robust set of Data Manipulation Language (DML) commands to interact with and modify data within a relational database. In this blog post, we will explore the various DML commands in SQL, offering a comprehensive overview and practical examples to help you master data manipulation.

1. INSERT Statement

The INSERT statement is used to add new records to a table. There are multiple ways to write an INSERT statement:

Method 1: Inserting Values into Specific Columns

INSERT INTO table_name (column1, column2, ...)
VALUES (value1, value2, ...);

This method allows you to specify the columns into which you want to insert values, followed by the corresponding values.

Method 2: Inserting Values into All Columns

INSERT INTO table_name
VALUES (value1, value2, ...);

This method inserts values into all columns of the table. The order of values must match the order of columns in the table.

2. UPDATE Statement

The UPDATE statement is used to modify existing records in a table. There are two common ways to write an UPDATE statement:

Method 1: Updating All Rows

UPDATE table_name
SET column1 = value1, column2 = value2, ...;

This method updates all rows in the specified table, setting new values for the specified columns.

Method 2: Updating Specific Rows

UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;

This method updates specific rows in the table based on the specified condition, setting new values for the specified columns.

3. DELETE Statement

The DELETE statement is used to remove records from a table. There are two common ways to write a DELETE statement:

Method 1: Deleting All Rows

DELETE FROM table_name;

This method removes all rows from the specified table, effectively deleting all data within the table.

Method 2: Deleting Specific Rows

DELETE FROM table_name
WHERE condition;

This method removes specific rows from the table based on the specified condition.

By understanding and utilizing these SQL DML commands effectively, you can manipulate data within your relational databases with ease. Whether you need to insert new records, update existing ones, or delete data, these commands provide the necessary tools for data manipulation.

SQL DDL Commands: A Comprehensive Guide to Data Definition

Structured Query Language (SQL) provides a set of Data Definition Language (DDL) commands to define and manage the structure of databases and database objects. In this blog post, we will explore the various DDL commands in SQL, offering a comprehensive overview and practical examples to help you master data definition.

1. CREATE TABLE Statement

The CREATE TABLE statement is used to create a new table with specified columns and constraints. Example:

CREATE TABLE table_name (
  column1 datatype constraint,
  column2 datatype constraint,
  ...
);

2. ALTER TABLE Statement

The ALTER TABLE statement is used to modify an existing table structure. There are multiple ways to use the ALTER TABLE command:

Method 1: Adding a New Column

ALTER TABLE table_name
  ADD column_name datatype constraint;

This method adds a new column to an existing table.

Method 2: Modifying a Column

ALTER TABLE table_name
  ALTER COLUMN column_name datatype;

This method modifies the data type of an existing column.

Method 3: Dropping a Column

ALTER TABLE table_name
  DROP COLUMN column_name;

This method removes a column from an existing table.

3. DROP TABLE Statement

The DROP TABLE statement is used to remove an existing table and its data. Example:

DROP TABLE table_name;

4. CREATE INDEX Statement

The CREATE INDEX statement is used to create an index on one or more columns of a table. Example:

CREATE INDEX index_name
  ON table_name (column1, column2, ...);

5. ALTER INDEX Statement

The ALTER INDEX statement is used to modify an existing index. There are multiple ways to use the ALTER INDEX command:

Method 1: Renaming an Index

ALTER INDEX index_name
  RENAME TO new_index_name;

This method renames an existing index.

Method 2: Modifying an Index

ALTER INDEX index_name
  [REBUILD | REORGANIZE];

This method modifies the structure or physical properties of an existing index.

6. DROP INDEX Statement

The DROP INDEX statement is used to remove an existing index. Example:

DROP INDEX index_name;

By understanding and utilizing these SQL DDL commands effectively, you can define and manage the structure of your databases and database objects. Whether you need to create tables, modify columns, or drop indexes, these commands provide the necessary tools for data definition.

Some Important SQL Queries

For geting ALL table_names From Database : SELECT table_name FROM information_schema.tables WHERE table_type='BASE TABLE'
Show all tables : show tables
Show list of base tables : SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE table_type='BASE TABLE'
Show list of all tables : SELECT * FROM INFORMATION_SCHEMA.TABLES
Count Base tables base tables : SELECT count(*) AS TotalTable FROM INFORMATION_SCHEMA.TABLES WHERE table_type='BASE TABLE'
coumls present in tables : SELECT TABLE_ROWS FROM INFORMATION_SCHEMA.TABLES WHERE table_type='BASE TABLE'
For Stucture Of Table : DESC table_name
Databases are at the core of data-driven applications. Among the different types of available database deployment options, the usage and popularity of cloud databases and DBaaS (Database-as-a-Service) offerings have been growing like never before. According to a recent ResearchAndMarkets.com report, cloud databases are the fastest-growing segment of cloud services, projected to generate $320 billion by 2025.
Imagine that you’re building a brand new app and need to get it to market as quickly as possible. You don't have the time or resources to worry about hardware procurement, software installation, configuration, and ongoing maintenance. Managed databases enable you to reduce this operational overhead using a set of simple API calls or with just a few clicks on the UI to spin up and manage databases.
With managed databases, enterprises are not bogged down by the "grunt work" of managing costly physical database infrastructure, mitigating security risks, scaling, storage, and other operational costs such as additional human capital to keep the service up and running. As a result, developers can devote more time to critical tasks, such as improving developer agility and innovating, leaving the rest to the provider running the managed database service.

What is Database-as-a-service (DBaaS)?

In a nutshell, DBaaS is a cloud-based database service that includes everything needed to run a database in the cloud, including hardware, software, licenses, support, and operational maintenance. As a result, users can quickly spin up and run distributed databases that live in the cloud, paying only for the time they use them. Using DBaaS have several key benefits -
  1. Cost effectiveness – Setting up physical infrastructure for building an application is one of the most significant expenses. It is also time-consuming which requires a dedicated workforce to set up, maintain and support on-premise infrastructure. With DBaaS, all these costs and resources are handled by the service provider. Enterprises using DBaaS solutions are charged based on their consumption.
  2. Improved scalability – If you have Database infrastructure that you manage, you need automation in place to ensure scaling based on traffic. This is where DBaaS is most effective. With DBaaS, you don't need to purchase any additional capacity of infrastructure or have automation and management in place for hypothetical future needs -- the provider continually expands or shrinks your storage capacities and compute resources based on traffic. Additionally, with autoscaling turned on, you can remove the grunt work of complex capacity planning. With this additional flexibility, you will be able to meet both surging demands and periods of low activity.
  3. Rapid development – With a DBaaS model in place, data operations are highly simplified. Unlike traditional on-premise database systems, developers don't need to go through the time-consuming database provisioning process, which can take days or weeks. Rapid on-demand database provisioning using DBaaS and better integration with other data solutions in the cloud can drastically shrink the time to market for a new app feature.
  4. Better data and application security – Meeting regulatory compliance requirements can be a challenging and costly affair. DBaaS solutions provide enterprise-level data security, which meets specific regulatory compliance standards like HIPAA (for health industry), FedRAMP (for defense), NERC CIP (for electrical power infrastructure), etc. DBaaS solutions also provide native security features like data encryption to protect sensitive data at rest and in transit.
DBaaS is an effective way to get your database up and running quickly. Still, it will not automatically solve your application architecture issues. Additionally, if your application is tightly coupled with a DBaaS service, it will be challenging to move your application to another DBaaS service in the future. This is where a Data API approach is beneficial.

What is a Data API?

Data APIs provide a way to loosely connect the frontend application logic directly to a DBaaS or similar system through a secure and fast-scaling API with a standardized query and response format. In fact, by using an API-based approach, you can break the tight coupling of the application from the database so that you can benefit from the reusability of the data and portability of your code.
While DBaaS significantly disrupted the world of database management, Data APIs represent the next evolution in how applications are built. With data APIs, you get the same power of a DBaaS, along with other unique advantages such as data safety, security, and scalability characteristics. For example, Fauna is a Data API that is provisioning-free, configuration-free, and available instantly as a serverless utility. This allows an enterprise to deliver limitless capacity and throughput, so that modern applications can perform under unpredictable loads.

Login
ADS CODE