create database di

use di



create table branch(
branchno		varchar(15) primary key,
branchname	varchar(30),
address		varchar(100),
phno		varchar(20),
dateReg		datetime);

create table dept(
deptno		varchar(15) primary key,
deptname		varchar(30),
phno		varchar(15),
branchno		varchar(15) references branch(branchno));


create table emp(
empno		integer primary key,
ename		varchar(40),
pwd		varchar(15),
age		varchar(10),
gender		varchar(10),
address		varchar(100),
phno		varchar(15),
emailID		varchar(40),
branchno		varchar(15) references branch(branchno),
deptno		varchar(15) references dept(deptno),
role		varchar(20),
dateReg		datetime);


create table data(
docno		integer primary key,
subject		text,
empno		integer references emp(empno),
dateForward	datetime,
status		varchar(10));

