You are on page 1of 18

A

REPORT ON
“ MYSQL Commands”
SUBMITTED TO THE
SHIVAJI POLYTECHNIC, ATPADI
IN THE PARTIAL FULFILLMENT OF THE REQUIREMENTS
OF
DIPLOMA IN
COMPUTER ENGINEERING
SUBMITTED BY

Name : Pooja Rajesh Chothe Exam seat No:-


Rajashri Tanaji Yele Exam Seat No:-
Sanjana Ashok Kengar Exam Seat No:-
Samruddhi Sachin Ghadge Exam Seat No:-

UNDER THE GUIDANCE OF


Prof:-Mr. Landage M.N

DEPARTMENT OF COMPUTER ENGINEERING


SHIVAJI POLYTECHNIC, ATPADI
1
(2023-2024)

SHIVAJI POLYTECHNIC, ATPADI

CERTIFICATE

This is to certify that Ms. Pooja Rajesh Chothe of class SY( Computer) as
per the curriculum laid down by the Maharashtra State Board of
Technical Education, Mumbai have successfully completed Micro project
entitled under our guidance in satisfactory manner as a part of academic
syllabus during the academic year 2023-2024.

Date:
Place : Atpadi

Prof. Mr. Landage M.N Prof.Ms.Belsare A.T


(Guide) (HOD)

Prof. Mr. Kulkarni O.G


(Principal)
2
Acknowledgments

It is matter of great pleasure for me to submit this micro project report


on "MYSQL Commands" as a part of curriculum for award of Diploma in
Computer Technology Maharashtra State Board Of Technical Education,
Mumbai.
Firstly, I would like to express my gratitude to my guide Prof. Mr.
Landage M.N sir his inspiration, adroit guidance, constant supervision,
direction and discussion in successful completion of this Micro project.
I am thankful to Head of Department Prof. Ms. Belsare A.T for guiding
and helping me right from the beginning,
I am thankful to my Principal Prof. Mr. Kulkarni O.G and to all our
staff members who encouraged me to do this micro project.
Also I extend my thanks to all my colleagues those who have helped me
directly or indirectly in completion of this micro project and last but not least,
I am thankful to my parents, who had inspired me with their blessings.

Name : Pooja Rajesh Chothe


Exam Seat No :

3
INDEX

SR. NO. CONTENTS PAGE NO.


1. INTRODUCTION 5

2. FEATURES & USES OF SQL 6


3. ADVANTAGES & 7
DISADVANTAGES OF SQL
4. TYPES OF SQL COMMANDS 8
5. CONCLUSION 17
6. REFERENCES 18

4
INTRODUCTION

SQL is an acronym for Structured Query Language, a standard language used to


communicate with databases. SQL is used to ask questions (queries) about data in a database,
retrieve data from a database, and manipulate data in a database.
SQL uses Data Manipulation Language (DML), and Data Definition Language (DDL)
commands to create, update, change, or perform other database structure tasks.

SQL is a powerful language that can be used to query and modify SQL databases. However, it
can be difficult for beginners to learn this language because there are many more advanced
features than they need.
SQL can be used in many ways, from simple database queries to complex data analytics.

5
FEATURES & USES OF SQL

• Data sharing

• Data retrieval

• Data definition

• Data manipulation

• Access control

6
ADVANTAGES OF MYSQL

 Fast and High-Performance database.


 Easy to use, maintain and administer.
 Easily available and maintain integrity of database.
 Provides scalability, usability and reliability.
 Low cost hardware.
 MySQL can read simple and complex queries and write operations.
 InnoDB is default and widely used storage engine.
 Provides strong indexing support.
 Provides SSL support for secured connections.
 Provides powerful data encryption and accuracy.
 Provides Cross-platform compatibility.
 Provides minimized code repetition.

DISADVANTAGES

1. MySQL is inefficient for places where we need to store very large data.
2. MySQL does not have good developing and debugging tools as compared to other
databases.
3. It does not support SQL check constraints.
4. It is inefficient in handling transactions as it is prone to data corruption.
5. It does not support ROLE, COMMIT, and Stored procedures in versions less than 5.0.
6. MySQL is hard to scale. It doesn’t support auto Sharding, you need to maintain the
nodes manually.
7. MySQL has weak stored procedures.
8. It is very difficult to install a consistent database cluster with MySQL.
9. Group by function does not work the way they are intended to.
10. Some Errors are misleading.
11. Correlated Subquery does not work as intended.
11. The development is not community driven.
12. Developers may find some of its limitations very difficult.

7
SQL COMMANDS

o SQL commands are instructions. It is used to communicate with the database. It is


also used to perform specific tasks, functions, and queries of data.
o SQL can perform various tasks like create a table, add data to tables, drop the table,
modify the table, set permission for users.

