Friday, September 8, 2023

HTML BASIC

                                        HTML BASIC

HTML Documents

All HTML documents must start with a document type declaration: <!DOCTYPE HTML>.

The HTML document itself begins with <html> and ends with </html>.

The visible part of the HTML document is between <body> and </body>.

Example

<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>
</html>

The <!DOCTYPE> Declaration

The <!DOCTYPE> declaration represents the document type, and helps browsers to display web pages correctly.

It must only appear once, at the top of the page (before any HTML tags).

The <!DOCTYPE> declaration is not case sensitive.

The <!DOCTYPE> declaration for HTML5 is:

<!DOCTYPE html>

HTML Headings

HTML headings are defined with the <h1> to <h6> tags.

<h1> defines the most important heading. <h6> defines the least important heading:

Example

<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>

HTML Paragraphs

HTML paragraphs are defined with the <p> tag:

Example

<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

HTML Links

HTML links are defined with the <a> tag:

<a href="https://bhavithacherukuri.blogspot.com/">click me</a>

The link’s destination is specified in the html attribute.

Attributes are used to provide additional information about HTML elements.

HTML Images

HTML images are defined with the <img> tag.

The source file (src), alternative text (alt), width, and height are provided as attributes:

Example

<img src="dog.jpg" alt="dogs.com" width="104" height="142">

Thursday, September 7, 2023

HTML EDITORS

                                   HTML EDITORS

An HTML element is defined by a start tag, some information that you want to write, and an end tag:

<tagname> Content goes here… </tagname>

The HTML element is everything from the start tag to the end tag:

<h1>My First Heading</h1>

<p>My first paragraph.</p>

HTML element

Web Browsers

The purpose of a web browser (Chrome, Edge, Firefox, Safari) is to read HTML documents and display them correctly.

A browser does not display the HTML tags, but uses them to determine how to display the document:

HTML Browser

HTML EDITORS

We can use NOTEPAD or NOTEPAD++ or VISUAL STUDIO CODE CODE for writing html tags and for creating web pages.

Beginners can use NOTEPAD as it is simple editor as it is good way for learning.

Write the HTML code as shown below:

Now create a new folder on your desktop and save this file.

Now save the html file

Now go to the folder and double click on the file that you have saved. Then the page opens in the browser.

This is how you create web page using html.

Friday, August 25, 2023

HTML Introduction

                          HTML Introduction

HTML is the standard markup language for creating Web pages.

What is HTML?

  • HTML stands for Hyper Text Markup Language
  • HTML is the standard markup language for creating Web pages
  • HTML describes the structure of a Web page
  • HTML consists of a series of elements
  • HTML elements tell the browser how to display the content
  • HTML elements label pieces of content such as “this is a heading”, “this is a paragraph”, “this is a link”, etc.

Sample HTML Document

Example

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>
</html>

Example Explained

  • The <!DOCTYPE HTML>declaration defines that this document is an HTML5 document
  • The <html> element is the root element of an HTML page
  • The <head> element contains meta information about the HTML page
  • The <title> element specifies a title for the HTML page (which is shown in the browser's title bar or in the page's tab)
  • The <body> element defines the document's body, and is a container for all the visible contents, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
  • The <h1> element defines a large heading
  • The <p> element defines a paragraph

Sunday, August 20, 2023

Difference between MySQL and MongoDB

 Difference between MySQL and MongoDB

MySQL and MongoDB are the two most popular database used for the enterprise application. Although both databases are free and open-source, they also have a lot of differences. In this section, we are going to compare the differences between MySQL and MongoDB database system based on the various parameters.

What is MySQL?

MySQL is the popular database management system used for managing the relational database. It is open-source database software, which is supported by Oracle Company. It is fast, scalable, and easy to use database management system in comparison with Microsoft SQL Server and Oracle Database. It is commonly used with PHP scripts for creating powerful and dynamic server-side or web-based enterprise applications.

It is developed and supported by the Swedish Company, MySQL AB, and written in C and C++ programming languages. Many small and big companies use MySQL. MySQL supports many Operating Systems like Windows, Linux, MacOS, etc. with C, C++, and Java languages.

What is MongoDB?

