Introduction To SQL: Dr. Sambit Bakshi
Introduction To SQL: Dr. Sambit Bakshi
NIT Rourkela
April 8, 2020
1 What is Database?
What is Database?
Types of Databases
What is SQL ?
Types of SQL
DML commands are used for manipulating the data stored in the
table and not the table itself.
DML commands are not auto-committed. It means changes are
not permanent to database, they can be rolled back.
The DML commands used are:
Command Description
insert to insert a new row
update to update existing row
delete to delete a row
drop to drop a table
merge merging two rows or two tables
Data control language are the commands to grant and take back
authority from any database user.
DCL commands in SQL are as follows:
Command Description
grant grant permission of right
revoke take back permission.
SQL Syntax
Create Command
Create Command
Example :
CREATE TABLE Student
(
student id INT,
name VARCHAR(100),
age INT
);
The above command will create a table named Student in the
current database with 3 columns, namely student id, name, age
of datatypes integer, varchar that can hold upto 100 characters
and integer respectively.
Alter Command
DROP, TRUNCATE
DML: update
Student
ROLL NO FIRST NAME AGE
1 Ram 20
2 Abhi 21
Example: UPDATE Student SET NAME = ’PRATIK’ WHERE
Age = 20;
ROLL NO FIRST NAME AGE
1 Pratik 20
2 Abhi 21
References
https://beginnersbook.com/2018/11/introduction-to-sql/
https://www.studytonight.com/dbms/alter-query.php
https://unacademy.com/lesson/introduction-to-sql-and-its-
syntaxinhindi/AHO6REIJ