We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
Balochistran University of Engineering & Technology, Khuzdar
Computer Science Department
Class: BS(CS) 4th Semester Course: Advanced Database Management Systems Assignment 2 (Fall 2024) Instructions Please read the following instructions carefully before submitting assignment: It should be clear that your assignment will not get any mark if: o The assignment is submitted after the due date. The use of ChatGPT, or similar AI tools, for generating content is strictly prohibited and students must complete their assignments without assistance from these tools. Students must paraphrase ideas from sources and avoid directly copying text. Use textbooks, lecture notes, and other scholarly resources for in-depth comprehension. Last Date of Submission: October 21st, 2024 Total Marks: [10] Assuming you have MongoDB installed and running, or you’re using MongoDB Atlas, you are required to create a collection using the MongoDB shell (or a tool like MongoDB Compass). Write MongoDB queries to: 1. Create a MongoDB Collection named ‘students’ Q No. 1 2. Insert some documents into the ‘students’ collection. Each document represents a student with fields such as name, age, major, and grades. 3. Perform the following basic queries on the ‘students’ collection: Find all documents in the collection [05] Find students who are majoring in 'Computer Science' Find students with a grade greater than 90 in any subject Update the major of 'Muhammad Shahzain' to 'Computer Engineering' Delete a student named 'Muhammad Ali' Group students by their major and count the number of students in each major Calculate the average grade for each student Imagine that university’s database contains student records, grades, and personal information. The database administrator Q No. 2 needs to ensure that only certain faculty members can update student grades, while others can only view them. How would you implement role-based permissions to meet these [05] requirements, and what integrity constraints would you enforce to ensure the accuracy and security of the data?