University Assignment Cs403

CREATE DATABASE DATA; USE DATA;

CREATE TABLE Customer( Cust_ID int identity(1,1) primary key not null, Cust_Name varchar(100), Cust_Add varchar(250), Cust_Ph# nvarchar(20), );

CREATE TABLE Operator( OP_ID int identity(1,1) primary key not null, OP_Name varchar(250), OP_Ph# varchar(250), OP_Emaiadd varchar(250), );

CREATE TABLE Complaint( Comp_ID varchar(250) primary key not null, Comp_Type varchar(250) not null, Comp_Date varchar(250) , Comp_status varchar(250), ); --Task#2 --Id of customer will be foreign key of Complaint-Table and also Operator Id will be a forigen key of complaint table as well.

--Task #3 insert into Complaint values('CMPT101','CB','2022-12-29','Resolved'),('CMPT102','CSB','2022-12-29','Pending'),('CMPT103','CSB','2023-01-10','Pending');

--Task #4

--1. select from Complaint where Comp_Type='CSB'; --2. SELECT Comp_ID,Comp_status FROM Complaint WHERE Comp_Date BETWEEN '2022-12-01' and '2023-01-15'; --3. Select from Complaint order by Comp_status asc