What is the oldest data model?

What is the oldest data model?





[A]
Network Data Model
[B]
Flat File Data Model
[C]
Relational Data Model
[D]
Hierachical Data Model




Answer: A

Look at the following data for table R:

Look at the following data for table R:

A B C
1 1 2
1 1 2
1 1 3
Choose all correct answers


[A]
R is not a relation
[B]
R is a relation
[C]
R has no key



Answer: B

DBMS stands for what?

DBMS stands for what?



[A]
Database Managing Systems
[B]
Database Management System
[C]
Database Manage System
[D]
Database Manageable System




Answer: B

Given relations Movies(title, year, length, genre. studioName. producer#). MovieExec(name. address. cert#). and Studio(name. address. presC#). Suppose we have the materialized view that finds the name -

Given relations Movies(title, year, length, genre. studioName. producer#). MovieExec(name. address. cert#). and Studio(name. address. presC#). Suppose we have the materialized view that finds the name -

ofthe producer of a given movie as follows:
CREATE MATERIALIZED VIEW MovieProd AS
SELECT title, year, name
FROM Movies. MovieExec
WHERE producer# - cert#
Which of the following modification will affect the MovieProd materialized view?

[A]
Insert a new tuple into Studio
[B]
Delete a tuple from Studio
[C]
Insert a new tuple into Movies or delete a tuple from Movies
[D]
None of the others




Answer: C

Select the right statement

Select the right statement



[A]
All of the others
[B]
Every constraint has a name. If we don't define constraint's name explicitly, then DBMS automatically generates a name for it
[C]
We can create constraint on a tuple as a whole.
[D]
We can create constraint on a single attribute



Answer: A

Choose an incorrect statement

Choose an incorrect statement



[A]
None of the others
[B]
Database is created and maintained by a DMBS
IC]
Database is a collection of information that exists over a long opened of time
[D]
Database is a collection of data that is managed by a DBMS




Answer: A

Four characteristics of transactions are

Four characteristics of transactions are



[A]
None of the others
[B]
Read uncommitted, Read committed, Repeatable read, Serializable
[C]
Atomicity. Isolation. Concurrency. Durability
[D]
Atomicity. Isolation. Consistency. Durability




Answer: D

Choose the right statement

Choose the right statement




[A]
The action associated with the trigger executes no matter what the condition is hold or not
[B]
Triggering events do not support INSERT and DELETE.
[C]
All of the others.
[D]
When the trigger is awakened, it tests a condition. If the condition is satisfied, the action associated with the trigger is executed.





Answer: D

Choose right answer(s).

Choose right answer(s).



[A]
NULL value is unknown, inapplicable, or withheld
[B]
Comparisons with NULL values will return UNKNOWN
[C]
Arithmetic operators on NULL values will return a NULL value
[D]
All of other




Answer: D

In DTD. the main difference between PCDATA and CDATA is

In DTD. the main difference between PCDATA and CDATA is




[A]
PCDATA is text that will be parsed by a parser and tags inside the text will be treated as markup and entities will be expanded CDATA is text that will NOT be parsed by a parser and tags inside the text wil
NOT be treated as markup and entities will not be expanded.
[B]
All of the others.
[C]
CDATA is used to assert something about the allowable content of elements where as PCDATA is used as a common type for attribute
[D]
There's no difference between PCDATA and CDATA.



Answer: A

Choose a wrong answer.

Choose a wrong answer.



[A]
Relational algebra can express recursion.
[B]
Basic relational algebra can be expressed in Datalog rule(s).
IC]
Single Datalog rule can be expressed in relational algebra.
[D]
Datalog does not support bag operations.




Answer: A

Given the relation Employee(SSN. FNAME. LNAME. SALARY. DepartmentNo). Select the right query below to count the number of employees in each department

Given the relation Employee(SSN. FNAME. LNAME. SALARY. DepartmentNo). Select the right query below to count the number of employees in each department



[A]
SELECT COUNTf) FROM Employee
[B]
SELECT DepartmentNo. COUNT(*) FROM Employee GROUP BY DepartmentNo
[C]
SELECT DepartmentNo. COUNT(*) FROM Employee
[D]
None of the others




Answer: B

Given the relation Movies(title, year, length, genre. studioName). Select the right query to create a View with the titles and studio names of all movies that were produced in 1980

Given the relation Movies(title, year, length, genre. studioName). Select the right query to create a View with the titles and studio names of all movies that were produced in 1980




