Press "Enter" to skip to content

Posts published in “blog”

Blog Help you to understand, How to use  MYSQL Command? How to Use PHP , How to  HTML Code

MySQL commands with examples

MySQL commands with examples

Organizational success is based on  effective decision making which requires timely, relevant and accurate information. That is why  information plays a critical role in today's competitive environment. Database Management Software (DBMS) makes more comprehensible  tasks of managing the data and extract useful information out of it. In this article , we shall learn about the basic concepts of databases and also learn how to use RDBMS for some applications

Basic Concepts and Definitions

Data is a collection of raw details which have not been processed to reveal useful information. Information is produced by processing data as shown in below: Data - > Processing ->  Information For example, given the data of the test marks of all the students in a class (data), the average, maximum and minimum marks in the class can be used as indicators of the performance of the class (information). In other words, we can say that we have extracted the information about average, maximum and minimum marks for given student data given below Marks obtained by students in an examination ->Compute: Average marks, Maximum marks, Minimum marks   ->Performance of the class Databases are being used mainly  in our day-to-day life. Be it business, engineering, medicine, education, library, to name a few. For example, consider the name, class, roll number, marks in every subject of every student in a school. To record this information about every student in a school, the school might have maintained a register, or stored it on a hard drive using a computer system and software such as a spreadsheet or DBMS package. Such collection of related data that has been recorded, organized and made available for searching is called a Database. A database has the following properties:  1) A database is a representation of some aspect of the real world also called mini world. Whenever there are changes in this mini world they are also reflected in the database.  2) It is designed, built and populated with data for specific purposes.  3) It can be of any size and complexity.  4) It can be maintained manually or it may be computerized. In this article we will learn MySQL CUI Commands. Not phpmyadmin GUI interface.

MySQL Set Root Password

If you want to set Mysql root login password,There are number of command but below is simple command ,which help you to set root password.
myadmin -uroot -p 'new password'

How To Connect to MySQL

How to connect to MySQL ? From the command line if you want to login to MySQL server ,below is the command.

# mysql -u root - p 

After this command screen ask for mysql server password. Give the password then # or $ prompt replace with 

mysql>

This shows that you're connected to the mysql server.

Connect to Mysql Remote Server

mysql -u root -h HOSTSERVERNAME -u

MySQL Create Database

After login to MySQL server below command help you create MySQL database

mysql>create database DATABASEname

Backup a MySQL Database using mysqldump

Backup a MySQL Database using mysqldump

#mysqldump -u root -p database-name > /home/user/backupdata.sql

You can also dump the database and compress while running command by piping it through gzip: mysqldump -u root -p database-name | gzip -v > database-backup.sql.gz

Dump all MySQL Databases on a server

If you want to take backup of all your databases  ,you can use one single command to take backup of all databases . 

#mysqldump -u root -p PASSWORD  --opt >/var/www/html/databases.sql

Dump a specific table from a mysql database

If some time you want to take a back for a specific table ,this command will help you.
mysqldump -c -u username -p ROOTPASSWORD  database-name table-name > /tmp/db-name.table-name.sql

Import a MySQL Database

Import or restore a database with a single command.
mysql -u username -p -h localhost database-name < database-backup.sql

Display All Database in MySQL Server

Login to mysql server ,then use
Show Databases;

Select or Open a Database in MySQL

You can perform all database operations after opening the database,Example create table,store information etc.
use databasename;

Show Tables in a MySQL Database

The command which shows all the tables in the database is
Show tables;
The above command displays all the tables in the database.

Drop A MySQL Database (deletes a db)

If you want to delete a database from mysql , Delete database will delete everything from the database like table,procedure,trigger etc. all objects will be deleted .Be careful while deleting the database.You can delete database while you close the database 
Drop database DATABASENAME

How To Reset the MySQL root password

How to reset the Mysql root login password ? .Below I have expalin process will allow you to reset the mysql root password: Stop mysql: /etc/init.d/mysqld stop Start mysql in safe mode: mysqld_safe --skip-grant-tables & Login as root: mysql -u root Set the mysql root password:
1 2 3 4 use mysql; update user set password=PASSWORD("new-root-passwd") where user='root'; flush privileges; quit
Restart the mysql service and you can login with your new password: /etc/init.d/mysql restart

