Assignment (IT)
Assignment (IT)
Q1. In the context of owner and weak entity sets Q2. Consider the following Relationship Entity
in the ER (Entity-Relationship) data model, Diagram (ERP):
which one of the following statements is
TRUE?
A. The owner entity set MUST have total
participation in the identifying relationship
B. Both weak and owner entity sets MUST have
total participation in the identifying Which of the following possible relations will
relationship not hold if the above ERD is mapped into a
C. The weak entity set MUST have total relation model?
participation in the identifying A. Person (NID, Name)
relationship B. Qualification (NID, ExamID, QualifiedDate)
D. Neither weak entity set nor owner entity set C. Exam (ExamID, ExamName)
MUST have total participation in the D. Exam (ExamID, NID, ExamName)
identifying relationship
Q3. In a relational database, a 'Foreign Key' is Q4. In the ER model, which of the following can be
used to: described as a 'Super Key'?
A. Ensure entity integrity A. Any attribute that is a primary key
B. Uniquely identify each record in a table B. A set of attributes that uniquely identify an
C. Define a data type entity
D. Link one table to another C. A key that contains only a single attribute
D. A weak entity
Q5. Which of the following is NOT a type of Q6. What does an RDBMS consist of?
integrity constraint? A. Collection of Records
A. Domain Constraint B. Collection of Keys
B. Referential Integrity Constraint C. Collection of Tables
C. Tuple Constraint D. Collection of Fields
D. Entity Integrity Constraint
Q7. In DBMS architecture, what does the term Q8. Which one of the options given below refers to
‘schema’ refer to? the degree (or arity) of a relation in relation in
A. Logical structure or design of a database relational database systems?
B. The data stored in a database A. Number of attributes of its relation schema
C. The physical storage of data B. Number of tuples stored in the relation
D. The indexing technique used by the C. Number of entries in the relation
database D. Number of distinct domains of its relation
schema
Q9. The values appearing in given attributes of Q10. Consider the following ER diagram
any tuple in the referencing relation must
likewise occur in specified attributes of at
least one tuple in the referenced relation,
according to _____________________ integrity
The minimum number of tables needed to
constraint.
represent M, N, P, R1, R2 is:
A. Referential
A. 2
B. Primary
B. 3
C. Referencing
C. 4
D. Specific
D. 5
1
Q11. Which of the following statements about Q12. What is information about data called?
a Candidate Key is true?
A. It is always a combination of more than one A. Hyper data
attribute B. Tera data
B. It can be used as a primary key C. Meta data
C. It is the same as a foreign key D. Relations
D. It allows duplicate values in a column
Q13. Given the basic ER and relational models, Q14. Consider the entities 'hotel room', and
which of the following is INCORRECT? 'person' with a many to many relationships
A. An Attribute of an entity can have more 'lodging' as shown below:
than one value
B. An attribute of an entity can be composite
If we wish to store information about the rent
C. In a row of a relational table, an attribute
payment to be made by person (s) occupying
can have exactly one value or a NULL value
different hotel rooms, then this information
D. In a row of a relational table, an should appear as an attribute of:
attribute can have more than one value A. Person
B. Lodging
C. Hotel Room
D. None of these
Q15. Which type of data can be stored in the Q16. The traditional storage of data organized by
database? the customer, stored in separate folders in
A. Image oriented data filing cabinets is an example of ______________
B. Text, files containing data type of ‘database’ management system.
C. Data in the form of audio or video A. Object-oriented database management system
D. All of the above B. Relational database management system
C. Network database management system
D. Hierarchical database management system
Q17. ______________ is a set of one or more Q18. The ability to query data, as well as insert,
attributes taken collectively to uniquely delete, and alter tuples, is offered by ____________
identify a record. A. TCL (Transaction Control Language)
A. Primary Key B. DCL (Data Control Language)
B. Foreign key C. DDL (Data Definition Langauge)
C. Super key D. DML (Data Manipulation Langauge)
D. Candidate key
Q19. The DBMS acts as an interface between Q20. Ins E-R model, X is the dominant entity and
_____ and _____ of an enterprise-class system. Y is subordinate entity
A. Data and the DBMS A. If Y is deleted, then X is also deleted
B. Application and SQL B. If X is deleted, then Y is also deleted
C. Database application and the database C. If X is deleted, then Y is not deleted
D. The user and the software D. None of the above
Responses:
Question
1 2 3 4 5 6 7 8 9 10
No.
Answer C D D B C C A A A B
Question
11 12 13 14 15 16 17 18 19 20
No.
Answer B C D B D D C D C B
2
Dr B R AMBEDKAR NATIONAL INSTITUTE OF TECHNOLOGY, JALANDHAR
Department of Information Technology
B. Tech (IT) III Semester
Course Code & Name: ITDC0207 Database Management Systems
Quiz- II Date: October 24, 2024 Maximum Marks: 05
Q1. In the relational algebra expression π(σ(R⋈S)), Q2. Which integrity constraint ensures that every
the symbol ⋈ represents: tuple in one relation that references another
A. Natural join relation must refer to an existing tuple in that
B. Cartesian product relation?
C. Left outer join A. Entity integrity
D. Cross join B. Referential integrity
C. Domain integrity
D. Key integrity
Q3. Consider a table with attributes (EmpID, Name, Q4. What is the output of this query assuming no
Salary, DeptID). Which of the following SQL NULL values?
queries will NOT give the same result as others? SELECT COUNT(*) FROM TableA
A. SELECT DeptID, AVG(Salary) FROM WHERE Column1 NOT IN (SELECT Column1 FROM
TableB);
Employees GROUP BY DeptID
B. SELECT DeptID, AVG(Salary) FROM A. Count of rows in TableA minus count of rows in
Employees WHERE Salary > 50000 GROUP TableB
BY DeptID B. Count of values in TableA.Column1 that don't
C. SELECT DeptID, AVG(Salary) FROM exist in TableB.Column1
Employees GROUP BY DeptID HAVING C. Count of distinct values in TableA.Column1
AVG(Salary) > 50000 D. Count of duplicate values between TableA and
D. SELECT DeptID, AVG(Salary) FROM TableB
Employees HAVING Salary > 50000 GROUP
BY DeptID
Q5. What will be the result of the following Q6. Given relations R(A,B) and S(B,C), what does the
query? following relational algebra expression represent?
SELECT * FROM TableA
MINUS πA(R ⋈ S) - πA(R)
SELECT * FROM TableA
WHERE Column1 > 10; A. All A values that appear in R but not in the join
A. Records where Column1 <= 10 B. All A values that appear in the join but not in R
B. Records where Column1 > 10 C. Always returns an empty set
C. All records from TableA D. All A values that appear in both R and S
D. Empty result set
Q7. Which of the following is NOT a valid aggregate Q8. In the context of cursors, what is the correct
function in SQL? sequence of operations?
A. STDEV A. DECLARE, OPEN, FETCH, CLOSE
B. MEDIAN B. OPEN, DECLARE, FETCH, CLOSE
C. COUNT C. DECLARE, FETCH, OPEN, CLOSE
D. AVG D. OPEN, FETCH, DECLARE, CLOSE
Q9. What is the result of the following query? Q10. Which of the following represents a correlated
SELECT COALESCE(NULL, NULL, subquery?
'Hello', NULL, 'World'); A. SELECT * FROM A WHERE id IN (SELECT id
A. NULL FROM B)
B. 'Hello' B. SELECT * FROM A WHERE id = (SELECT
C. 'World' MAX(id) FROM B)
D. Error C. SELECT * FROM A WHERE id > (SELECT id
FROM B WHERE B.name = A.name)
D. SELECT * FROM A WHERE EXISTS
(SELECT 1 FROM B)
1
Q11. In relational algebra, what is the difference Q12. Which of the following is true about domains
between σ and π operations? in relational model?
A. σ performs selection while π performs projection A. A domain can contain only atomic values
B. σ performs projection while π performs selection B. A domain can contain nested relations
C. σ performs join while π performs selection C. A domain can contain arrays
D. σ performs cartesian product while π performs D. A domain can contain multiple data types
join
Q13. What is the output of the following query? Q14. What happens when you try to update a
primary key column that is referenced by a
SELECT COUNT(*) FROM (SELECT DISTINCT foreign key in another table?
Column1 FROM Table1) AS T; A. The update is allowed without any restrictions
B. The update is rejected unless CASCADE is
A. Total number of rows in Table1 specified
B. Number of distinct values in Column1 C. The update automatically updates the foreign key
C. Number of NULL values in Column1 values
E. Number of duplicate values in Column1 D. The update is always rejected regardless of
constraints
Q15. What is the purpose of the ‘HAVING’ Q16. Which of the following is true about SQL
clause in SQL? transactions?
A. To filter rows before grouping A. They can be nested indefinitely
B. To filter groups after grouping B. They always require explicit commit or rollback
C. To sort the result set C. They can be partially committed
D. To join multiple tables D. They must maintain ACID properties
Q17. In the context of relational algebra, which Q18. Which SQL command is used to make
operation has the highest precedence? permanent changes made by a transaction in a
A. Selection (σ) database?
B. Projection (π) A. COMMIT
C. Union (∪) B. ROLLBACK
D. Join (⋈) C. SAVEPOINT
D. CHECKPOINT
Q19. Given relations R(A,B) and S(B,C), which of Q20. Consider the following integrity constraint in
the following relational algebra expressions is a relational schema:
equivalent to "SELECT DISTINCT A FROM R "The salary of any employee must not be more than
WHERE B NOT IN (SELECT B FROM S)"? 1.5 times the salary of their manager."
A. πA(R) - πA(R ⋈ S) Which type of constraint is this?
B. πA(R) - πA(R ⋉ S) A. Domain constraint
C. πA(σB∉πB(S)(R)) B. Entity integrity constraint
D. πA(R - (R ⋈ S)) C. Referential integrity constraint
D. Tuple-based constraint
Responses:
Question
1 2 3 4 5 6 7 8 9 10
No.
Answer A B B B A C B A B C
Question
11 12 13 14 15 16 17 18 19 20
No.
Answer A A B B B D A A B D
2
Dr B R AMBEDKAR NATIONAL INSTITUTE OF TECHNOLOGY, JALANDHAR
Department of Information Technology
B. Tech (IT) III Semester
Course Code & Name: ITDC0207 Database Management Systems
Quiz- III Date: November 12, 2024 Maximum Marks: 05
Responses:
Question
1 2 3 4 5 6 7 8 9 10
No.
Answer A D B A A C D C A B
Question
11 12 13 14 15 16 17 18 19 20
No.
Answer A B B D C D A C B C
Q1. Let R(A,B,C,D) be a relation with Q2. Consider a relation R(W,X,Y,Z) with
functional dependencies A→B, B→C, and functional dependencies:
C→D. The minimal key for relation R is: W → X,
a) {A} X → Y,
b) {A,B} Y→Z
c) {A,B,C} The relation R is in:
d) {A,B,C,D} a) 1NF but not in 2NF
b) 2NF but not in 3NF
c) 3NF but not in BCNF
d) BCNF
Q5. In the notation X → Y, what does the arrow Q6. Which normal form addresses transitive
symbol represent? dependencies?
a) X determines Y a) First Normal Form (1NF)
b) Y determines X b) Second Normal Form (2NF)
c) X is related to Y c) Third Normal Form (3NF)
d) X and Y are equal d) BCNF
Q7. Consider a relation R(A,B,C,D) with Q8. What is preserved when moving from a
functional dependency set F = {A→B, C→D}. lower normal form to a higher normal form?
The relation R is in: a) Performance
a) 1NF only b) Data redundancy
b) 2NF but not in 3NF c) Information content
c) 3NF but not in BCNF d) Table structure
d) BCNF
1
Q9. A relation is in BCNF if and only if every Q10. What type of dependency is addressed when
determinant is a: moving from 2NF to 3NF?
a) Candidate key a) Partial dependency
b) Primary key b) Transitive dependency
c) Foreign key c) Multi-valued dependency
d) Composite key d) Join dependency
Q13. A table with a single-column primary key is Q14. Which normal form ensures that every non-
automatically in: trivial functional dependency has a superkey as
a) 3NF its determinant?
b) 2NF a) 1NF
c) BCNF b) 2NF
d) None of the above c) 3NF
d) BCNF
Q15. In a relation FACULTY(fid, fname, Q16. What type of anomaly occurs when the
dept_id, dept_name, dept_phone), which same information needs to be changed in
anomaly would occur if a department has no multiple rows and there's a risk of
faculty members? inconsistency?
a) Update anomaly a) Insertion anomaly
b) Deletion anomaly b) Deletion anomaly
c) Insertion anomaly c) Redundancy anomaly
d) No anomaly d) Update anomaly
Q17. Consider a relation EMPLOYEE(emp_id, Q18. A relation R(W,X,Y,Z) has the following
emp_name, dept_name, dept_location). If a functional dependencies: W,X → Y Y → Z W
department relocates, which problem would → X The relation has:
occur? a) No anomalies
a) Multiple update anomaly b) Only update anomalies
b) Data redundancy c) Insertion, deletion, and update anomalies
c) Insertion anomaly d) Only deletion anomalies
d) Deletion anomaly
Q19. In a relation SUPPLY(supplier_id, Q20. Which normal form guarantees elimination
supplier_name, part_id, part_name, quantity), of all update anomalies?
which anomaly occurs when deleting the last a) 1NF
supply record of a supplier causes loss of b) 2NF
supplier information? c) 3NF
a) Update anomaly d) 4NF
b) Deletion anomaly
c) Insertion anomaly
d) Redundancy anomaly