[A]
CREATE VIEW OldMovies SELECT title. studioName FROM Movies WHERE year-1980
[B]
CREATE VIEW OldMovies SELECT title, year FROM Movies WHERE year=1980
[C]
CREATE VIEW OldMovies AS SELECT title. studioName FROM Movies WHERE year=1980
[D]
None of the others



Answer: C

Choose the right statement

Choose the right statement



[A]
Sub-queries return a single constant this constant can be compared with another value in a WHERE clause;
[B]
Sub-queries return relations, that can be used in WHERE clause
[C]
Sub-queries can appear in FROM clauses, followed by a tuple variable
[D]
All of the others





Answer: D

Which of the following statements is true?

Which of the following statements is true?



[A]
I3NF implies BCNF
[B]
Multi-valued Dependency (MVD) implies Fourth Normal form (4NF)
[C]
4NF implies BCNF and BCNF implies 3NF
[D]
None of the others




Answer: C

Select the right statement to declare MovieStar to be a relation whose tuples are of type StarType. Note; StarType is a user-defined type that has its definition as follows;

Select the right statement to declare MovieStar to be a relation whose tuples are of type StarType. Note; StarType is a user-defined type that has its definition as follows;

CREATE TYPE StarType AS (
nameCHAR(30).
address CHAR(IOO) };


[A]
CREATE TABLE MovieStar (name StarType).
PI
CREATE TABLE MovieStar (name StarType PRIMARY KEY);
[C]
CREATE TABLE MovieStar OF StarType Q;
[D]
None of the others


Answer: C

Select the right answer

Select the right answer




[A]
Virtual views do not exist physically
[B]
Virtual views are defined by an expression like a query
[C]
Virtual views can be queried and can even be modified
[D]
All of other



Answer: D

Choose a right answer

Choose a right answer



[A]
The object-relational model is the extension of the relation model with new features such as structured types, methods, identifiers for tuples, and references
[B]
Object-relation model allows a non-atomic type that can be a relation schema which is called nested relation
[C]
In object-relational model, the type of an attribute can be a reference to a tuple with a given schema or a set of references to tuples with a given schema
[D]
All of the others



Answer: D