TYPES OF SQL COMMANDS

There are five types of SQL commands: DDL, DML, DCL, TCL, and DQL.

1. Data Definition Language (DDL)


o DDL changes the structure of the table like creating a table, deleting a table, altering a
table, etc.
o All the command of DDL are auto-committed that means it permanently save all the
changes in the database.

Here are some commands that come under DDL:

o CREATE
o ALTER
o DROP

8
o TRUNCATE

a. CREATE

It is used to create a new table in the database.

Syntax:
CREATE TABLE TABLE_NAME (COLUMN_NAME DATATYPES[,....]);

Example:

CREATE TABLE EMPLOYEE(id int,name varchar(20),salary int);

b. DROP:

It is used to delete both the structure and record stored in the table.

Syntax
1. DROP TABLE table_name;

Example
DROP TABLE EMPLOYEE;

c. ALTER:

It is used to alter the structure of the database. This change could be either to modify the
characteristics of an existing attribute or probably to add a new attribute.

Syntax:

9
To add a new column in the table

1. ALTER TABLE table_name ADD column_name COLUMN-definition;

To modify existing column in the table

EXAMPLE
1. ALTER TABLE EMPLOYEE ADD
(ADDRESS VARCHAR(20));

d. TRUNCATE:
It is used to delete all the rows from the table and free the space containing the table.

Syntax:

1. TRUNCATE TABLE table_name;

Example:

1. TRUNCATE TABLE EMPLOYEE;

10
2. Data Manipulation Language
o DML commands are used to modify the database. It is responsible for all form of
changes in the database.
o The command of DML is not auto-committed that means it can't permanently save all
the changes in the database. They can be rollback.

o INSERT
o UPDATE
o DELETE

a. INSERT:
The INSERT statement is a SQL query. It is used to insert data into the row of a
table.

Syntax:

INSERT INTO TABLE_NAME


VALUES (value1, value2, value3, .... valueN);

For example:

INSERT INTO EMPLOYEE VALUES (101,’samir’,30000);

11
b. UPDATE:
This command is used to update or modify the value of a column in the table.

Syntax:

UPDATE table_name SET [column_name1= value1,...column_nameN = valueN] [WHERE


CONDITION]

For example:

UPDATE employe
SET Name = 'kshitija'
WHERE Id = '103' ;

c. DELETE:
It is used to remove one or more row from a table.

Syntax:

DELETE FROM table_name [WHERE condition];

For example:

DELETE FROM employe


WHERE id=105;

12
3. Data Control Language
DCL commands are used to grant and take back authority from any database user.

Here are some commands that come under DCL:

o Grant
o Revoke

a. Grant:
It is used to give user access privileges to a database.

Example

GRANT SELECT, UPDATE ON MY_TABLE TO SOME_USER, ANOTHER_USER;

b. Revoke:
It is used to take back permissions from the user.

Example

REVOKE SELECT, UPDATE ON MY_TABLE FROM USER1, USER2;

4. Transaction Control Language

TCL commands can only use with DML commands like INSERT, DELETE and UPDATE
only.

These operations are automatically committed in the database that's why they cannot be used
while creating tables or dropping them.
13
Here are some commands that come under TCL:

o COMMIT
o ROLLBACK
o SAVEPOINT

a. Commit:

Commit command is used to save all the transactions to the database.

Syntax:
COMMIT;

Example:
DELETE FROM CUSTOMERS

WHERE AGE = 25;


COMMIT;

b. Rollback:
Rollback command is used to undo transactions that have not already been saved to the
database.

Syntax:

ROLLBACK;
14
Example:
DELETE FROM CUSTOMERS
WHERE AGE = 25;
ROLLBACK;

c. SAVEPOINT:

It is used to roll the transaction back to a certain point without rolling back the entire
transaction.

Syntax:

SAVEPOINT SAVEPOINT_NAME;

Example:

Savepoint library_1;

15
5. Data Query Language
DQL is used to fetch the data from the database.

It uses only one command:

*SELECT

*SELECT:

This is the same as the projection operation of relational algebra. It is used to select the
attribute based on the condition described by WHERE clause.

Syntax:
SELECT expressions
FROM TABLES
WHERE conditions;

For example:
SELECT id
FROM employee
WHERE salary < 27000;

16
CONCLUSION :

Highly experienced and seasoned MySQL Developer with a proven record of strong database
development and maintenance.

Profoundly knowledgeable about a wide variety of data programs. Excellent ability to work
independently or as a part of a team. Developed diagrams for Data Structure, Entity
Relationship, and Data Flow.

17
REFERENCE :

https://stackoverflow.com/questions/3002605
https://www.tutorialkart.com/mysql/add-column-t…
https://phoenixnap.com/kb/mysql-create-inde

18

You might also like