Professional Documents
Culture Documents
March 2021202
March
DBMS
DBMS LabLab
ASSIGNMENT 4(2-6) AND ASSIGNMENT 5(1-5)
ASSIGNMENT 4(2-6) AND ASSIGNMENT 5(1-5)
LOVISH BANSAL.
LOVISH BANSAL.
Roll No. 101917087
E-mail Id lbansal_be19@thapar.edu
Assignment 4(2-6)
2. Display current time in hour : min : sec format
year ?
Solution:
Script:
create table employe(Eno Int, Ename varchar(40) , hiredate Date , salary Number(20) , Commission Number(10));
2. Create table dept which has the following attributes (department table)
(@deptno, dname)
Where deptno is primary key, dname in (Acc, comp, elect)
Script:
create table dept(deptno int primary key, dname varchar(20) check(dname in('Acc','comp', 'elect')));
desc dept;
create table employee(empno int primary key,ename varchar(20) unique,job varchar(20) check(job in('Prof','AP', 'Lect')),sal int not null,
depno int references dept(deptno));
desc employee;
create table S(sno int primary key,sname varchar(20),city varchar(20));
desc S;
create table P(pno int primary key,pname varchar(20),color varchar(20));
desc P;
create table J(jno int primary key,jname varchar(20),city varchar(20));
desc J;
-