Open In App

DataBase Operations through XAMPP Console

Last Updated : 22 Mar, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we are going to perform database operations in My SQL Xampp Server using Xampp tool. We will perform the following operation as follows.

  • Creating database
  • Create a table in database
  • Insert data into it
  • View data.

Requirements –Xampp server

Introduction :
Database is a collection of related operation. MySQL is a one of the query language for managing the databases. MySQL is a database system used on the web which runs on a server. It is mainly used for large applications.

Xampp :
It has an Apache HTTP Server, MariaDB, and interpreter for 11 different programming languages like Perl and PHP. 

X    - Cross-platform
A    - Apache
M    - MySQL
P    - PHP
P    - Perl

To start your XAMPP server, you can follow the given below steps as follows. 

  • Start xampp server.

  • Type “localhost/phpmyadmin” in your browser. You can see the following screenshots as follows.

Steps to implement database operations :

  • Create a database named mydata.

  • Create a table named student with 4 columns (student_id,name,gender,marks).

  • Open console tab and start typing commands.

Note –
To execute a command press ctrl+Enter Button.

Database Operations :

Insert :
Insert command is used to insert data into the table.

Syntax –

insert into table_name 
values(value1,value2,value3,.....,valuen);

Command – 

INSERT INTO student 
VALUES(1,'sravan kumar','m',95)

Output :

Insert multiple records at a time :

INSERT INTO student 
VALUES(2,'bobby','m',85),(3,'ojaswi','f',95)

Output :

SELECT :
SELECT command is used to display data in the table.

SELECT * FROM student

Output :

Display name and marks :

SELECT name,marks 
FROM student

Output :

UPDATE :
It is used to update / change value based on the given condition.

Syntax –

update table_name 
set column_name="value" where clause..

Command –

UPDATE student 
SET name="rohith" 
WHERE marks=95

Output :


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads