Database 2203 (Review)

Ace your homework & exams now with Quizwiz!

A Database Administrator is responsible for developing logical data model. Select one: True False

False

A NULL value is treated as a blank or 0. Select one: True False

False

A UNION query combines the output from no more than two queries and must include the same number of columns. Select one: True False

False

A primary key of a relation should be part of every other relation to provide referential integrity. Select one: True False

False

A relation is in the first normal form if it has no more than one multivalued attribute. Select one: True False

False

Data analysis begins with the statement of data design. Select one: True False

False

INSERT INTO SUBJECTS VALUES (1, 'Mathematics', 1, NULL, 65 ) This SQL statement always causes an error. Select one: True False

False

Implementation in the Waterfall model means the construction of a computer system according to a given implementation document. Select one: True False

False

Relations should always be normalized to the highest normal form possible. Select one: True False

False

The degree of a relationship is described as the relationship's maximum cardinality. Select one: True False

False

A deletion anomaly occurs when deleting data about one entity results in the loss of data about another entity. Select one: True False

True

A pool of atomic values constitutes a domain. Select one: True False

True

A relation is in BCNF if, and only if, every determinant is a candidate key. Select one: True False

True

A relational database stores data in the form of relations. Select one: True False

True

Data integrity is concerned with ensuring that any new data that is added to the tables is compatible with the existing inter-table relationships. Select one: True False

True

For a given conceptual data model, it is not necessary that all the user requirements it represents be satisfied by a single database. Select one: True False

True

JDBC API is a natural Java interface and is built on ODBC. JDBC retains some of the basic features of ODBC. Select one: True False

True

ODBC requires manual installation of the ODBC driver manager and driver on all client machines. JDBC drivers are written in Java and JDBC code is automatically installable, secure, and portable on all platforms. Select one: True False

True

Primary keys must have different values for each table row. Select one: True False

True

SELECT LECTURERS.SURNAME, LECTURERS.SURNAMEFROM LECTURERS, LECTURERSWHERE DEPT_NO = DEPT_NO The above query is syntactically correct. Select one: True False

True

Structured Query Language (SQL) is not a complete programming language. Select one: True False

True

The CREATE TABLE command creates an empty table-one with no records. Select one: True False

True

The DROP TABLE command is a part of SQL's DDL. Select one: True False

True

The JDBC API is a Java API that can access any kind of tabular data, especially data stored in a relational database. Select one: True False

True

The UPDATE command in SQL is used to change the existing values of the columns. Select one: True False

True

The output of the COUNT() function is the number of rows or column values that would be selected by the query. Select one: True False

True

The standards for SQL has been maintained by The American National Standards Institute (ANSI). Select one: True False

True

When using SQL create table command, defining constraints is optional. Select one: True False

True

Consider a relation, R (A, B, C, D, E) with the given functional dependencies; A → B, B → DE and D → C. What is the closure (A)? Select one: a. A = ABDEC b. A = ADEC c. A = ABEC d. A = ABDC

a. A = ABDEC

Given only the following part of an E-R diagram, what does the circle across the relationship line near the entity in the figure below indicate? Select one: a. A minimum cardinality of zero b. A minimum cardinality of one c. A maximum cardinality of one d. A maximum cardinality of many

a. A minimum cardinality of zero

Which of the following is wrong? Select one: a. A relation includes a foreign key matching the primary key of other relation is called an insertion anomaly b. If the removal of data in one entity results in the unintentional loss of data in another entity is deletion anomaly c. A relation is in 2NF if and only if it is in 1NF and all non-key attributes are determined by the entire primary key d. The condition that a non-key attribute determines another non-key attribute is known as transitive dependency

a. A relation includes a foreign key matching the primary key of other relation is called an insertion anomaly

Which of the following is wrong? Select one: a. A relation includes a foreign key matching the primary key of other relation is called an insertion anomaly b. If the removal of data in one entity results in the unintentional loss of data in another entity is deletion anomaly c. A relation is in 2NF if and only if it is in 1NF and all non-key attributes are determined by the entire primary key d. The condition that a non-key attribute determines another non-key attribute is known as transitive dependency

a. A relation includes a foreign key matching the primary key of other relation is called an insertion anomaly

Which of the following statements is wrong? Select one: a. A relation is a one-dimensional table. b. All the values in any column must be of the same type. c. The E-R model is used to build a conceptual model. d. It is not a good practice to use a surrogate key.

a. A relation is a one-dimensional table.

Consider a relation, R (A, B, C, D, E) with the given functional dependencies A → B, B → DE and D → C. What is the closure (A)? Select one: a. A+ = ABDEC b. A+ = ADEC c. A+ = ABEC d. A+ = ABDC

