Deck 22: Relational Databases

ملء الشاشة (f)
exit full mode
سؤال
A ____________ is a set of rows and columns that provides a "window" through which you can see some of the database data.

A) table
B) view
C) window
D) subquery
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Based on the table below, which of the following statements will return the number of customers in Michigan (MI)?
Customer table
<strong>Based on the table below, which of the following statements will return the number of customers in Michigan (MI)? Customer table  </strong> A) SELECT COUNT(*) FROM Customer WHERE State = 'MI' b) SELECT AVG(*) FROM Customer WHERE State = 'MI' C) SELECT MAX(*) FROM Customer WHERE State = 'MI' D) SELECT SUM(*) FROM Customer WHERE State = 'MI' <div style=padding-top: 35px>

A) SELECT COUNT(*) FROM Customer WHERE State = 'MI' b) SELECT AVG(*) FROM Customer WHERE State = 'MI'
C) SELECT MAX(*) FROM Customer WHERE State = 'MI'
D) SELECT SUM(*) FROM Customer WHERE State = 'MI'
سؤال
Which of the following statements is correct?

A) SQL uses double quotes (") to delimit strings. b) The SQL command INSERT AT adds data to a database
C) SQL is not case sensitive.
D) SQL is a part of the Java API.
سؤال
Based on the table below, the query that finds all customers who do not live in Pleasantville is _________________.
Customer table
<strong>Based on the table below, the query that finds all customers who do not live in Pleasantville is _________________. Customer table  </strong> A) SELECT * FROM Customer WHERE City NOT 'Pleasantville' B) SELECT * FROM Customer WHERE NOT (City = 'Pleasantville') C) SELECT * FROM Customer WHERE City <> 'Pleasantville' D) SELECT * FROM Customer WHERE City != 'Pleasantville' <div style=padding-top: 35px>

A) SELECT * FROM Customer WHERE City NOT 'Pleasantville'
B) SELECT * FROM Customer WHERE NOT (City = 'Pleasantville')
C) SELECT * FROM Customer WHERE City <> 'Pleasantville'
D) SELECT * FROM Customer WHERE City != 'Pleasantville'
سؤال
Which of the following would be a good primary key for a Course table designed to hold course information for a university?

A) CourseName
B) CourseID
C) CourseCredit
D) CoursePrerequisites
سؤال
In the table below, the ____ correspond(s) to the attributes of a customer in the database.
Customer table
<strong>In the table below, the ____ correspond(s) to the attributes of a customer in the database. Customer table  </strong> A) foreign key B) primary key C) column headers D) data type <div style=padding-top: 35px>

A) foreign key
B) primary key
C) column headers
D) data type
سؤال
Based on the following table, the query that gets the names and complete mailing addresses of all customers is ____________________.
Customer table
<strong>Based on the following table, the query that gets the names and complete mailing addresses of all customers is ____________________. Customer table  </strong> A) SELECT * FROM Customer B) SELECT Name, Address, City, State, Zip INTO Customer C) SELECT FROM Customer FIELDS Name, Address, City, State, Zip D) SELECT Name, Address, City, State, Zip FROM Customer <div style=padding-top: 35px>

A) SELECT * FROM Customer
B) SELECT Name, Address, City, State, Zip INTO Customer
C) SELECT FROM Customer FIELDS Name, Address, City, State, Zip
D) SELECT Name, Address, City, State, Zip FROM Customer
سؤال
Based on the table below, the query that finds the names and zip codes of all customers is _____________________.
Customer table
<strong>Based on the table below, the query that finds the names and zip codes of all customers is _____________________. Customer table  </strong> A) SELECT ALL Name, Zip FROM Customer B) SELECT Name, Zip C) SELECT * FROM Customer D) SELECT Name, Zip FROM Customer <div style=padding-top: 35px>

A) SELECT ALL Name, Zip FROM Customer
B) SELECT Name, Zip
C) SELECT * FROM Customer
D) SELECT Name, Zip FROM Customer
سؤال
A ____________ is a reference to a primary key in a linked table.

A) foreign key
B) primary key
C) column headers
D) data type
سؤال
In database terminology, a column (or combination of columns) that uniquely identifies a row in a table is called a(n) ____.

A) data type
B) attribute
C) primary key
D) column header
سؤال
Which of the following table attributes could be a unique identifier for a person?

A) Name b) SocialSecurityNumber
C) State
D) Birthday
سؤال
Based on the customer table below, which of the attributes do you think represents the primary key?
Customer table
<strong>Based on the customer table below, which of the attributes do you think represents the primary key? Customer table  </strong> A) Address b) Name C) Customer_Number D) Zip <div style=padding-top: 35px>

A) Address b) Name
C) Customer_Number
D) Zip
سؤال
A _____________ is a column (or set of columns) whose value uniquely specifies a table record.

A) foreign key
B) primary key
C) column headers
D) data type
سؤال
Complete the following statement, which inserts rows into the following Course table.
____________________ VALUES ('CS221', 'Data Structures', '4', 'J. Jones')
Course table
<strong>Complete the following statement, which inserts rows into the following Course table. ____________________ VALUES ('CS221', 'Data Structures', '4', 'J. Jones') Course table  </strong> A) INSERT INTO Course table B) INSERT FROM Course C) INSERT INTO Course D) INSERT INTO Table Course <div style=padding-top: 35px>

A) INSERT INTO Course table
B) INSERT FROM Course
C) INSERT INTO Course
D) INSERT INTO Table Course
سؤال
In SQL, the _____________ command is used to issue queries.

A) QUERY
B) UPDATE
C) START
D) SELECT
سؤال
Insert the statement that would remove the following table from the database.
CREATE TABLE Course
(
Course_ID VARCHAR(11),
Credits VARCHAR(4),
Room_No INT(4)
)
____________________

A) DELETE TABLE Course
B) TRUNCATE TABLE Course
C) DROP Course
D) DROP TABLE Course
سؤال
In SQL, the _____________ command is used to issue queries that do not modify the database.

A) APPEND
B) UPDATE
C) MODIFY
D) SELECT
سؤال
In SQL, ____ is used to test for equality.

A) EQUAL b) ==
C) =
D) EQUALS
سؤال
Based on the table below, insert the statement that queries the database for the names of customers who live in the city of Pleasantville: ______________________
Customer table
<strong>Based on the table below, insert the statement that queries the database for the names of customers who live in the city of Pleasantville: ______________________ Customer table  </strong> A) SELECT Name FROM Customer WHERE City 'Pleasantville' B) SELECT Name FROM Customer WHERE City == 'Pleasantville' C) SELECT Name FROM Customer WHERE City >< 'Pleasantville' D) SELECT Name FROM Customer WHERE City = 'Pleasantville' <div style=padding-top: 35px>

A) SELECT Name FROM Customer WHERE City 'Pleasantville'
B) SELECT Name FROM Customer WHERE City == 'Pleasantville'
C) SELECT Name FROM Customer WHERE City >< 'Pleasantville'
D) SELECT Name FROM Customer WHERE City = 'Pleasantville'
سؤال
The outcome of a SQL query is a ____________________.

A) table
B) view of the data
C) list
D) subquery
سؤال
All database URLs have the format:

A) jdbc:subprotocol:driver-specific data
B) jdbc/subprotocol/driver/data
C) oracle.jdbc.driver.OracleDriver
D) c:\jdk1.7.0\db\lib\driver.jar
سؤال
In a Java program, the result of a SQL query is returned in a(n) _____________ object.

A) ResultSet
B) connection
C) view
D) driver
سؤال
The acronym JDBC stands for ________:

A) Joint Data Base Center
B) Java Database Control
C) Joint Database Connectivity
D) Java Database Connectivity
سؤال
The ___ symbol in the query string denotes variables that you fill in when you make an actual query

A) ?
B) *
C) !
D) ::
سؤال
What should the database.properties file contain so you can connect to a database?

A) a database URL, user name, password
B) a database URL, the program name, and a JDBC driver
C) a database URL, the program name, and database name
D) the JDBC driver path
سؤال
What statement will return the value of a given key from the configuration file? Assume props is of type Properties.

A) String driver = props.getProperty("database.properties");
B) Connection conn = SimpleDataSource.getProperty("database.properties");
C) String driver = props.getProperty("jdbc.driver");
D) Properties props = SampleDataSource.init("jdbc.driver");
سؤال
A ______________ object can create statement objects that are used to execute SQL commands.

A) ResultSet
B) Connection
C) JDBC
D) Driver
سؤال
If your statement has variable parts, you should use a _________ object.

A) ResultSet
B) ResultSetMetaData
C) PreparedStatement
D) Statement
سؤال
The outcome of a SELECT query is a _________ that you can view and analyze.

A) table
B) list
C) result set
D) subquery
سؤال
What is one reason why you need a finally clause after a try/catch sequence that accesses a database?

A) To commit the changes
B) To display the ResultSet
C) To display the metadata
D) To close the connection
سؤال
Which Java statement connects to a database using a Connection object?

A) Connection conn = new Connection(url, username, password);
B) Conenction conn = DriverManager.getConnection();
C) Connection conn = DriverManager.connect(url, username, password);
D) Connection conn = DriverManager.getConnection(url, username, password);
سؤال
Based on the table below, the SQL statement that changes the address and city of customer 3175, Gregory Adams, to 1337 Parkway Ave and Pembrook, SD, 57462, respectively, is _____________________.
Customer table
<strong>Based on the table below, the SQL statement that changes the address and city of customer 3175, Gregory Adams, to 1337 Parkway Ave and Pembrook, SD, 57462, respectively, is _____________________. Customer table  </strong> A) UPDATE Customer Address = '1337 Parkway Ave', City = 'Pembrook', State = 'SD', Zip = '57462' WHERE FirstName = 'Gregory' AND LastName = 'Adams' B) UPDATE Customer SET Address = '1337 Parkway Ave', City = 'Pembrook', State = 'SD', Zip = '57462' WHERE FirstName = 'Gregory' AND LastName = 'Adams' C) UPDATE Customer SET Address = '1337 Parkway Ave', City = 'Pembrook', State = 'SD', Zip = '57462' WHERE Name = 'Gregory Adams' D) UPDATE Customer SET Address = '1337 Parkway Ave', City = 'Pembrook', State = 'SD', Zip = '57462' <div style=padding-top: 35px>

