Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Aptitude
  • Engineering Mathematics
  • Discrete Mathematics
  • Operating System
  • DBMS
  • Computer Networks
  • Digital Logic and Design
  • C Programming
  • Data Structures
  • Algorithms
  • Theory of Computation
  • Compiler Design
  • Computer Org and Architecture
Open In App
Next Article:
REPLACE() Function in MySQL
Next article icon

Performing DataBase Operations in XAMPP

Last Updated : 26 Nov, 2020
Comments
Improve
Suggest changes
Like Article
Like
Report

XAMPP is a cross-platform web server used to develop and test programs on a local server. It is developed and managed by Apache Friends and is open-source. It has an Apache HTTP Server, MariaDB, and interpreter for 11 different programming languages like Perl and PHP. XAMPP Stands for cross-platform, Apache, MySQL, PHP, and Perl.

  • It allows you to build a website on a local web server on your computer.
  • Stores data locally

In this article, we are going to perform Database operations like Create, Insert, Update, Delete data from the database created in XAMPP localhost server. We are also going to create a table and then start performing database operations. Following are the list of database operations with their respective syntax:

SELECT statement 

It is used to display all the details from the table.

Syntax: SELECT * FROM 'table_name'

INSERT statement 

It is used to insert data into the table.

Syntax: INSERT INTO `table_name`(`col`, `col2`, `col3`,.. `coln`) VALUES ([value-1],[value-2],      [value-3],....,[value-n)

Update statement

It is used to change/update any data in the table.

Syntax: UPDATE `table_name` SET `col1`=[value-1],   `col2`=[value-2],   `col3`=[value-3],   `coln`=[value-n] WHERE 1

Delete statement

It is used to delete data from a table.

Syntax: DELETE FROM table_name where col="value"

Procedure:

Follow the below steps to perform database operations on XAMPP:

  • Start XAMPP Server
  • Create Database and Create Table
  • Perform Database Operations
  • Verify Resultant Table

Steps to Create a Database:

1. Start XAMPP server

2. Go to Browser and type “http://localhost/phpmyadmin” and Create a database with the name “Vignan” by selecting new

3.  After that, Create table Name “ITDept” and give the number of columns (I created 4 columns) and click on Go

Give column names as “Rollno”(Varchar), “Name”(Varchar), “Gender” (Char), “Address”(Varchar), and Save.

Note: Clicking the “Save” option is important, if not the table is not created.

Then we get the output as:

Performing SQL Operations:

INSERT Operation:

  • Click on SQL

  • Click on INSERT Option

By default, code is available like this:

INSERT INTO `itdept`(`Rollno`, `Name`, `Gender`, `Address`)  VALUES ([value-1],[value-2],[value-3],[value-4])
  • We want to modify the values as follows and click  on “GO”
INSERT INTO `itdept`(`Rollno`, `Name`, `Gender`, `Address`)   VALUES ("171FA07058","Sravan Kumar Gottumukkala", "m", "HYD" )

Output:

  • Now insert 5 records. Data in the database is as follows:

UPDATE Operation:

Default code in the update is:

UPDATE `itdept` SET `Rollno`=[value-1],  `Name`=[value-2],  `Gender`=[value-3],  `Address`=[value-4] WHERE 1
  • Now change the name to Sujatha where rollno is 171FA07078 as follows:
UPDATE `itdept` SET NAME="Sujitha" WHERE `Rollno`="171FA07078"

Output:

SELECT Operation:

The Select statement is used to display or query for data from the database. Follow the below steps to do so:

  • Click on the Select* option

This will result in the following code generation:

SELECT * FROM `itdept` 

Output:

For Selecting particular data follow the below sample query:

Select Rollno, Name from itept

DELETE Operation:

  • Click on the Delete  button to delete the data as shown below:

The generated code would look like below:

DELETE FROM itdept where Rollno="171FA07058"
  • Confirm the deletion by clicking YES

Output:

Our Final data in Table is:



Next Article
REPLACE() Function in MySQL
author
sravankumar_171fa07058
Improve
Article Tags :
  • DBMS
  • DBMS-SQL

Similar Reads

  • PHP - MYSQL : sum() operation
    Problem Statement: In this article, we are going to perform sum() aggregate operation on our database using PHP with xampp server. So we are considering the food_order database and perform database sum() operation. Requirements: xampp Introduction: PHP stands for hypertext preprocessor which is a se
    3 min read
  • CRUD Operations in MySQL
    As we know that we can use MySQL to use Structure Query Language to store the data in the form of RDBMS. SQL is the most popular language for adding, accessing, and managing content in a database. It is most noted for its quick processing, proven reliability, ease, and flexibility of use. The applic
    3 min read
  • Difference between LAMP stack and LEMP stack?
    Difference between LAMP and LEMP stack :A Web Stack or Web application stack refers to a compilation of software that is together used to build websites or web applications. To construct a stack basic requirements are : Operating SystemWebserverDatabaseScript Interpreter 1. LAMP Stack :LAMP stack is
    4 min read
  • Basic SQL Commands
    Structured Query Language (SQL) is the standard language used for managing and interacting with relational databases. Whether we are retrieving data, updating records, or defining the structure of our data, SQL commands provide a powerful and flexible way to handle these tasks. This article will exp
    6 min read
  • REPLACE() Function in MySQL
    The REPLACE() function in MySQL is a powerful tool for string manipulation, allowing users to substitute specific substrings within a larger string. This functionality is particularly useful in various applications such as updating text data, cleaning up input or adjusting content in a database. In
    3 min read
  • MySQL WHILE Loop
    In this, we will cover the overview of MySQL WHILE Loop and then will cover the algorithm of each example and then will see the analysis of each example. Let's discuss it one by one. Introduction :MySQL WHILE loop statement is used to execute one or more statements again and again, as long as a cond
    4 min read
  • DataBase Operations through XAMPP Console
    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 databaseCreate a table in databaseInsert data into itView data.Requirements -Xampp serverIntroduction :Database is a collection of relate
    2 min read
  • PHP | Inserting into MySQL database
    Inserting data into a MySQL database using PHP is a crucial operation for many web applications. This process allows developers to dynamically manage and store data, whether it be user inputs, content management, or other data-driven tasks. In this article, We will learn about How to Inserting into
    6 min read
  • PHP | MySQL Database Introduction
    What is MySQL? MySQL is an open-source relational database management system (RDBMS). It is the most popular database system used with PHP. MySQL is developed, distributed, and supported by Oracle Corporation. The data in a MySQL database are stored in tables which consists of columns and rows.MySQL
    4 min read
  • PHP - MySQL min(),max() aggregate operations
    In this article, we are going to find minimum and maximum details from the table column using PHP from MySQL Xampp server. We are taking an example from employee database to find the minimum and maximum salary of the employee. Requirements -Xampp server Introduction : PHP - It stands for Hyper Text
    4 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences