Module 1 Assignment
Module 1 Assignment
1. Creating Database
To Create database the Query is CREATE DATABASE Vishnu. This will create a new database.
3. Creating Table
5. Alter table.
If I want to add an extra column with column name age to the existing table, the query is
alter table trainee
add gender varchar(50) null
It will create a new column in the table trainee with null values.
To Insert the values into the column the Query is
update trainee
set gender = iif ( trainee_id in (1, 2, 4), 'M', 'F')
It will update the age column with ‘M’ for those who are having trainee_id as 1, 2, 4 and the rest
of the trainee_id with ‘F’
7) Delete a column.
To delete a Column in a table the Query is
alter table trainee
drop column gender
The column will be deleted.
8) Delete a Table
drop table trainee
9) Delete a Database
drop database vishnu