a. A+ = ABDEC

Given a relation R with five attributes A,B,C,D,E with the following dependencies: AB → C CD → E DE → B What is the candidate key for R? Select one: a. ABD b. ABC c. CDE d. ACE

a. ABD

Which of the following statements is incorrect? Select one: a. Aggregate functions are mostly used in the WHERE clause of a SELECT statement. b. SELECT LECTURERS.SURNAME, LECTURERS.SURNAMEFROM LECTURERS, LECTURERSWHERE DEPT_NO = DEPT_NO c. A composite primary key can be defined using the SQL Constraint keyword. d. Primary keys must have different values for each table row.

a. Aggregate functions are mostly used in the WHERE clause of a SELECT statement.

Which of the following statements is wrong? Select one: a. Aggregate functions are mostly used in the WHERE clause of a SELECT statement. b. When using the equivalence operator (=) in the predicate, you must make sure that the subquery retrieves exactly one value. c. SQL's concept of joining two or more tables also applies to joining two copies of the same table. d. Output of the COUNT() function is the number of rows or column values that would be selected by the query.

a. Aggregate functions are mostly used in the WHERE clause of a SELECT statement.

What does "a named column of a relation" refer to? Select one: a. Attribute b. Domain c. Tuple d. Relation

a. Attribute

What does "a named column of a relation" refer to? Select one: a. Attribute b. Domain c. Tuple d. Relation

a. Attribute

A student's name, birthday, and student number are all examples of: Select one: a. Attributes b. Relationships c. Entities d. Extensions

a. Attributes

If B is a subset of attributes in set A, then which of the following is wrong? Select one: a. B → A b. AC → BC c. AB → B d. A → B

a. B → A

Which of the following is not a Numeric Type? Select one: a. BOOLEAN b. TINYINT c. SMALLINT d. BIGINT

a. BOOLEAN

Consider a relation, R (A, B, C, D, E) with the given functional dependencies A → B, B → DE and D → C. What is the closure (C)? Select one: a. C+ = C b. C+ = DC c. C+ = BC d. C+ = DEC

a. C+ = C

Which one is not an anomaly type which results from redundancy? Select one: a. Cancelation Anomalies b. Deletion Anomalies c. Insertion Anomalies d. Update Anomalies

a. Cancelation Anomalies

Given a relation R with three attributes A, B, C with the following dependencies: ABC → C C → A What is the candidate key for R? Select one: a. Candidate key is ABC b. Candidate key is C c. Candidate key is A d. Candidate key is AB

a. Candidate key is ABC

Which of the following includes a set of commands used to control access to the data within the database, including security? Select one: a. DCL b. DML c. DDL d. DAL

a. DCL

Which of the following sentences is incorrect? Select one: a. Dependency preserving implies lossless join and vice-versa. b. Lossless join decomposition must be achieved at all times. c. Functional Dependencies are a kind of integrity constraints. d. BCNF is not always achievable.

a. Dependency preserving implies lossless join and vice-versa.

In an Entity-Relationship model, which concept is generally used to represent a student? Select one: a. Entity b. Attribute c. Constraint d. Relationship set

a. Entity

In an Entity-Relationship model, which concept is generally used to represent a student? Select one: a. Entity b. Attribute c. Constraint d. Relationship set

a. Entity

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 WHERE CUSTOMER_T. CUSTOMER_ID = ORDER_T. CUSTOMER_ID MC Select one: a. Equi-join b. Natural join c. Outer Join d. Cartesian Join

a. Equi-join

Which of the following is a definition of Embedded SQL? Select one: a. Hard-coded SQL statements in a programming language such as Java. b. The process of making an application capable of generating specific SQL code on the fly. c. Hard-coded SQL statements in a procedure. d. Hard-coded SQL statements in a trigger.

a. Hard-coded SQL statements in a programming language such as Java.

Which of the following would motivate to de-normalize a relation? Select one: a. Improve performance b. Relax security c. Reduce design time d. End user preference

a. Improve performance

Which of the following is not a problem associated with storing data in a file? Select one: a. Inconsistency occurs when a data item is used multiple times b. Inability to store partial data c. Duplication of data items d. A large amount of disk space is required

a. Inconsistency occurs when a data item is used multiple times or b. Inability to store partial data

Which of the following statements is true concerning subqueries? Select one: a. Involves the use of an inner and outer query b. Cannot return the same result as a query that is not a subquery. c. Does not start with the word SELECT. d. All of the above.

a. Involves the use of an inner and outer query

Which view of information deals with how the information is physically arranged, stored,and accessed? Select one: a. Physical View b. Logical View c. Information View d. None of the Above

