参考答案和解析
答案:B
更多“( 难度:中等)Mysql按照姓名降序排列用哪个语句?A.ORDER BY DESC NAME   B.ORDER BY NAME DESC  C.ORDER BY NAME ASCD.ORDER BY  ASC NAME”相关问题
  • 第1题:

    已知关系:学生(学号,姓名,年龄),如果按年龄降序列出所有学生,并且相同年龄的学生按姓名升序排列。则排序子句应该是( )。

    A.ORDER BY年龄,姓名

    B.ORDER BY姓名,年龄

    C.ORDER BY年龄DESC,姓名

    D.ORDER BY姓名,年龄DESC


    正确答案:C
    解析:ORDERBY语句默认为升序排列,对年龄降序排列需要在列名之后加上DESC来标志,因此选项C为正确答案。

  • 第2题:

    连接MySQL后选择需要的数据库DB_NAME?以下哪些方法是对的()

    A、连接后用USEDB_NAME选择数据库

    B、连接后用SETDB_NAME选择数据库

    C、用mysql-hhost-uuser-pDB_NAME连接数据库

    D、用mysql-hhost-uuser-p-TDB_NAME连接数据库


    答案:AC

  • 第3题:

    Person p = new Person(“张三”,23);这条语句会调用下列哪个构造方法给属性进行初始化()

    A.public Person(){}

    B.public Person(String name,int age) { this.name = name; this.age = age; }

    C.public Person(int age,String name) { this.age = age; this.name = name; }

    D.public Person(String name) { this.name = name; }


    答案:B
    解析:创建对象时会找到匹配的构造方法给属性进行初始化,由于Person p = new Person(“张三”,23);这条语句中有两个参数,而且第1个参数是String类型的,第2个参数是int类型的,因此会调用B选项中的构造方法。

  • 第4题:

    连接MySQL后选择需要的数据库DB_NAME?以下哪些方法是对的()

    • A、连接后用USEDB_NAME选择数据库
    • B、连接后用SETDB_NAME选择数据库
    • C、用mysql-hhost-uuser-pDB_NAME连接数据库
    • D、用mysql-hhost-uuser-p-TDB_NAME连接数据库

    正确答案:A,C

  • 第5题:

    现有学生住处表Student_info,其中包括姓名(stu_name),学号(stu_id),成绩(stu_grade)。我们需要查询成绩为80分的学生姓名,要求结果按照学号降序排列。下面查询语句正确的是()。

    • A、SELECT stu_name FROM student_info Where stu_grade=80 ORDER BY stu_id ASC;
    • B、SELECT stu_name FROM student_info WHERE stu_grade=80 ORDER BY stu_id DESC;
    • C、SELECT stu_id,stu_name FROM student_info WHERE stu_grade=80 ORDER BY stu_name ASC;
    • D、SELECT stu_name FROM student_info WHERE stu_grade LIKE 80 ORDER BY stu_id DESC;

    正确答案:B

  • 第6题:

    Evaluate these two SQL statements: SELECT last_name, salary , hire_date FROM EMPLOYEES ORDER BY salary DESC; SELECT last_name, salary, hire_date FROM EMPLOYEES ORDER BY 2 DESC; What is true about them?()

    • A、The two statements produce identical results.
    • B、The second statement returns a syntax error.
    • C、There is no need to specify DESC because the results are sorted in descending order by default.
    • D、The two statements can be made to produce identical results by adding a column alias for the salary column in the second SQL statement.

    正确答案:A

  • 第7题:

    单选题
    Given the following query:SELECT last_name, first_name, age, hire_date FROM employee WHERE age > 40Which of the following clauses must be added to return the rows sorted by AGE, oldest first, and by LAST_NAME, from A to Z?()
    A

    SORT BY age ASC, last_name

    B

    SORT BY age DESC, last_name

    C

    ORDER BY age DESC, last_name

    D

    ORDER BY age ASC, last_name


    正确答案: C
    解析: 暂无解析

  • 第8题:

    单选题
    按照姓名升序排列()。
    A

    ORDER BY DESC NAME

    B

    ORDER BY NAME DESC

    C

    ORDER BY ASC NAME

    D

    ORDER BY NAME ASC


    正确答案: B
    解析: 暂无解析

  • 第9题:

    单选题
    按照姓名升序排列()。
    A

    ORDER BY DESC NAME

    B

    ORDER BY NAME DESC

    C

    ORDER BY ASC NAME

    D

    ORDER BY NAME ASC


    正确答案: D
    解析: 暂无解析

  • 第10题:

    单选题
    现有学生住处表Student_info,其中包括姓名(stu_name),学号(stu_id),成绩(stu_grade)。我们需要查询成绩为80分的学生姓名,要求结果按照学号降序排列。下面查询语句正确的是()。
    A

    SELECT stu_name FROM student_info Where stu_grade=80 ORDER BY stu_id ASC;

    B

    SELECT stu_name FROM student_info WHERE stu_grade=80 ORDER BY stu_id DESC;

    C

    SELECT stu_id,stu_name FROM student_info WHERE stu_grade=80 ORDER BY stu_name ASC;

    D

    SELECT stu_name FROM student_info WHERE stu_grade LIKE 80 ORDER BY stu_id DESC;


    正确答案: C
    解析: 暂无解析

  • 第11题:

    单选题
    关于查询中列的别名, 以下()语句是不正确的
    A

    Select name as’姓名’from table

    B

    Select name as姓名from table where id=1

    C

    Sleect name=姓名from table姓名=names(正确答案)

    D

    Select names姓名from table


    正确答案: A
    解析: 暂无解析

  • 第12题:

    单选题
    Given the following query:SELECT last_name, first_name, age, hire_date FROM employee WHERE age > 40Which of the following clauses must be added to return the rows sorted by AGE, oldest first, and by LAST_NAME, from A to Z?()
    A

    SORT BY age ASC, last_name

    B

    SORT BY age DESC, last_name

    C

    ORDER BY age DESC, last_name

    D

    ORDER BY age ASC, last_name


    正确答案: A
    解析: 暂无解析

  • 第13题:

    MySQL中用DROP语句可删除数据库和数据表,以下哪句是正确的语法?()

    A、DROPTABLEtable_name1

    B、DROPTABLEtable_name1,table_name2

    C、DROPTABLEIFEXISTStable_name1

    D、DROPDATABASEDBname1


    答案:ABCD

  • 第14题:

    Given the following query:SELECT last_name, first_name, age, hire_date FROM employee WHERE age >40Which of the following clauses must be added to return the rows sorted by AGE, oldest first, and by LAST_NAME, from A to Z?()

    A.SORT BY age ASC, last_name

    B.SORT BY age DESC, last_name

    C.ORDER BY age DESC, last_name

    D.ORDER BY age ASC, last_name


    参考答案:C

  • 第15题:

    Given the following query:SELECT last_name, first_name, age, hire_date FROM employee WHERE age > 40Which of the following clauses must be added to return the rows sorted by AGE, oldest first, and by LAST_NAME, from A to Z?()

    • A、SORT BY age ASC, last_name
    • B、SORT BY age DESC, last_name
    • C、ORDER BY age DESC, last_name
    • D、ORDER BY age ASC, last_name

    正确答案:C

  • 第16题:

    按照姓名升序排列()。

    • A、ORDER BY DESC NAME
    • B、ORDER BY NAME DESC
    • C、ORDER BY ASC NAME
    • D、ORDER BY NAME ASC

    正确答案:D

  • 第17题:

    Evaluate these two SQL statements: SELECT last_name, salary , hire_date FROM EMPLOYEES ORDER BY salary DESC; SELECT last_name, salary , hire_date FROM EMPLOYEES ORDER BY 2 DESC; What is true about them?()

    • A、The two statements produce identical results.
    • B、The second statement returns a syntax error.
    • C、There is no need to specify DESC because the results are sorted in descending order by default.
    • D、The two statements can be made to produce identical results by adding a column alias for the salary column in the second SQL statement.

    正确答案:A

  • 第18题:

    Evaluate these two SQL statements: SELECT last_name, salary , hire_date FROM EMPLOYEES ORDER BY salary DESC; SELECT last_name, salary, hire_date FROM EMPLOYEES ORDER BY 2 DESC; What is true about them? ()

    • A、The two statements produce identical results.
    • B、The second statement returns a syntax error.
    • C、There is no need to specify DESC because the results are sorted in descending order by default.
    • D、The two statements can be made to produce identical results by adding a column alias for the salary column in the second SQL statement.

    正确答案:A

  • 第19题:

    多选题
    连接MySQL后选择需要的数据库DB_NAME?以下哪些方法是对的()
    A

    连接后用USEDB_NAME选择数据库

    B

    连接后用SETDB_NAME选择数据库

    C

    用mysql-hhost-uuser-pDB_NAME连接数据库

    D

    用mysql-hhost-uuser-p-TDB_NAME连接数据库


    正确答案: B,D
    解析: 暂无解析

  • 第20题:

    单选题
    Given the following query:SELECT last_name, first_name, age, hire_date FROM employee WHERE age > 40Which of the following clauses must be added to return the rows sorted by AGE, oldest first, and by LAST_NAME, from A to Z?()
    A

    SORT BY age ASC, last_name

    B

    SORT BY age DESC, last_name

    C

    ORDER BY age DESC, last_name

    D

    ORDER BY age ASC, last_name


    正确答案: C
    解析: 暂无解析

  • 第21题:

    单选题
    Given the following query:SELECT last_name, first_name, age, hire_date FROM employee WHERE age > 40Which of the following clauses must be added to return the rows sorted by AGE, oldest first, and by LAST_NAME, from A to Z?()
    A

    SORT BY age ASC, last_name

    B

    SORT BY age DESC, last_name

    C

    ORDER BY age DESC, last_name

    D

    ORDER BY age ASC, last_name


    正确答案: B
    解析: 暂无解析

  • 第22题:

    单选题
    关于查询中列的别名, 以下()语句是不正确的
    A

    Select name as’姓名’from table

    B

    Select name as姓名from table where id=1

    C

    Sleect name=姓名from table姓名=names(正确答案)

    D

    Select names姓名from table


    正确答案: C
    解析: 暂无解析

  • 第23题:

    多选题
    连接MySQL后选择需要的数据库DB_NAME?以下哪些方法是对的()
    A

    连接后用USEDB_NAME选择数据库

    B

    连接后用SETDB_NAME选择数据库

    C

    用mysql-hhost-uuser-pDB_NAME连接数据库

    D

    用mysql-hhost-uuser-p-TDB_NAME连接数据库


    正确答案: A,D
    解析: 暂无解析

  • 第24题:

    多选题
    连接MySQL后选择需要的数据库DB_NAME?以下哪些方法是对的()
    A

    连接后用USEDB_NAME选择数据库

    B

    连接后用SETDB_NAME选择数据库

    C

    用mysql-hhost-uuser-pDB_NAME连接数据库

    D

    用mysql-hhost-uuser-p-TDB_NAME连接数据库


    正确答案: D,B
    解析: 暂无解析