Font size
WorksheetsSQL and Database Concepts Quiz
Total questions: 88
Worksheet time: 47mins
Another name for a table in a relational database?
Tuple
Attribute
Relation
Schema
What is a tuple?
A column
A unique row in a table
A table
A key
Purpose of defining primary keys?
Improve performance
Ensure data integrity and uniqueness
Reduce storage
Create indexes
Example of one-to-many relationship?
Order to Order
Product to Supplier
Customer to Orders
Country to Capital
Role of a superkey?
Sorts tuples
Defines table structure
Ensures no two tuples are identical
Creates foreign keys
Not a fundamental component of an ER model?
Entities
Attributes
Relationships
Algorithms
What is a foreign key in RDM conversion?
A key that must be unique
A key used to establish relationships between tables
A primary key
A composite key
What is a primary key?
Any attribute
A foreign key
A candidate key chosen to uniquely identify tuples
A non-unique identifier
What is normalization?
Merging tables
Splitting tables to eliminate redundancy
Sorting data
Encrypting data
Role of a foreign key?
Ensures uniqueness
Establishes a link between two tables
Creates indexes
Defines primary keys
What is a foreign key?
A unique attribute
Attribute referencing a primary key in another relation
A primary key
A superkey
What is a superkey?
A key that must be foreign
Attribute(s) uniquely identifying a tuple
A minimal key
A composite key only
What is a relationship’s degree?
Number of attributes
Number of entities participating
Number of keys
Number of tuples
How are tables typically related?
By indexes
By triggers
Through shared attributes
Through stored procedures
Entity that can exist independently?
Weak entity
Strong entity
Recursive entity
Composite entity
Role of a foreign key in ER model?
Improve performance
Enforce referential integrity
Create tables
Define attributes
Command to create a table?
MAKE TABLE
NEW TABLE
CREATE TABLE
TABLE CREATE
Command to update multiple rows?
MODIFY
UPDATE
CHANGE
ALTER
DDL commands do what?
Manipulate data
Define database structure
Query data
Delete rows
DELETE is classified as…
DDL
DML
TCL
DCL
COUNT function does what?
Sums values
Finds max
Counts rows
Groups rows
ON DELETE CASCADE does what?
Prevents deletion
Deletes child rows when parent is deleted
Updates child rows
Ignores deletion
Optional clause in SELECT?
FROM
WHERE
SELECT
GROUP BY
Clause for sorting results?
FILTER
GROUP BY
ORDER BY
SORT
CHECK constraint is used for…
Creating indexes
Validating data in columns
Sorting data
Joining tables
Not a DDL command?
CREATE
ALTER
DROP
UPDATE
Clause specifying condition for selecting records?
ORDER BY
WHERE
GROUP BY
HAVING
GROUP BY is used with…
Scalar functions
Aggregate functions
String functions
Date functions
Add a new column to a table?
INSERT
UPDATE
ALTER TABLE
MODIFY
SELECT * does what?
Selects first row
Selects all columns
Selects all tables
Selects all databases
What is DDL?
Data Delete Language
Data Definition Language
Data Download Language
Data Deployment Language
Operator checking value in a range?
IN
BETWEEN
LIKE
ANY
Command to retrieve data?
GET
SELECT
FETCH
SHOW
Default ORDER BY sorting?
Descending
Ascending
Random
None
DML command to add data?
UPDATE
ALTER
INSERT
MERGE
DEFAULT constraint does what?
Prevents NULL
Assigns default value if none provided
Creates index
Enforces uniqueness
SQL command to change table structure?
UPDATE
INSERT
ALTER
MODIFY
Purpose of INSERT command?
Delete data
Modify data
Add new data
Sort data
What does the UNIQUE constraint do?
Prevents duplicate values in a column
Prevents NULL values
Makes a column the primary key
Sorts values automatically
What does SQL stand for?
Simple Query Logic
Structured Query Language
Sequential Query Language
System Query Layer
Which SQL constraint ensures that values in a primary key column are unique?
UNIQUE
CHECK
FOREIGN KEY
PRIMARY KEY
Which SQL keyword eliminates duplicate rows in the result?
REMOVE
DISTINCT
UNIQUE
FILTER
What does DML stand for?
Data Manipulation Language
Data Modeling Language
Data Management Layer
Database Mapping Logic
What does the SELECT statement do?
Delete data
Retrieve data from a table
Modify table structure
Grant permissions
Purpose of FOREIGN KEY constraint?
Ensures uniqueness
Links two tables together
Creates indexes
Sorts data
Which SQL command modifies existing records?
INSERT
UPDATE
ALTER
MODIFY
Which SQL constraint ensures column values must not be empty?
Which SQL command modifies existing records?
INSERT
UPDATE
ALTER
MODIFY
Which SQL constraint ensures column values must not be empty?
UNIQUE
CHECK
NOT NULL
DEFAULT
SQL command to remove a database?
DELETE DATABASE
DROP DATABASE
REMOVE DB
CLEAR DATABASE
Which command grants user access?
ALLOW
GRANT
PERMIT
ACCESS
Wildcard symbol matching any substring in LIKE?
_
%
SQL command removing a table entirely?
DELETE
REMOVE
DROP
CLEAR
How to specify constraints when creating a table?
RULE
LIMIT
DEFINE
CONSTRAINT
What type of SQL statement is SELECT?
DDL
DML
TCL
DCL
Command to remove all constraints from a table?
DROP ALL
ALTER TABLE DROP CONSTRAINT
DELETE CONSTRAINTS
REMOVE RULES
What does ROLLBACK do?
Save changes
Cancel pending changes
Delete the transaction
Restart the database
SQL statement to modify a column data type?
UPDATE COLUMN
ALTER TABLE
MODIFY TYPE
CHANGE COLUMN
Which is independent of any DBMS?
Physical design
Internal schema
Conceptual design
Storage mapping
Which type of attribute uniquely identifies entity instances?
Composite attribute
Multivalued attribute
Derived attribute
Identifier
Total completeness implies:
It may belong to no subtype
It must belong to exactly one subtype
It must be a member of at least one subtype
It belongs to all subtypes
The 'supertype' represents:
A weak entity
A general entity type with common attributes
A relationship
A multivalued attribute
Attribute computed from another attribute:
Composite attribute
Multivalued attribute
Derived attribute
Key attribute
Set of possible values for an attribute:
Tuple
Key
Domain
Schema
Overlapping subtypes mean:
Must belong to only one subtype
May appear in more than one subtype
Cannot belong to any subtype
Must belong to all subtypes
Association among entities is called:
Attribute
Domain
Relationship
Key
NULL in attributes means:
Zero
Empty string
Missing/unknown value
Invalid data
Conceptual design is:
DBMS-specific
Physical
Independent of any DBMS
Hardware-based
Most important EER construct:
Composite attributes
Multivalued attributes
Supertype/subtype discriminator
Weak entities
Conceptual design is based on info from:
Implementation phase
Requirements analysis phase
Testing phase
Deployment phase
Disjoint subtypes mean:
Can belong to many subtypes
Must appear in only one subtype
Must appear in all subtypes
Appear in no subtype
Nature of an attribute:
A relationship
A property of an entity
A table
A key
If 'Owns' is defined for Vehicle, then:
Only Car participates
Only Truck participates
Both Car and Truck participate
Neither participates
One-to-many means:
Many A to many B
Each A maps to many B; each B maps to one A
One A to one B
Many A to one B
Purpose of EER model:
Replace ER model
Extend ER model with new constructs
Remove relationships
Remove attributes
Completeness constraint specifies:
Whether subtype has attributes
Whether each supertype occurrence must belong to a subtype
Whether keys exist
Whether relationships are recursive
'Skill' for Employee is:
Relationship
Attribute
Domain
Key
Composite attribute example:
Salary
Name (First, Middle, Last)
Age
ID
Relationship defined at supertype level means:
Only supertype participates
All subtypes participate
No subtype participates
Only one subtype participates
Subtype represents:
General entity
Specialized entity inheriting from supertype
Weak entity
Domain
Subtype of Employee:
Department
Salaried Employee
Project
Skill
Chen notation is used for:
Physical modeling
Conceptual modeling
Logical modeling
Implementation
NOT part of ERM:
Entities
Attributes
Relationships
User interface designs
Elements of ERM include:
Tables only
Entities, attributes, relationships, constraints
Queries
Reports
Partial completeness symbol:
Double line
Circle over single line
Triangle
Dashed line
Attribute naming convention:
Verb
Noun describing characteristic
Adjective
Symbol
Attribute on a relationship describes:
Entity property
Property of the connection
Domain
Key
An entity must have:
Verb name
Number name
Noun name
Symbol name
