Worksheetsall final DBS
Total questions: 120
Worksheet time: 3600secs
What is the best data type definition for Oracle when a field is alphanumeric and has a fixed length?
VARCHAR2
CHAR
LONG
NUMBER
What is the best data type definition for Oracle when a field is alphanumeric and its length may vary?
VARCHAR2
CHAR
LONG
NUMBER
Selecting a data type involves which of the following?
Maximize storage space
Represent most values
Improve data integrity
All of the above
If a denormalization situation exists with a one-to-one binary relationship, which is true?
All fields stored in one relation
All fields stored in two relations
All fields stored in three relations
All fields stored in four relations
If a denormalization situation exists with a many-to-many relationship, which is true?
All fields stored in one relation
All fields stored in two relations
All fields stored in three relations
All fields stored in four relations
Which of the following is an advantage of partitioning?
Complexity
Inconsistent access speed
Extra space
Security
Sequential retrieval on a primary key for sequential file storage has which feature?
Very fast
Moderately fast
Slow
Impractical
A rule of thumb for choosing indexes includes which of the following?
Indexes are more useful on smaller tables
Indexes are more useful for columns not used in WHERE
Do not specify unique index for primary key
Be careful indexing attributes with null values
Which of the following are integrity controls that a DBMS may support?
Assume default value
Limit permissible values
Limit nulls in some fields
All of the above
A secondary key is which of the following?
Non-unique key
Primary key
Useful for denormalization decisions
Determines tablespace
The fastest read/write time and most efficient data storage of any disk array type is:
RAID-0
RAID-1
RAID-2
RAID-3
A multidimensional database model is most often used in:
Data warehouse
Relational
Hierarchical
Network
Which is NOT a factor when switching block sizes?
Length of fields in row
Number of columns
Block contention
Random row access speed
Which improves query processing time?
Write complex queries
Combine table with itself
Query within query
Use compatible data types
The blocking factor is:
Group of fields stored together
Number of physical records per page
Attributes grouped by primary key
Attributes grouped by secondary key
The command to eliminate a table from a database is:
REMOVE TABLE CUSTOMER
DROP TABLE CUSTOMER
DELETE TABLE CUSTOMER
UPDATE TABLE CUSTOMER
The command to eliminate a row from a table is:
REMOVE FROM CUSTOMER
DROP FROM CUSTOMER
DELETE FROM CUSTOMER
UPDATE FROM CUSTOMER
Which command sorts rows in SQL?
SORT BY
ALIGN BY
ORDER BY
Correct processing order for SQL SELECT statements:
SELECT, FROM, WHERE
FROM, WHERE, SELECT
WHERE, FROM, SELECT
SELECT, WHERE, FROM
A view is which of the following?
A virtual table accessible via SQL
A virtual table not accessible
A base table accessible via SQL
A base table not accessible
Which of the following is valid SQL for creating an index?
CREATE INDEX ID
CHANGE INDEX ID
ADD INDEX ID
REMOVE INDEX ID
Which SQL statement is equivalent to: SELECT NAME FROM CUSTOMER WHERE STATE = 'VA';
SELECT NAME IN CUSTOMER WHERE STATE IN ('VA')
SELECT NAME IN CUSTOMER WHERE STATE = 'VA'
SELECT NAME IN CUSTOMER WHERE STATE = 'V'
SELECT NAME FROM CUSTOMER WHERE STATE IN ('VA')
What was the original purpose of SQL?
Define SQL DDL semantics
Define SQL DML semantics
Define data structures
All of the above
Benefits of a standard relational language include:
Reduced training costs
Increased dependence on a single vendor
Applications are not needed
All of the above
Which must be considered when creating a table in SQL?
Data types
Primary keys
Default values
All of the above
ON UPDATE CASCADE ensures:
Normalization
Data Integrity
Materialized Views
All of the above
You can add a row using SQL with which command?
ADD
CREATE
INSERT
MAKE
The wildcard in a SELECT statement is:
%
&
#
@
The wildcard in a WHERE clause is useful when:
Exact match is necessary in SELECT
Exact match is not possible in SELECT
Exact match necessary in CREATE
Exact match impossible in CREATE
The HAVING clause does which of the following?
Acts like WHERE for groups
Acts like WHERE for rows
Acts like WHERE for columns
Acts exactly like WHERE
Data manipulation language (DML) commands are used for:
Creating, altering, dropping tables
Defining database structures
Processing and manipulating data
All of the above
SQL SELECT statement with aggregate functions returning multiple values is:
Scalar aggregate
Vector aggregate
Group aggregate
None of the above
A dynamic view is:
A view whose contents are stored permanently
A view that materializes only when accessed
A base table
A static snapshot
Indexes can be created for:
Only primary keys
Only secondary keys
Both primary and secondary keys
None
SELECT DISTINCT allows a user to:
See duplicate rows
Remove duplicate rows
Include null rows
None of the above
COUNT(field_name) does what?
Counts all rows
Counts non-null values only
Counts null rows
SUM, AVG, MIN, MAX can be used on:
Numeric columns only
All data types
Date and numeric only
None
To establish a range of values the operators used are:
= and <>
< and >
!= and =
<= and =
DISTINCT (or ALL) can be used:
Only once
Multiple times
Only with WHERE
Only with numeric columns
Which of the following is generally used for performing tasks like creating the structure of relations and deleting relations?
DML (Data Manipulation Language)
Query
Relational Schema
DDL (Data Definition Language)
Which of the following provides the ability to query information, insert, delete, and modify tuples in the database?
DML
DDL
Query
Relational Schema
Which query is equivalent to: SELECT name, course_id FROM instructor, teaches WHERE instructor_ID = teaches_ID;
SELECT name, course_id FROM teaches, instructor WHERE instructor_id = course_id
SELECT name, course_id FROM instructor NATURAL JOIN teaches
SELECT name, course_id FROM instructor
SELECT course_id FROM instructor JOIN teaches
Which statement likely contains an error?
select * from emp where empid = 10003;
select empid from emp where empid = 10006;
select empid from emp;
select empid where empid = 1009 AND Lastname = 'GELLER';
In the query below, what wildcard goes in the blank? WHERE dept_name LIKE '____ Computer Science' (to find dept names ending with “Computer Science”)
&
_
%
$
What is a one-to-many relationship?
One class may have many teachers
One teacher can have many classes
Many classes may have many teachers
Many teachers may have many classes
Fill the blanks for ORDER BY: Sort salary highest → lowest, then name alphabetically. ORDER BY salary ___, name ___.
Ascending, Descending
Asc, Desc
Desc, Asc
All of the above
Equivalent query for: SELECT name FROM instructor1 WHERE salary <=100000 AND salary >=90000;
WHERE salary BETWEEN 100000 AND 90000
WHERE salary BETWEEN 90000 AND 100000
SELECT name FROM instructor1 WHERE salary BETWEEN 90000 AND 100000
WHERE salary <=90000 AND salary >=100000
Which refers to “data about data”?
Directory
Sub Data
Warehouse
Metadata
Which level describes how data is actually stored?
Conceptual
Physical
File level
Logical
A file is a collection of related ______.
Rows & columns
Fields
Database
Records
Rows of a relation are known as:
Degree
Tuples
Entity
All of the above
The number of tuples in a relation is called:
Entity
Column
Cardinality
None
Which is a Data Manipulation Command?
Create
Alter
Delete
Which is a Data Definition Language command?
Create
Update
Delete
Merge
A top-down approach where a higher-level entity is divided into sub-entities is:
Aggregation
Generalization
Specialization
All of the above
Multiple lower-level entities grouped into one higher-level entity is:
Specialization
Generalization
Aggregation
None
In a relational database, tuples divided into fields are known as:
Queries
Domains
Relations
All of the above
In a relational table, “attribute” refers to:
Entity
Row
Column
Both b & c
Number of attributes in a relation is called:
Degree
Row
Column
All
Used in application programs to request data from DBMS:
Data Manipulation Language
Data Definition Language
Data Control Language
All
Command that saves a transaction permanently:
COMMIT
ROLLBACK
SAVEPOINT
None
Command that restores database to last committed state:
Savepoint
Rollback
Commit
Both a & b
Collection of information stored in a database at a specific time is a:
Independence
Instance
Schema
Domain
SQL stands for:
Standard Query Language
Sequential Query Language
Structured Query Language
Server-side Query Language
Purpose of DML:
Addition of new structure
Manipulation & processing of database
Definition of physical structure
All
In relational model, relations are known as:
Tuples
Attributes
Rows
Tables
Key used to represent relationship between tables:
Primary key
Foreign key
Secondary key
None
Keyword used to count values in a column:
TOTAL
COUNT
SUM
ADD
Term commonly used to define overall design of database:
Application program
Data definition language
Schema
Source code
Command to modify a column inside a table:
Drop
Update
Alter
Set
____ business rules are implemented in a database.
Five
Three
Not all
All
The SDLC phase in which every data attribute, category, and relationship is defined is the _____ phase.
Design
Implementation
Analysis
Planning
A key that consists of more than one attribute is called a:
Multivalued key
Foreign key
Cardinal key
Composite key
Relationships have ______, representing the number of instances participating between entities.
Line
Constraint
Cardinality
Degree
The rule specifying a supertype instance may belong to no subtype is:
Partial specialization
Disjointness
Total specialization
Semi-specialization
ER diagrams include ____ for entities and ____ for relationships.
Rectangles, cardinalities
Objects, lines
Oval, cardinalities
Object, degrees
Rectangles, lines
Subtypes should be used when:
A recursive relationship is needed
Some attributes apply to only some instances
Instances do not participate in unique relationships
Supertypes relate to external objects
A form of database specification mapping conceptual requirements is called:
Physical specifications
Security specifications
Response specifications
Logical specifications
A ____ degree represents a relationship between entities of the same type.
Multiple
Ternary
Unary
Binary
A constraint between two attributes is called a:
Functional relation constraint
Attribute dependency
Functional relation
Functional dependency
A simple attribute has no component parts. A _____ attribute can be broken down. A _____ attribute is computed from others. Example: _____.
simple, composite, derived; age = current year − birth year
simple, derived, composite; age = birth year − current year
composite, simple, derived; age = current year + birth year
simple, multivalued, derived; age = current year × birth year
Relationship _____ specify number of entity types involved.
Line
Cardinality
Constraint
Degree
Main goals of normalization include all EXCEPT:
Maximize storage space
Simplify referential integrity
Make data easier to maintain
Minimize redundancy
Which constraint ensures referential integrity?
Primary key
Foreign key
Unique
Check
The rule stating no primary key value may be null is the:
Entity integrity rule
Partial specialization rule
Referential integrity rule
Domain rule
Which is NOT a good characteristic of a data name?
Readable
Relates to business characteristics
Relates to technical characteristics
Repeatable
The logical representation of organizational data is called a:
Relationship systems design
Database entity diagram
Database model
Entity-relationship model
Purpose of normalization in relational design:
Reduce redundancy and improve integrity
Convert ERD to relational model
Increase redundancy
Ensure every table has a foreign key
A two-dimensional table of data is called a:
Relation
Declaration
Set
Group
A domain definition includes all EXCEPT:
Integrity constraints
Domain name
Size
Data type
When transforming ER diagrams to relations, a ____ attribute becomes a separate relation with a FK.
Derived
Multivalued
Composite
Complicated
The rule specifying each supertype instance MUST belong to a subtype is:
Total specialization
Partial specialization
Total convergence
Semi-specialization
Which scenario requires denormalization?
Ensure 3NF
Reduce null values
Improve read performance, avoid joins
Reduce redundancy
Which constraint prevents invalid data?
Referential integrity
Entity integrity
Domain integrity
All of the above
A ______ defines or constrains some aspect of business.
Business rule
Business structure
Business control
Business constraint
Which ensures consistency of relationships between tables?
Entity integrity
Functional dependency
Domain integrity
Referential integrity
______ constraints define whether a supertype instance must belong to a subtype.
Total specialization
Completeness
Partial specialization
Disjointness
______ database specification indicates parameters for physical storage.
Schematic
Physical
Logical
Conceptual
A ______ attribute depends on others for its value.
Derived
Foreign
Multivalued
Single-valued
Referential integrity requires any ____ value must match a ____ value in the parent table.
Non-key → primary key
Primary key → foreign key
Non-key → determinant
Foreign key → primary key
The property by which subtype entities inherit the attributes of a supertype is called:
Hierarchy reception
Class management
Generalization
Attribute inheritance
In an ER diagram, how many business rules exist for every relationship?
One
Zero
Two
Three
A relation with no multivalued attributes, whose non-key attributes depend solely on the primary key but still contains transitive dependencies, is in which normal form?
Third
Second
Fourth
First
______ is a component of the relational data model used to specify business rules to maintain integrity.
Business integrity
Data structure
Data integrity
Business rule constraint
An entity should NOT be:
An output of the database system
An object composed of multiple attributes
An object being modeled
An object with many instances
A user of the database
Given the functional dependencies F = {A → B, B → C, A → C}, the table:
Violates 1NF
Is in 2NF but not 3NF
Violates 2NF
Violates 3NF due to transitive dependencies
What is the best data type for Oracle when a field is alphanumeric with fixed length?
VARCHAR2
CHAR
LONG
NUMBER
What is the best data type for Oracle when a field is alphanumeric with variable length?
VARCHAR2
CHAR
LONG
NUMBER
Selecting a data type involves which of the following?
Maximize storage space
Represent most values
Improve data integrity
All of the above
If a denormalization situation exists with a one-to-one relationship:
All fields in one relation
All fields in two relations
All fields in three relations
All fields in four relations
If a denormalization situation exists with a many-to-many relationship:
One relation
Two relations
Three relations
Four relations
Which is an advantage of partitioning?
Complexity
Inconsistent speed
Extra space
Security
Sequential retrieval on a primary key is:
Very fast
Moderately fast
Slow
Impractical
Rule of thumb for choosing indexes:
More useful on smaller tables
Useful when column not used in WHERE
Never specify unique index for PK
Be careful indexing NULL attributes
Integrity controls a DBMS may support include:
Default values
Restrict permissible values
Limit nulls
All of the above
A secondary key is:
Non-unique key
Primary key
Needed for denormalization
Determines tablespace
Fastest disk array (read/write) is:
RAID-0
RAID-1
RAID-2
RAID-3
Multidimensional database models are mostly used in:
Data warehouse
Relational systems
Hierarchical databases
Network databases
Factor NOT considered when changing block size:
Row length
Number of columns
Block contention
Random access speed
Which improves query processing time?
Writing complex queries
Self join
Nested queries
Using compatible data types
