0% found this document useful (0 votes)
86 views3 pages

MySQL LECTURE 1 PDF

My-SQL is a relational database management system used to create, edit, and manage databases and tables. It allows users to store and organize data into collections called databases, which contain related tables with columns and rows of data. Common uses of My-SQL include data warehousing, e-commerce applications, and web databases. It provides commands to create, alter, query, and manipulate database objects like databases, tables, columns, and rows.

Uploaded by

Imran Shaikh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views3 pages

MySQL LECTURE 1 PDF

My-SQL is a relational database management system used to create, edit, and manage databases and tables. It allows users to store and organize data into collections called databases, which contain related tables with columns and rows of data. Common uses of My-SQL include data warehousing, e-commerce applications, and web databases. It provides commands to create, alter, query, and manipulate database objects like databases, tables, columns, and rows.

Uploaded by

Imran Shaikh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

THE STUDY ZONE

What is My-SQL

My-SQL is used for relational Data Base Management system (RDBMS). Data Base is collection of
Data & Management system means creating file, Adding records, Deleting records, Editing records,
sorting records, Query records, Display records, etc.

RDBMS- Relational Database Management System

What is used for?


The application is used for a wide range of purposes, including data warehousing, e-commerce
and logging Application. The most common use for My-SQL however is for the purpose of a web
database.

 Important Things in My-SQL:

1) Database: Collection of related tables makes a database. Database is set of related


information.
Ex.: Generally a Database contains Tables, Table contains columns and Rows.

2) Tables (File): Collection of related rows makes a table. In example all rows together is called
as a table.

3) Columns (Fields): Particular information is called a column.


Ex.: One column for Name, One column for Roll No, etc.

4) Row (Data/Record): Collection of related columns makes a row (Record).

1. DATABASE RELATED COMMANDS:


1) i) To Display the names of all available databases in My-SQL.
>SHOW DATABASES;
ii) To Display a particular Database name contains “A”.
>SHOW DATABASES LIKE “%a%” ;

2) To create a new database with a given name. (At a time You can create only one Database)
>CREATE DATABASE database name;

3) To use/open/select an existing database.


>USE database name;

4) To Remove/Drop/Delete a database.
>DROP DATABASE databse name;

CONTACT: 9833270055 / 7303741343


THE STUDY ZONE

2. TABLE RELATED COMMANDS:-


1) To Display the names of all available tables in Database.
>SHOW TABLES;

2) To create a new Table with given name in current database.

>CREATE TABLE table name

-Column Name data type attribute,

-Column Name data type attribute);

3) To Display Structure of the table OR To describe the table.

>DESC table name;

OR

>DESCRIBE tabe name;

OR

>SHOW COLUMNS FROM table name;

4) To Rename/Change the name Table.

>RENAME TABLE old name TO new name;

5) To Remove/Drop/Delete a table.
>DROP TABLE table name;

3. COLUMNS RELATED COMMANDS:-


1) To add a new Column to a table.

>ALTER TABLE table name ADD Column name data type attribute;

2) To Modify/Changes in the data type or Size or attributes of a column.

>ALTER TABLE table name MODIFY Column name Changes in data type or attributes;

3) To Rename/Change the name of column.

>ALTER TABLE table name CHANGE Old column name new column name;

4) To Remove/Drop/Delete the column from a table.

>ALTER TABLE table name DROP Column name;

CONTACT: 9833270055 / 7303741343


THE STUDY ZONE

4. ROW RELATED COMMANDS:-


1) To add a new row/s to an existing table. (Adding rows to a table is also called a populating
table.)

>INSERT INTO table name (Column names Separated by Comma)

VALUES (Values separated by Comma);

OR

>INSERT INTO table name VALUES (values separated by comma);

2) To make changes in the data which is already entered into a table?

>UPDATE table name SET column name = Changes;

OR

>UPDATE table name SET column name = Changes WHERE Column name = Condition;

3) i) To Display all the columns from the table.

>SELECT * FROM table name;

ii) To Display particular columns from the table.

>SELECT column names separated by comma FROM table name;

iii) To Display all the columns but selected Rows from the table.

>SELECT * FROM table name WHERE column name = condition;

iv) To Display particular columns and selected Rows.

>SELECT column names separated by comma FROM table name

WHERE column name = condition;

4)To Remove/Delete a row (Record) from a table.

>DELETE FROM table name WHERE column name = condition;

CONTACT: 9833270055 / 7303741343

You might also like