a. Physical View

tblProducts Table ProductID SupplierID CategoryID ProductName 111Chai211Chang312Aniseed Syrup422Chef Anto's Cajun Using the tblProducts Table shown above, which of the columns in the above table is more appropriate for being a "Primary Key"? Select one: a. ProductID b. SupplierID c. CategoryID d. ProductName

a. ProductID

CREATE TABLE BOOK ( BookID CHAR(20) NOT NULL,Title VARCHAR(30) NOT NULL,PublisherName VARCHAR(20),PRIMARY KEY (BookID)) Considering SQL statement above, which of the following is wrong? Select one: a. PublisherName can't be null b. The name of the created table is BOOK c. There are three columns in this table d. Primary key of this table is BookID

a. PublisherName can't be null

A rule that each foreign key value must match a primary key value in the other relation is called as? Select one: a. Referential integrity constraint b. Entity integrity constraint c. Tuple constraint d. Semantic integrity constraint

a. Referential integrity constraint

Assume that there is a table called "Shippers". Return all the fields from the "Shippers" table. Select one: a. Select * from Shippers b. Alter * from Shippers c. Insert * from Shippers d. Bring * from Shippers

a. Select * from Shippers

tblProducts Table ProductID SupplierID CategoryID ProductName 111Chai211Chang312Aniseed Syrup422Chef Anto's Cajun Using the tblProducts Table shown above, which of the following SQL statements returns just the ProductID, CategoryID, and ProductName of all the products with SupplierID of 1 and CategoryID of 1? Select one: a. Select ProductID, CategoryID, ProductName from tblProducts Where SupplierID =1 and CategoryID=1 b. Select ProductID, CategoryID, ProductName from tblProducts c. Select ProductID, CategoryID, ProductName from tblProducts Where CategoryID =1 d. Select SupplierID =1, CategoryID=1, ProductName from tblProducts

a. Select ProductID, CategoryID, ProductName from tblProducts Where SupplierID =1 and CategoryID=1

In JDBC, what represents a single instance of a particular database session? Select one: a. a thread b. an opened connection c. a closed connection d. a pipe

a. a thread

Which of the following data types used in SQL could be used to define a fixed-length text field of 20 characters? Select one: a. char(20) b. varchar(20) c. fixed(20) d. bit(20)

a. char(20)

Which of the following SQL command is used for creating a database? Select one: a. create schema b. create table c. create view d. create file

a. create schema

Which SQL statement is used to insert new data in a database? Select one: a. insert into b. insert new c. add new d. add record

a. insert into

In an Entity-Relationship model, which concept is generally used to represent the name of an instructor? Select one: a.Attribute b.Relationship set c.Constraint d.Entity

a.Attribute

An athletics meeting involves several competitors who participate in a number of events. The database is intended to record who is to take part in which event and to record the outcome of each event. As results become available the winner attribute will be updated with the cid of the appropriate competitor. Competitor(cid, name, nationality) Event(eid, description, winner) Competes(cid, eid) Competitorcid name nationality 01PatBritish02HilaryBritish03SvenSwedish04PierreFrench Eventeid description winner 01running02jumping03throwing Competes cid eid 01010201030204020403 Identify the result of the following SQL statement: SELECT eid FROM Competes, Competitor WHERE Competes.cid=Competitor.cid AND nationality = 'Swedish' Select one: a. 01 b. 02 c. 03 d. 04 e.

b. 02

Consider a relation that doesn't include multivalued attributes and non-key attributes in this relation dependent on the primary key. However, this relation contains transitive dependencies. What is the best normal form that R satises (1NF, 2NF, 3NF, or BCNF)? Select one: a. 1NF b. 2NF c. 3NF d. BCNF

b. 2NF

Consider a relation that doesn't include multivalued attributes and non-key attributes in this relation dependent on the primary key. However, this relation contains transitive dependencies. What is the best normal form that R satisfies (1NF, 2NF, 3NF, or BCNF)? Select one: a. 1NF b. 2NF c. 3NF d. BCNF

b. 2NF

Consider a relation that doesn't include multivalued attributes and non-key attributes in this relation dependent on the primary key. However, this relation contains transitive dependencies. What is the best normal form that R satisfies (1NF, 2NF, 3NF,or BCNF)? Select one: a. 1NF b. 2NF c. 3NF d. BCNF

b. 2NF

