30 Questions
Which attribute is commonly used as a primary key in a database relation?
Id
Why can 'Street' not be considered as a primary key?
It can occur more than once
What is the role of a foreign key in a relation?
To reference the primary key of another relation
Which term is used for the relation that contains the primary key from another relation as a normal attribute?
Referenced relation
What makes an attribute suitable to be a primary key?
Uniqueness across all tuples
Why are attributes like 'Name' and 'Street' not ideal choices for primary keys?
'Name' and 'Street' are common attributes shared by many tuples.
In the given SQL query, what is the missing keyword that needs to be inserted to correctly insert values into the table?
Values
Which of the following SQL queries does not specify the relation from which the values are selected?
Select empid where empid = 1009 and lastname = ‘GELLER’;
Which keyword is essential in an SQL query to specify the table into which values need to be inserted?
Into
If you want to select only the 'empid' from the 'emp' table where 'lastname' is 'GELLER', which SQL query should you use?
Select empid where empid = 1009 and lastname = ‘GELLER’;
What clause is missing in the following SQL query that causes it to be incorrect: 'Select * from empid = 10003;'?
From
Which keyword is necessary in an SQL query to indicate the condition for selecting specific records?
Where
To prevent cascading of authorizations from the user, which statement should be used?
Revoke select on department from Amit, Satoshi restrict
How can confusion arising from the revoking of user roles be overcome?
The privilege must be granted only by roles
Which keyword can be used to indicate that revocation should cascade?
Cascade
What should be done before executing 'set role name' to associate a current role with a session?
Grant the specified role to the user
In the context of database authorizations, what does 'revoking with restrict' prevent?
Cascading effect of revocations
What is the purpose of granting and revoking roles by the user in a database management system?
To manage user permissions and access control
What does the tuple relational calculus describe?
Nonprocedural query language
In tuple relational calculus, what does the symbol ∧ represent?
Logical AND
Which query finds the names of all instructors whose department is in the Watson building?
Finds the names of all instructors whose department is in the Watson building
Which symbol is used in place of 'except' in relational calculus?
¬
What does the symbol ∀ represent in SQL?
'For all' operator
Given the sentence 'Find all students who have taken all courses offered in the Biology department', which expression matches this query?
∀ t ε r (Q(t))
What privilege is granted in the statement 'Grant update(budget) on department to Raj'?
Update on department's budget
How can privileges be removed from a user in a database management system?
Revoke update on employee from Amir
Which role creation and authorization statement is correct to provide delete authorization to an instructor?
CREATE ROLE instructor; GRANT DELETE ON takes TO instructor;
In a database management system, which statement is used to provide privilege to only a particular attribute?
Grant update(budget) on department to Raj
What is the key aspect in creating views in a database management system?
Providing access to specific attributes only
Which statement accurately reflects the process of removing privileges from a user?
Revoke update on employee from Amir
Test your knowledge on primary keys in databases with this quiz. Learn about the concepts of keys, attributes, and fields. Identify which attribute can be considered as a primary key and which cannot.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free