A04 - 007, database table contents of the operation - check

Disclaimer: This article is a blogger original article, shall not be reproduced without permission. https://blog.csdn.net/weixin_42464054/article/details/91129705

0, this chapter outlines the learning catalog - search

Beginner consuming: 1h

Note: CSDN end of the phone does not support chapter jumps within the chain, but the chain is available, also requested a better experience on the PC side.

First, the database table contents of the operation - Charles
  1.1 to create the database and to insert data in database tables.
  1.2 query all the information students.
  1.3 query all the student's name and achievements.
  1.4 lookup table is equal to 24 years older than the student information.
  1.5 Query age is not 25-year-old student.
  1.6 Query age> 23, and scores> 80 students of information.
  1.7 student information query performance between 80 to 100 (inclusive).
  1.8 student information query performance between 80 to 100 (inclusive).
  1.9 Query students aged 18,23,25 of information.
  1.10 All student information queries containing "rock" of.
  1.11 trainees inquiry no birthday information. Is the birthday is null.
  1.12 Query age student information. Age is not empty.
  1.13 Show unique age.
  1.14 pairs score after sorting output.
  1.15 output sorted in descending order of age (in descending order) of.
  1.16 pairs of students sorted in descending order of age, the same age, according to the results in descending order.
  1.17 points to the age and aliases.
  1.18 omit key as the query again.

Second, the face questions
    2.1 above SQL statements What is the difference?



  • 1, A04 series full set of network disk resources:

Beverage giant comfort zone Akzo  ||  ♂ ♀ tired feel no love





First, the database table contents of the operation - check

  1.1 to create the database and to insert data in database tables.

create database day02;

use day02;

create table student(
	id int primary key auto_increment,
    name varchar(32) not null,
	age int ,
	gender varchar(10) not null,
	score double not null,
	birthday date
);

insert into student (id,name,age,gender,score,birthday) values(null,'zhangsan',23,'male',98.99,'1990-09-09');
insert into student (id,name,age,gender,score,birthday) values(null,'lisi',23,'男',56.99,'1990-02-09');
insert into student (id,name,age,gender,score,birthday) values(null,'王五',24,'女',75.99,'1988-01-01');
insert into student (id,name,age,gender,score,birthday) values(null,'赵六',25,'男',80.99,'1980-11-12');
insert into student (id,name,age,gender,score,birthday) values(null,'柳岩',null,'女',84,null);

  1.2 to query all the information students.

Query visualization tools in general.

select * from student;

  1.3 to query all the student's name and achievements.

select name,score from student;

  1.4 ~ lookup table is equal to 24 years older than the student information.

select * from student where age >= 24;

  1.5 to queries age is not 25-year-old student.

select * from student where age != 25;
select * from student where age <> 25;

  1.6 to queries age> 23, and scores> 80 students of information.

select * from student where age>23 and score>80;

  1.7 to student information query performance between 80 to 100 (inclusive).

select * from student where score >= 80 and score <=100;

  1.8 to student information query performance between 80 to 100 (inclusive).

select * from student where score>=80 and score<=100;
select * from student where score between 80 and 100;

  1.9 to query students aged 18,23,25 of information.

select * from student where age=18 or age=23 or age=25;
select * from student where age in(18,23,25);

  1.10 to query all student information containing "rock" of.

select * from student where name like '%岩%';

  1.11 ~ inquiry no birthday student information. Is the birthday is null.

select * from student where birthday is null;

  1.12 ~ queries student information age. Age is not empty.

select * from student where age is not null;

  From 1.13 to show no repeat of age.

select distinct age from student;

  1.14 ~ to score after sorting output.

select * from student order by score asc;

select * from student order by score desc;

  1.15 to sort the output of age in descending order (descending order) of.

select * from student order by age desc;

  1.16 - for students of all ages in descending order, of the same age in accordance with the results in descending order.

select * from student order by age desc,score desc;

  1.17 to score to age and aliases.

select age as 年龄,score as 分数 from student;

  1.18 ~ omitted key as the query again.

select age 年龄,score 分数 from student;


Then the less harsh, less impulsive self-willed things to do.

- - - - - - - - - - - - - - - - - - - - - - - - - - - -


Second, face questions

  2.1 to the above SQL statements What is the difference?

1、select age , score from student;
2、select age score from student;

alt
alt

Sql query two first sentence, second sentence sql only one, score an alias.


Then the less harsh, less impulsive self-willed things to do.

- - - - - - - - - - - - - - - - - - - - - - - - - - - -



^ At this point, the contents of the database table operation - check is completed.


- - - - - - - - - - - - - - - - - - - - - - - - - - - -


※ worldly temptations so great that the firm always moved.

Establish a normal TCP connections require () steps, normally closed () steps a TCP connection needs?


A、3,3
B、3,4
C、4,4
D、4,3

B
alt



Then the less harsh, less impulsive self-willed things to do.

- - - - - - - - - - - - - - - - - - - - - - - - - - - -


Note: CSDN end of the phone does not support chapter jumps within the chain, but the chain is available, also requested a better experience on the PC side.

I know my weakness, I know what you are picky, but I just I do not like fireworks, thank you for pointing, creating a piece of me :)!



Then the less harsh, less impulsive self-willed things to do.


Guess you like

Origin blog.csdn.net/weixin_42464054/article/details/91129705