Create Table EXAMS ( SUB_NO integer Not Null, STUDENT_NO integer Not Null, MARK decimal (3), DATE_TAKEN date);The above SQL statement is used to create the EXAMS table. Considering the EXAMS table; which of the following SQL statements is used to define the primary key of the EXAMS table?Select one: a. Alter Table EXAMS Primary Key (SUB_NO); b. Alter Table EXAMS Add Primary Key (SUB_NO); c. Alter Table Add SUB_NO Primary Key (EXAMS); d. Alter Table SUB_NO Add Primary Key (EXAMS);

b. Alter Table EXAMS Add Primary Key (SUB_NO);

CREATE TABLE tblOrderDetails ( OrderID int NULL, ProductID int NULL, UnitPrice float NOT NULL, Quantity smallint NOT NULL, Discount real NOT NULL) Which of the following SQL statements gives an error while defining Primary Key for the above table? Select one: a. CREATE TABLE tblOrderDetails ( OrderID int NULL, ProductID int NULL, UnitPrice float NOT NULL, Quantity smallint NOT NULL, Discount real NOT NULL,Primary Key (OrderID)) b. CREATE TABLE tblOrderDetails ( OrderID int NULL, ProductID int NULL, UnitPrice float NOT NULL, Quantity smallint NOT NULL, Discount real NOT NULL,CONSTRAINT Primary Key (ProductID)) c. CREATE TABLE tblOrderDetails ( OrderID int NULL, ProductID int NULL, UnitPrice float NOT NULL, Quantity smallint NOT NULL, Discount real NOT NULL) d. CREATE TABLE tblOrderDetails ( OrderID int NULL, ProductID int NULL, UnitPrice float NOT NULL, Quantity smallint NOT NULL, Discount real NOT NULL,Primary Key (OrderID, ProductID));

b. CREATE TABLE tblOrderDetails ( OrderID int NULL, ProductID int NULL, UnitPrice float NOT NULL, Quantity smallint NOT NULL, Discount real NOT NULL,CONSTRAINT Primary Key (ProductID))

Which of the following SQL statements should be used to create a table in a database? Select one: a. DML b. DDL c. DAL d. DCL

b. DDL

When an accounting application creates new orders in the orders table, which SQL statements of the following should be used? Select one: a. DCL b. DML c. DDL d. DAL

b. DML

Which of the following is not a property of a data model? Select one: a. The blueprint of any database system b. Defines relationships betweenmanaged objects c. Includes many details d. Intended for software developers

b. Defines relationships betweenmanaged objects

Given the table Instructor (InstructorID, Name, Course), which of the following SQL statements would be used to add new instructor data to the Instructor table? Select one: a. INSERT INTO Instructor SET InstructorID =1111, Name=David, Course =CS 2204 b. INSERT INTO Instructor VALUES (1111, 'David', ' CS 2204') c. INSERT INTO New Instructor VALUES (1111, 'David', ' CS 2204') d. INSERT INTO Instructor VALUES ('David', 1111, ' CS 2204')

b. INSERT INTO Instructor VALUES (1111, 'David', ' CS 2204')

Given the table Instructor (InstructorID, Name, Course), which of the following SQL statements can't be used to add new instructor data to the Instructor table? Select one: a. INSERT INTO Instructor (InstructorID, Name) VALUES (1111, 'David') b. INSERT INTO New Instructor VALUES (1111, 'David', ' CS 2203') c. INSERT INTO Instructor VALUES (1111, 'David', 'CS 2203') d. INSERT INTO Instructor (InstructorID, Name, Course) VALUES (1111, 'David', 'CS 2203')

b. INSERT INTO New Instructor VALUES (1111, 'David', ' CS 2203')

ODBC stands for: Select one: a. Open Database Community b. Open Database Connectivity c. Open Source Database Community d. Open Database Connection

b. Open Database Connectivity

With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"? Select one: a. SELECT * FROM Persons SORT BY 'FirstName' DESC b. SELECT * FROM Persons ORDER BY FirstName DESC c. SELECT * FROM Persons ORDER FirstName DESC d. SELECT * FROM Persons SORT 'FirstName' DESC

b. SELECT * FROM Persons ORDER BY FirstName DESC

Which of the following supports both static and dynamic modes of execution? Select one: a. JDBC b. SQLJ c. DB2 CLI d. ODBC

b. SQLJ

tblProducts Table ProductID SupplierID CategoryID ProductName 111Chai211Chang312Aniseed Syrup422Chef Anto's Cajun Using the tblProducts Table shown above, which of the following SQL statements returns just the ProductID, CategoryID and ProductName of all the products and order the results by CategoryID? Select one: a. Select ProductID, ProductName from tblProducts Order By CategoryID b. Select ProductID, CategoryID, ProductName from tblProducts Order By CategoryID c. Select ProductID, CategoryID, ProductName from tblProducts Where CategoryID=1 Order By CategoryID d. Select ProductID, CategoryID, ProductName Order By CategoryID