A) UPDATE Customer Address = '1337 Parkway Ave', City = 'Pembrook', State = 'SD', Zip = '57462' WHERE FirstName = 'Gregory' AND LastName = 'Adams'
B) UPDATE Customer SET Address = '1337 Parkway Ave', City = 'Pembrook', State = 'SD', Zip = '57462' WHERE FirstName = 'Gregory' AND LastName = 'Adams'
C) UPDATE Customer SET Address = '1337 Parkway Ave', City = 'Pembrook', State = 'SD', Zip = '57462' WHERE Name = 'Gregory Adams'
D) UPDATE Customer SET Address = '1337 Parkway Ave', City = 'Pembrook', State = 'SD', Zip = '57462'
سؤال
The following command will compile a Java program called TestDB:

A) java TestDB.class
B) java TestDB.java
C) javac TestDB.java
D) javac TestDB.class
سؤال
If you encounter an error during updating a transaction, then call the ______ method:

A) undo
B) takeback
C) rollaround
D) rollback
سؤال
Given the following two statements, what does the call to the next() method return?
ResultSet result = statement.executeQuery();
Result.next();

A) The next record in the result.
B) true or false.
C) The primary key.
D) The next column in the table.
سؤال
An example of a lightweight database is:

A) Oracle
B) MS Access
C) Apache Derby
D) MySQL
سؤال
Based on the table below, the SQL statement that changes the last name of customer 3175 to Michael is _____________________.
Customer table
<strong>Based on the table below, the SQL statement that changes the last name of customer 3175 to Michael is _____________________. Customer table  </strong> A) UPDATE Customer SET LastName = 'Michael' WHERE Customer_Number = 3175 B) UPDATE Customer SET Customer_Number = 3175 WHERE LastName = 'Michael' C) UPDATE Customer table SET LastName = 'Michael' WHERE Customer_Number = 3175 D) UPDATE Customer SET FirstName = 'Susan' WHERE LastName = 'Michael' <div style=padding-top: 35px>

A) UPDATE Customer SET LastName = 'Michael' WHERE Customer_Number = 3175
B) UPDATE Customer SET Customer_Number = 3175 WHERE LastName = 'Michael'
C) UPDATE Customer table SET LastName = 'Michael' WHERE Customer_Number = 3175
D) UPDATE Customer SET FirstName = 'Susan' WHERE LastName = 'Michael'
سؤال
When you execute a rollback:

A) the temporary data are made permanent.
B) the temporary tables are simply discarded.
C) the database stores the changes in a temporary table.
D) it will commit all the updates.
سؤال
What should be on the class path when you launch a Java program that accesses a database?

A) the JDBC driver
B) the derby.jar file
C) the user name and password
D) the JDK
سؤال
Which SQL command(s) modify the data in a database?
I SELECT
II INSERT
III DELETE
IV UPDATE

A) I, II, III
B) II, III
C) II, III, IV
D) III, IV
سؤال
Microsoft Access is an example of a:

A) Heavyweight Java database.
B) Lightweight Java database.
C) Desktop database.
D) Production-quality database.
سؤال
What will the following command do?
Java -classpath derby.sql;. ExecSQL database.properties Product.sql

A) It will execute the statements in the database.properties file.
B) It will execute the statements in the derby.sql file.
C) It will execute the statements in the Product.sql file.
D) It will act as an interactive testing tool only.
سؤال
An example of a production-quality database is:

A) Oracle
B) MS Access
C) Apache Derby
D) Powerbuilder
سؤال
What does the execute method return?

A) ResultSet
B) Query
C) RecordSet
D) boolean
سؤال
Apache Derby is an example of a:

A) Heavyweight Java database.
B) Lightweight Java database.
C) Desktop database.
D) Production-quality database.
سؤال
If your program needs to look at several result sets at the same time, _____.

A) you need to create multiple Statement objects.
B) you can reuse the Statement or PreparedStatement objects
C) you should close the ResultSet before creating a new one.
D) you are not able to see several sets at the same time.
سؤال
When you close a connection:

A) it closes the connection only.
B) it closes the connection and the associated result set.
C) it closes the connection and the associated statement.
D) it closes the connection and closes all statements and result sets.
سؤال
What is the effect of the following statement?
String product_code = result.getString(1);

A) it will return the data in the second column.
B) it will return the data in the first column.
C) it will store the integer 1 as a string in the product_code.
D) it will return the name of the column.
سؤال
An example of a desktop database is:

A) Oracle
B) MS Access
C) Apache Derby
D) MySQL
سؤال
One of the steps for testing the JDBC driver is:

A) to setup your user account.
B) to find the name of the database URL that your driver expects.
C) to install the JDBC driver program.
D) to change the directory to the JDBC driver directory.
سؤال
What is wrong with the following statement?
ResultSet result = statement.execute("SELECT * from emp WHERE empNum = '5'");

A) ResultSet should be String
B) execute should be executeQuery
C) execute should be prepareStatement
D) 5 should not be used as an empNum value
سؤال
If you want to find out about properties of a result set from an unknown table, you need to use:

A) the ResultSet class.
B) the Statement class.
C) the ResultSetData class.
D) the ResultSetMetaData class.
سؤال
What will the following command do?
Java -classpath derby.sql;. ExecSQL database.properties

A) It will execute the statements in the database.properties file.
B) It will execute the statements in the derby.sql file.
C) It will compile the statements in the derby.sql file.
D) It will use ExecSQL program as an interactive testing tool.
سؤال
You can use the generic ____ method to execute arbitrary SQL statements.

A) setString()
B) prepareStatement()
C) executeQuery()
D) execute()
سؤال
When you are done with a Statement object, _______.

A) you should close it and you must close the associated result set as well.
B) you should not close it and should not close the associated result set.
C) you should close it and that automatically closes the associated result set.
D) you should only close the associated result set.
سؤال
What is wrong with the following statement?
Boolean result = statement.execute("SELECT * from emp WHERE empNum = '?'");

A) boolean should be ResultSet
B) execute should be executeQuery
C) execute should be prepareStatement
D) ? should be an integer
سؤال
The ______ class has a next method to visit the next row of a query result.

A) Scanner
B) Statement
C) ResultSet
D) Connection
سؤال
When you first get a result set from the executeQuery method, you need to call ____ to move to the first row

A) first()
B) start()
C) move()
D) next()
سؤال
Oracle is an example of a:

A) Heavyweight Java database.
B) Lightweight Java database.
C) Desktop database.
D) Production-quality database.
سؤال
A ______ lets you fetch a query result, one row at a time.

A) Query
B) Statement
C) ResultSet
D) PreparedStatement
سؤال
In jdbc.URL, the acronym URL stands for:

A) Universal Resource Locator
B) Uniform Resource Locator
C) Universe Resultset Locator
D) Uniform Resultset Locator
سؤال
Used with the LIKE operator, the ______ symbol matches exactly one character.

A) _
B) %
C) ?
D) $
سؤال
To fetch a column in a result set that stores the number of children, use the ______ method.

A) nextInt()
B) getInt()
C) nextDouble()
D) getDouble()
سؤال
Beginners are afraid of issuing complex SQL queries, so they are ______

A) throwing away a major benefit of a relational database.
B) throwing an exception called badQueryException.
C) doing the right thing by avoiding those queries for efficiency.
D) taking advantage of the SQL benefits.
سؤال
What will the following expression match to?
Name LIKE 'e_%'

A) all strings in the Name column that have at least 3 characters.
B) all strings in the Name column whose first letter is an "e".
C) all strings in the Name column that start with the letter "e" and end with underscore.
D) all strings in the Name column whose second letter is any character.
سؤال
To fetch a column in a result set that stores prices, use the ______ method.

A) nextInt()
B) getInt()
C) nextDouble()
D) getDouble()
سؤال
What does the following statement do?
String prodCode = nextLine(in, "Product Code (D=Done, L=List)");

A) It will store the string "Product Code (D=Done, L=List)" in the variable in.
B) It will display "in, Product Code (D=Done, L=List)" on the screen.
C) It will display the contents of the variable in on the screen.
D) It will read the user's input and store it in the object prodCode.
سؤال
What will the following expression match to?
Name LIKE '%e%'

A) all strings in the Name column that end with "e".
B) all strings in the Name column whose second to last letter is an "e".
C) all strings in the Name column that contain the letter "e".
D) all strings in the Name column whose second letter is an "e".
سؤال
Database tables store rows that contain the following except

A) strings
B) fundamental data types
C) arbitrary objects
D) numbers
سؤال
The ______ clause is used to select data that fulfill a condition

A) SELECT
B) FROM
C) WHEN
D) WHERE
سؤال
"SQL injection attacks" have been responsible for many cases of data theft. One of the solutions is:

A) Never use double quotes in the query.
B) Never use single quotes in the query.
C) Never add a string to a query that you didn't type yourself.
D) Never add a number to a query that you didn't type yourself.
سؤال
What will the following expression match to?
Name LIKE '_e%'

A) all strings in the Name column that end with "e".
B) all strings in the Name column whose second to last letter is an "e".
C) all strings in the Name column that start with the letter "e".
D) all strings in the Name column whose second letter is an "e".
سؤال
To get the number of columns in a result set, you use _________ method of the ResultSetMetaData class.

A) getColumnInt()
B) getColumnsCount()
C) getCount()
D) getColumnCount()
سؤال
Which import statement will allow you to use a SQLException object?