Create a MySQL table

To store information in database ,create tables in mysql database ,
Create table t1 ( Sno int, Name varchar(20), );

Create an INNODB Table in MySQL

If you want to create INNODB table ,The following will create an innodb table:
Create table t1( Sno int, Name varchar(20), )type=innodb;

Convert Mysql Table Engine MyISAM to INNODB

This command help you to convert MySQL table engine to INNODB.
ALTER TABLE example  ENGINE = InnoDB

Repair Broken Table(s) in MySQL

If you have a corrupt / broken table (pretty common with MyiSAM) then take a dump (see the skip broken table with mysqldump instructions above) and then run:First run check table error with  given command.
check table tablename
And then run repair table tablename;

Show MySQL Database Fields & Field Formats

To check the fields or Columns in the table,the command you can run.
Describe table-name;

MySQL Show Table Data (Displays the contents of a table)

This command shows all rows and columns from the table.
Select * from table-name;

Show Columns in a MySQL Table

Select column-name from table-name;

Add a new column in MySQL

Add a new column in mysql table .The following is an example of how to add a new column in mysql:
alter table table-name add column new-column datatype(20);

Delete a Column in MySQL

Some time we want to delete column from table.The following is an example of how to delete (drop) a column in mysql:
alter table table-name drop column column-name;

Delete a Row from a MySQL Table

How to delete row from table.
Delete from table-name where column-name ='some’;

Show total rows  in a MySQL Table

Select count(*) from table-name;

MySQL SUM Column Example

Select sum(columnname) from table-name;

MySQL Join two and more Tables

How to join tables in MySQL: SELECT column_names FROM table-1, table-2 WHERE (table-1.column = table-2.column)

Display Table data in Descending Order (DESC)

 

Show records in descending records . Select * from table-name ORDER by column-name  Default is ascending order but for descending order you have to give DESC at the end. Select * from table-name ORDER by column-name DESC.

How to display MySQL table  Unique Records

Shows all unique records from a mysql table: Select distinct column name from table-name.

How to display rows Containing a Value

This example will show all rows containing “America”: Select * from table-name where column-name=“America” MySQL Search for a Record Matching (Various Examples) Search for records with the name “Johan” born in “1996”: Select * from table where column-name=”Johan” and dob=”1996”

MySQL Commands List

MySQL use database

MySQL Use Database

MySQL use database command is use for to Open Database. Lets understand How to run SQL use database . First of all connect to MySQL than once it is connected with MySQL , It is used to select one database  or in other word it will help to open one database if server has multiple database. Selecting Database from the Command Prompt How to Open database ,it is very simple. Once the command prompt appears then in front of mysql> type use "database name"; This is an example, will open w3htmlschool at command #mysql -u root -p Enter password:  mysql> use w3htmlschool; Database changed mysql> Above Command will open database  at command prompt , It is ready for MySQL command like ,create tables ,show tables etc. MySQL Tutorial More on MYSQL

System Software

System Software

System software is a kind of computer program that is programmed to communicate with computer hardware and application programs. Computer Hardware only runs once it has system software like an Operating system. The Operating system communicates between hardware and software, Let Understand, for example, If I want to play the game on to computer then click on the game and the game will start, computer sound will start , keyboard start working accordingly. Now in this example playing the game is only possible if you have a computer with an operating system and game (application software) If we think of the computer system as a layered model, the system software is the interface between the hardware and user applications. An example of system software is Operating System. The Operating system manages all activity or the other programs in a computer.

System software is used to manage the computer working like printing.
System software runs in the background for example saving file.
Maintaining the computer's basic functions so users can run higher-level application software to perform certain tasks. Essentially, system software responsible for a platform for application software to be run on top of it.

System Software Examples

Systems software can be categorized under the following:

  1. The Operating system: Help communication between hardware, system programs, and other applications.
  2. Device driver: Enables device communication with the OS and other programs.
  3. Firmware: Enables device control and identification.
  4. Translator: Translates high-level languages to low-level machine codes.
  5. Utility: Ensures optimum functionality of devices and applications.
Operating System

