Deck 24: Relational Databasesetext Only

ملء الشاشة (f)
exit full mode
سؤال
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
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
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 the names and zip codes of all customers is _____________________.
Customer table
Based on the table below, the query that finds the names and zip codes of all customers is _____________________. Customer table   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
سؤال
SQL uses single quotes (') to delimit strings.What is the standard in order to include a single quote in a String? For example: 'Joe's Burgers'
A.Use double quotes (")
B.Use a normal single quote
C.Use the single quote twice
D.Escape with a (\') as in Java
سؤال
The outcome of a SQL query is a ____________________.
A.table
B.a 2D array of objects
C.list
D.subquery
سؤال
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
سؤال
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
سؤال
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
سؤال
Based on the following table, the query that gets the names and complete mailing addresses of all customers is ____________________.
Customer table
Based on the following table, the query that gets the names and complete mailing addresses of all customers is ____________________. Customer table   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
سؤال
In SQL, the _____________ command is used to issue queries that do not modify the database.
A.APPEND
B.UPDATE
C.MODIFY
D.SELECT
سؤال
Based on the table below, the query that finds all customers who do not live in Pleasantville is _________________.
Customer table
Based on the table below, the query that finds all customers who do not live in Pleasantville is _________________. Customer table   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'
سؤال
Based on the customer table below, which of the attributes do you think represents the primary key?
Customer table
Based on the customer table below, which of the attributes do you think represents the primary key? Customer table   A.Address B.Name C.Customer_Number D.Zip<div style=padding-top: 35px>
A.Address
B.Name
C.Customer_Number
D.Zip
سؤال
In the table below, the ____ correspond(s) to the attributes of a customer in the database.
Customer table
In the table below, the ____ correspond(s) to the attributes of a customer in the database. Customer table   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 table below, insert the statement that queries the database for the names of customers who live in the city of Pleasantville: ______________________
Customer table
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   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'
سؤال
Complete the following statement, which inserts rows into the following Course table.
____________________ VALUES ('CS221', 'Data Structures', '4', 'J.Jones')
Course table
Complete the following statement, which inserts rows into the following Course table. ____________________ VALUES ('CS221', 'Data Structures', '4', 'J.Jones') Course table   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
سؤال
Which of the following table attributes could be a unique identifier for a person?
A.Name
B.SocialSecurityNumber
C.State
D.Birthday
سؤال
What is the purpose of a primary key?
A.To establish a link from one table to another
B.To be the first identifier, which does not need to be unique
C.To use a row that uniquely identifies a column
D.To link a column to another column
سؤال
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
سؤال
How does a relational database store information?
A.Arrays
B.Linked Lists
C.Tables
D.Charts
سؤال
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
سؤال
Based on the table below, which of the following statements will return the number of customers in Michigan (MI)?
Customer table
Based on the table below, which of the following statements will return the number of customers in Michigan (MI)? Customer table   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'
سؤال
Oracle is an example of a:
A.Heavyweight Java database.
B.Lightweight Java database.
C.Desktop database.
D.Production-quality database.
سؤال
Which clause allows the joining of multiple tables in SQL?
A.WHERE with multiple items
B.JOIN with multiple items
C.FROM with multiple items
D.WITH with multiple items
سؤال
Used with the LIKE operator, the ______ symbol matches exactly one character.
A._
B.%
C.?
D.$
سؤال
Microsoft Access is an example of a:
A.Heavyweight Java database.
B.Lightweight Java database.
C.Desktop database.
D.Production-quality database.
سؤال
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
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      <div style=padding-top: 35px> 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      <div style=padding-top: 35px> 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      <div style=padding-top: 35px>
سؤال
The acronym JDBC stands for ________:
A.Joint Data Base Center
B.Java Database Control
C.Joint Database Connectivity
D.Java Database Connectivity
سؤال
What is the purpose of the LIKE clause?
A.Selects data that fulfills a numerical condition
B.Finds the location of the initial starting point
C.Matches all strings which contains certain characters
D.Tests for equality in ASCII value
سؤال
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".
سؤال
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
سؤال
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
سؤال
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.
سؤال
Which SQL command(s) modify the data in a database?
I SELECT
II INSERT
III DELETE
IV UPDATE
A.I, II, III
B.Only II, III
C.II, III, IV
D.Only III, IV
سؤال
An example of a lightweight database is:
A.Oracle
B.MS Access
C.Apache Derby
D.MySQL
سؤال
The ______ clause is used to select data that fulfill a condition.
A.SELECT
B.FROM
C.WHEN
D.WHERE
سؤال
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");
Title
What statement will return the value for a given key from the configuration file?
سؤال
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.
سؤال
In SQL, ____ is used to test for equality.
A.EQUAL
B.==
C.=
D.EQUALS
سؤال
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 the effect of the following statement?
String productCode = 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 productCode.
D.it will return the name of the column.
سؤال
An example of a production-quality database is:
A.Oracle
B.MS Access
C.Apache Derby
D.Powerbuilder
سؤال
In jdbc.URL, the acronym URL stands for:
A.Universal Resource Locator
B.Uniform Resource Locator
C.Universe Resultset Locator
D.Uniform Resultset Locator
سؤال
If your statement has variable parts, you should use a _________ object.
A.ResultSet
B.ResultSetMetaData
C.PreparedStatement
D.Statement
سؤال
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.
سؤال
In a Java program, the result of a SQL query is returned in a _____________ object.
A.ResultSet
B.connection
C.view
D.driver
سؤال
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.
سؤال
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()
سؤال
You can use the generic ____ method to execute arbitrary SQL statements.
A.setString()
B.prepareStatement()
C.executeQuery()
D.execute()
سؤال
Apache Derby is an example of a:
A.Heavyweight Java database.
B.Lightweight Java database.
C.Desktop database.
D.Production-quality database.
سؤال
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
سؤال
What does the execute method return?
A.ResultSet
B.Query
C.RecordSet
D.boolean
سؤال
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.
سؤال
The ___ symbol in the query string denotes variables that you fill in when you make an actual query
A.?
B.*
C.!
D.::
Title
The ___ symbol in the query string denotes variables filled by an actual quer
سؤال
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
سؤال
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.
سؤال
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);
سؤال
An example of a desktop database is:
A.Oracle
B.MS Access
C.Apache Derby
D.MySQL
سؤال
Why should we use try-with-resources to open a Connection to a database?
A.To commit the changes
B.To display the ResultSet
C.To display the metadata
D.To close the connection
سؤال
A ______________ object can create statement objects that are used to execute SQL commands.
A.ResultSet
B.Connection
C.JDBC
D.Driver
سؤال
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.
Section
Reference 1: 24.5 Application: Entering an Invoice
سؤال
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.
سؤال
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.
سؤال
In what format does the SQL query return a result?
A.XPath syntax
B.ResultSet object
C.A String separated by colons
D.An array of results
سؤال
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.
سؤال
"SQL injection attacks" have been responsible for many cases of data theft.One of the solutions for preventing these attacks 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.
سؤال
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()
سؤال
Database tables store rows that contain the following except
A.strings
B.fundamental data types
C.arbitrary objects
D.numbers
Title
Database tables store rows that contain the following excep
سؤال
To fetch a column in a result set that stores prices, use the ______ method.
A.nextInt()
B.getInt()
C.nextDouble()
D.getDouble()
سؤال
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.
Title
What to do when you are done with the Statement objec
سؤال
If you encounter an error during updating a transaction, then call the ______ method:
A.undo
B.takeback
C.rollaround
D.rollback
سؤال
What is the main purpose of the Connection object?
A.Accesses a database from a Java program
B.Combines multiple data tables
C.Skips the loading step of the database driver class
D.Manually loads the database driver class
سؤال
An important part of database processing is transaction handling.What is a transaction?
A.A set of data that is translated into the required language and then added to the database
B.A set of database transfers to another database
C.A set of database updates that may have some parts successful
D.A set of database updates that should either succeed fully or not happen at all
سؤال
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;
سؤال
The ______ class has a next method to visit the next row of a query result.
A.Scanner
B.Statement
C.ResultSet
D.Connection
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/75
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 24: Relational Databasesetext Only
1
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
DROP TABLE Course
2
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.
SQL is not case sensitive.
3
Based on the table below, the query that finds the names and zip codes of all customers is _____________________.
Customer table
Based on the table below, the query that finds the names and zip codes of all customers is _____________________. Customer table   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
SELECT Name, Zip FROM Customer
4
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
5
SQL uses single quotes (') to delimit strings.What is the standard in order to include a single quote in a String? For example: 'Joe's Burgers'
A.Use double quotes (")
B.Use a normal single quote
C.Use the single quote twice
D.Escape with a (\') as in Java
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
6
The outcome of a SQL query is a ____________________.
A.table
B.a 2D array of objects
C.list
D.subquery
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
7
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
8
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
9
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
10
Based on the following table, the query that gets the names and complete mailing addresses of all customers is ____________________.
Customer table
Based on the following table, the query that gets the names and complete mailing addresses of all customers is ____________________. Customer table   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
11
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
12
Based on the table below, the query that finds all customers who do not live in Pleasantville is _________________.
Customer table
Based on the table below, the query that finds all customers who do not live in Pleasantville is _________________. Customer table   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
13
Based on the customer table below, which of the attributes do you think represents the primary key?
Customer table
Based on the customer table below, which of the attributes do you think represents the primary key? Customer table   A.Address B.Name C.Customer_Number D.Zip
A.Address
B.Name
C.Customer_Number
D.Zip
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
14
In the table below, the ____ correspond(s) to the attributes of a customer in the database.
Customer table
In the table below, the ____ correspond(s) to the attributes of a customer in the database. Customer table   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
15
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
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   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
16
Complete the following statement, which inserts rows into the following Course table.
____________________ VALUES ('CS221', 'Data Structures', '4', 'J.Jones')
Course table
Complete the following statement, which inserts rows into the following Course table. ____________________ VALUES ('CS221', 'Data Structures', '4', 'J.Jones') Course table   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
17
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
18
What is the purpose of a primary key?
A.To establish a link from one table to another
B.To be the first identifier, which does not need to be unique
C.To use a row that uniquely identifies a column
D.To link a column to another column
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
19
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
20
How does a relational database store information?
A.Arrays
B.Linked Lists
C.Tables
D.Charts
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 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
Based on the table below, which of the following statements will return the number of customers in Michigan (MI)?
Customer table
Based on the table below, which of the following statements will return the number of customers in Michigan (MI)? Customer table   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'
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
23
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
24
Which clause allows the joining of multiple tables in SQL?
A.WHERE with multiple items
B.JOIN with multiple items
C.FROM with multiple items
D.WITH with multiple items
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
25
Used with the LIKE operator, the ______ symbol matches exactly one character.
A._
B.%
C.?
D.$
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
26
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
27
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
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      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      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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
28
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
29
What is the purpose of the LIKE clause?
A.Selects data that fulfills a numerical condition
B.Finds the location of the initial starting point
C.Matches all strings which contains certain characters
D.Tests for equality in ASCII value
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
30
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
31
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
32
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
33
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
34
Which SQL command(s) modify the data in a database?
I SELECT
II INSERT
III DELETE
IV UPDATE
A.I, II, III
B.Only II, III
C.II, III, IV
D.Only III, IV
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
35
An example of a lightweight database is:
A.Oracle
B.MS Access
C.Apache Derby
D.MySQL
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
36
The ______ clause is used to select data that fulfill a condition.
A.SELECT
B.FROM
C.WHEN
D.WHERE
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
37
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");
Title
What statement will return the value for a given key from the configuration file?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
38
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
39
In SQL, ____ is used to test for equality.
A.EQUAL
B.==
C.=
D.EQUALS
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
40
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
41
What is the effect of the following statement?
String productCode = 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 productCode.
D.it will return the name of the column.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
42
An example of a production-quality database is:
A.Oracle
B.MS Access
C.Apache Derby
D.Powerbuilder
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
43
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
44
If your statement has variable parts, you should use a _________ object.
A.ResultSet
B.ResultSetMetaData
C.PreparedStatement
D.Statement
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
45
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
46
In a Java program, the result of a SQL query is returned in a _____________ object.
A.ResultSet
B.connection
C.view
D.driver
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
47
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
48
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
49
You can use the generic ____ method to execute arbitrary SQL statements.
A.setString()
B.prepareStatement()
C.executeQuery()
D.execute()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
50
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
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
What does the execute method return?
A.ResultSet
B.Query
C.RecordSet
D.boolean
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
53
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
54
The ___ symbol in the query string denotes variables that you fill in when you make an actual query
A.?
B.*
C.!
D.::
Title
The ___ symbol in the query string denotes variables filled by an actual quer
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
55
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
56
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
57
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
58
An example of a desktop database is:
A.Oracle
B.MS Access
C.Apache Derby
D.MySQL
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
59
Why should we use try-with-resources to open a Connection to 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
60
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
61
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.
Section
Reference 1: 24.5 Application: Entering an Invoice
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
62
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
63
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
64
In what format does the SQL query return a result?
A.XPath syntax
B.ResultSet object
C.A String separated by colons
D.An array of results
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
65
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
66
"SQL injection attacks" have been responsible for many cases of data theft.One of the solutions for preventing these attacks 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
67
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
68
Database tables store rows that contain the following except
A.strings
B.fundamental data types
C.arbitrary objects
D.numbers
Title
Database tables store rows that contain the following excep
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
69
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
70
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.
Title
What to do when you are done with the Statement objec
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
71
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
72
What is the main purpose of the Connection object?
A.Accesses a database from a Java program
B.Combines multiple data tables
C.Skips the loading step of the database driver class
D.Manually loads the database driver class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
73
An important part of database processing is transaction handling.What is a transaction?
A.A set of data that is translated into the required language and then added to the database
B.A set of database transfers to another database
C.A set of database updates that may have some parts successful
D.A set of database updates that should either succeed fully or not happen at all
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 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
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
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.