Learn MySQL for Windows – Database, Tables, Insert, Update, Delete Commands

MySQL DBMS Practical on Windows – Complete Guide for FYBSc IT

If you are a FYBSc IT student, learning MySQL is an essential part of your DBMS practicals. This step-by-step guide explains how to perform common MySQL operations such as viewing databases, creating a database, creating tables, inserting records, updating records, and deleting records – all on MySQL for Windows.

Aim of the Practical

To understand and perform basic MySQL operations on Windows such as viewing databases, creating databases, creating tables (with and without constraints), inserting records, updating records, and deleting records.

Step 1: Open MySQL on Windows

Once MySQL is installed on your Windows system, you can use either:

  • MySQL Command Line Client (black terminal window)
  • MySQL Workbench (GUI-based tool)

In this practical, we’ll use the command line interface on Windows for better understanding.

Step 2: Viewing All Databases

SHOW DATABASES;
    

This command displays all available databases in your MySQL server.

Step 3: Creating a Database

CREATE DATABASE CollegeDB;
    

Here, we created a new database called CollegeDB. You can replace the name with any database name you prefer.

Step 4: Viewing All Tables in a Database

First, switch to the database you created:

USE CollegeDB;
    

Now view all tables inside it:

SHOW TABLES;
    

Step 5: Creating Tables (With and Without Constraints)

Without Constraints:

CREATE TABLE Students (
    id INT,
    name VARCHAR(50),
    course VARCHAR(50)
);
    

With Constraints:

CREATE TABLE Students (
    id INT PRIMARY KEY,
    name VARCHAR(50) NOT NULL,
    course VARCHAR(50),
    age INT CHECK (age >= 18)
);
    

Step 6: Inserting Records

INSERT INTO Students (id, name, course, age) 
VALUES (1, 'Rahul Sharma', 'BSc IT', 20);

INSERT INTO Students (id, name, course, age) 
VALUES (2, 'Priya Patel', 'BSc IT', 19);
    

Step 7: Updating Records

UPDATE Students 
SET course = 'Computer Science' 
WHERE id = 2;
    

This updates Priya’s course to Computer Science.

Step 8: Deleting Records

DELETE FROM Students 
WHERE id = 1;
    

This deletes the student record where id = 1.

Conclusion

By following these steps in MySQL for Windows, you can perform all the essential DBMS practical tasks required in FYBSc IT. From creating a database to inserting, updating, and deleting records, these commands help you understand the basics of database management.

👉 Practice these commands regularly to gain confidence in SQL for your DBMS practicals.

🔗