Sei sulla pagina 1di 29

SQL

Part 1 of 1 -

90.0/ 100.0 Points

5.0/ 5.0 Points


Question 1 of 20
Which of the following appropriately describes a domain (defined area), a term
used for relational databases?
A. It is a set of values that attributes can hold.
B. It is the general term for data insertion, updating, deletion, and search in a
database.
C. It is a relationship derived by applying the relational operations to the
basic relationship.
D. It is a specification for copying the real world to a database.
Question 2 of 20
In an E-R diagram attributes are represented by:

0.0/ 5.0 Points

A. Rectangle.
B. Triangle.
C. Square.
D. Ellipse.

Question 3 of 20
The conceptual model is:
A. Dependent on hardware.
B. Dependent on both hardware and software.
C. Dependent on software.
D. Independent of both hardware and software.

5.0/ 5.0 Points

Question 4 of 20

5.0/ 5.0 Points

When the data model is represented to conform to the notational convention


shown below, which of the following statements appropriately interprets the
designated E-R diagram?

A. A single product is supplied by a single supplier.


B. Order statements and delivery statements have a one-to-one
correspondence.
C. It doe not occur that a single order placement is given for multiple types
of products.
D. It does not occur that a single order placement is given to multiple
suppliers.
Question 5 of 20

5.0/ 5.0 Points

The following data model has been created as a part of a library reservation
system. Which is the correct description for it? In this question, 1 * means one-tomany cardinality and the underlined attributes in the table definition are primary
keys

User(User_ID, User_Name, Address) Reservation(User_ID, Book_Title_ID,


Reservation_Date) Book_Title(Book_Title_ID, Category_Code, Book_Title,
Author) Stocked_Book(Stocked_Book_ID, Book_Title_ID, Purchase_Date,
Cumulative_Lending_Count)
A. The cardinality between the Book_Title entity and Stocked_Book entity
is opposite
B. The Book_Title entity is an abstract entity that has no physical substance

C. It is redundant to separate the Book_Title entity and Stocked_Booked


entity
D. The Stocked_Book to be lent can be decided at the time of reservation
Question 6 of 20
The values of the attribute describes a particular_____________

5.0/ 5.0 Points

A. File
B. Organization
C. Entity set
D. Entity instance
5.0/ 5.0 Points
Question 7 of 20
You are building a new database for a company with 10 departments. Each
department contains multiple employees. In addition, each employee might work
for several departments. How should you logically model the relationship between
the department entity and the employee entity?

A. Create a new entry, create a one-to-many relationship from the new entry
to the employee entry, and then create a one-to-many relationship from the entry
to the department entry.
B. Create a mandatory one-to-many relationship between department and
employee.
C. Create a new entry, create a one-to-many relationship from the employee
to the new entry, and create a one-to-many relationship from the department
entry to the new entry.
D. Create an optional one-to-many relationship between department and
employee.
Question 8 of 20
Conceptual design
A. Involves modelling independent of the DBMS.

5.0/ 5.0 Points

B. Needs data volume and processing frequencies to determine the size of


the database.
C. Is designing the relational model.
D. Is a documentation technique.
Question 9 of 20
In an E-R diagram an entity set is represent by a:

5.0/ 5.0 Points

A. Rectangle.
B. Ellipse.
C. Circle.
D. Diamond box.
Question 10 of 20
In E-R diagram generalization is represented by

5.0/ 5.0 Points

A. Dashed ellipse
B. Ellipse
C. Rectangle
D. Triangle
Question 11 of 20
In case of entity integrity, the primary key may be:

5.0/ 5.0 Points

A. Not Null
B. Both Null & not Null.
C. Null
Question 12 of 20
The following are functions of a DBMS except _______ .
A. creating databases
B. administrating databases

5.0/ 5.0 Points

C. creating and processing forms


D. processing data
Question 13 of 20
Which of the following is an accurate
statement in regard to an E-R diagram?

5.0/ 5.0 Points

A. It expresses the entire process from data creating to destruction.


B. It creates an abstraction of information handled in operations, so as to
express entities and the relations between them.
C. It clarifies the operational relations between individual processes and
data. As a result, the relations between introduced entities express the individual
operational processes.
D. It is created as a pretext to implementing a relational database
5.0/ 5.0 Points
Question 14 of 20
The DBMS acts as an interface between what two components of an enterpriseclass database system?
A. The user and the database application
B. Data and the database
C. Database application and the database
D. Database application and SQL
Question 15 of 20
E-R model uses this symbol to represent weak entity set?

5.0/ 5.0 Points

A. Dotted rectangle.
B. Diamond.
C. Doubly outlined rectangle.
D. None of these.
0.0/ 5.0 Points
Question 16 of 20
Which of the following is not a restriction for a table to be a relation?

A. The columns must be ordered.


B. All of the entries in any column must be of the same kind.
C. No two rows in a table may be identical.
D. The cells of the table must contain a single value.
5.0/ 5.0 Points
Question 17 of 20
What is a relationship called when it is maintained between two entities?
A. Binary
B. Unary
C. Ternary
D. Quaternary
Question 18 of 20
A table can have only one

5.0/ 5.0 Points

A. Unique key
B. Secondary key
C. Alternate key
D. Primary key
Question 19 of 20
It is better to use files than a DBMS when there are:

5.0/ 5.0 Points

A. Stringent real-time requirements.


B. Multiple users wish to access the data.
C. Complex relationships among data.
D. All of the above.
Question 20 of 20
A DBMS query language is designed to:
A. Support end users who use English-like commands.

5.0/ 5.0 Points

B. Support in the development of complex applications software.


C. Specify the structure of a database.
D. All of the above.
Question 1 of 20
Which of the following are the properties of entities?

5.0/ 5.0 Points

A. Switchboards
B. Groups
C. Table
D. Attributes
Question 3 of 20

5.0/ 5.0 Points

In the ERD diagram, the one-to-many relationship, "a company has multiple
employees," is expressed as follows:

Which of the following statements correctly explains the above diagram?


A. There are multiple companies, and each company has
multiple shareholders.
B. One company has multiple shareholders.
C. There are multiple companies, and each company has a
shareholder.
D. One company has one shareholder.
Question 5 of 20

5.0/ 5.0
Points

Which of the following is an accurate statement in regard to an E-R diagram?


A. It expresses the entire process from data creating to destruction.
B. It creates an abstraction of information handled in operations, so
as to express entities and the relations between them.
C. It clarifies the operational relations between individual processes
and data. As a result, the relations between introduced entities express
the individual operational processes.
D. It is created as a pretext to implementing a relational database
Question 6 of 20
NULL is:

0.0/ 5.0
Points

A. The same as 0 for integer


B. The same as blank for character
C. The same as 0 for integer and blank for character
D. Not a value
Question 7 of 20

5.0/ 5.0 Points

The entity-relationship diagrams A and B shows the relationships between three


entities in a school: teacher, class, and classroom. Which of the following is an
appropriate interpretation concerning the diagrams? Here, " 1 1 " shows a one-toone relationship while " 1 * " shows a one-to-many relationship.

A.

In A, one class is always assigned to the same classroom. In B, one


class may be assigned to one or more classrooms.
B.
In A, when a teacher or a classroom is decided, a single class will
be
decided. In B, if a teacher and a classroom are decided, a single
class
will be decided.
C.
In A, one class is always supervised by one teacher. In B, one class
may
be supervised by one or more teachers.
D.
In A, a teacher is responsible for one class only. In B, a teacher may
be responsible for one or more classes.
Question 8 of 20
A relation is considered a:

5.0/ 5.0
Points

A. Column.
B. one-dimensional table.
C. two-dimensional table.
D. three-dimensional table.
5.0/ 5.0 Points
Question 9 of 20
The file organization that provides very fast access to any arbitrary record of a file
is:
A. Hashed file.
B. B-tree.
C. Unordered file.
D. Ordered file.

Question 10 of 20
Which of the following is another name for weak entity?

0.0/ 5.0 Points