Operating system is the software that acts as an interface between user and computer hardware. A computer needs to communicate with both the hardware and software; to do this;
it utilizes the services of an Operating system. Examples of some popular operating system are Windows, Linux, Unix, MS-DOS, SOLARIS, MAC OS, Gary Arlen Kildall is known as the father of operating system.
It also acts like a government which lays down policies for efficient utilization of the resources and provides for effective coordination amongst the various components of a computer. Every computer system whether it is an independent system like a desktop or a cell phone must have an operating system for performing the core functionalities like accepting input from various input devices, directing the output to the display, managing the files and directories, communicating with hardware, and installing /uninstalling of peripheral devices.

Operating System

Operating System as an Interface Functions of an Operating system can be broadly categorized as:
− Communication Manager
− Resource Management
− Process Management
− File Management
− Memory Management
presents the various functions of an operating system.

Device driver Device driver

A device driver is a program that installs on to computer operating system that enables one or more hardware devices to communicate with the computer's operating system, Without a device driver, the hardware unable to communicate with the operating system

Frmware software firmware

Firmware is a set of instructions programmed on a hardware device. It provides the necessary instructions for how the device communicates with the other computer hardware.

Introduction to software

Introduction to software

Software is a set of instructions that tell a computer what work to be done. The software comprises the set of Instructions, procedures, and routines associated with the operation of a computer hardware or system . A sotware is set of instructions that directs or tells a computer's hardware to perform a task is called a program, or software program. For example, A software tells a computer that displays MY Name on the screen then computer hardware works accordingly. Computer hardware is dump and duff that means whatever you instruct the computer the computer works accordingly so software is giving that instruction to the computer and then the hardware works. Can we run a computer without software, then its answer is NO

What are the basics of software?

Software required to run the hardware components of the laptop and different software programs is known as system software. System software program acts as an interface between hardware and personal applications. An interface is wanted due to the fact hardware devices or machines and people communicate in one-of-a-kind languages.

What are the 3 main types of software?

  1. System Software
  2. Application software
  3. Programming language software

Application Software

To understand the Applications software lets us understand computer applications. Home Playing games, online bill payment, watching movies or shows at home, home tutoring, social media access, internet access, etc. Medical Field Storing patient details,maintaining a database of hospitals etc history. Entertainment Watching movies online, play games online, listening to music, etc Industry Maintaining inventory, designing purpose, creating virtual sample products, interior designing, video conferencing, etc Education Online classes,As we can see how helpful computers are in COVID-19,All students attending classes Online. Government Citizen database and policies accordly after analysing data,Use full in Defence for wapen , missile development etc Banking Online banking or mobile bank Science and Engineering And many more fields All of the above facilitate users in performing their tasks in an easy and effective manner. A wide range of operations can be carried out with this application software. These consist of developing spreadsheets, composing electronic mail, and taking part in games. It is necessary to be aware that each and every application software program is designed to function with positive particular duties such as a calculator is supposed to operate numeric calculations only. Another famous instance of software program may want to be Microsoft Word Application which is a single suite that contains a couple of functionalities. Features of Application Software An application software program is developed to facilitate its customers with several capabilities, to make certain clean operations of the respective task. Following are some of the key aspects of utility software:
  • Application software is developed user requirement
  • Application Software is developed to perform specific tasks.
  • Application software gives a good user interface, manage a huge amount of available information so that it can be used to create easy to understand data graphically
  • It is easy to design application software. compare to system software.
