Professional Documents
Culture Documents
REPORT ON
“ MYSQL Commands”
SUBMITTED TO THE
SHIVAJI POLYTECHNIC, ATPADI
IN THE PARTIAL FULFILLMENT OF THE REQUIREMENTS
OF
DIPLOMA IN
COMPUTER ENGINEERING
SUBMITTED BY
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
3
INDEX
4
INTRODUCTION
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
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
There are five types of SQL commands: DDL, DML, DCL, TCL, and DQL.
o CREATE
o ALTER
o DROP
8
o TRUNCATE
a. CREATE
Syntax:
CREATE TABLE TABLE_NAME (COLUMN_NAME DATATYPES[,....]);
Example:
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
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:
Example:
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:
For example:
11
b. UPDATE:
This command is used to update or modify the value of a column in the table.
Syntax:
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:
For example:
12
3. Data Control Language
DCL commands are used to grant and take back authority from any database user.
o Grant
o Revoke
a. Grant:
It is used to give user access privileges to a database.
Example
b. Revoke:
It is used to take back permissions from the user.
Example
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:
Syntax:
COMMIT;
Example:
DELETE FROM CUSTOMERS
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.
*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