Cormcctor/Net supports a decoupled database connection mode, where a database Connection is established only when needed.
'
Choose the three parts that are involved when working with decoupled data.
Assume your connection uses SQL mode ANSI_QUOTES.
Which two statements cause a syntax error?
As a developer, you inherit this table as part of a project:
CREATE TABLE exam (
Exam_id INTEGER UNSIGNED NOT NULL PRIMARY KEY,
Examinee_id INTEGER UNSIGNED UNIQUE,
Score INTEGER UNSIGNED
)
What change should you make to ensure that examinee_id is an integer value throughout the table?
Inspect the SELECT query:
Mysql> EXPLAIN SELECT employees. Emp_no, first_name, last_name FROM employees JOIN title WHERE to_date > ‘2008-10-11’;
2 rows in set (0.00 sec)
Which action will optimize the query?
Consider the structures of the country and countrylanguage tables.
mysql >DESCRIBE country;
mysql> DESCRIBE countrylanguage;
Which query will give you the list of all European countries where German is spoken?
Consider the my_table table with two integer columns, a and b, and the contents as shown;
Mysql > SELECT a, b FROM my_table;
1 row in set result of this query?
SELECT a—b
FROM my_table;
When executing a stored routine, how is the SQL_MODE determined?
You want to compare all columns of table A to columns with matching names in table B. You want to select the rows where those have the same values on both tables.
Which query accomplishes this?
Given the table City:
SELECT Name
FROM City
WHERE CountryCode = ‘USA” OR WHERE CountryCode= ‘JPN’
What does this statement procedure?
These there tables represent a many –to-many relationship in asocial networking database:
This query draft is constructed to report for the past 30 days:
Which change will correct this query?
Consider the CREATE FUNCTION statement:
CREATE FUNCTION countrycount ()
BEGIN
DECLARE count INT;
SELECT COUNT (*) INTO count FROM country;
RETURN count ;
END
What is the outcome when you try to create the function?
The city table has the following structure:
Consider the statement with an incorrect field name:
PREPARE countryBYID FROM ‘SELECT country FROM city WHERE ID=?,
What happens if a prepared statement named countryByID already exists when the above statement is executed?
Examine this table that contains over two million rows of data:
CREATE TABLE ‘news_feed’ (
.id’bigint (20) NOT NULL AUTO _INCREMENT,
.news _sources_id’varchar (11) NOT NULL,
.dataline’ datetime NOT NULL,
.headline’ varchar (256) NOT NULL,
.story’ text NOT NULL,.tag varchar (32768) DEFAULT NULL,
PRIMARY KEY (‘id’)
KEY ‘dateline’ ( ‘dateline’)
)
Examine this query that returns 332 rows of date:
SELECT *
FROM news_feed
WHERE DATE(dateline)= ‘2013-01-01’
Which change would show the greatest improvement in the response time of the query?
You wish to create a trigger on the ‘city’ table that will check the value of the ‘District’ field before any INSERT. The trigger needs to change it to” Unknown” for an empty string or NULL.
CREATE TRIGGER City_bi
BEFORE INSERT ON CITY
FOR EACH ROW
BEGIN
IF OLD. District IS NULL OR OLD.District= . .
THEN
SET NEW.District=’Unknown’;
END IF :
END;
Does the CREATE TRIGGER statement accomplish this goal?
You have a database ‘dev’ that contains 15 tables, all of which use the CHARACTER SET ‘utfs’ and the COLLATION ‘utfs_general_ci’.
You perform the command:
ALTER DATABASE ‘dev’ CHARACTER SET =’latin’ COLLATION=’latin1’_swedish_ci’
What is the result?