Professional Documents
Culture Documents
in
‘SQL’
What is SQL - Structured Query Language. it is a standard language which is used by various
DBMS packages with very small syntax changes. it is mainly used to query data from
database. or we can say to convert data into information.
2. Alter - is used to make changes in the structure (schema) of table. we can perform the
following things with alter command.
1. add new column (use add with alter command)
for eg.
alter table student add (city char(20))
2. modify data type of a column (use modify with alter command)
for eg.
alter table student modify city char(40)
3. remove a column (use drop with alter command)
for eg.
alter table student drop column city
4. change name of the column (use change with alter command)
4. Select - is used to select (filter) data from the database (most useful and popular
command)
for eg.
1. select * from student - will display all the records from student table
2. select roll,name from student - will display only roll and name of student
3. select * from student where city='ajmer' - will display records of students living in ajmer
4. select * from student where marks between 20 and 60 - will display records of students
obtaining marks between 20 and 60
5. select * from student where class='XII' and sec='a' - will display records of student studying
in class XII and section A
6. select * from student where name like 'a%' - will display records of student whose name
starts with the letter a
7. select * from student where name like '____' - will display records of students whose name is
of four letters
9. Revoke - is used to release the permission given to any user of the database.
for eg.
REVOKE INSERT ON student.* FROM 'aman'@'localhost'
11. Savepoint - is used to create a checkpoint or savepoint at any point of the transaction.
for eg.
savpoint s1