Consider the following simple database schema and write SQL statements for each of the following:
Student(SID, SName, City, Faculty)
Course(CID, CName, Credits)
Enrollment(SID, CID, Grade)
a. Use CREATE TABLE statement to create Student, Course and Enrollment table assuming appropriate data types for attributes.
b. Insert a new student: SID=10, SName='Aarav', City='Pokhara', Faculty='BIT'.
c. List the names of all students who are from 'Kathmandu'.
d. Find the names of all students enrolled in the course named 'Database'.
e. Update address of student to Kathmandu having SID = 10.
Define entity, attribute and relationship with suitable example. Design a complete ER diagram for the following scenario:
Scenario: A school has teachers and students. Each teacher has a teacher_id (unique), name, and subject. Each student has a student_id (unique), first name, last name, and date of birth (age is derived). A student can have multiple phone numbers. A teacher teaches many students, and a student can be taught by many teachers. Each teaching relationship records the academic year.
Explain transaction and ACID properties of a transaction in brief. What are different states of a transaction? What is a 'serial schedule' and why it is always considered correct?
Attempt any Eight questions
[8×5=40]What is a Database Management System? List any 5 advantages of using a DBMS over a traditional file-based system. Give one real-life example of a DBMS application.
Explain the Three-Schema Architecture of a DBMS with diagram. Differentiate between logical data independence and physical data independence with one example each.
What is a weak entity type? Give one suitable example of a weak entity with a diagram showing the weak entity, its owner entity, the identifying relationship, and the partial key.
Define Domain Constraint and Referential Integrity Constraint. What happens when a DELETE operation violates referential integrity?
Explain two phase locking protocol. How can we detect deadlock in transaction?
What is functional dependency? Define First Normal Form (1NF) with suitable example.
What is concurrency control and why is it needed? Differentiate between shared lock (S-lock) and exclusive lock (X-lock).
What is database recovery? Explain shadow paging technique with suitable diagram.
Write short notes on:
a. NoSQL Database
b. Database Users