A) import javax.swing.SQLException;
B) import java.sql.SQLException;
C) import java.util.SQLException;
D) import java.io.SQLException;
سؤال
Metadata are ______

A) data about an object.
B) the properties of a result set.
C) the objects that are used to execute the SQL commands.
D) data about a connection.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/75
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 22: Relational Databases
1
A ____________ is a set of rows and columns that provides a "window" through which you can see some of the database data.

A) table
B) view
C) window
D) subquery
B
2
Based on the table below, which of the following statements will return the number of customers in Michigan (MI)?
Customer table
<strong>Based on the table below, which of the following statements will return the number of customers in Michigan (MI)? Customer table  </strong> A) SELECT COUNT(*) FROM Customer WHERE State = 'MI' b) SELECT AVG(*) FROM Customer WHERE State = 'MI' C) SELECT MAX(*) FROM Customer WHERE State = 'MI' D) SELECT SUM(*) FROM Customer WHERE State = 'MI'

A) SELECT COUNT(*) FROM Customer WHERE State = 'MI' b) SELECT AVG(*) FROM Customer WHERE State = 'MI'
C) SELECT MAX(*) FROM Customer WHERE State = 'MI'
D) SELECT SUM(*) FROM Customer WHERE State = 'MI'
A
3
Which of the following statements is correct?

A) SQL uses double quotes (") to delimit strings. b) The SQL command INSERT AT adds data to a database
C) SQL is not case sensitive.
D) SQL is a part of the Java API.
C
4
Based on the table below, the query that finds all customers who do not live in Pleasantville is _________________.
Customer table
<strong>Based on the table below, the query that finds all customers who do not live in Pleasantville is _________________. Customer table  </strong> A) SELECT * FROM Customer WHERE City NOT 'Pleasantville' B) SELECT * FROM Customer WHERE NOT (City = 'Pleasantville') C) SELECT * FROM Customer WHERE City <> 'Pleasantville' D) SELECT * FROM Customer WHERE City != 'Pleasantville'

A) SELECT * FROM Customer WHERE City NOT 'Pleasantville'
B) SELECT * FROM Customer WHERE NOT (City = 'Pleasantville')
C) SELECT * FROM Customer WHERE City <> 'Pleasantville'
D) SELECT * FROM Customer WHERE City != 'Pleasantville'
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
5
Which of the following would be a good primary key for a Course table designed to hold course information for a university?

A) CourseName
B) CourseID
C) CourseCredit
D) CoursePrerequisites
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
6
In the table below, the ____ correspond(s) to the attributes of a customer in the database.
Customer table
<strong>In the table below, the ____ correspond(s) to the attributes of a customer in the database. Customer table  </strong> A) foreign key B) primary key C) column headers D) data type

A) foreign key
B) primary key
C) column headers
D) data type
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
7
Based on the following table, the query that gets the names and complete mailing addresses of all customers is ____________________.
Customer table
<strong>Based on the following table, the query that gets the names and complete mailing addresses of all customers is ____________________. Customer table  </strong> A) SELECT * FROM Customer B) SELECT Name, Address, City, State, Zip INTO Customer C) SELECT FROM Customer FIELDS Name, Address, City, State, Zip D) SELECT Name, Address, City, State, Zip FROM Customer

A) SELECT * FROM Customer
B) SELECT Name, Address, City, State, Zip INTO Customer
C) SELECT FROM Customer FIELDS Name, Address, City, State, Zip
D) SELECT Name, Address, City, State, Zip FROM Customer
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
8
Based on the table below, the query that finds the names and zip codes of all customers is _____________________.
Customer table
<strong>Based on the table below, the query that finds the names and zip codes of all customers is _____________________. Customer table  </strong> A) SELECT ALL Name, Zip FROM Customer B) SELECT Name, Zip C) SELECT * FROM Customer D) SELECT Name, Zip FROM Customer

A) SELECT ALL Name, Zip FROM Customer
B) SELECT Name, Zip
C) SELECT * FROM Customer
D) SELECT Name, Zip FROM Customer
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
9
A ____________ is a reference to a primary key in a linked table.

A) foreign key
B) primary key
C) column headers
D) data type
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
10
In database terminology, a column (or combination of columns) that uniquely identifies a row in a table is called a(n) ____.

A) data type
B) attribute
C) primary key
D) column header
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
11
Which of the following table attributes could be a unique identifier for a person?

A) Name b) SocialSecurityNumber
C) State
D) Birthday
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
12
Based on the customer table below, which of the attributes do you think represents the primary key?
Customer table
<strong>Based on the customer table below, which of the attributes do you think represents the primary key? Customer table  </strong> A) Address b) Name C) Customer_Number D) Zip

A) Address b) Name
C) Customer_Number
D) Zip
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
13
A _____________ is a column (or set of columns) whose value uniquely specifies a table record.

A) foreign key
B) primary key
C) column headers
D) data type
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
14
Complete the following statement, which inserts rows into the following Course table.
____________________ VALUES ('CS221', 'Data Structures', '4', 'J. Jones')
Course table
<strong>Complete the following statement, which inserts rows into the following Course table. ____________________ VALUES ('CS221', 'Data Structures', '4', 'J. Jones') Course table  </strong> A) INSERT INTO Course table B) INSERT FROM Course C) INSERT INTO Course D) INSERT INTO Table Course

A) INSERT INTO Course table
B) INSERT FROM Course
C) INSERT INTO Course
D) INSERT INTO Table Course
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
15
In SQL, the _____________ command is used to issue queries.

A) QUERY
B) UPDATE
C) START
D) SELECT
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
16
Insert the statement that would remove the following table from the database.
CREATE TABLE Course
(
Course_ID VARCHAR(11),
Credits VARCHAR(4),
Room_No INT(4)
)
____________________

A) DELETE TABLE Course
B) TRUNCATE TABLE Course
C) DROP Course
D) DROP TABLE Course
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
17
In SQL, the _____________ command is used to issue queries that do not modify the database.

A) APPEND
B) UPDATE
C) MODIFY
D) SELECT
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
18
In SQL, ____ is used to test for equality.

A) EQUAL b) ==
C) =
D) EQUALS
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
19
Based on the table below, insert the statement that queries the database for the names of customers who live in the city of Pleasantville: ______________________
Customer table
<strong>Based on the table below, insert the statement that queries the database for the names of customers who live in the city of Pleasantville: ______________________ Customer table  </strong> A) SELECT Name FROM Customer WHERE City 'Pleasantville' B) SELECT Name FROM Customer WHERE City == 'Pleasantville' C) SELECT Name FROM Customer WHERE City >< 'Pleasantville' D) SELECT Name FROM Customer WHERE City = 'Pleasantville'

A) SELECT Name FROM Customer WHERE City 'Pleasantville'
B) SELECT Name FROM Customer WHERE City == 'Pleasantville'
C) SELECT Name FROM Customer WHERE City >< 'Pleasantville'
D) SELECT Name FROM Customer WHERE City = 'Pleasantville'
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
20
The outcome of a SQL query is a ____________________.

A) table
B) view of the data
C) list
D) subquery
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
21
All database URLs have the format:

A) jdbc:subprotocol:driver-specific data
B) jdbc/subprotocol/driver/data
C) oracle.jdbc.driver.OracleDriver
D) c:\jdk1.7.0\db\lib\driver.jar
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
22
In a Java program, the result of a SQL query is returned in a(n) _____________ object.

A) ResultSet
B) connection
C) view
D) driver
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
23
The acronym JDBC stands for ________:

A) Joint Data Base Center
B) Java Database Control
C) Joint Database Connectivity
D) Java Database Connectivity
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
24
The ___ symbol in the query string denotes variables that you fill in when you make an actual query

A) ?
B) *
C) !
D) ::
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
25
What should the database.properties file contain so you can connect to a database?

A) a database URL, user name, password
B) a database URL, the program name, and a JDBC driver
C) a database URL, the program name, and database name
D) the JDBC driver path
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
26
What statement will return the value of a given key from the configuration file? Assume props is of type Properties.

A) String driver = props.getProperty("database.properties");
B) Connection conn = SimpleDataSource.getProperty("database.properties");
C) String driver = props.getProperty("jdbc.driver");
D) Properties props = SampleDataSource.init("jdbc.driver");
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
27
A ______________ object can create statement objects that are used to execute SQL commands.

A) ResultSet
B) Connection
C) JDBC
D) Driver
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
28
If your statement has variable parts, you should use a _________ object.

A) ResultSet
B) ResultSetMetaData
C) PreparedStatement
D) Statement
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
29
The outcome of a SELECT query is a _________ that you can view and analyze.

A) table
B) list
C) result set
D) subquery
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
30
What is one reason why you need a finally clause after a try/catch sequence that accesses a database?

A) To commit the changes
B) To display the ResultSet
C) To display the metadata
D) To close the connection
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
31
Which Java statement connects to a database using a Connection object?

A) Connection conn = new Connection(url, username, password);
B) Conenction conn = DriverManager.getConnection();
C) Connection conn = DriverManager.connect(url, username, password);
D) Connection conn = DriverManager.getConnection(url, username, password);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
32
Based on the table below, the SQL statement that changes the address and city of customer 3175, Gregory Adams, to 1337 Parkway Ave and Pembrook, SD, 57462, respectively, is _____________________.
Customer table
<strong>Based on the table below, the SQL statement that changes the address and city of customer 3175, Gregory Adams, to 1337 Parkway Ave and Pembrook, SD, 57462, respectively, is _____________________. Customer table  </strong> A) UPDATE Customer Address = '1337 Parkway Ave', City = 'Pembrook', State = 'SD', Zip = '57462' WHERE FirstName = 'Gregory' AND LastName = 'Adams' B) UPDATE Customer SET Address = '1337 Parkway Ave', City = 'Pembrook', State = 'SD', Zip = '57462' WHERE FirstName = 'Gregory' AND LastName = 'Adams' C) UPDATE Customer SET Address = '1337 Parkway Ave', City = 'Pembrook', State = 'SD', Zip = '57462' WHERE Name = 'Gregory Adams' D) UPDATE Customer SET Address = '1337 Parkway Ave', City = 'Pembrook', State = 'SD', Zip = '57462'

A) UPDATE Customer Address = '1337 Parkway Ave', City = 'Pembrook', State = 'SD', Zip = '57462' WHERE FirstName = 'Gregory' AND LastName = 'Adams'
B) UPDATE Customer SET Address = '1337 Parkway Ave', City = 'Pembrook', State = 'SD', Zip = '57462' WHERE FirstName = 'Gregory' AND LastName = 'Adams'
C) UPDATE Customer SET Address = '1337 Parkway Ave', City = 'Pembrook', State = 'SD', Zip = '57462' WHERE Name = 'Gregory Adams'
D) UPDATE Customer SET Address = '1337 Parkway Ave', City = 'Pembrook', State = 'SD', Zip = '57462'
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
33
The following command will compile a Java program called TestDB:

A) java TestDB.class
B) java TestDB.java
C) javac TestDB.java
D) javac TestDB.class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
34
If you encounter an error during updating a transaction, then call the ______ method:

A) undo
B) takeback
C) rollaround
D) rollback
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
35
Given the following two statements, what does the call to the next() method return?
ResultSet result = statement.executeQuery();
Result.next();

A) The next record in the result.
B) true or false.
C) The primary key.
D) The next column in the table.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
36
An example of a lightweight database is:

A) Oracle
B) MS Access
C) Apache Derby
D) MySQL
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
37
Based on the table below, the SQL statement that changes the last name of customer 3175 to Michael is _____________________.
Customer table
<strong>Based on the table below, the SQL statement that changes the last name of customer 3175 to Michael is _____________________. Customer table  </strong> A) UPDATE Customer SET LastName = 'Michael' WHERE Customer_Number = 3175 B) UPDATE Customer SET Customer_Number = 3175 WHERE LastName = 'Michael' C) UPDATE Customer table SET LastName = 'Michael' WHERE Customer_Number = 3175 D) UPDATE Customer SET FirstName = 'Susan' WHERE LastName = 'Michael'

A) UPDATE Customer SET LastName = 'Michael' WHERE Customer_Number = 3175
B) UPDATE Customer SET Customer_Number = 3175 WHERE LastName = 'Michael'
C) UPDATE Customer table SET LastName = 'Michael' WHERE Customer_Number = 3175
D) UPDATE Customer SET FirstName = 'Susan' WHERE LastName = 'Michael'
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
38
When you execute a rollback:

A) the temporary data are made permanent.
B) the temporary tables are simply discarded.
C) the database stores the changes in a temporary table.
D) it will commit all the updates.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
39
What should be on the class path when you launch a Java program that accesses a database?

A) the JDBC driver
B) the derby.jar file
C) the user name and password
D) the JDK
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
40
Which SQL command(s) modify the data in a database?
I SELECT
II INSERT
III DELETE
IV UPDATE

A) I, II, III
B) II, III
C) II, III, IV
D) III, IV
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
41
Microsoft Access is an example of a:

A) Heavyweight Java database.
B) Lightweight Java database.
C) Desktop database.
D) Production-quality database.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
42
What will the following command do?
Java -classpath derby.sql;. ExecSQL database.properties Product.sql

A) It will execute the statements in the database.properties file.
B) It will execute the statements in the derby.sql file.
C) It will execute the statements in the Product.sql file.
D) It will act as an interactive testing tool only.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
43
An example of a production-quality database is:

A) Oracle
B) MS Access
C) Apache Derby
D) Powerbuilder
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
44
What does the execute method return?

A) ResultSet
B) Query
C) RecordSet
D) boolean
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
45
Apache Derby is an example of a:

A) Heavyweight Java database.
B) Lightweight Java database.
C) Desktop database.
D) Production-quality database.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
46
If your program needs to look at several result sets at the same time, _____.

A) you need to create multiple Statement objects.
B) you can reuse the Statement or PreparedStatement objects
C) you should close the ResultSet before creating a new one.
D) you are not able to see several sets at the same time.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
47
When you close a connection:

A) it closes the connection only.
B) it closes the connection and the associated result set.
C) it closes the connection and the associated statement.
D) it closes the connection and closes all statements and result sets.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
48
What is the effect of the following statement?
String product_code = result.getString(1);

A) it will return the data in the second column.
B) it will return the data in the first column.
C) it will store the integer 1 as a string in the product_code.
D) it will return the name of the column.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
49
An example of a desktop database is:

A) Oracle
B) MS Access
C) Apache Derby
D) MySQL
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
50
One of the steps for testing the JDBC driver is:

A) to setup your user account.
B) to find the name of the database URL that your driver expects.
C) to install the JDBC driver program.
D) to change the directory to the JDBC driver directory.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
51
What is wrong with the following statement?
ResultSet result = statement.execute("SELECT * from emp WHERE empNum = '5'");

A) ResultSet should be String
B) execute should be executeQuery
C) execute should be prepareStatement
D) 5 should not be used as an empNum value
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
52
If you want to find out about properties of a result set from an unknown table, you need to use:

A) the ResultSet class.
B) the Statement class.
C) the ResultSetData class.
D) the ResultSetMetaData class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
53
What will the following command do?
Java -classpath derby.sql;. ExecSQL database.properties

A) It will execute the statements in the database.properties file.
B) It will execute the statements in the derby.sql file.
C) It will compile the statements in the derby.sql file.
D) It will use ExecSQL program as an interactive testing tool.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
54
You can use the generic ____ method to execute arbitrary SQL statements.

A) setString()
B) prepareStatement()
C) executeQuery()
D) execute()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
55
When you are done with a Statement object, _______.

A) you should close it and you must close the associated result set as well.
B) you should not close it and should not close the associated result set.
C) you should close it and that automatically closes the associated result set.
D) you should only close the associated result set.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
56
What is wrong with the following statement?
Boolean result = statement.execute("SELECT * from emp WHERE empNum = '?'");

A) boolean should be ResultSet
B) execute should be executeQuery
C) execute should be prepareStatement
D) ? should be an integer
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
57
The ______ class has a next method to visit the next row of a query result.

A) Scanner
B) Statement
C) ResultSet
D) Connection
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
58
When you first get a result set from the executeQuery method, you need to call ____ to move to the first row

A) first()
B) start()
C) move()
D) next()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
59
Oracle is an example of a:

A) Heavyweight Java database.
B) Lightweight Java database.
C) Desktop database.
D) Production-quality database.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
60
A ______ lets you fetch a query result, one row at a time.

A) Query
B) Statement
C) ResultSet
D) PreparedStatement
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
61
In jdbc.URL, the acronym URL stands for:

A) Universal Resource Locator
B) Uniform Resource Locator
C) Universe Resultset Locator
D) Uniform Resultset Locator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
62
Used with the LIKE operator, the ______ symbol matches exactly one character.

A) _
B) %
C) ?
D) $
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
63
To fetch a column in a result set that stores the number of children, use the ______ method.

A) nextInt()
B) getInt()
C) nextDouble()
D) getDouble()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
64
Beginners are afraid of issuing complex SQL queries, so they are ______

A) throwing away a major benefit of a relational database.
B) throwing an exception called badQueryException.
C) doing the right thing by avoiding those queries for efficiency.
D) taking advantage of the SQL benefits.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
65
What will the following expression match to?
Name LIKE 'e_%'

A) all strings in the Name column that have at least 3 characters.
B) all strings in the Name column whose first letter is an "e".
C) all strings in the Name column that start with the letter "e" and end with underscore.
D) all strings in the Name column whose second letter is any character.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
66
To fetch a column in a result set that stores prices, use the ______ method.

A) nextInt()
B) getInt()
C) nextDouble()
D) getDouble()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
67
What does the following statement do?
String prodCode = nextLine(in, "Product Code (D=Done, L=List)");

A) It will store the string "Product Code (D=Done, L=List)" in the variable in.
B) It will display "in, Product Code (D=Done, L=List)" on the screen.
C) It will display the contents of the variable in on the screen.
D) It will read the user's input and store it in the object prodCode.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
68
What will the following expression match to?
Name LIKE '%e%'

A) all strings in the Name column that end with "e".
B) all strings in the Name column whose second to last letter is an "e".
C) all strings in the Name column that contain the letter "e".
D) all strings in the Name column whose second letter is an "e".
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
69
Database tables store rows that contain the following except

A) strings
B) fundamental data types
C) arbitrary objects
D) numbers
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
70
The ______ clause is used to select data that fulfill a condition

A) SELECT
B) FROM
C) WHEN
D) WHERE
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
71
"SQL injection attacks" have been responsible for many cases of data theft. One of the solutions is:

A) Never use double quotes in the query.
B) Never use single quotes in the query.
C) Never add a string to a query that you didn't type yourself.
D) Never add a number to a query that you didn't type yourself.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
72
What will the following expression match to?
Name LIKE '_e%'

A) all strings in the Name column that end with "e".
B) all strings in the Name column whose second to last letter is an "e".
C) all strings in the Name column that start with the letter "e".
D) all strings in the Name column whose second letter is an "e".
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
73
To get the number of columns in a result set, you use _________ method of the ResultSetMetaData class.

A) getColumnInt()
B) getColumnsCount()
C) getCount()
D) getColumnCount()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
74
Which import statement will allow you to use a SQLException object?

A) import javax.swing.SQLException;
B) import java.sql.SQLException;
C) import java.util.SQLException;
D) import java.io.SQLException;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
75
Metadata are ______

A) data about an object.
B) the properties of a result set.
C) the objects that are used to execute the SQL commands.
D) data about a connection.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.