A statement exists that can duplicate the definition of the ‘world’table.
What is missing?
CREATE TABLE t1 ___________world
Inspect the query:
Mysql> SELECT count (emp_no) FROM titles WHERE title = ‘senior staff’;
How can this query be optimized?
Assume your connection uses SQL mode ANSI_QUOTES.
Which two statements cause a syntax error?
A table (t1) contains 1000 random integer values in the first column (col1).The random values are in the range of 0-1000.
Examine this query:
SELECT col1 FROM t1 WHERE col1 <=100 UNION
SELECT col1 FROM t1 WHERE col1 >=900 ORDER BY col1 DESC
What is the expected output?
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?