b. Select ProductID, CategoryID, ProductName from tblProducts Order By CategoryID

Which of the following statements is correct? Select one: a. A surrogate key is an attribute or set of attributes that uniquely identifies a record in a relation b. Two or more attributes can be defined on the same domain. c. A relation is in the first normal form if it has no more than one multivalued attribute. d. There is a single attribute in each relation

b. Two or more attributes can be defined on the same domain.

Assume that you are dealing with money and you do a lot of calculations that you want them to be exact. Which of the following data types is the best option to store this in a relation? Select one: a. integer b. decimal(10,2) c. varchar(12) d. char(12)

b. decimal(10,2)

Considering all the other tables exist in the database, which of the following SQL statements that if used to create tables would give an error? Select one: a.Create Table Instructor(ID integer Not Null,Name varchar (40),SureName varchar (40),CONSTRAINT pk Primary Key (ID),CONSTRAINT fk Foreign Key (Name) References Departments(Name)); b.Create Instructor( ID integer, Name varchar (40), SureName varchar (40),Primary Key (ID),Unique (ID)); c.Create Table Instructor(ID integer Not Null,Name varchar (40),SureName varchar (40),Primary Key (ID),Foreign Key (Name) References Departments); d.Create Table Instructor( ID integer Not Null, Name varchar (40), SureName varchar (40),Primary Key (ID, Name));

b.Create Instructor( ID integer, Name varchar (40), SureName varchar (40),Primary Key (ID),Unique (ID));

Which of the following statements is incorrect? Select one: a.The standards for SQL has been maintained by The American National Standards Institute (ANSI). b.SQL can only be used as a Data Manipulation Language (DML). c.A surrogate key does not exist in the real world as a real attribute of an entity set. d.SQL was developed by IBM in the late 1970s.

b.SQL can only be used as a Data Manipulation Language (DML).

Considering the below E-R diagram. Which of the following statements is wrong? Select one: a. The store has to provide its phone number. b. For each sale, tax has to be calculated. c. A customer has to give his/her phone number. d. Each item has to have a description.

c. A customer has to give his/her phone number.

If B is a subset of attributes in set A, then which of the following is correct? Select one: a. B → A b. BC → AC c. AC → BC d. B → AB

c. AC → BC

Which of the following is wrong about the functional dependency A → (B, C, D)? Select one: a. A determines D. b. B, C, and D are functionally dependent on A c. B, C, and D together determine A d. C is functionally dependent on A.

c. B, C, and D together determine A

Which of the following is a UNION query? Select one: a. Combines the output from no more than two queries and must include the same number of columns. b. Combines the output from no more than two queries and does not include the same number of columns. c. Combines the output from multiple queries and must include the same number of columns. d. Combines the output from multiple queries and does not include the same number of columns.

c. Combines the output from multiple queries and must include the same number of columns.

Which of the following SQL statements that are used to create tables gives an error? Select one: a. Create Table Students( Name char(10) Not Null, SureName char (40)) b. Create Table StudentsFriends( Name char(20) Not Null, SureName varchar (50)) c. Create Table StudentsFriendsandFamily( Name char(30) Not Null, Name varchar (40)) d. Create Table StudentsFriendsandInstructors( Name char(30) Not Null, SureName varchar (30))

c. Create Table StudentsFriendsandFamily( Name char(30) Not Null, Name varchar (40))

Consider a relation, R (A, B, C, D, E) with the given functional dependencies; A → B, B → DE and D → C. What is the closure (E)?Select one:a. E+ = DECb. E+ = DEc. E+ = Ed. E+ = BE

c. E+ = E

Which of the following statements is correct when this E-R diagram is implemented in a SQL database? Select one: a. If there is a SaleID with S1 value in SALE_ITEM table, S1 also has to be in ITEM table. b. If there is an ItemID with I1 value in ITEM table, there can be two tuples that include I1 in SALE_ITEM table. c. If there is a SaleID with S1 value in SALE table, there can be more than one tuple that includes S1 value at the SaleID column. d. If there is an ItemID with I1 value in ITEM table, I1 also has to be in SALE_ITEM table.

c. If there is a SaleID with S1 value in SALE table, there can be more than one tuple that includes S1 value at the SaleID column.

Which of the following is not a property of a data model? Select one: a. The blueprint of any database system b. Defines relationships between managed objects c. Includes many details d. Intended for software developers

c. Includes many details

Which of the following is not a goal of normalization? Select one: a. Minimizing data redundancy b. Simplifying the enforcement of referential integrity c. Maximizing data storage space d. Maintaining data effectively

c. Maximizing data storage space

Which SQL keyword is used to sort the result-set? Select one: a. SORT BY b. ORDER c. ORDER BY d. SORT

c. ORDER BY

In the evolution of database management systems, what does optimization refer to? Select one: a. High Availability b. Security c. Performance d. Scalability

c. Performance

Which of the following is not a component of a database model? Select one: a. Structural component b. Manipulation component c. Physical component d. Data Integrity component

c. Physical component

Which of the following is an incorrect statement? Select one: a. Host variables are programming language variables that should only be used for static SQL processing. b. The SQLCODE is one such variable in the data structure which is set to 0 (zero) after every successful SQL execution. c. SQLSTATE provides a more specific message that is standardized across different database vendor products. d. Dynamic SQL statements include parameters whose values are not known until runtime when they are supplied as input to the application.

c. SQLSTATE provides a more specific message that is standardized across different database vendor products.

tblProducts Table ProductID SupplierID CategoryID ProductName 111Chai211Chang312Aniseed Syrup422Chef Anto's Cajun Using the tblProducts Table shown above, which of the following SQL statements returns the total number of products that come from SupplierID=1 in the tblProducts table? Select one: a. Select * From tblProducts Count(*) b. Select Count(*) from tblProducts c. Select Count(*) from tblProducts Where SupplierID=1 d. Count(*) tblProducts

c. Select Count(*) from tblProducts Where SupplierID=1

tblProducts Table ProductID SupplierID CategoryID ProductName 111Chai211Chang312Aniseed Syrup422Chef Anto's Cajun Using the tblProducts Table shown above, which of the following SQL statements returns just the ProductID, CategoryID and ProductName of all the products whose ProductID is NOT 2? Select one: a. Select ProductID, CategoryID, ProductName from tblProducts b. Select ProductID =1, ProductID=3, ProductID=4 from tblProducts c. Select ProductID, CategoryID, ProductName from tblProducts Where ProductID <>2 d. Select ProductID, CategoryID, ProductName from tblProducts Where ProductID = 2

c. Select ProductID, CategoryID, ProductName from tblProducts Where ProductID <>2

Which of the following is wrong about domains of a relation? Select one: a. A tuple can draw values from different domains b. A pool of atomic values constitutes a domain c. Two attributes that include values from different domains can easily be compared d. Two or more attributes can be defined on the same domain

c. Two attributes that include values from different domains can easily be compared

Which of the following SQL command is used for adding one or more new columns to a table? Select one: a. create schema b. create table c. alter table d. alter file

c. alter table

Which of the following SQL command is used to define a logical table from one or more tables or views? Select one: a. create table b. define table c. create view d. create database

c. create view

Which of the following statements is wrong? Select one: a.A relational database stores data in the form of relations. b.Both the primary key and a candidate key can uniquely identify the tuples in a relation. c.A relational database can be defined as a self-describing collection of non-integrated relations. d.Physical model includes the lowest level of abstractions

c.A relational database can be defined as a self-describing collection of non-integrated relations.

Given the table Instructor (InstructorID, Name, Course), which of the following SQL statements can't be used to add new instructor data to the Instructor table? Select one: a.INSERT INTO Instructor (InstructorID, Name, Course) VALUES (1111, 'David', 'CS 2203') b.INSERT INTO Instructor (InstructorID, Name) VALUES (1111, 'David') c.INSERT INTO Instructor VALUES (1111, 'David', 'CS 2203') d.INSERT INTO New Instructor VALUES (1111, 'David', ' CS 2203')

c.INSERT INTO Instructor VALUES (1111, 'David', 'CS 2203')

"A student can attend six courses, each with a different instructor. Each instructor teaches at least 3 courses." What is the type of relationship between students and instructors? Select one: a.one-to-one b.one-to-many c.many-to-many d.None of the above

c.many-to-many

Consider a relation, R (A, B, C, D, E) with the given functional dependencies A → B, B → E and D → C. What is the closure (A)? Select one: a. A+ = ABDEC b. A+ = ADEC c. A+ = ABDC d. A+ = ABE

d. A+ = ABE

What are the basic categories of the SQL language based on functionality? Select one: a. Data definition b. Data modification c. Data control d. All the above

d. All the above

Given only the following part of an E-R diagram, what does the hash mark across the relationship line near the entity in the figure below indicate? Select one: a. A minimum cardinality of zero b. A minimum cardinality of one c. A maximum cardinality of one d. Both B and C

d. Both B and C

The address of a student can be defined using street, city, state, and zip code. What type of attribute should be used to represent the address of a student? Select one: a. Single valued attribute b. Multi-valued attribute c. Derived attribute d. Composite attribute

