In this exercise you have to perform DDL operations by using Create, Alter and Drop Statements
- Write a query to create database with name
ShoppingDB
. - Write a query to create a
Customer
table inShoppingDB
database with below mentioned structure details.
Column Name | Datatype |
---|---|
CustomerID | int |
CustomerName | varchar(10) |
varchar(20) | |
Age | int |
DOB | Datetime |
- Write a query to create an
Orders
table inShoppingDB
database with below mentioned structure details.
Column Name | Datatype |
---|---|
OrderID | int |
OrderDate | Datetime |
CustomerID | int |
- Write a query to add a new column as
Phone
with datatypevarchar(10)
. - Write a query to modify
CustomerName
column datatype tovarchar(20)
and make it asnot null
. - Write a query to remove
DOB
column fromCustomer
table. - Write a query to remove
Customer
table fromShoppingDB
database.