DB

A visually engaging illustration representing various database concepts like SQL, normalization, and data integrity, featuring colorful diagrams and charts.

Mastering Database Concepts Quiz

Test your knowledge of database fundamentals with our comprehensive quiz designed for learners and professionals alike. Dive into the world of SQL, normalization, and database integrity.

Key Features:

  • 30 thoughtfully crafted questions
  • Multiple choice format for interactive learning
  • Immediate feedback on your answers
60 Questions15 MinutesCreated by QueryMaster842
The term for information that describes what type of data is available in a database is
Metadata
Index data
Data dictionary
Data repository
Tables in second normal form (2NF)
Eliminate all hidden dependencies
Have a composite key
have all non-key fields depend on the whole primary key
Eliminate the possibility of a insertion anomalies
One approach used by databases to handle the differences in fonts used by different languages (i.e., English, Russian, Chinese, etc). Is the support of
UNIX
Perl
ASCII
Unicode
In referential integrity, in order to ensure that all matching records in a referring table are deleted when the matching record is deleted in the referenced relation, we can use:
Delete-Matching
None of the above
Cascade Delete
Delete All
Which type of query combines every row from the left table with every row from the right table and inserts a NULLs where appropriate?
INNER JOIN
THETA JOIN
FULL JOIN
OUTER JOIN
A ....... Is an SQL virtual table that is constructed from other tables.
Relation
Query results
Just another table
View
A ......... Is a program that performs some common action on database data and that is stored in the database.
Stored procedure
Method
Pseudofile
None of the above is correct.
For what purposes are views used?
To hide complicated SQL statements only
All of the above are uses for SOL views.
To hide columns only
To hide rows only
Which of the following describes triggers in databases?
Fire automatically when the condition is satisfied
Contain both a condition part and an action part
Allow the developer to save some of the application logic in the database
All of the above
What is the impact of not including a join command when using multiple tables in a query?
The primary keys in each table are joined together
The query will not work , an error is generated
The foreign keys in each table are linked to the primary keys in the other tables
All records in each table are associated with all records in the other tables
A ................ Is a stored program that is attached to a table or a view.
Stored procedure
embedded SELECT statement
Trigger
None of the above is correct.
What is not an advantage of stored procedures?
Sql can be optimized
Increased network traffic
Greater security
Code sharing
What SQL structure is used to limit column values of a table?
The CHECK constraint
The LIMIT constraint
The VALUE constraint
None of the above is correct.
What type of join is needed when you wish to include rows that do not have matching values?
Equi-join
Natural join
Outer join
All of the above
Which of the following is one of the basic approaches for joining tables?
Subqueries
Union Join
Natural join
All of the above
Table is synonymous with the term:
Record
Relation.
Tuple.
View.
Which of the following is true concerning a procedure?
You do not create them with SQL.
They do not need to have a unique name.
They include procedural and SQL statements.
They are the same thing as a function.
A functional dependency is a relationship between or among:
Attributes.
Tables
Relations
Rows
Which of the followwing statements is true concerning subqueries?
Involves the use of an inner and outer query.
Cannot return the same result as a query that is not a subquery
Does not start with the word SELECT
All of the above.
The following SQL is which type of join : SELECT CUSTOMER_T.CUSTOMER ID, ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM CUSTOMER_T,ORDER_T;
Equi-join
Natural join
Outer join
Cartesian join
A transitive dependency is which of the following?
A functional dependency between two or more key attributes.
A functional dependency between two or more nonkey attributes.
Arelation that is in first normal form.
A relation that is in second normal form.
When mapping a binary many-to-many relationship into a relation which of the following is true?
Four relations are created.
Three relations are created.
Two relations are created.
One relation is created
Denormalization is performed in order to:
Reduce redundancy
Create smaller tables
Eliminate repating groups
Improve query performance
A view is which of the following?
A virtual table that cannot be accessed via SQL commands
A base table that can be accessed via SOL commands
A base table that cannot be accessed via SOL commands
A virtual table that can be accessed via SQL commands
The HAVING clause does which of the following ?
Acts like a WHERE clause but is used for groups rather than rows
Acts like a WHERE clause but is used for rows rather than columns
Acts EXACTLY like a WHERE clause.
Acts like a WHERE clause but is used for columns rather than groups
You have a department table and an Employee table in your database. You need to ensure that an employee can be assigned to only an existing department.What should you apply to the Employee table?
A primary key
An index
A foreign key
A data type
To remove duplicate rows from the results of an SQL SELECT statement, the ............ Qualifier specified must be included.
ONLY
UNIQUE
SINGLE
DISTINCT
Which statement creates a composite key?
CREATE TABLE Order (OrderID INTEGER PRIMARY KEY, OrderltemID , INTEGER PRIMARY KEY)
CREATE TABLE Order (OrderID INTEGER, OrderltemID INTEGER, PRIMARY KEY)
CREATE TABLE Order (OrderID INTEGER, OrderltemID INTEGER,PRIMARY KEY OrderID, PRIMARY KEY OrderltemID)
CREATE TABLE Order (OrderID INTEGER, OrderltemID INTEGER, PRIMARY KEY(OrderID,OrderItemID))
You create a table that stores product names. You need to record the product names in different language. Which data type should you use?
CHAR
NCHAR
TEXT
VARCHAR
You execute a statement inside a transaction to delete 100 rows from a table,the transaction fails after only 40 rows are deleted. What is the result in the database?
The table will be corrupted.
The transaction will restart
No rows will be deleted from the table
Forty (40) rows will be deleted from the table
You need to enable a new employee to authenticate to your database. Which command should you use?
ADD USER
ALLOW USER
INSERT USER
CREATE USER
Which statement deletes the rows where the employee’s phone number is not entered?
DELETE FROM Employee WHERE phone is NULL
DELETE FROM Employee WHERE phone = “%’
DELETE FROM Employee WHERE phone IS NOT NULL
DELETE FROM Employee WHERE phone = NULLABLE
view can be used to:
Ensure referential integrity.
Save an extra copy of data stored in a separate table.
Limit access to specific rows or columns of data in a table.
Save historical data before deleting it from the base table.
.......are used to set the rules for all records in the table.
ROLS
WHERE
GROUP BY
Constraints
...... Is used to ensure whether the value in columns fulfills the specified condition.
CHECK
UNIQUE
FOREIGN KEY
PRIMARY KEY
..... Is used to return all changes made by the transaction are reverted back and database remains as before.
COMMIT
ROLLBACK
SAVEPOINT
RETRY
Which command should you use to give a user permission to read the data in a table?
ALLOW
SELECT
GRANT SELECT
PERMIT READ
You need to disable User5’s access to view the data in the Customer table. Which statement should you use?
REMOVE User5 FROM Customer
REVOKE User5 FROM Customer
REMOVE SELECT ON Customer FROM User5
REVOKE SELECT ON Customer FROM User5
You need to list the name and price of each product, sorted by price from lowest to highest. Which statement should you use?
SELECT Name, TOP Price FROM Product
SELECT Name, BOTTOM Price FROM Product
SELECT Name, Price FROM Product ORDER BY Price ASC
SELECT Name, Price FROM Product ORDER BY Price DESC
Ifa table is in 1NF and does not have a composite key, then it is in 2NF.
True
False
A subquery uses the same syntax as a regular query.
True
False
All data triggers only activate after a value in a row is changed.
True
False
All queries can be designed to avoid subqueries.
True
False
It is possible to use a WHERE if the query contains a GROUP BY.
True
False
The employee-manager association is an example of a reflexive, self-join,relationship.
True
False
Many to Many associations create problems and should be avoided in database designs.
True
False
Using an IN operator is an alternative to using a group of OR clauses in a WHERE statement.
True
False
It is a good idea to wait until data is entered into the database before normalizing the tables.
True
False
A primary key can point to more than one table.
True
False
The outer join describes what should happen when values in one table do not exist in the second table.
True
False
The UNION command combines rows of data from two tables, the command will not automatically eliminate duplicate rows of data.
True
False
A relation that has a composite primary key cannot be in 2NF.
True
False
A Column alias is a way to control the naming of columns in query results.
True
False
A transaction always involves at least two operations on the database.
True
False
DML is a set of commands that are used to define data.
True
False
A relation is in 3NF if and only if it is in INF and some keys are dependent on the primary key.
True
False
A limitation of the UPDATE operation is that it can only change one column at the same time.
True
False
Unlike tables created using the INSERT INTO Statement, the output ghisine? by VIEWS, will always be up-to-date in response to changes in the underlying data.
True
False
Views can be used exactly like tables in any retrieval query.
True
False
To list each employee’s first and last name and salary, we can use ..
A
B
C
D
{"name":"DB", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Test your knowledge of database fundamentals with our comprehensive quiz designed for learners and professionals alike. Dive into the world of SQL, normalization, and database integrity.Key Features:30 thoughtfully crafted questionsMultiple choice format for interactive learningImmediate feedback on your answers","img":"https:/images/course1.png"}
Powered by: Quiz Maker