Purpose of Application Software Help end-users with their daily task. Manage Huge data for users. Help users to maintain data properly,and according to data, they can plan business promotions, etc. Application Software Examples Nowadays users are dependent on computers which help them to execute their tasks in a much more effective manner. There are many Application software examples,which help users to perform day-to-day operations. Like open document, saving a file, sending a file as email, searching for information on the internet, drawing, etc. Other Than this we can use Many mobile apps for day-to-day tasks. Like Skype, video making, etc. Word Processor The software mainly deals with the creation, editing, formatting and printing of word documents. With the assistance of these application software programs, one can store their large amount of data easily. In addition to this, it permits users to perform various operations as well. Following are some of the most commonly used word processor based applications software programs: GOOGLE DOCS Google Docs is a free online word processor software that permits its customers to create and manipulate files in an effortless and high-quality manner. MS WORD It is one of the most popular which helps to create ,modify ,print and save documents . Database Application Software When Users want to save huge amounts of data into computer system very easily then Database Application help them.These are application software is developed for Database Management System ., MYSQL Very popular RDBMS ,Help user to edit ,delete ,modity create ,save database as backend. Graphics Software When users are looking for high quality images,picture editing etc. To do all this graphics photo editing software applications include the following: CORELDRAW ADOBE PHOTOSHOP Presentation Software Application software which helps to make presentation information in slides. In this presentation slides store graphics elements, audio or other multimedia for better comprehension of the topic. Web Browsers The software is used for browsing the internet, it is used for surfing the internet. Also, when a particular user reads to any web page, then web browsers look for the appropriate page. It then provides information to the requested page by the user. The different types of web browsers available are: GOOGLE CHROME Google Chrome is one of the most popularly used web browsers in the world by google enc. It is used for surfing the internet and showing information. INTERNET EXPLORER Microsoft to be used in Windows OS ,Internet Explorer is another most common web browser Firefox Safari Microsoft edge Opera

Best PHP tutorial Online

Best PHP tutorial - What Is PHP?

  • PHP - PHP stands for "PHP: Hypertext Preprocessor". In 1994 Rasmus Lerdorf unleashed the first version of PHP .
  • PHP is a server side scripting language . PHP is an open source project /general-purpose scripting language that is especially suited to web development and evolved as more and more people found out how useful it was.
  • PHP is a very easy language that can be embedded into HTML.
  • PHP script can be run on all major operating systems, including Linux, many Unix variants (including HP-UX, Solaris and OpenBSD), Microsoft Windows, macOS, RISC OS, and probably others.
  • PHP support for most of the web servers today. This includes Apache, IIS, and many others.
  • After Choosing Operating system and web server now you have the choice of using procedural programming or object oriented programming (OOP), or a mixture of them both.
  • PHP support for a wide range of databases like MySQL, PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server, connect to any database supporting the Open Database Connection standard via the ODBC extension. Other databases may utilize cURL or sockets, like CouchDB.
  • PHP is used to manage dynamic content, databases, cookies, session tracking, and even build entire e-commerce sites.
  • PHP Syntax is C language Like.
  • PHP has support protocols such as LDAP, IMAP, SNMP, NNTP, POP3, HTTP, COM (on Windows) and many more ,so that it can talk to others services easily .

Uses of PHP

  • It is used for creating dynamic websites.
  • PHP support interacting with any back-end and database server e.g. MySQL, HTML etc
  • PHP use for implement the business logical layers (one or more) It can Encrypt Data
  • PHP support Cookies variable and set cookies
  • PHP code is used for send and receive E-Mails.
  • PHP has a number of inbuilt functions which find today's date, and then build a calendar for the month. Etc
  • PHP script has system functions, i.e. from files on a system it can create, open, read, write, and close them.
  • It can handle forms, i.e. gather data from files, save data to a file.

Characteristics of PHP

  • Simplicity
  • Efficiency
  • Security
  • Flexibility
  • Familiarity

PHP Script Example "Hello World"

To get a feel of PHP, first start with simple PHP scripts. Since "Hello, World!" is an simple example, As mentioned earlier, PHP is embedded in HTML examples . That means that in amongst your normal HTML you'll have PHP statements can be embedded like this: <HTML> <HEAD>HELLO </HEAD <BODY> <?php echo “Hello World”; ?> </BODY> </HTML> Output of above code is as follow: Hello World In this example we have seen that PHP has embedded inside the the HTML code the PHP code sends to to server and translated or executed by server and the output is displayed on the with HTML on browser screen.Lets Understand the above code PHP script Start with <?php PHP script End with ?> Echo will display the Hello World on Browser.

PHP code Example without embedded in HTML

<?php  echo “Hello World” ; ?>

What is Search Engine Optimization?

SEO

What Is Search Engine Optimization?

