Missed Review Questions Flashcards
What API only supports one language?
DB-API
Several connections can exist at the same time T/F
True
Stored functions have no parameters T/F
False
What is embedded SQL syntax
Starts with EXEC SQL, follows normal syntax for SQL and ends with semi colon
Which database might have an unordered set of values?
MySQL
What is equijoin?
Condition is based on ‘=’ between columns of two tables
What is self-join?
Table join with itself to compare rows within same table
What is cross join?
Returns Cartesian product of two table (all possible row combinations)
What is non-equijoin?
Uses operators other than ‘=’ to compare the join like <, > etc
Which name refers to a single value selected by flightCursor?
airport
What is the only difference between multi-set and list
Elements are ordered in list types but not multiset
Which datatype is best for storing a cities population from dozen - 24 Million?
unsigned Integer
Does inserting into a table view require a primary key?
Yes, the primary key of the base table
What is the statement to add a column to a table?
ALTER TABLE tableName ADD ColumnName Datatype
Which statements shows all databases in a database system?
SHOW DATABASES;
Do you need to specify a primary key if it has the AUTO_INCREMENT qualifier?
No it will generate the value on its own
Programming languages fall into either ____ or ____ paradigms
imperative, declarative
Which of the following database programming techniques is commonly used with OOP?
API
An application may use a ___ API which in turn uses a ____ API to access unsupported data sources
primary, secondary
In DB APIs, ____ a query is a term used when compiling happens before executing the query
preparing
Given a connection object conn, the following connector /J code fragment executes the stored procedure. What XXX and YYY complete the code?
CallableStatement, registerOutParameter
____ allows a programmer to create an SQL query with a PREPARE statement at runtime
Dynamic SQL
Which of the following DB programming techniques is an extension of the SQL language that is typically used for DP applications?
Procedural SQL
Why would mysql.connector.connect() throw an exception in a connector/python program?
The function was called with a username that does not have access to the DB
A develop wants to create an application using PHP. Which of the following APIs can the developer use to interact with DB?
PDO
Which statement should replace XXX? There is a CREATE FUNCTION code with the line right above BEGIN missing
READS SQL DATA
DB queries are commonly implemented using a declarative programming language because of which two main reasons?
Easier programming and faster execution
The ____ method of the ____ class creates a connection object in connector
getConnection(), DriverManager
Assume that a DB connection is valid connection. What is the output of the code below?
No change on the teacher table because the dbQuery has not been executed with EXEC
Which statement is not an advantage of using a view table?
The creation of a new base table is always up to date
Refer to the stored procedure,what is the correct syntax to get the number of classes taught using a stored procedure call?
CALL TeacherClassLoad(45631, @numberOfClasses)
In order to run a program with Embedded SQL, the compiler ____
translates the SQL code to the host language first, and then to an executable program
The ___ keyword helps the compiler identify embedded SQL statements in a program
EXEC SQL
Which DB programming technique best matches - compiles and stores complex data processing tasks on the DB server
Procedural SQL
The ____ statement executes a query
OPEN
C contains control flow statements and SQL does not. This is an example of the ____ gap
paradigm
The EXEC sql keyword is used in procedural SQL T/F
False
A stored procedure is compiled every time the procedure is called T/F
False
A ___ determines how to process statements in a declarative language
compiler
What API is often used with the C# language?
ADO.NET
How does UNION work?
Union joins everything while removing duplicates
How does INTERSECT work?
Only returns rows that are in both lists
How does UNION ALL work?
Union all puts both tables together without removing duplicates
What is DB-API?
Python database API for interacting with databases
What is JDBC?
A Java API for connecting and interacting with APIs
Embedded SQL is commonly used in which language?
C
What is INTO in SQL?
Used to add new records into a table or to copy elements to a new table. Used with INSERT and SELECT respectively
____ languages do not explicitly specify how results are processed
Declarative
The ODBC API for the Java language consists of Java classes T/F
True
Procedural SQL is specified in the SQL standard T/F
True
A driver manager communicates with all drivers using the same commands T/F
True
What has become less popular with the rise of OOP?
Embedded SQL
To list all the contents from the PRODUCT table, you would use ____
SELECT * FROM PRODUCT
XML Schema improves and expands the DTD specification… T/F
True
A connection consists of a database address only T/F
False
Adding a FK constraint to a table only affects inserting new rows into the table
False
What are considered objects in a JSON file?
All things enclosed in curly braces {}
How do you add a UNIQUE constraint called UniqueNameMgr that ensures the name and ManagerID combination are unique?
CONSTRAINT UniqueNameMgr UNIQUE(Name, ManagerID)
How do you rename a column in a table?
CHANGE oldName newName
What kind of type is the following value (XML)?
Document
___ is the ISO standard that extends procedural SQL for use in stored procedures
SQL/PSM
MONEY is an example of a ____ type
Semantic
Which of the following DB programming techniques is an extension of the SQL language that is typically used for DB applications?
Procedural SQL
API defines ___ for applications written in a procedural programming language and ___ for applications in OOP
procedure calls, classes
A standardized spatial reference system is identified with a ___
SRID
What does SQL stand for?
Structured Query Language
Which type is complex?
JSON
In two dimensions, a minimum bounding rectangle is the ____
The smallest rectangle aligned with the X and Y axes that contains a spatial value
An Inventory view table is defined with a WHERE clause that specifies ShelfNumber = 25. An INSERT adds a new item to ShelfNumber 20. What
happens when the WITH CHECK OPTION is not specified in the CREATE VIEW statement?
The item appears in the base table but not in the view table.
Elements of the ____ type can be repeated and are not ordered
MULTISET
When using the fetch in a SELECT statement, each call to fetch) returns the next row from the result table. If it reaches the last row, the next returned value is __.
False
The PosgreSQL ARRAY type is an example of a ____ type
Collection
In ___ data, each element is named and element types are not explicitly declared
Semistructured
In the relational algebra, compatible tables have the sane ____
number of columns, columnNames, and datatypes
In MySQL, a column has a SET type with 16 possible elements. How many bytes does each column value require?
2