Fortune Telling Collection - Ziwei fortune-telling - Query the number of students surnamed Qian with sql.

Query the number of students surnamed Qian with sql.

Use sql statements to complete the following functions:

1. Establish the database as school and activate the currently newly created database.

2. Table creation: it is stated in the definition that 1) each table must have a primary key; 2) The gender of students can only be' male' or' female'; 3) The student name cannot be empty; 4) The foreign key system name is created in the table class; 5) The system codes of related table departments cannot be duplicate or blank.

3. Insert the following data table: 10 1, Software, Computer, 2003, 102, Microelectronics, Computer, 2004, Student Table: 8 10 1, Zhang San, male. 12 1, Zhejiang,1984,8103, Wang Ling, female, 13 1, Fujian,1985,8/kloc.

4. Complete the following query functions: 1) query the student numbers, names and genders of all students, 2) query the student records from Fujian, 3) query the student names and calculate the student ages, 4) fuzzy query the records of girls surnamed Qian, 5) calculate the total number of all students by using aggregation function and alias them as the number of students, and 6) query the information of all classes and sort them in descending order of class numbers. 7) Update the name of the student whose student number is 8 103 to Zhang Ling; 8) Find the information of students whose student numbers are between 8 10 1 to 8 103; 9) Delete the student record with Li Fei's name; 10) Delete data table students.