What Is Search Engine Optimization? Search Engine Optimization (SEO) is used in all factors of net marketing. You want to understand as a lot as you can about how web optimization works in order to get the proper  marketing of your website online. When you use search engine optimization in all of your content material - each textual content and visual, you can draw moretraffic to your site. In order to apprehend how to use SEO, you want to be aware of why people use this kind of advertising and count number on it so closely in order to get the desired traffic to their website. search engine optimization is what receives a website seen in the search engines. So what precisely is SEO? This sets up your text, pictures and movies so that they are easy to discover when any one is looking out for them the use of the various search engines online. While it is regularly stated that Google depends extra on website positioning content material than Yahoo, which reliesmore on hyperlink building, the fact of the rely is that in order for a internet site to be discovered online, it ought to come up in the search engine. For example, if you have a website that sells cooking appliances, you will desire to make sure that you shape your website so that others who might also be searching for the merchandise yousell will be capable to locate it online. Those who are searching on line for what you have to sell may do it in a range of exceptional ways, even though the best way for any one to find something on line is to use the search engines. Most of the site visitors to your website will come from search engine optimization. You want to comprehend which key phrases will work for your website. These are the phrases or phrases that humans will put into the search engine bars to get hold of the search engine results pages. Many humans these days are inserting in longer phrases into the search engines to narrow down their search. There are tools that the website proprietor can use to check out the first-class key phrases for their website, based totally on what they promote and what phrases viable clients are probable to plug into the search bars that will lead them to the site. In order to be successful at this, a website owner need to no longer solely understand the thinking of SEO, however additionally a great deal about the goal market,which is these who are most possibly to buy the merchandise on the website. If you are simply beginning out your website, or if you have a website up and strolling already,you want to understand how to use search engine optimization in all aspects of your marketing.While there are different methods to market your internet site and products except the usage of SEO, the fact of the depend is that 60 percentage of all visitors on web sites comes from these who found the internet site in the search engines. These humans are searching for out what you have to offerand are discovering you on line as lengthy as you are accessible. Once your web site is search engine optimized, you can assume to get extra site visitors to your site from the search engines. People who may additionally be involved in your web site will discover it simpler if your internet site is search engine optimized. Most human beings use the search engines to locate what if  they are searching for when they go online. By having your internet site optimized and handy to find in the search engine effects pages, you can appeal to extra visitors to your website through the search engines. There are many web advertising and marketing businesses that will assist you get your internet site search engine optimized and preserve it that way. Some of the strategies that they use to optimize a website encompass the following:
  • Article marketing
  • Blogs
  • Press Releases
  • Video ads
  • Google ads
All of these can be optimized in order to include key phrases that will make the website appear in the search engine outcomes pages or, in the case of Google ads, land them on pages the place they are most in all likelihood to discover humans who will be fascinated in your website. The complete motive of making a website search engine optimized is to make it less complicated for potential purchasers or clients to go to your site. Those who can also be fascinated in your merchandise or offerings can solely take benefit of them if the understand about them and the place to get them. You have, most likely, long gone on line in search of some thing that you desired to purchase at one time or another. Chances are that you put the records into the search engine toolbar to pull up search engine results pages. You likely sifted via a few pages earlier than you got here up with what you wanted. This is the fundamental thinking of SEO. Those who recognize how to use search engine optimization to make their website greater searchable and probable to come up in the first two pages of the search engine results pages are greater possibly to have consumers land on their site. There are possibly many websites out there that provide you fascinating data as nicely as products or services. Unfortunately, many of them are buried deep in the search engine results pages. Most people, when looking on line for something, will provide up after going a few pages into the search engine consequences pages. In some cases, a search may additionally produce tens of millions of hits. Needless to say, you do no longer prefer to go via each and every one in order to locate what you are searching for. Most human beings have neither the time or the inclination to do this. This is why it is so vital for organizations and others who choose to have their websitenoticed make certain that they use web optimization methods in order to do so. By the use of SEO, website will no longer be buried in the center or at the cease of tens of millions of results. It has a better hazard of getting to the the front of the search engine effects web page

What is HTML?

HTML is not a programming language; it is a Hyper Text  markup language that defines the structure of your content. HTML consists of a number of elements, which you use to enclose, or wrap, different parts of the content to make it appear a certain way, or act a certain way. The enclosing tags can make a word or image hyperlink to somewhere else, can italicize words, can make the font bigger or smaller, and so on.  For example, take the following line of content: