Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 12

Computer/ IT – Semester 3rd

a m Unit - 2
ir Te
ib S
s h
To
• Computer - Relational Data Model
---------------------------------
Fundamentals of RDBMS - Record , fields, data types, tables and database
Concept of RDBMS
E.F.CODD's rule for RDBMS
Key Concept - candidate key, Primary key, foreign key
Normalization - 1NF, 2NF, 3NF
Structured Query Language
DDL - CREATE, ALTER, DROP, TRUNCATE, DESC, RENAME
DML - INSERT, UPDATE, DELETE
DCL - COMMIT, ROLLBACK, SAVEPOINT, GRANT, REVOKE
DQL - SQL
Data Integrity Constraint
I/O - Primary Key, Foreign Key, Unique Key
a m
Te
Business rule constraint - Null, Not Null and Check constraint

ir
SQL Operators
Arithmetic

ib S
h
Comparison
Logical
Set Operators
Range Searching Operators - Between To s
Pattern matching operations – Like

• IT - Data Models & Database types


----------------------------------
Database Models - Hierarchical, Network, Object-oriented
Relational Database Model - Domain, Attributes, Tuples and Relations
Types of Database System - Centralized, Parallel, Client/ Server, Distributed
 
• What is a foreign key?
a) A foreign key is a primary key of a relation which is an attribute in another relation
b) A foreign key is a superkey of a relation which is an attribute in more than one other relations
c) A foreign key is an attribute of a relation that is a primary key of another relation
d) A foreign key is the primary key of a relation that does not occur anywhere else in the schema

• An attribute is a __________ in a relation.


a) Row
b) Column
c) Value
d) Tuple

a m
Te
• What is the method of specifying a primary key in a schema description?

ir
a) By writing it in bold letters
b) By underlining it using a dashed line
c) By writing it in capital letters
ib S
d) By underlining it using a bold line
s h
• Statement 1: A tuple is a row in a relation To
Statement 2: Existence of multiple foreign keys in a same relation is possible
a) Both the statements are true
b) Statement 1 is correct but Statement 2 is false
c) Statement 1 is false but Statement 2 is correct
d) Both the statements are false
• The process of making a normalized schema unnormalized is called as _________
a) Unnormalization
b) Denormalization
c) Renormalization
d) Annormalization

• Which of the following data types does the SQL standard not support?
a) char(n)
b) String(n)
c) varchar(n)
d) float(n)

• Which command is used to create a new relation in SQL


a m
a) create table( , …)

ir Te
S
b) create relation( , …)

ib
c) new table( , …)
d) new relation( , …)
s h
• To
What is the syntax to load data into the database? (Consider D as the database and a, b, c as data)
a) enter into D (a, b, c);
b) insert into D values (a, b, c);
c) insert into D (a, b, c);
d) insert (a, b, c) values into D;
• Which of the following commands do we use to delete all the tuples from a relation (R)?
a) delete table R
b) drop table R
c) delete from R
d) drop from R

• Which of the following commands do we use to delete a relation (R) from a database?
a) drop table R
b) drop relation R
c) delete table R
d) delete from R

• What does the notnull integrity constraint do?


a) It ensures that at least one tuple is present in the relation
a m
b) It ensures that at least one foreign key is present in the relation
c)
ir
It ensures that all tuples have a finite value on a specified attribute Te
ib S
d) It ensures that all tuples have finite attributes on all the relations

s h
To
• Which of the following syntax of the basic query is correct?
a) select <relation> from <attribute>
b) select <attribute> from <relation>
c) select <tuple> from <relation>
d) select <tuple> from <attribute>
• Which of the following logical connectives is not included in SQL?
a) and
b) or
c) nor
d) not

• State true or false: Multiple conditions in the where clause are separated by a “,”
a) True
b) False

• What is the function of the union operation?


a) It combines the results of any two different queries

m
b) It combines the results of two different queries which have the same set of attributes in the select clause
a
Te
c) It combines the results of two different queries which have the same condition in the where clause

ir
d) It gives the Cartesian product of the results of any 2 queries

ib S
h
• What is the function of the intersect operation?

To s
a) It returns the intersection of the results of the results of any two different queries
b) It returns the intersection of the results of two different queries which have the same set of attributes in the select clause
c) It returns the intersection of the results of two different queries which have the same condition in the where clause
d) None of the mentioned
• Using the _______ clause retains only one copy of identical tuples
a) distinct
b) is not null
c) no repeat
d) from

• Which of the following correctly describes the between predicate in the where clause?
a) It is used to check whether a value is in between two specified values
b) It is used to check whether a value is exactly in the center of the relation alphabetically
c) It is used to check whether a value is in between any two other values in the database
d) None of the mentioned

• A ___________ is an association among several entities.


a m
Te
a) Relationship

ir
b) Association
c) Set

ib S
h
d) Combination


To s
State true or false: We cannot specify keys in the Entity-Relationship model
a) True
b) False
• State true or false: Multiple attributes combined together can be primary keys
a) True
b) False

• Which of the following is a good database management practice?


a) Adding redundant attributes
b) Removing redundant attributes
c) Not specifying primary keys
d) None of the mentioned

• Which of the following symbols represent relationship sets in an ER diagram


a) Divided rectangles
b) Diamonds
c) Lines
a m
Te
d) Undivided rectangles

• An entity set that has a primary key is called as ___________


S ir
ib
a) Strong entity set
b) Weak entity set
s h
To
c) Complete entity set
d) None of the mentioned

• The term Relation and Tuple are referred to as?


Table and Domain
Table and column
Table and Row
Table and Attribute
• Primary Key and Foreign Key can be shown pictorially by ______?
E-R Diagram
Schema Diagram
Database Diagram
All of the above

• A _____ in a Table represents a relationship among a set of values?


Row
Column
Attribute
All of the above

• For each attribute there is set of permitted values called?


a m
A. Key Set

ir Te
S
B. Value Set

ib
C. Domain
D. B and C
s h
• To
An attribute takes ___ value when an entity does not have a value for it
Zero
blank
Null
NA
• In Relational Model, set of indivisible values is called?
Attribute
Domain
Tuple
Relation

• In Relational Model, Table is cosiderred as?


Tuple
Domain
Attribute
Relation


a m
Te
The given Query can be replaced with ____________:

ir
SELECT name
FROM instructor1
WHERE salary <= 100000 AND salary >= 90000;
ib S
s h
a.
SELECT name
FROM instructor1
To
WHERE salary BETWEEN 100000 AND 90000

b.
SELECT name
FROM instructor1
WHERE salary BETWEEN 90000 AND 100000;
• To which of the following the term "DBA" referred?
Data Bank Administrator
Database Administrator
Data Administrator
None of the above

• The term "TCL" stands for_____.


Ternary Control Language
Transmission Control Language
Transaction Central Language
Transaction Control Language


a m
Te
In the relational table, which of the following can also be represented by the term "attribute"?

ir
Entity
Row
Column
ib S
Both B &C
s h
• To
Which of the following commands is used to save any transaction permanently into the database?
Commit
Rollback
Savepoint
None of the above
• Choose the correct statement regarding superkeys
a) A superkey is an attribute or a group of multiple attributes that can uniquely identify a tuple
b) A superkey is a tuple or a set of multiple tuples that can uniquely identify an attribute
c) Every superkey is a candidate key
d) A superkey is an attribute or a set of attributes that distinguish the relation from other relations

• While operating with strings, what does “_ _ _%” match with?


a) A string of three letters
b) A string of at least three letters
c) A string of three words
d) A string of at least three words

• State true or false: Multiple attributes combined together can be primary key
a m
a) True

ir Te
S
b) False


s h ib
State true or false: Redundancy is desired in a relational schema

To
a) True
b) False

You might also like