0% found this document useful (0 votes)
11 views

DBMS Lab

Uploaded by

nybh018
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

DBMS Lab

Uploaded by

nybh018
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Dr.

Ram Manohar Lohia Awadh University


Department of Business management & Entrepreneurship

Bachelor of Computer Application

DBMS Lab Manual


Note : Every student have to make a combined project file of DBMS Laboratory
&Practical Work for all the Experiments provided below:
Experiment 3

Consider the following schema for OrderDatabase:

SALESMAN (Salesman_id, Name, City, Commission)

CUSTOMER (Customer_id, Cust_Name, City, Grade,Salesman_id)

ORDERS (Ord_No, Purchase_Amt, Ord_Date, Customer_id, Salesman_id)

Write SQL queries to

1. Count the customers with grades above Bangalore’saverage.

2. Find the name and numbers of all salesmen who had more than onecustomer.

3. List all salesmen and indicate those who have and don’t have customers in

their cities (Use UNIONoperation.)

4. Create a view that finds the salesman who has the customer with the highest

order of a day.

5. Demonstrate the DELETE operation by removing salesman with id 1000. All his orders must also
bedeleted.
Experiment 6

C. Consider the schema for MovieDatabase:

ACTOR (Act_id, Act_Name, Act_Gender)

DIRECTOR (Dir_id, Dir_Name, Dir_Phone)

MOVIES (Mov_id, Mov_Title, Mov_Year, Mov_Lang, Dir_id)

MOVIE_CAST (Act_id, Mov_id, Role)

RATING (Mov_id, Rev_Stars)

Write SQL queries to

1. List the titles of all movies directed by‘Hitchcock’.

2. Find the movie names where one or more actors acted in two or moremovies.
3. List all actors who acted in a movie before 2000 and also in a movieafter 2015 (use
JOINoperation).

4. Find the title of movies and number of stars for each movie that has at least one
rating and find the highest number of stars that movie received. Sort the result by movie title.

5. Update rating of all movies directed by ‘Steven Spielberg’ to 5.

Experiment 9
Consider the following relational schema for the Office of the Controller of
Examinations Application.
Student (Rollno, Name, Dob, Gender, Doa, Bcode);
Implement a check constraint for

• Gender
• Date of Admission

Branch (Bcode, Bname, Dno);


Department (Dno, Dname);
Course (Ccode, Cname, Credits, Dno);
Branch_Course (Bcode, Ccode, Semester);
Enrolls (Rollno, Ccode, Sess, Grade);
For Example,

SESS can take values ‘APRIL 2013’, ‘NOV 2013’

Implement a check constraint for grade Value Set (‘S’, ‘A’, ‘B’, ‘C’, ‘D’, ‘E’,
‘U’ );

Students are admitted to Branches and they are offered by Departments. A


branch is offered by only one department.

Each branch has a set of Courses (Subjects). Each student must enroll
during a semester. Courses are offered by Departments. A course is offered
only by one department. If a student is unsuccessful in a course he/she
must enroll for the course during next session. A student has successfully
completed a course if the grade obtained by is from the list (A, B, C, D,
and E).
A student is unsuccessful if he/she have grade ‘U’ in a course.
Primary Keys are underlined.

You might also like