一、原题 View the Exhibit and examine the structure of the CUSTOMERS table. Evaluate the following SQL statement: SQL> SELECT cust_city, COUNT(cust_last_name) FROM customers WHERE cust_credit_limit > 1000 GROUP BY cust_city HAVING AVG(cust_credit_l…
一、原题 Where can subqueries be used? (Choose all that apply.) A. field names in the SELECT statement. B. the FROM clause in the SELECT statement. C. the HAVING clause in the SELECT statement. D. the GROUP BY clause in the SELECT statement. E. the WHERE…
排序 order by 列名 asc(默认) desc(降序)
查询所有学生记录 按年龄升序排列
select * from student order by age;
或者
select * from student order by age ASC;查询所有学生记录,按年级降序排序
select * from student order by age DESC;查询所有学生,按班级数字降序排序…
转载自:http://blog.163.com/hks_blog/blog/static/214926090201382225845920/ 在介绍GROUP BY 和 HAVING 子句前,我们必需先讲讲sql语言中一种特殊的函数:聚合函数,
例如SUM, COUNT, MAX, AVG等。这些函数和其它函数的根本区别…
一、原题 Where can sub queries be used? (Choose all that apply) A. field names in the SELECT statement B. the FROM clause in the SELECT statement C. the HAVING clause in the SELECT statement D. the GROUP BY clause in the SELECT statement E. the WHERE cla…
一、原题 View the Exhibit and examine the structure of the PROMOTIONS table. Examine the following two SQL statements: Statement 1 SQL>SELECT promo_category,SUM(promo_cost) FROM promotions WHERE promo_end_date-promo_begin…
一、原题 Which three statements are true about multiple-row subqueries? (Choose three.) A. They can contain a subquery within a subquery. B. They can return multiple columns as well as rows. C. They cannot contain a subquery within a subquery. D. They ca…
一、原题 View the Exhibit and examine the structure of the SALES table. The following query is written to retrieve all those product ID s from the SALES table that have more than 55000 sold and have been ordered more than 10 times. SQL> SELECT prod_id…
一、原题 Which statements are true regarding the WHERE and HAVING clauses in a SELECT statement?(Choose all that apply.) A. The HAVING clause can be used with aggregate functions in subqueries. B. The WHERE clause can be used to exclude rows after dividi…