Professional Documents
Culture Documents
BSC Sem 5 Next Generatin Database Practical Set 2 PDF
BSC Sem 5 Next Generatin Database Practical Set 2 PDF
Note:
1. The candidate has option to either attempt question 3 or question 4.
2. Numbers to the right indicate full marks.
3. Use of approved scientific calculator is allowed.
4. Additional 20 minutes will be provided after the examination to submit the answers
Q1) 15 Marks
Page 1 of 4
quantity: 20, date : ISODate( "2021-03-13T09:13:24Z" ) },
{ _id: 2, name: "Pepperoni", size: "large", price: 21,
quantity: 30, date : ISODate( "2021-03-17T09:22:12Z" ) },
{ _id: 3, name: "Cheese", size: "small", price: 12,
quantity: 15, date : ISODate( "2021-03-13T11:21:39.736Z" ) },
{ _id: 4, name: "Cheese", size: "medium", price: 13,
quantity:50, date : ISODate( "2022-01-12T21:23:13.331Z" ) }
])
Attempt Q3 OR Q4 15 Marks
Q3A. Create a database of movies. Create collection to accept only 100 enteries. 20 Marks
Also the collection should have fields, that compulsary have director name and
emailID, moviename cannot exceed 100 charecters.
Explain the syntax to add new data into collection. Add 10 enetries into the
collection . eg-
{
... "actor id":1,
... fname:"aamir",lname:"khan",
... address:[
... {street:"wall street"},
... {city:"new york"},
... {state:"mid state"},
... {country:"usa"},
... {pincode:"62201"}
... ],
... "contact details":[
... {emailid:"sallu@gmail.com"},
... {phonene:"12345678"}
... ]
... },
... {
... "actor id":2,
... fname:"aamir",lname:"khan",
... address:[
... {street:"wall street"},
... {city:"new york"},
... {state:"mid state"},
... {country:"usa"},
... {pincode:"62201"}
... ],
... "contact details":[
Page 2 of 4
... {emailid:"sallu@gmail.com"},
... {phonene:"12345678"}
... ]
... },
Write a query that shows list of amir khan movies released in current year
Write the aggregate query that groups the data based on actors, gives count of
movies, and sort them in an order.
Q4A. Create database EMP and Make Collection With name "EMPL" 20 Marks
Add a New Field remark to document with name "RS" set Remark as WC
Page 3 of 4
Update the Field "RD" by multiplying with salary by 2
To Find Document From the empl collection where name begins with S
Page 4 of 4