NEW
Font size
WorksheetsJSKBS - Database Management System
Total questions: 15
Worksheet time: 15mins
With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” ends with an “a”?
SELECT * FROM Persons WHERE FirstName=’a’
SELECT * FROM Persons WHERE FirstName LIKE ‘a%’
SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
SELECT * FROM Persons WHERE FirstName=’%a%’
How can you change “Hansen” into “Nilsen” in the “LastName” column in the Persons table?
UPDATE Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’
MODIFY Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
MODIFY Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’
UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70.
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ OR temperature > 70
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ AND temperature > 70
Referential Integrity is
System of rules
System of data
Table constraints
is related to Primary key
______________ constraint prevents NULL values
UNIQUE
NOT NULL
NULL
FOREIGN KEY
Every Boyee-Codd normal form is in
1NF
2Nf
3NF
all the above
If every non-key attribute is functionally dependent on the primary key, then the relation will be in :
1NF
2NF
3NF
4NF
What is a relationship?
Which of the following is false about the entity relationship diagram?
Entities are represented by rectangles.
All simple attributes are represented with single-lined ovals.
Multi-valued attributes are represented with double-lined ovals.
A derived attribute is connected to the entity by broken lines.
Find the ID, name, dept name, salary for instructors whose salary is greater than $80,000 .
{t | t ε instructor ∧ t[salary] > 80000}
Э t ∈ r (Q(t))
{t | Э s ε instructor (t[ID] = s[ID]∧ s[salary] > 80000)}
None of the mentioned
The attribute name could be structured as an attribute consisting of first name, middle initial, and last name. This type of attribute is called _______________
Simple attribute
Composite attribute
Multivalued attribute
Derived attribute
A query in the tuple relational calculus is expressed as:
{t | P() | t}
{P(t) | t }
{t | P(t)}
All of the mentioned