A. Child
B. Owner
C. Dominant
D. All of the above
5.0/ 5.0 Points
Question 11 of 20
The database environment has all of the following components except:
A. Users.
B. Database administrator.
C. Separate files.
D. Database.
Question 13 of 20
In the relational modes, cardinality is termed as:

5.0/ 5.0 Points

A. Number of constraints.
B. Number of attributes.
C. Number of tables.
D. Number of tuples
Question 15 of 20
What is data integrity?
A. It is the data contained in database that is shared.
B. It is the data contained in database that is accurate and
consistent.
C. It is the data contained in database that is secured.
D. It is the data contained in database that is non redundant.

5.0/ 5.0 Points

5.0/ 5.0
Question 18 of 20
Points
Which of the following appropriately describes a schema in a relational database
management system?
A. It is a set of data definitions such as the data properties, format,
relationship with other data, etc.
B. It is the general term for various conditions and constraints that
are used to maintain the database in absolutely perfect condition.
C. It is the general term for database operations such as data
insertion, updating, deletion, search, etc.
D. It is not an actual table but a virtual table from the perspective of
the user.
Question 20 of 20

5.0/ 5.0
Points

If the condition given below applies, which of the following is appropriate as an ER diagram showing the departments employees belong to?

p n ng
Question 2 of 20
Which of the following are the properties of entities?

5.0/ 5.0 Points

A. Switchboards
B. Groups
C. Table
D. Attributes
Question 4 of 20

5.0/ 5.0 Points

If both the functional dependencies : XY and YX hold for two attributes X


and Y then the relationship between X and Y is
A. M:N
B. 1:1
C. M:1
D. 1:M
5.0/ 5.0 Points
Question 6 of 20
Which of the following statements correctly describes data normalization?
A. It increases the efficiency of database searches
B. It facilitates application program creation
C. It prevent data multiplicity, thereby making maintenance and
management easier
D. It reduces the amount of required memory space by
simplifying database structures.
5.0/ 5.0
Question 7 of 20
Points
Consider the join of a relation R with relation S. If R has m tuples and S has n
tuples, then the maximum size of join is:
A. 2(m+n)
B. mn
C. m+n
D. (m+n)/2
Question 17 of 20
In E-R Diagram relationship type is represented by:
A. Ellipse
B. Dashed ellipse
C. Diamond
D. Rectangle

0.0/ 5.0 Points

Question 18 of 20

0.0/ 5.0 Points

You are tasked with creating a database to manage where computers are installed
at a company that has offices in several buildings. You create an asset table, a
room table, and a building table, and link each of them together. When new
data is entered, the data in the referenced table must already exist. Which of the
following is the appropriate order of in-put? Here, the underlined items in each
table are either primary or foreign keys.

A. Asset table Building table Room table


B. Room table Asset table Building table
C. Building table Room table Asset table
D. Room table Building table Asset table
5.0/ 5.0 Points
Question 19 of 20
The method in which records are physically stored in a specified order according to
a key field in each record
A. Hash.
B. Direct.
C. Sequential.
D. All of the above.
Question 20 of 20
DBMS helps achieve:
A. Data independence.

5.0/ 5.0 Points

B. Centralized control of data.


C. Neither (A) nor (B).
D. Both (A) and (B).
Question 1 of 20
Count function in SQL returns the number of :

5.0/ 5.0 Points

A. Columns
B. Groups
C. Values
D. Distinct values
5.0/ 5.0 Points
Question 2 of 20
The statement in SQL which allows change the definition of a table is:
A. Create.
B. Select
C. Update.
D. Alter.
Question 3 of 20

5.0/ 5.0 Points

Which of the following SQL statements corresponds to the projection operation


of the relational algebra that can extract only the column Continent from the
table Country and eliminate duplicates from the records returned?

A. SELECT Continent FROM Country


