0% found this document useful (0 votes)
100 views5 pages

Dbi202 Test2 Su 24

DBI202 PT2

Uploaded by

hainam25072004
Copyright
© © All Rights Reserved
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
0% found this document useful (0 votes)
100 views5 pages

Dbi202 Test2 Su 24

DBI202 PT2

Uploaded by

hainam25072004
Copyright
© © All Rights Reserved
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/ 5

Part 1: 40 pts

QN=1 The conceptual model is


a. Dependent on hardware
b. Dependent on software
c. Dependent on both hardware and software
d. Independent of both software and hardware

QN=2 When the number of entities are borrowed together into one
entity based on their similar characteristics, what is this process called?
a. Generalization
b. Specialization
c. Inheritance
d. Abstraction

QN=3 Consider the following Statements:


(1) An Entity Integrity constraint states that the primary key value cannot be null.
(2) A referential integrity constraint is specified between two relations.
(3) A foreign key cannot be used to refer to its own relation.
Which of the above statements are correct?
a. Only (1)
b. Only (2)
c. Only (2) and (3)
d. Only (1) and (2)

QN=4 Which of the following is a component of the relational data


model included to specify business rules to maintain the integrity of data when
they are manipulated?
a. Business rule constraint
b. Data integrity
c. Business integrity
d. Data structure
e. Entity integrity

QN=5 What should we do when converting the 1-M binary relationship


into tables?
a. Create a table with all attributes from both entities
b. Add foreign key to the many side referencing to the parent (1 side)
c. Add foreign key to the 1 side referencing to the child (M side)
d. Add foreign key to all of tables

QN=6 What is the output of conceptual design model


a. ER diagram
b. Relational database schema
c. Technical specifications for construction of the database
d. None of the others

QN=7 The difference between PRIMARY KEY constraint and UNIQUE constraint
is:
a. The data of field has UNIQUE constraint that can be NULL, otherwise to PRIMARY
KEY constraint
b. The data of field has PRIMARY constraint that can be NULL, otherwise to UNIQUE
constraint
c. These constraints are not different.
d. None of the others.

QN=8 Which statement is use to add FOREIGN KEY constraint into Student table
(IdClass is a foreign key which refer to Class table)
a. ALTER TABLE Student
ADD CONSTRAINT FKStudent FOREIGN KEY(IdClass)
REFERENCES Class(IdClass)
b. ALTER TABLE Student
ADD FOREIGN KEY(IdClass) REFERENCES Class(IdClass)

c. ALTER TABLE Student


ADD FKStudent FOREIGN KEY(IdClass)
REFERENCES Class(IdClass)

d. None of the others

QN=9 Selecting the victim to be rollbacked to the previous state is determined by the
minimum cost. The factors determining cost of rollback is
a. How long the transaction has computed, and how much longer the transaction will
compute before it completes its designated task.
b. How many data items the transaction has used
c. How many more data items the transaction needs for it to complete
d. All of these answers

QN=10 What is the property of a transaction which ensures that either all operations
of the transaction are reflected properly in the database or none?
a. Atomicity
b. Durability
c. Isolation
d. Consistency
e. Deadlocke.

QN=11 Which of the following is a comparison operator in SQL?


a. =
b. LIKE
c. BETWEEN
d. All of the answers

QN=12 Which of the following group functions ignore NULL values?


a. MAX
b. SUM
c. COUNT
d. All of these answers

QN=13 Suppose you want to compare three keys (‘Primary Key’, ‘Super Key’ and
‘Candidate Key’) in a database. Which of the following option(s) is/are correct?

(1)Minimal super key is a candidate key


(2)Only one Candidate Key can be Primary Key
(3)All super keys can be a candidate key
(4)We cannot find “Primary Key” from “Candidate Key”
a. (1) & (2)
b. (1) & (3)
c. (2) & (3)
d. (3) & (4)

QN=14 Which of the following statement(s) is/are true about “HAVING” and
“WHERE” clauses in SQL?
(1) WHERE” is always used before “GROUP BY” and HAVING after “GROUP BY”
(2) WHERE” is always used after “GROUP BY” and “HAVING” before “GROUP
BY”
(3) “WHERE” is used to filter rows but “HAVING” is used to filter groups
(4) “WHERE” is used to filter groups but “HAVING” is used to filter rows

a. (1) & (4)


b. (1) & (3)
c. (2) & (3)
d. (2) & (4)
QN=15 Which of the following statements is true?
a. A weak entity set may exist without participation in any relationship
b. A weak entity should participate in a relationship with another weak entity set
c. A weak entity set should participate in a relationship with at least one strong entity set
d. Weak entity sets have no primary key that is derived from the parent entity in the
binary relationship with at least one strong entity set.

QN=16 Which statement is used to modify the value of Address in table Student
selected from Addr column in table EnrollmentInformation?
a. UPDATE Student
SET Address = (SELECT Addr FROM EnrollmentInformation
WHERE Student.Id = EnrollmentInformation.Id)
b. UPDATE Student
SET Addr = (SELECT Address FROM EnrollmentInformation
WHERE Student.Id = EnrollmentInformation.Id)
c. UPDATE Student
SET Address = (SELECT Addr FROM EnrollmentInformation)

d. None of the others

QN=17 Which statement is used to insert data from table HREmp to table
Employee:
a. INSERT INTO Employee
SELECT * FROM HREmp
b. INSERT INTO Employee
VALUES(SELECT * FROM HREmp)
c. INSERT INTO Employee (Dept)
VALUES(‘HREmp)
d. None of the others

QN=18 Which statement is used to delete all the data but keep the structure of table
Student
a. DELETE FROM Student
b. DELETE TABLE Student
c. DROP TABLE Student
d. None of the others
QN=19 What type of join is needed when you wish to include rows that do not have
matching values?
a. Equi-join
b. Natural join
c. Outer join
d. All of the others

QN=20 To display the unique values of a column, which word is used?


a. Top
b. Distinct
c. All
d. From

Part 2: 60 pts
(Even Student) Draw a ER model for a pharmacy store, relationships and attributes and
draw the ERD.

(Odd Student ) Draw a ER model for an online shopping system (Shopee) ,


relationships and attributes and draw the ERD.

 Draw ER model (20pts)


 Explain your ER model (30pts)
 Draw ERD (10pts)

You might also like