Given relation U(A, B, C) that has 2 tuples (1,2,3) and (4,5,6), and relation V(B(C, D) that has 2 tuples (2,3,10) and (2,3,11). Choose the right answer below;

Given relation U(A, B, C) that has 2 tuples (1,2,3) and (4,5,6), and relation V(B(C, D) that has 2 tuples (2,3,10) and (2,3,11). Choose the right answer below;




[A]
None of the others.
[B]
The outer join of U and V is the relation R(A, B, C, D) that has 2 tuples (1.2, 3.10) and (1,2, 3,11).
[C]
The outer join of U and V is the relation R(A. B. C. D) that has 3 tuples (1.2.3.10) .(1.2.3.11) and (4.5.6. NULL).
[D]
The outer join of U and V is the relation R(A. B. C. D) that has only 1 tuple (NULL. 4.5.6).





Answer: C

Select the right answer.

Select the right answer.




[A]
All of the others
[B]
Tags in XML are text surrounded by triangular brackets (for example, <_>).
[C]
An XML tag can be a single tag with no matching closing tag (for example. <foo />
[D]
Tags in XML comes in matching pairs, with an opening tag like <foo> and a matched closing tag like</foo>



Answer: A

Select the right syntax for HAVING clause in SOL

Select the right syntax for HAVING clause in SOL



[A]
SELECT <list of attributes>
FROM <list of tables>
WHERE <conditions on tuples>
HAVING <conditions on groups>
GROUP BY <list of attributes>
[B]
SELECT <list of attributes>
FROM <list of tables>
WHERE <conditions on tuples>
GROUP BY <list of attributes>
HAVING <conditions on groups>
[C]
SELECT < list of attributes>
FROM < list of tables>
HAVING <conditions on groups>
WHERE <conditions on tuples>
GROUP BY <list of attributes>
[D]
All of the others




Answer: B


Choose the right statement

Choose the right statement



[A]
XML Schema allows us to declare simple types, such as integer or float and even complex types
[B]
All of the others
[C]
XML schema provides us the ability to declare keys and foreign keys.
[D]
XML Schema is an alternative way to provide a schema for XML documents.



Answer: B

Select the valid query to declare the foreign key presC# of the relation Studiolname. address. presC#) that references the cert of the relation MovieExeclname. address. cert#. netWorth):

Select the valid query to declare the foreign key presC# of the relation Studiolname. address. presC#) that references the cert of the relation MovieExeclname. address. cert#. netWorth):



[A]
All of the others.
[B]
CREATE TABLE Studio (name CHAR(30) PRIMARY KEY. address VARCHAR(256). presC# INT FOREIGN KEY):
[C]
CREATE TABLE Studio (name CHAR(30) PRIMARY KEY. address VARCHAR(256). presC# INT UNIQUE KEY REFERENCES MovieExec):
[D]
CREATE TABLE Studio (name CHAR(30) PRIMARY KEY. address VARCHAR(256). presC# INT REFERENCES Movie Exec (cert#));





Answer: D

Choose a right answer

Choose a right answer



[A]
When a privilege is granted, it cannot be revoked
[B]
Privileges cannot be granted on a view
[C]
An authorization ID may be granted privileges from others or may grve its privileges to others
[D]
All of the others



Answer: C

In the three-tier architecture, the database tier's function is to

In the three-tier architecture, the database tier's function is to



[A]
All of the others.
[B]
Execute the business logic of the organization operating the database.
[C]
Manage the interactions with the user.
[D]
Execute queries that are requested from the application tier.




Answer: D

Which of the followings is true?

Which of the followings is true?




[A]
The Entity Relationship (ER) model represents the structure of data graphically
[B]
The ER model is a low level database design
IC]
The ER model represents the operation on data
[D]
All of the others



Answer: A

Select the well-formed XML

Select the well-formed XML




[A]
All of the others
[B]
<? xml version = "1.0" ?>
<MovieData>
<Movie tiHe="StarWar*><Year>1997</Yearx/MovJe>
</MovieData>
[C]
<? xml version - "1 0' ?>
<MovieData>
<Movie Me-'StarWaf*><Year>1997</Year></Movie>
</Movies>
[D]
<? xml version = 1 0 7>
<MovieData>
<Movie trtle-"StarWar"><Year>1997</Movie></Year>
</MovieData>



Answer: B

Given the relation Employee(SSN. FNAME. LNAME. SALARY). Select the right query below to find the employee(s) who has the lowest salary in the company

Given the relation Employee(SSN. FNAME. LNAME. SALARY). Select the right query below to find the employee(s) who has the lowest salary in the company



[A]
SELECT LNAME. FNAME. SALARY FROM Employee WHERE SALARY IN (SELECT MIN(SALARY) FROM Employee)
[B]
SELECT LNAME. FNAME. SALARY FROM Employee WHERE SALARY >= ALL (SELECT SALARY FROM Employee)
[C]
SELECT LNAME. FNAME. SALARY FROM Employee WHERE SALARY < MAX (SELECT SALARY FROM Employee)
[D]
None of the others


Answer: A

Choose a right answer.

Choose a right answer.



[A]
A SOL environment is the framework under which data may exist and SQL operations on data may be executed
[B]
All of the others
[C]
Within a SQL environment are two special kinds of processes: SQL clients and SQL servers.
[D]
A SQL environment is a DBMS running at some installation.




Answer: B

The IN SQL keyword

The IN SQL keyword 




a. Is used with the DISTINCT SQL keyword only
b. Is used with the INSERT SQL keyword only
c. Determines if a value
any of the values in a list or a sub-query
d. Defines the tables we are selecting or deleting data from




Answer: C

Look at the following tables and then choose the correct statement:

Look at the following tables and then choose the correct statement:


ARTISTS
Airtist_id Airtist_Name
-----------------------------------
1 Bono
2 Cher

ALBUM
artist_id Album_name
------------------------------------
3 Eat the rich


a. The above picture is an example of a database that has not enforced referential integrity
b. The above picture is an example of a database that has not enforced entity integrity
c. The above picture is an example of a database that has not enforced domain integrity
d. All of the others


Answer: B

Choose the in-correct statement:

Choose the in-correct statement: 




a. In SQL Server, every DML operation is a transaction regardless of whether it has a BEGIN TRANSACTION or not
b. COMMITTING a transaction makes permanent the changes resulting from all SQL statements in the transaction
c. ROLLING back a transaction rejects any of the changes resulting from the SQL statements in the transaction
d. When the sequence of tasks is complete, the SAVE POINT closes the transaction




Answer: D

(TRUE AND NULL) returns: ???

(TRUE AND NULL) returns: ???



a. NULL
b. TRUE
c. FALSE
d. None of the others




Answer: A

Relation R(x,y) currently consists of only one tuple (NULL, NULL). Which of the following queries will produce a nonempty output? That is, at least one tuple will be produced, although the tuple(s) may have NULL's.

Relation R(x,y) currently consists of only one tuple (NULL, NULL). Which of the following queries will produce a nonempty output? That is, at least one tuple will be produced, although the tuple(s) may have NULL's. 




a. SELECT * FROM R WHERE x IS NULL
b. SELECT * FROM R WHERE x = NULL
c. SELECT * FROM R WHERE x = y
d. SELECT * FROM R WHERE x <> 10



Answer: A

What is a "join"?

What is a "join"? 



a. 'join' used to connect two or more tables logically with or without common field(s) a
b. 'join' used to connect two or more tables logically with common field(s)
c. 'join' used to connect two or more tables logically without common field(s)
d. 'join' used to connect two or more tables logically with aliases



Answer: A

What does the following SQL statement do: SELECT Customer, COUNT(Order) FROM Sales GROUP BY Customer HAVING COUNT(Order) > 5

What does the following SQL statement do:
SELECT Customer, COUNT(Order)
FROM Sales
GROUP BY Customer
HAVING COUNT(Order) > 5 




A.Selects the total number of orders from the Sales table, if this number is greater than 5
B.Selects all Customers from the Sales table
C.Selects all customers from table Sales that have made more than 5 orders.
D.None of the other three



Answer: C

Suppose relation R(a,b,c) has the following tuples:

Suppose relation R(a,b,c) has the following tuples: 


A B C
-----------------------------------
1 1 3
1 2 3
2 1 4
2 3 5
2 4 1
3 2 4
3 3 6


Which tuple is contained in the result of the following query:

SELECT a, COUNT(DISTINCT B) FROM R
GROUP BY a
HAVING SUM(B) >3;


A.(2,10)
B.(3,7)
C.(2,3)
D.(3,12)



Answer: C

What is the difference between Where and Having Clause?

What is the difference between Where and Having Clause? 




A.WHERE is for Rows and HAVING is for Groups
B.WHERE is for Groups and HAVING is for Rows
C.WHERE and HAVING are the same
D.We can use aggregation functions in WHERE clause




Answer: A

Choose the correct statement

Choose the correct statement 




A.Except for COUNT, aggregate functions ignore null values
B.Except for SUM, aggregate functions ignore null values
C.Except for AVG, aggregate functions ignore null values
D.Except for MIN, aggregate functions ignore null values
E.Except for MAX, aggregate functions ignore null values


Answer: A

A weak entity

A weak entity 



A.does not depend on other entities
B.does not have enough key attribute(s)
C.is an entity that has not any key-attribute
D.None of the others



Answer: B

When drawing an ERD: (a)Entity sets and their attributes should reflect reality (b)Redundancy is not important, so we can ignore it (c) Avoid introducing more elements into the design than is absolutely necessary (d) Choosing the right relationships

When drawing an ERD:
(a)Entity sets and their attributes should reflect reality
(b)Redundancy is not important, so we can ignore it
(c) Avoid introducing more elements into the design than is absolutely necessary
(d) Choosing the right relationships 




A.(a) and (b) and (c) are correct
B.(a) and (c) and (d) are correct
C.(a) and (b) and (d) are correct
D.(b) and (c) and (d) are correct


Answer: B

Consider the following statement: "When drawing ERD, if an entity has no non-key attribute and it is the 'one' in many-one relationship, then we should set it to the attribute of other entities" That above statement describes which principle?

Consider the following statement:
"When drawing ERD, if an entity has no non-key attribute and it is the 'one' in many-one relationship, then we should set it to the attribute of other entities"
That above statement describes which principle? 




A.Avoid Redundancy Principle
B.Picking the right kind of element principle
C.Limit the use of weak entity sets principle
D.Faithfulness principle


Answer: B

When an entity is called "weak"? (a) When it is used to represent weak objects, such as patients, elders (b) When all of its attributes can not identify itself (c) When It always needs support from other entity (d) When It is not really necessary in the ERD

When an entity is called "weak"?
(a) When it is used to represent weak objects, such as patients, elders
(b) When all of its attributes can not identify itself
(c) When It always needs support from other entity
(d) When It is not really necessary in the ERD 





a.(a) and (b) are correct
b.(b) and (c) are correct
c.(c) and (d) are correct
d.(d) and (a) are correct



Answer: B

Why we should use stored procedures?

Why we should use stored procedures? 



a. They allow faster execution
b. They can reduce network traffic
c. They allow modular programming
d. They can be used as a security mechanism
e. All of the others




Answer: E

What is a view?

What is a view? 



a. A view is a database diagram
b. A view is a special stored procedure executed when certain event occurs
c. A view is a virtual table which results of executing a pre-compiled query. A view is not a part of the physical database schema, while the regular tables are.
d. None of the others




Answer: C

Which of the following statements is the most correct?

Which of the following statements is the most correct? 




a. Poorly designed indexes and a lack of indexes are primary sources of database application bottlenecks.
b. Designing efficient indexes is paramount to achieve good database and application performance
c. The selection of the right indexes for a database and its workload is a complex balancing act between query speed and update cost
d. All of the others


Answer: D

Database integrity ensures that:

Database integrity ensures that: 




a. data entered into the database is accurate, valid, and consistent
b. data entered into the database is accurate, and consistent
c. data entered into the database is valid, and consistent
d. data entered into the database is accurate, and valid



Answer: A

The SQL BETWEEN operator:

The SQL BETWEEN operator: 



a. Specifies a range to test.
b. Specifies which tables we are selecting from.
c. Specifies that a column is a primary key.
d. None of the others



Answer: A

What does the keyword ESCAPE mean?

What does the keyword ESCAPE mean? 



a. The keyword ESCAPE is used to match any string that contains the characters "%" or "_"
b. There is no keyword named ESCAPE
c. The keyword ESCAPE is used to match any string that contains the characters "?" or "*"
d. The keyword ESCAPE is used to match any string that contains the characters "@" or "$"



Answer: A

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"?

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"? 




a. SELECT * FROM Persons WHERE FirstName='a'
b. SELECT * FROM Persons WHERE FirstName LIKE '%a'
c. SELECT * FROM Persons WHERE FirstName='%a%'
d. SELECT * FROM Persons WHERE FirstName LIKE 'a%'




Answer: D

Pay attention into the following query:

Pay attention into the following query:


SELECT * FROM R
WHERE A LIKE '%a%';

So, in the above case, the wildcard % represents what?


a. % (percent sign) represents zero, one, or more character
b. % (percent sign) represents exactly 1 character




Answer: A

What is "normalization"?

What is "normalization"? 




a. Normalizing data means eliminating redundant information from a table and organizing the data so that future changes to the table are easier
b. Normalizing data means minimizing columns from a table and organizing the data so that future changes to the table will be made more quickly
c. Normalizing data means removing columns from a table and organizing the data so that future changes to the table will be made more quickly
d. Normalizing data means adding more columns to a table and organizing the data so that future changes to the table will be made more quickly




Answer: A

Look at the following statements:

Look at the following statements:

(a)All relations in 3NF are also in 2NF
(b)All relations in 2NF are also in 1NF
(c)All relations in 1NF are also in BCNF
(d)All relations in 1NF are also in 3NF


a. (b) and (d) are true
b. (a) and (c) are true
c. (a) and (d) are true
d. (a) and (b) are true




Answer: D

Look at the following statements:

Look at the following statements:

(a) For any relation schema, there is a dependency-preserving decomposition into 3NF
(b) For any relation schema, there is not dependency-preserving decomposition into 3NF
(c) For any relation schema, there is dependency-preserving decomposition into BCNF
(d) For some relation schema, there is not dependency-preserving decomposition into BCNF




a. (a) and (d) are true
b. (a) and (b) are true
c. (a) and (c) are true
d. (b) and (d) are true



Answer: A

The relation R(ABCD) has following FDs:

The relation R(ABCD) has following FDs:

{ AB -> C ; ABD -> C ; ABC -> D ; AC -> D}

Choose a correct statement about R?


a. R is in 3NF
b. R is not in 3NF
c. R is in BCNF





Answer: B

Suppose we have a relation R(ABCD) with FD's:

Suppose we have a relation R(ABCD) with FD's: 

BC -> A ;
AD -> C ;
CD -> B ;
BD -> C



a. R is in BCNF
b. R is not in BCNF
c. All of the others
d. None of the others


Answer: B

Given the relation R(ABCDE) with the following FD's:

Given the relation R(ABCDE) with the following FD's: 

D -> C,
CE ->A,
D ->A, and
AE ->D
Which of the following attribute set is a key?



a. ABCDE
b. CDE
c. ABE
d. BD



Answer: C

Let R(ABCDEFGH) satisfies the following functional dependencies:

Let R(ABCDEFGH) satisfies the following functional dependencies: 

A -> B,
CH -> A,
B -> E,
BD -> C,
EG -> H,
DE -> F.
Which of the following FDs is also guaranteed to be satisfied by R?


a. CGH -> BF
b. ACG -> DH
c. ADG -> CH
d. BCD -> FH




Answer: C