B. SELECT *FROM Country
C. SELECT DISTINCT Continent FROM Country
D. SELECT *FROM Country GROUP BY Continent
5.0/ 5.0 Points
Question 4 of 20
Which of the following aggregate functions does not ignore nulls in its results?.
A. MAX
B. COUNT.
C. MIN
D. COUNT (*)
5.0/ 5.0 Points
Question 5 of 20
Your database contains a table named Purchases. The table includes a
DATETIME column named PurchaseTime that stores the date and time each
purchase is made. There is a non-clustered index on the PurchaseTime column.
The business team wants a report that displays the total number of purchases made
on the current day. You need to write a query that will return the correct results in
the most efficient manner. Which Transact-SQL query should you use?
A. SELECT COUNT(*)
FROM Purchases
WHERE PurchaseTime = CONVERT(DATE, GETDATE())
B. SELECT COUNT(*)
FROM Purchases
WHERE PurchaseTime >= CONVERT(DATE, GETDATE())
AND PurchaseTime < DATEADD(DAY, 1, CONVERT(DATE, GETDATE()))
C. SELECT COUNT(*)
FROM Purchases
WHERE PurchaseTime = GETDATE()

D. SELECT COUNT(*)
FROM Purchases
WHERE CONVERT(VARCHAR, PurchaseTime, 112) =
CONVERT(VARCHAR, GETDATE(), 112)

Question 6 of 20
Which of the following is a legal expression in SQL?

5.0/ 5.0 Points

A. SELECT NULL FROM EMPLOYEE;


B. SELECT NAME FROM EMPLOYEE;
C. None of the above
D. SELECT NAME FROM EMPLOYEE WHERE SALARY = NULL;
Question 7 of 20
Which of the following is a comparison operator in SQL?

5.0/ 5.0 Points

A. =
B. LIKE
C. BETWEEN
D. All of the above
0.0/ 5.0 Points
Question 8 of 20
You develop a Microsoft SQL Server 2012 database. The database is used by two
web applications that access a table named Products. You want to create an object
that will prevent the applications from accessing the table directly while still
providing access to the required data. You need to ensure that the following
requirements are met:
Future modifications to the table definition will not affect the applications' ability
to access data.
The new object can accommodate data retrieval and data modification.
You need to achieve this goal by using the minimum amount of changes to the
existing applications.
What should you create for each application?

A. Views
B. Table partitions
C. Table-valued functions
D. Stored procedures
Question 9 of 20
DML is provided for:

5.0/ 5.0 Points

A. Manipulation & processing of database.


B. Addition of new structures in the database system.
C. Description of logical structure of database.
D. Definition of physical structure of database system.
Question 10 of 20

5.0/ 5.0 Points

You are a database developer of a Microsoft SQL Server 2012 database. You are
designing a table that will store Customer data from different sources. The table
will include a column that contains the CustomerID from the source system and a
column that contains the SourceID. A sample of this data is as shown in the
following table.

You need to ensure that the table has no duplicate CustomerID within a SourceID.
You also need to ensure that the data in the table is in the order of SourceID and
then CustomerID. Which Transact- SQL statement should you use?
A.

CREATE TABLE Customer


(
SourceID int NOT NULL,
CustomerID int NOT NULL PRIMARY KEY CLUSTERED,
CustomerName varchar(255) NOT NULL
);
B.
CREATE TABLE Customer
(
SourceID int NOT NULL,
CustomerID int NOT NULL,
CustomerName varchar(255) NOT NULL,
CONSTRAINT PK_Customer PRIMARY KEY CLUSTERED
(SourceID, CustomerID)
);
C.
CREATE TABLE Customer
(
SourceID int NOT NULL IDENTITY,
CustomerID int NOT NULL IDENTITY,
CustomerName varchar(255) NOT NULL
);
D.
CREATE TABLE Customer
(
SourceID int NOT NULL PRIMARY KEY CLUSTERED,
CustomerID int NOT NULL UNIQUE,
CustomerName varchar(255) NOT NULL
);
Question 11 of 20

5.0/ 5.0 Points

You are a database developer of a Microsoft SQL Server database. The database
contains a table named Customers that has the following definition:

You need to ensure that the CustomerId column in the Orders table contains only
values that exist in the CustomerId column of the Customer table. Which
Transact-SQL statement should you use?
A.
ALTER TABLE Customer
ADD OrderId INT NOT NULL;
B.
ALTER TABLE Orders
ADD CONSTRAINT FX_Orders_CustomerID FOREIGN KEY (CustomerId)
REFERENCES Customer (CustomerId)
C.
ALTER TABLE Customer
ADD CONSTRAINT FK_Customer_OrderID FOREIGN KEY (CrderlD)
REFERENCES Orders (CrderlD);
ALTER TABLE Orders
ADD CONSTRAINT PK Orders CustomerId PRIMARY KEY (CustomerID)
D.
ALTER TABLE Orders
ADD CONSTRAINT CK_Crders_CustomerID
CHECK (CustomerId IN (SELECT CustomerId FROM Customer))

E.
ALTER TABLE Customer
ADD CONSTRAINT FK_Customer_CustomerID FOREIGN KEY
{CustomerID) REFERENCES Orders (CustomerId)
Question 12 of 20

0.0/ 5.0 Points

Which of the following SQL statements for the stated table Shipment_Record
produces the largest value as a result of its execution?

A. SELECT AVG(quantity) FROM shipment_record


B. SELECT SUM(quantity) FROM shipment_record WHERE
date=19991011
C. SELECT COUNT(*) FROM shipment_record
D. SELECT MAX(quantity) FROM shipment_record
Question 13 of 20
SQL can be used to:
A. create database structures only.
B. query database data only.
C. modify database data only.
D. All of the above can be done by SQL.

5.0/ 5.0 Points

Question 14 of 20

0.0/ 5.0 Points

Which SQL gain table B from table A?

A. SELECT department_code, employee_ID, name FROM A ORDER BY


department_code
B. SELECT department_code, employee_ID, name FROM A GROUP BY
employee_ID
C. SELECT department_code, employee_ID, name FROM A GROUP BY
department_code
D. SELECT department_code, employee_ID, name FROM A ORDER BY
employee_ID
Question 15 of 20
The database schema is written in:

0.0/ 5.0 Points

A. DCL
B. DDL
C. HLL
D. DML
5.0/ 5.0 Points
Question 16 of 20
The ______ operator is used to compare a value to a list of literals values that
have been specified.

A. BETWEEN
B. IN
C. ANY
D. ALL
5.0/ 5.0 Points
Question 17 of 20
You want to create a table to store Microsoft Word documents. You need to
ensure that the documents must only be accessible via Transact-SQL queries.
Which Transact-SQL statement should you use?
A. CREATE TABLE DocumentStore
(
[Id] INT NOT NULL PRIMARY KEY,
[Document] VARBINARY(MAX) NULL
)
GO
B. ) CREATE TABLE DocumentStore AS FileTable
C. CREATE TABLE DocumentStore
(
[Id] [uniqueidentifier] ROWGUIDCOL NOT NULL UNIQUE,
[Document] VARBINARY(MAX) FILESTREAM NULL
)
GO
D. CREATE TABLE DocumentStore
(
[Id] hierarchyid,
[Document] NVARCHAR NOT NULL
)
GO

Question 18 of 20

5.0/ 5.0 Points

Which of the following is an appropriate explanation concerning functions of


keywords in SQL?
A. INDEX is a special way to join two or more tables.
B. LIKE is used along with JOIN clause.
C. HAVING specifies a search condition for an aggregate or a group.
D. VALUES is used to sort the data in ascending or descending order.
Question 19 of 20
Which of the following SQL statements defines a schema?

5.0/ 5.0 Points

A. DELETE
B. INSERT
C. CREATE
D. SELECT
Question 20 of 20
SQL is:

0.0/ 5.0 Points

A. a programming language
B. an operating system
C. a DBMS.
D. a data sublanguage.
5.0/
5.0
Question 2 of 20
Point
s
Which is the SQL constraint that allows inputting NULL in a specified column in a
DBMS table but that does not allow inputting the already entered value?
A. UNIQUE
B. CHECK
C. REFERENCES
D. PRIMARY KEY

Question 5 of 20
A primary key is combined with a foreign key creates:

5.0/ 5.0 Points

A. Parent-Child relationship between the tables that connect


them.
B. Network model between the tables that connect them.
C. of the above.
D. Many to many relationship between the tables that connect
them.
Question 7 of 20

5.0/ 5.0
Points

Which of the following is the appropriate SQL statement that is used to create
Table A from Persons Table?

A. SELECT name FROM Persons WHERE country LIKE


'%Korea%' AND gender = 'F' OR age = 26
B. SELECT name FROM Persons WHERE country LIKE
'%Korea%' OR gender = ' F' AND age = 26
C. SELECT name FROM Persons WHERE country LIKE
'%Korea%' AND gender = 'F' AND age = 26
D. SELECT name FROM Persons WHERE country LIKE
'%Korea%' OR gender = 'F' OR age = 26

5.0/ 5.0
Points

Question 11 of 20
Which of the following is not the SQL statement?
A. CREATE
B. INSERT
C. DELETE
D. DIVIDE
Question 13 of 20

0.0/ 5.0 Points

There is a student score table shown below with basic and advanced subject codes
which begin with letters B and A respectively. Which of the following SQL
statements can be used to retrieve students, from the score table, whose basic
subject score is 70 or more and examination date is 2007-05-04?

A. SELECT student_number FROM score_table WHERE score


>=70 AND examination_date = 2007-05-04
B. SELECT student_number FROM score_table WHERE score
>=70 AND examination_date = 2007-05-04 AND subject_code LIKE
B%
C. SELECT * FROM score_table WHERE score >=70 AND
examination_date = 2007-05-04
D. SELECT * FROM score_table WHERE score >=70 AND
examination_date = 2007-05-04 AND subject_code LIKE B_ _

Question 14 of 20
SQL query and modification commands make up a(n) ________________

5.0/ 5.0
Points

A. DML
B. DDL
C. XML
D. HTML
Question 16 of 20

5.0/ 5.0 Points

Which of the following two descriptions on the operation of the stated


customer_table is wrong?

Operation 1: SELECT CUSTOMER_NAME, ADDRESS FROM CUSTOMER


Operation 2: SELECT * FROM CUSTOMER WHERE CUSTOMER_NO =
D0010
A. The table extracted by operation 1 has four rows
B. Operation 1 is PROJECTION and operation 2 is
SELECTION
C. The table extracted by operation 1 has two columns
D. The table extracted by operation 2 has two columns
Question 18 of 20

5.0/ 5.0
Points

Given below data in the Leased_Apartment_Table table

If the following statement is executed, which data group is extracted?


SELECT Property FROM Leased_Apartment_Table
WHERE (District=Tu Liem OR Time_From_The_Station<15) AND
(Floor_Space>60)
A. B, D, E
B. A
C. A, C
D. A, C, D, E
Question 8 of 20
AS clause is used in SQL for:

5.0 Points

A. Selection operation.
B. Join operation.
C. Rename operation.
D. Projection operation.
Question 2 of 20

5.0/ 5.0 Points

Which of the following product groups can be found when searching the Product
Inventory table for products with a sales price of 500 dollars or more per unit and
an inventory of less than 10 units?

A. Large refrigerator, medium refrigerator, small refrigerator, air


purif ier, and air conditioner
B. Medium refrigerator, small refrigerator, portable refrigerator,
coffee maker, and air conditioner
C. Medium refrigerator, small refrigerator, and air conditioner
D. Large refrigerator, medium refrigerator, small refrigerator,
portable refrigerator, air purifier, coffee maker, and air conditioner

Question 14 of 20

5.0/ 5.0
Points

You develop a database for a travel application. You need to design tables and
other database objects. You create a view that displays the dates and times of the
airline schedules on a report. You need to display dates and times in several
international formats. What should you do?
A. Use the DATETIME data type.

B. Use the DATETIME2 data type.


C. Use the DATE data type.
D. Use the FORMAT function.
E. Use the CAST function
Question 16 of 20
SQL stands for _______________________

5.0/ 5.0 Points

A. Sequential Query Language


B. Structured Query Language
C. Structured Question Language
D. Sequential Question Language
Question 17 of 20
Which one of the following is not true for a view?

5.0/ 5.0 Points

A. View never contains derived columns.


B. View is a virtual table.
C. A view definition is permanently stored as part of the database
D. View is derived from other table

Potrebbero piacerti anche