d. Composite attribute

The address of a student can be defined using street, city, state, and zip code. What type of attribute should be used to represent the address of a student? a. Single valued attribute b. Multi-valued attribute c. Derived attribute d. Composite attribute

d. Composite attribute

Considering all the other tables exist in the database, which of the following SQL statements that if used to create tables would give an error? Select one: a. Create Table Instructor(ID integer Not Null,Name varchar (40),SureName varchar (40),CONSTRAINT pk Primary Key (ID),CONSTRAINT fk Foreign Key (Name) References Departments(Name)) b. Create Table Instructor( ID integer Not Null, Name varchar (40), SureName varchar (40),Primary Key (ID, Name)) c. Create Table Instructor(ID integer Not Null,Name varchar (40),SureName varchar (40),Primary Key (ID),Foreign Key (Name) References Departments) d. Create Instructor( ID integer, Name varchar (40), SureName varchar (40),Primary Key (ID),Unique (ID))

d. Create Instructor( ID integer, Name varchar (40), SureName varchar (40),Primary Key (ID),Unique (ID))

Which of the following SQL statements that are used to create tables gives an error? Select one: a. Create Table Instructor( ID char(10) Not Null, Name varchar (40), SureName varchar (40)) b. Create Table Instructor( ID integer Not Null, Name varchar (40), SureName varchar (40),CONSTRAINT pk Primary Key (ID)) c. Create Table Instructor( ID integer Not Null, Name varchar (40), SureName varchar (40),CONSTRAINT pk Unique (ID)) d. Create Table Instructor( ID integer Not Null, Name varchar (40), SureName varchar (40),CONSTRAINT pk Primary Key (ID),CONSTRAINT pk Unique (ID))

d. Create Table Instructor( ID integer Not Null, Name varchar (40), SureName varchar (40),CONSTRAINT pk Primary Key (ID),CONSTRAINT pk Unique (ID))

Which of the following includes a set of commands used to control access to the data within the database, including security? Select one: a. DAL b. DML c. DDL d. DCL

d. DCL

If we write a program in a programming language and switch to SQL when we require to use the database, then the SQL environment in use is known as _______ SQL. Select one: a. Real-time b. Dynamic c. PL d. Embedded

d. Embedded

Which of the following is always correct? Select one: a. If A → BC, then A → B and B → C b. If A → B and C is another attribute, then AB → C c. If A → B and A → C, then B → C d. If A → B and A → C, then A → BC

d. If A → B and A → C, then A → BC

Which of the following keywords is not one of the SQL built-in functions? Select one: a. AVG b. COUNT c. MAX d. MODE

d. MODE

Data modeling includes several models. Which model of data modeling includes the lowest level of abstractions? Select one: a. Internal model b. External model c. Conceptual model d. Physical model

d. Physical model

Data modeling includes several models. Which model of data modeling includes the lowest level of abstractions? Select one: a. Internal model b. External model c. Conceptual model d. Physical model

d. Physical model

Which SQL statement is used to return only different values? Select one: a. SELECT UNIQUE b. SELECT IDENTITY c. SELECT DIFFERENT d. SELECT DISTINCT

d. SELECT DISTINCT

which of the following table contents can't be inserted to the EXAMS table (assume date format is correct)? Select one: a. SUB_NO STUDENT_NO MARK DATE_TAKEN 11 b. SUB_NO STUDENT_NO MARK DATE_TAKEN 1105-23-2020 c. SUB_NO STUDENT_NO MARK DATE_TAKEN 1185 d. SUB_NO STUDENT_NO MARK DATE_TAKEN 18505-23-2020 e.

d. SUB_NO STUDENT_NO MARK DATE_TAKEN 18505-23-2020

tblProducts Table ProductID SupplierID CategoryID ProductName 111Chai211Chang312Aniseed Syrup422Chef Anto's Cajun Using the tblProducts Table shown above, which of the following SQL statements returns ProductID and ProductName columns? Select one: a. Select * from tblProducts b. Select * from tblProducts Where ProductID=1 c. Select * from tblProducts Where ProductID=1 and ProductName ='Chai' d. Select ProductID, ProductName from tblProducts

d. Select ProductID, ProductName from tblProducts

tblProducts Table ProductID SupplierID CategoryID ProductName 111Chai211Chang312Aniseed Syrup422Chef Anto's Cajun Using the tblProducts Table shown above, which of the following SQL statements returns just the ProductID and ProductName of all the products of which the ProductName includes the string "Cha"? Select one: a. Select ProductID, ProductName from tblProducts b. Select ProductID, ProductName from tblProducts Where ProductName like 'Cha%' c. Select ProductID, ProductName from tblProducts Where ProductName like '%Cha%' d. Select ProductID, ProductName from tblProducts Where ProductName like '%Cha'

