1.

What is data definition language? Explain SELECT and UPDATE commands.

Answer»

Data Defintion Language commands create database objects such as tables, views, etc., The various Data definition language commands are Create Table, Alter Table, Create View, Drop Table, etc.,

1. Select Command:
It is used to view tuple/records from the tables. It is a read only command.

Usage:
> select columns from table_name where condition;

For example:
> select * from tablename;
> select columnname1, columnname2,…. From tablename;
> select * from tablename where columnname = value

2. UPDATE command:

The update command is used to change row values from a table. The SET key word takes the column in which values needs to be changed or updated.
Syntax:
update tablename set columnname = value where condition;
Example:
> update marks set total = marks 1 + marks 2 + marks 3 where class =”IIPUC”;



Discussion

No Comment Found

Related InterviewSolutions