Mid Term - (DBMS) Labfile (Sahil Negi)
Mid Term - (DBMS) Labfile (Sahil Negi)
Mid Term - (DBMS) Labfile (Sahil Negi)
Technology
MANAV RACHNA UNIVERSITY, FARIDABAD
Q1: Create and display 5 records for students using file operations in C
Q2: Using file operations create, display, modify insert and delete records for employee system
Show database;
Create database project;
Use project;
Create table student(no char(4) PRIMARY KEY, name varchar(30) NOT NULL,class CHAR(10),section
CHAR(1),contact int);
Desc student;
Lab 2
Create table table_name();
Alter table table_name add constraints ch1 constraint_name(attribute);
Insert into table_name(column_name,..) values (‘’,’’,’’);
Select * from table_name;
-Create table empl(emplno char(4) PRIMARY KEY, emplname varchar(30) NOT NULL,class CHAR(10),section
CHAR(1),emplcontact int);
Course Outcome CO1: Students will be able to use DDL – create/alter table statement – to create
relations along with the constraints specified.
Course Outcome CO1: Students will be able to use DDL – create/alter table statement – to create
relations along with the constraints specified.
4. Employee (eno char(3), ename varchar(20), eadd varchar(30), ephone char(8), esal
int, grade char(1), edoj date, dno char(3), emgrno char(3))
create table employe ( eno char(3) primary key, ename varchar (20), eadd varchar(30), ephone
char(8) unique, esal int CHECK (esal BETWEEN 1000 and 60000), grade char(1), edoj date CHECK
(edoj >’01-Jan-1990’), dno char(3), FOREIGN KEY (dno) REFERENCES department (dno), emgrno
char(3));
Course Outcome CO1: Students will be able to use DML – insert/update table statement – to insert
and update records in existing relations.
12. Dependent (eno char(3), dpname varchar(20), dpdob date, dprelation varchar(20))
Course Outcome CO1: Students will be able to use select statement to retrieve rows from a single
table. (using relational and logical operators, renaming of attributes, order by, like, between etc.)
1. Retrieve employee name, employee salary and date of joining for the employees working for
department no. ‘D02’.