Databse Systems (Lab Manual)
Databse Systems (Lab Manual)
Databse Systems (Lab Manual)
Experiment No.-01
Installation of MYSQL/ ORACLE (Refer Video Tutorial)
http://www.spoken-tutorial.org/
http://www.spoken-tutorial.org/keyword-search/?q=SQL
Show Video
Experiment No.-02
Focus Area: Table Creation & Tuples Insertion
Create a relational database schema for below given database, described by the
following relations and Insert tuples.
a) CAR(Serial_no, Model, Manufacturer, Price)
OPTION(Serial_no, Option_name, Price)
SALE(Salesperson_id, Serial_no, Date, Sale_price)
SALESPERSON(Salesperson_id, Name, Phone)
b) SALESPERSON(Ssn, Name, Start_year, Dept_no)
TRIP(Ssn, From_city, To_city, Departure_date, Return_date, Trip_id)
EXPENSE(Trip_id, Account#, Amount)
c) CATALOG(Cno, Ctitle)
STUDENTS(Sid, Fname, Lname, Minit)
COURSES(Term, Sec_no, Cno, A, B, C, D)
ENROLLS(Sid, Term, Sec_no)
d) SUPPLIER(Sno, Sname)
PART(Pno, Pname)
PROJECT(Jno, Jname)
SUPPLY(Sno, Pno, Jno)
e) EMPLOYEE (Employee_name,Street, city)
WORKS (Employee_name, Company_name, Salary)
Company (Comapny _name, City)
MANAGES (Employee_name, Manager_name)
Experiment No.-03
Create a relational database schema for a Minor-Project, described by the following
relations and Insert tuples.
7)
semester.
Update guide details of a roll no 110011, new guide is Ram Mohan & id
112200.
8) Remove the Guide details, guide no is 112211 and assign guide no 133113 to
all respective students project group.
Experiment No.-04
Create a relational database schema for a University, described by the following
relations and Insert tuples.
Experiment No.-05
Specify the following queries in SQL on the database University schema (experiment no
04)
1) Find the names of all departments whose building name includes the substring
Watson.
2) Find the names of instructors with salary amounts between $90,000 and $100,000.
3) To list in alphabetic order all instructors in the Physics department.
4) Retrieve the list of students, who are born on 1990.
5) Retrieve the list of courses taught by teacher whose name consist R as fourth word.
6) Find the IDs of all students who were taught by an instructor named
Einstein makes sure there are no duplicates in the result.
7) Find the average salary of instructors in the Computer Science department
8) Find the total number of course in University
9) Find the total number of instructors who teach a course in the Spring 2010 semester
10) Find the average salary in each department
11) Find all instructors earning the highest salary (there may be more than one with the
same salary).
12) Find the average salary of all instructors
13) Find the number of instructors in each department who teach a course in the Spring
2010 semester.
Experiment No.-06
Specify the following queries in SQL on the database University schema (experiment no
04)
1) Find the average salary of instructors in those departments where the average
2)
3)
4)
5)
6)
all students enrolled in the section, if the section had at least 2 students.
7) Find the average instructors salaries of those departments where the average
salary is greater than $42,000
Experiment No.-07
Specify the following queries in SQL on the database University schema (exp. no
04)
1) Retrieve the name department which has amount no of budget; also retrieve the
number of classrooms in dept and capacity of classroom.
2) List the name computer science faculties, whose classes are slotted after 12.35 pm
in Computer Science dept.
3) List the name computer science faculties, whose classes are slotted after 12.35 pm
in Computer Science dept and EC dept of 6th and 8th Semester.
4) Find the IDs and names of all students who have not taken any course offering
before Spring 2009.
5) Find the names of all students who have taken at least one Comp. Sci. course;
make sure there are no duplicate names in the result.
6) Find the names of course on which more than 20 student earned less than credits
5 on 3rd Year.
7) List the name of instructors who are not teaching any 8th semester course.
8) List of the all students whose advisor belongs to other department.
9) Retrieve the name of student, subject name taught by an instructor, who is not an
adviser to any of the students.
Experiment No.-08
5)
List the name and address of all employees who work for the Research
department.
6) List the names of employees who works on all project controlled by department
number 5.
7) List the names of all employees who have a dependent with the same first name as
8)
themselves.
Retrieve the names of all employees in department 5 who work more than 10
Experiment No.-09
Specify the following queries in SQL on the database Company schema (exp. no 08)
1)
2)
3)
4)
5)
6)
Experiment No.-10
Specify the following queries in SQL on the database Company schema (experiment no
08)
Experiment No.-11
Specify the following queries in SQL on the database University schema (experiment no
08)
1)
2)
3)
4)
5)
6)