CS VTU Lab Manual - 03 - StudentCoursesBooks - MD at Master FSMK - CS VTU Lab Manual GitHub
CS VTU Lab Manual - 03 - StudentCoursesBooks - MD at Master FSMK - CS VTU Lab Manual GitHub
fsmk / CS-VTU-Lab-Manual
Dismiss
Join GitHub today
GitHub is home to over 31 million developers working together to host
and review code, manage projects, and build software together.
Sign up
kaushikthedeveloper V/ : Fixed headers for all the `md` files in the project 50f7594 on Jun 4, 2018
5 contributors
PROGRAM 3
DESCRIPTION:
Consider the following database of student enrollment in courses & books adopted for each course.
Queries:
1. Create the above tables by properly specifying the primary keys and the foreign keys.
2. Enter at least five tuples for each relation.
3. Demonstrate how you add a new text book to the database and make this book be adopted by some department.
4. Produce a list of text books (include Course #, Book-ISBN, Book-title) in the alphabetical order for courses offered by the
'CS' department that use more than two books.
5. List any department that has all its adopted books published by a specific publisher.
6. Generate suitable reports.
7. Create suitable front end for querying and displaying the results.
Create:
https://github.com/fsmk/CS-VTU-Lab-Manual/blob/master/VTU/Sem5/DB_Lab/03_StudentCoursesBooks/03_StudentCoursesBooks.md 1/6
2/28/2019 CS-VTU-Lab-Manual/03_StudentCoursesBooks.md at master · fsmk/CS-VTU-Lab-Manual · GitHub
major VARCHAR(20),
bdate DATE,
PRIMARY KEY (regno) );
Query OK, 0 rows affected (0.12 sec)
https://github.com/fsmk/CS-VTU-Lab-Manual/blob/master/VTU/Sem5/DB_Lab/03_StudentCoursesBooks/03_StudentCoursesBooks.md 2/6
2/28/2019 CS-VTU-Lab-Manual/03_StudentCoursesBooks.md at master · fsmk/CS-VTU-Lab-Manual · GitHub
Insertion:
https://github.com/fsmk/CS-VTU-Lab-Manual/blob/master/VTU/Sem5/DB_Lab/03_StudentCoursesBooks/03_StudentCoursesBooks.md 3/6
2/28/2019 CS-VTU-Lab-Manual/03_StudentCoursesBooks.md at master · fsmk/CS-VTU-Lab-Manual · GitHub
(113,'SS','ISE'),
(114,'DBMS','CSE'),
(115,'SIGNALS','ECE');
https://github.com/fsmk/CS-VTU-Lab-Manual/blob/master/VTU/Sem5/DB_Lab/03_StudentCoursesBooks/03_StudentCoursesBooks.md 4/6
2/28/2019 CS-VTU-Lab-Manual/03_StudentCoursesBooks.md at master · fsmk/CS-VTU-Lab-Manual · GitHub
| 1pe11cs005 | 112 | 3 | 100 |
+------------+----------+------+-------+
5 rows in set (0.00 sec)
Queries:
###4. Produce a list of text books (include Course #, Book-ISBN, Book-title) in the alphabetical order for courses offered by
the 'CS' department that use more than two books.
###5. List any department that has all its adopted books published by a specific publisher.
https://github.com/fsmk/CS-VTU-Lab-Manual/blob/master/VTU/Sem5/DB_Lab/03_StudentCoursesBooks/03_StudentCoursesBooks.md 5/6
2/28/2019 CS-VTU-Lab-Manual/03_StudentCoursesBooks.md at master · fsmk/CS-VTU-Lab-Manual · GitHub
AND t.book_isbn=b.book_isbn
AND t.publisher='PEARSON')
AND c.dept NOT IN
(SELECT c.dept
FROM course c,book_adoption b,text t
WHERE c.courseno=b.courseno
AND t.book_isbn=b.book_isbn
AND t.publisher != 'PEARSON');
+------+
| dept |
+------+
| CSE |
+------+
1 row in set (0.00 sec).
https://github.com/fsmk/CS-VTU-Lab-Manual/blob/master/VTU/Sem5/DB_Lab/03_StudentCoursesBooks/03_StudentCoursesBooks.md 6/6