Which two functions can be used in a C program to retrieve information about warning? (Choose two.)
mysql_info
mysql_error
mysql_warning_count
mysql_errno
Correct answer: AB
Question 2
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?
Yes; the trigger works correctly.
No; FOR EACH ROW is invalid syntax.
No; the syntax should be CREATE TRIGGER city-bi ON city BEFORE INSERT….
No; the OLD keyword cannot be used in an INSERT trigger.
Correct answer: A
Question 3
The tab-delimited file”/tmp/people,txt contains:
This is the structure of the people table:
Which statement will load the first and last names into the Names column and the country into the country column?
LOAD DATA INFILE ‘/tmp/people.txt’INTO TABLE PEOPLE@First=$2. @Last=$3 @Country=$4
(CONCAT (@First, ‘ ‘,@Last) , @ Country)
LOAD DATA INFILE ‘/tmp/people.txt ‘ INTO TABLE People
@Skip=$1 , @ First=$2, @Last=$3, @ Country=4,
(CONCAT (@First, ‘ ‘ .@ Last) , @ Country)
LOAD DATA INFILE ‘/tmp/people.txt ‘INTO TABLE People
(@ Skip, @First , @Last, @Country
SET Name=CONCAT (@First, ‘ ‘,@Last)
LOAD DATA INFILE ‘/tmp/people,txt, INTO TABLE People.
(@Skip. @First, @Last, @Country)
Country=@country
It is not possible to load the data from the file/tmp/people.txt into the people table, as shown.