d. Select ProductID, ProductName from tblProducts Where ProductName like '%Cha'

A user is setting up a join operation between tables EMP and DEPT. There are some employees in the EMP table that the user wants returned by the query, but the employees are not assigned to departments yet. Which SELECT statement is most appropriate for this user? Select one: a. Select e.empid, d.head from emp e, dept d b. Select e.empid, d.head from emp e, dept d where e.dept# = d.dept# c. Select e.empid, d.head from emp e, dept d where e.dept# (+) = d.dept# d. Select e.empid, d.head from emp e right outer join dept d on e.dept# = d.dept#

d. Select e.empid, d.head from emp e right outer join dept d on e.dept# = d.dept#

"The maximum number of courses a student can take in one term is 6." Which constraint should be used to enforce this statement? Select one: a. Referential integrity constraint b. Entity integrity constraint c. Tuple constraint d. Semantic integrity constraint

d. Semantic integrity constraint

Which of the following statements is wrong? Select one: a. The CREATE TABLE command is a part of SQL's DDL b. The ALTER TABLE command is a part of SQL's DDL c. The DROP TABLE command is a part of SQL's DDL d. The SELECT TABLE command is a part of SQL's DDL

d. The SELECT TABLE command is a part of SQL's DDL

Which of the following is an incorrect statement? Select one: a. Embedded SQL has the capability of executing SQL statements dynamically. b. Database APIs are totally dynamic. c. Database API is used to develop applications independently of target databases. d. The intermediate layer between the application and programming language is the database connectivity driver.

d. The intermediate layer between the application and programming language is the database connectivity driver.

Which of the following statements is incorrect? Select one: a. One of the advantages of normalized tables is the elimination of modification anomalies. b. Once the view is created, you can use it just like any table. c. A data type of Char(30) indicates a fixed length field of 30 characters. d. While creating a table using SQL, specifying the NULL property for a column means that only null values can be stored in that column.

d. While creating a table using SQL, specifying the NULL property for a column means that only null values can be stored in that column.

"A student can attend six courses, each with a dierent instructor. Each instructor has 30 students." What is the type of relationship between students and instructors? Select one: a. weak b. one-to-one c. one-to-many d. many-to-many

d. many-to-many

With SQL, how can you return all the records from a table named "Persons" sorted ascending by "FirstName"? Select one: a.SELECT * FROM Persons SORT BY 'FirstName' DESC b.SELECT * FROM Persons ORDER BY FirstName DESC c.SELECT * FROM Persons SORT 'FirstName' ASC d.SELECT * FROM Persons ORDER BY FirstName ASC

d.SELECT * FROM Persons ORDER BY FirstName ASC

Which of the following statements is correct? Select one: a.A surrogate key is an attribute or set of attributes that uniquely identifies a record in a relation b.A relation is in the first normal form if it has no more than one multivalued attribute. c.There is a single attribute in each relation d.Two or more attributes can be defined on the same domain.

d.Two or more attributes can be defined on the same domain.

A primary key of a relation should be part of every other relation to provide referential integrity.

false

Database systems are used by users, however, users are not considered as a part of a database system.

false

Most of the commercial databases are based on the hierarchical model.

false

OpenOffice Base is an example of a database.

false

Relations should always be normalized to the highest normal form possible

false

Relations should always be normalized to the highest normal form possible.

false

The Database Administrator is responsible for developing the logical data model.

false

The degree of a relationship is described as the relationship's maximum cardinality.

false

A deletion anomaly occurs when deleting data about one entity results in the loss of data about another entity.

true

A relational database stores data in the form of relations.

true

A unique constraint specifies that attribute values must be different.

true

All instances of a given entity set have the same attributes in the E-R Model.

true

Both the primary key and a candidate key can uniquely identify the tuples in a relation.

true

The E-R model is used to build a conceptual model.

true


Related study sets

AH1 MOD 6 CARDIO Shock Iggy NCLEX, Iggy Chp 35 - Care of Patients with Cardiac Problems, CH 33, 35 Cardiac, Nursing Management: Coronary Artery Disease and Acute Coronary Syndrome, Nursing Assessment: Cardiovascular System

View Set

Adobe animate Gmetrix test 1 answers

View Set

12. A makrogazdaság szereplői és a makrojövedelem keletkezése

View Set

Respiratory Acidosis, Respiratory Alkalosis, Metabolic Acidosis & Metabolic Alkalosis

View Set