MongoDB is an open-source, cross-platform, and document-oriented NoSQL database that provides high performance, a high volume of data storage, rich query language, and automatic scaling. It is written in C++ and developed and maintained by a company named 10gen. It is simple, easy to use and learn by the developers. It stores data in JSON-like format. MongoDB is designed to work on the concept of collection and document.

MongoDB supports many Operating Systems like Windows, Linux, MacOS, etc. with C, C++, PHP, Node.js, Python, Java, and Ruby languages. The main purpose of using the MongoDB database is its fast development features, big-data support, flexible deployment, and easy to use.

Let us see the following comparison chart to understand the essential differences between MySQL and MongoDB.

MySQL vs MongoDB

Saturday, August 19, 2023

MySQL Updating a View

                 MySQL Updating a View

A view can be updated with the CREATE OR REPLACE VIEW statement.

CREATE OR REPLACE VIEW Syntax

CREATE OR REPLACE VIEW view_name AS
SELECT column1, column2, ...
FROM table_name
WHERE condition;

The following SQL adds the “City” column to the “Brazil Customers” view:

Example

CREATE OR REPLACE VIEW [Brazil Customers] AS
SELECT CustomerName, ContactName, City
FROM Customers
WHERE Country = 'Brazil';

MySQL Dropping a View

A view is deleted with the DROP VIEW statement.

DROP VIEW Syntax

DROP VIEW view_name;

The following SQL drops the “Brazil Customers” view:

Example

DROP VIEW [Brazil Customers];

MySQL Views

                                        MySQL Views

MySQL CREATE VIEW Statement

In SQL, a view is a virtual table based on the result-set of an SQL statement.

A view contains rows and columns, just like a real table. The fields in a view are fields from one or more real tables in the database.

You can add SQL statements and functions to a view and present the data as if the data were coming from one single table.

A view is created with the CREATE VIEW statement.

CREATE VIEW Syntax

CREATE VIEW view_name AS
SELECT column1, column2, ...
FROM table_name
WHERE condition;

Note: A view always shows up-to-date data! The database engine recreates the view, every time a user queries it.

MySQL CREATE VIEW Examples

The following SQL creates a view that shows all customers from Brazil:

Example

CREATE VIEW [Brazil Customers] AS
SELECT CustomerName, ContactName
FROM Customers
WHERE Country = 'Brazil';

We can query the view above as follows:

Example

SELECT * FROM [Brazil Customers];

The following SQL creates a view that selects every product in the “Products” table with a price higher than the average price:

Example

CREATE VIEW [Products Above Average Price] AS
SELECT ProductName, Price
FROM Products
WHERE Price > (SELECT AVG(Price) FROM Products);

Thursday, August 17, 2023

MySQL Working With Dates

  MySQL Working With Dates

MySQL Dates

The most difficult part when working with dates is to be sure that the format of the date you are trying to insert, matches the format of the date column in the database.

As long as your data contains only the date portion, your queries will work as expected. However, if a time portion is involved, it gets more complicated.

MySQL Date Data Types

MySQL comes with the following data types for storing a date or a date/time value in the database:

  • DATE - format YYYY-MM-DD
  • DATETIME - format: YYYY-MM-DD HH:MI:SS
  • TIMESTAMP - format: YYYY-MM-DD HH:MI:SS
  • YEAR - format YYYY or YY

Note: The date data type are set for a column when you create a new table in your database

Working with Dates

Look at the following table:

Orders Table

Orders

Now we want to select the records with an OrderDate of “2021–07–27” from the table above.

We use the following SELECT statement:

SELECT * FROM Orders WHERE OrderDate='2021-07-27'

Now, assume that the “Orders” table looks like this (notice the added time-component in the “OrderDate” column):

If we use the same SELECT statement as above:

SELECT * FROM Orders WHERE OrderDate='2008-11-11'
Orders

we will get no result! This is because the query is looking only for dates with no time portion.

Tip: To keep your queries simple and easy to maintain, do not use time-components in your dates, unless you have to!

Building Static Website(part6) HTML Lists

  Building Static Website (part6) HTML Lists Today, let us add some lists to our detailed view section by using html lists. Lists: List is a...