You are on page 1of 9

worksheet 2.

Student Name: Vishal Singh UID: 21BCA1253


Branch: BCA(UIC) Section/Group: 3(a)
Semester: 3rd Date of Performance: 26-10-2022
Subject Name: DBMS Subject Code: 21CAP-215

Aim/Overview of the practical:

A. Create a table books_details with following column.


✓ BOOK_id …………………...….. Primary key
✓ Book_subject....................................Unique
✓ Book_publisher................................Not null
✓ Book_price ………………….....Check(price should be more that 200)
✓ Book_published year........................Not null
✓ Book_Edition....................................Not null

B. Enter any 10 values as per the table requirements and performs the following
queries.

C. Display the details of the books having price more than 500.

D. Display the unique contents of years of published along with book_id.

E. Create and Update the view of the table with any one single entry.
F. Create another table with name Books_info and take columns as follows:
✓ Order_id……………...primary key
✓ Order_name …..…… not null
✓ Book_id …………..… foreign key
G. Enter any 05 values in this table.

1. Task to be done:

 In this experiment we have to create a books_details table and insert 10


records as per the table requirement.
 Then we have to display the details of books having price more than 500 and the
unique contents of year of published along with book_id.
 After that we have to create and update the view of the table with
any one single entry.
 Then we have to create another table with name Books_info and insert 5
values in this table.

2. Steps/Commands involved to perform practical:


use my_database;

create table book_detail(

  BOOK_ID int primary key,

  BOOK_SUBJECTvarchar(20)unique,

  BOOK_PUBLISHER varchar(20) NOT NULL,

  BOOK_PRICE int check(book_price>200),

  BOOK_PUBLISHED date ,

  BOOK_EDITION varchar(20) NOT NULL

);

  insert into book_detail(BOOK_ID, BOOK_SUBJECT, BOOK_PUBLISHER, BOOK_PRICE, BOOK_PUBLISHED,


BOOK_EDITION)

  values  (……all values here..);


 

  select*from book_detail where BOOK_PRICE> 500 ;

  select distinct BOOK_ID,BOOK_PUBLISHED from book_detail;

  create table Books_Info(

  Order_id varchar(10) Primary Key,

  Order_name varchar(15) not null,

  BOOK_id  varchar (10),

  foreign key(BOOK_id) references book_detail(BOOK_ID)

  );

  insert into Books_Info(Order_id,Order_name,BOOK_id )

  values(all values here );

3. Result/Output/Writing Summary:

4. CREATE TABLE command:


5. DESC books_details:

a. After 10 entries:
b. Displaying the details of books having price more than 500:

c. Displaying the unique contents of year of published along with book_id:


d. Creating table BOOKS_INFO with Foreign key:
e. After 5 entries:

6. Learning outcomes (What I have learnt):

1. I learn to Calculate the average age of the students.

2. I learn to Arrange the details of the students as per the alphabetical order as per
the Stu_name.

3. I learn to Implement the group by clause by taking stu_id and stu_cgpa into
consideration.

4. I learn to Display the contents of the table whose cgpa is more than 8.

Evaluation Grid:
Sr. No. Parameters Marks Obtained Maximum Marks

1. Worksheet 20

2. Demonstration/Performance / 10
Quiz/Viva

Worksheet Rubrics:
Understanding of Experiment 10% of total grade that is 2 marks

Command Description for all concepts covered in experiment 30% of total grade that is 6marks

Steps Involved in question 40% of total grade that is 8 marks

Writing Output/Screenshot 20% of total grade that is 4 marks

You might also like