A table (t1) contains 1000 random integer values in the first column (col1). The random values range from 1 to 1000.
You execute this query:
SELECT col1 FROM t1 WHERE col1< 100
UNION
SELECT col1 FROM t1 WHERE col1 BETWEEN 100 and 200
UNION ALL
SELECT col1 FROM t1 WHERE col 1 >=900
What is the output?
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?
Consider the query and its output:
Mysql> SELECT Language As Lang FROM countrylanguage
->WHERE countrycode ='GBR';
A user wants to have an output as shown:
What query would achieve this?
Inspect the query:
Mysql>SELECT dept_no, emp_no FROM employees JOIN dept _manager USING(emp_no) WHERE dept_no'd004';
4 rows in set (0.00 sec)
Mysql>EXPLAIN SELECT dept_no, emp_no FROM employees JOIN dept_manager USING (emp_no) WHERE dept_no='d004';
2 rows in set (0.00 sec)
Which two statements are true about the EXPLAIN output?