Professional Documents
Culture Documents
Exp 1&2 (DBMS)
Exp 1&2 (DBMS)
EXPERIMENT-1
Create a table STUDENT with appropriate data types and perform the
following queries.
regd no, student name, date of birth, branch and year of study.
a. Insert 5 to 10 rows in a table
b. List all the students of all branches
c. List student names whose name starts with ‘s’
d. List student names whose name contains ‘s’ as third literal
e. List student names whose contains two ‘s’ anywhere in the name
f. List students whose branch is NULL
g. List students of AIML who born after 1985.
h. List all students in reverse order of their names
i. Delete students of any branch whose name starts with ‘s’
j. Display student name padded with ‘*’ after the name of all the
Students.
STUDENT TABLE CREATION:
1
a. Insert 5 to 10 rows in a table.
2
b. List all the students of all branches.
e. List student names whose contains two ‘s’ anywhere in the name
3
f. List students whose branch is NULL
4
j. Display student name padded with ‘*’ after the name of all the
students
5
EXPERIMENT-2
Create the following tables with appropriate data typesand constraints.
6
CREATING TABLES:
7
a. Insert 5 to 10 rows into all the tables.
INSERT INTO EMPLOYEE:
INSERT INTO EMPLOYEE (FNAME, MNAME, LNAME, SSN, BDATE,
ADDRESS, GENDER, SALARY, SUPERSSN, DNO)
VALUES(‘SAI’,’MANIKANTA’,’T’,’40020511’,’1980-08-
08’,’HYDERABAD’,’M’,’20000,’40020511’,1);
…………………………………..
EMPLOYEE TABLE:
8
INSERT INTO DEPENDENT:
INSERT INTO DEPENDENT (ESSN, DEPENDENT_NAME, GENDER, BDATE,
RELATIONSHIP) VALUES(’40020511’,’GANDHI’,’M’,’1965-09-07’,’FATHER’);
………………………………………………
DEPENDENT TABLE:
9
c. Display all employee’s names along with their dependent details.
d. Display name and address of all employees who work for ‘AIML’
department.
1
0
e. List the names of all employees with two or more dependents.
1
1
h. List the names of the employees along with names of their supervisors
using aliases.
i. Display name of the department and name of manager for all the
departments.
1
2
j. Display the name of each employee who has a dependent with the
same first name and gender as the employee.
1
3
m. List the departments of each female employee along with her name.
n. List all employee names and also the name of the department they
manage if they happen to manage a dept
1
4
1
5