WorksheetsGEM of DBMS
Total questions: 60
Worksheet time: 53mins
In relational data model, the total number of rows can be identified as ______________________ .
Cardinality
Degree
Attribute
Entity
Identify the total number of attributes in a relational data model.
Tuple
Entity
Degree
Cardinality
Identify the candidate key.
W
X
Y
Z
If related data exists in more than one table, they can be joined by using the Primary Key link to the same key in the other table. Identify this key.
Foreign Key
Primary Key
Candidate Key
Composite Key
Choose the CORRECT symbol of SELECT in the Relational Algebra
x
π
∩
σ
Based on the figure above, identify the number of tuples that will be returned by the following relational algebra query : σ Type = 'Saving' (Account)
2
3
6
0
Base on the table given, identify output that will be produced when, σ Salary > 3000 ˅ City = ‘Batu Pahat’ (WORKER).
Recognize the following that hold a single value attribute
Address
Register number
Reference
Subject_taken
Based on the table given, identify the relation name.
AccoundID
Car Loan
Account
Balance
Which of the following relational algebra operations do not require the participating tables to be union-compatible?
unioin
intersection
difference
cartesian product
The rule that a value of a foreign key must appear as a value of some specific table is called as
Referential constraint
Index
Integrity constraint
Domain constraint
Minimal Superkeys are called
Primary key
Foreign key
Candidate key
Attribute keys
Which of the following is not a restriction for a table to be a relation?
The cells of the table must contain a single value.
All of the entries in any column must be of the same kind.
The columns must be ordered.
No two rows in a table may be identical.
v_num is Null
v_num is NOT Null
compilation error
runtime error
Which error occurs while the program is running and cannot be detected by the PL/SQL compiler?
Syntax error
Runtime error
Both A & B
None of the above
Which keyword is used instead of the assignment operator to initialize variables?
NOT NULL
DEFAULT
%TYPE
%ROWTYPE
________ does not correlate with an oracle error, instead, user_define
exceptions usually enforce business rules in situations
in which an oracle error would not necessarily occur
Predefined Exception
Internal Exception
User defined Exception
None of the above
Which choice shows what I will see on the screen after the following block is executed?
-1
VALUE_ERROR
-1
TOO_MANY_ROWS
3
NO ERROR
1
NO ERROR
Which SQL function is used to count the number of rows in a SQL query?
COUNT()
NUMBER()
SUM()
COUNT(*)
With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” ends with an “a”?
SELECT * FROM Persons WHERE FirstName=’a’
SELECT * FROM Persons WHERE FirstName LIKE ‘a%’
SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
SELECT * FROM Persons WHERE FirstName=’%a%’
What does the ALTER TABLE clause do?
The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints
The SQL ALTER TABLE clause is used to insert data into database table
THE SQL ALTER TABLE deletes data from database table
The SQL ALTER TABLE clause is used to delete a database table
Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70.
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ OR temperature > 70
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ AND temperature > 70
Find the names of these cities with temperature and condition whose condition is neither sunny nor cloudy.
SELECT city, temperature, condition FROM weather WHERE condition NOT IN (‘sunny’, ‘cloudy’)
SELECT city, temperature, condition FROM weather WHERE condition NOT BETWEEN (‘sunny’, ‘cloudy’)
SELECT city, temperature, condition FROM weather WHERE condition IN (‘sunny’, ‘cloudy’)
SELECT city, temperature, condition FROM weather WHERE condition BETWEEN (‘sunny’, ‘cloudy’);
What will be the degree and cardinality of the cartesian product of two tables if the degree of first table is 3 and second table is 5. The cardinality of first table is 10 and cardinality of second table is 6.
Degree 15, Cardinality 16
Degree 8 Cardinality 16
Degree 8 Cardinality 60
Degree 15 cardinality 60
Which query is incorrect?
SELECT * FROM EMP WHERE CITY IN ('MUMBAI','DELHI','CHENNAI');
SELECT * FROM EMP WHERE CITY NOT IN ('MUMBAI','DELHI','CHENNAI');
SELECT * FROM EMP GROUP BY DEPT;
ALL THE ABOVE
Which database level is closest to the users?
External
Internal
Physical
Conceptual
Who developed the E-R model?
Codd
Chen
Date
Bachman
E-R model uses which symbol for Weak entity
Rectangle
Diamond
Double rectangle
Dotted line
What you understand by data redundancy?
Assurance of the accuracy of data
Duplicate values in database
Security of Data
None of these
The table attached is an example of First Normal Form.
TRUE
FALSE
A table is in 2NF if it is in 1NF and if
no column is not part of the primary key and is dependent on only a portion of the alternate key.
no column that is not a part of the primary key is dependent on only a portion of the primary key.
no column that is not a part of the primary key is dependent on only a portion of the foreign key.
no column that is not a part of the primary key is dependent on only a portion of the candidate key.
Non-prime attributes cannot be transitively dependent, so the relation must have the ___ normal form.
First
Second
Third
Fourth
THE ASSOCIATION OF 2 DIFFERENT ENTITIES ARE CALLED
DATA MODEL
RELATIONSHIP
ROW
ATTRIBUTE
