My SQL✿
My SQL✿
✿MY SQL✿
TITLE SLIDE
Advantages:
Centralized data management
Improved data security
Easy access and retrieval
Supports multiple users simultaneously
Applications:
Business operations
Research and analytics
INFORMATION ABOUT DATA
Types of Data:
Structured: Stored in tables (e.g., customer
details)
Unstructured: Emails, images, videos
Semi-structured: XML, JSON
Characteristics:
Accuracy, Consistency, Completeness,
Timeliness
COMPONENTS OF RDBMS
Key Components:
Tables: Store data in rows and columns
Primary Key: Unique identifier for
each row
Foreign Key: Links tables together
Indexes: Speed up data retrieval
SQL: Language for querying and
managing data
DOWNLOADING AND INSTALLING MYSQL
Steps:
Visit the official MySQL website.
Download the installer for your operating
system.
Follow the installation wizard.
Set up the root password and configure server
options.
Tools:
MySQL Workbench
Command-Line Interface
TYPES OF SQL COMMANDS
Categories:
DDL (Data Definition Language):
CREATE, ALTER, DROP
DML (Data Manipulation
Language): SELECT, INSERT, UPDATE,
DELETE
DCL (Data Control Language):
GRANT, REVOKE
TCL (Transaction Control
Language): COMMIT, ROLLBACK
DATA TYPES IN SQL
Common Data Types:
Numeric: INT, FLOAT, DECIMAL
String: CHAR, VARCHAR, TEXT
Date/Time: DATE, TIME, DATETIME
Boolean: BOOLEAN
CREATING A DATABASE
Command:
CREATE DATABASE my_database ;
Example:
Create a database named school.
Showing Databases
Command:
SHOW DATABASES;
Purpose:
Lists all databases available on the server.
USING A DATABASE
Command:
USE my_database ;
Example:
Switch to the school database.
Dropping the Database
Command:
Caution:
Deletes the entire database permanently.
CREATING A TABLE
Command:
CREATE TABLE students (
id INT PRIMARY KEY,
name VARCHAR (50),
age INT);
Example:
Create a students table with columns
id, name, and age.
SHOWING TABLES OF A DATABASE
Command:
SHOW TABLES;
Purpose:
Lists all tables in the selected database.
Altering a Table
Command:
ALTER TABLE students ADD COLUMN grade
VARCHAR(10);
Example:
Add a grade column to the students table.
MYSQL QUERIES
Basic Query:
SELECT * FROM students;
Filtering:
SELECT * FROM students WHERE age >
18;
Sorting:
SELECT * FROM students ORDER BY
name;
SUMMARY:
--MySQL is a robust RDBMS used for
managing relational data.
It supports a wide range of commands and
features.
Call to Action:
Experiment with MySQL commands and
queries.
Build your own database projects.
Thank You!