There's nothing more to say, just look at the code:
#include void display (int array[], int size) { int i; for (i = 0; i { printf ("%d", Array[i]); } printf ("\ n"); } void Insert_sort (int array[], int size) { if (Size > 1) { Insert_sort (array, SIZE-1); Int temp = array[size-1]; int i; for (i = size-2 i >= 0; i) { if (temp { Array[i + 1] = Array[i]; } Else { break; } Array[i + 1] = temp; } int main () { int array[] = {4,1,5,2,8}; Inse
Select* fromTB12 limit offset 20; //20 rows starting from line 10th D: Sort Select* fromtb12 ORDER BY id desc; Big to small select* fromTB12 ORDER by ID ASC; Small to large Select* fromtb12 ORDER by age Desc,id desc; Priority first, if the data is the same at the beginning of the second starting from the size of the 10 data (sorted first in the Fetch data) Select* fromTB12 ORDER BY id DESC limit 10; E: Group:****select count (ID), part_id fromUserinfo5 GROUP by part_id; count Max min sum avgIf
Tags: image src delete address com ack name DDR tle (1): see if there is a job database in MySQL (2) change the storage engine of the user table to I myisam Because of the time in a hurry directly to look at the table on the SQL statement, now look at the topic requirements slowly change it Create a unique index named Index_uid on the UserID field and arrange it in descending order Create a multi-column index named Index_user on the username and passwd fields Create a full-text index n
Label:1. Query the teacher all units that are not duplicated depart column.2. Query all records of the student table in descending order of class.3. Query all records of the score table in CNO Ascending, degree descending order.4. Check the number of students in the "95031" class.5. Check the student number and course number of the highest score in the score table. (sub-query or sort)6. The query score is greater than 70, less than the Sno column of 90.7. Check the records of all students in cla
SbirthdayCheck the year of birth of sno=108, and check the record of the year of birth equal to this studentSelect Sno,sname,sbirthday from student where year (sbirthday) =(Select year (sbirthday) from student where sno= ' 108 ')--23, inquires "Zhang Xu" the student achievement which the teacher teaches. Three tables join up and then satisfy the condition Tname to Zhang XuSelect *from ScoreJoin Course on COURSE.CNO=SCORE.CNOJoin teacher on Course.tno=teacher.tnoWhere Teacher.tname= ' Zhang Xu '
1 Public"-//w3c//dtd XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >234567 89PHPTen One Try A { - $dsn= "Mysql:dbname=mydb;host=localhost"; MySQL is the driver name dbname database name host server address - the $pdo=NewPDO ($dsn, "root", "123"); Root database user name 123 database password - - } - Catch(pdoexception$e) + { - Echo"Connection error."$e-GetMessage (); + } A at //Enquiry - $sql= "SELECT * FROM Info"; - -
highest scores of students.Select Sno,cno,degree from Scorewhere degree= (select MAX (degree) from score)--43, inquiries and "Li June" with the sex of all the students of the sname.Select Sname from Studentwhere ssex= (select Ssex from student where Sname= ' Li June ')--44, inquiries and "Li June" with the same sex and classmates sname.Select Sname from Studentwhere ssex= (select Ssex from student where Sname= ' Li June ') and class= (select class from student where Sname= ' Li June ')--45, que
Tags: ack back log border student Ges open style Sam First step:win+r input cmd, open command Line window input mysql-h 127.0.0.1-u root-p The second step: to see if there is a database in the example database if there is a backup and then delete, and then create a database, enter the Create databases example; In show DATABASES, confirm that the database is created successfully. - The third step: create student and grade two tables, first use example; To select the example database, Enter th
duplicate ID more than three records, the complete query statement as follows:SELECT * FROM (select COUNT (ID) as count from table Group by ID) T where t.count>39. say the meaning of the following aggregate numbers: AVG, SUM, max, Min, Count, COUNT (*)AVG: AveragingSum: SumMax: Ask for maximum valueMin: Find minimum valueCOUNT (*): Returns all rowsKeyword meaningTransaction Transaction Trigger TRIGGER continue continue unique unqiuePrimary key primary key identity column identity foreign key fo
from emp order by SAL ASC; This is a small-to-large arrangement sal
Select Sal, HireDate from emp ORDER by Sal ASC, HireDate DESC; This is by Sal Row, if the same and then press HireDate from the big to the small row
Select Ename,job,sal from emp where Sal > N order by sal ASC; Now add the Where condition
Here are the exercises for the function:AVG (average)Count (Count)Max (max)MIN (minimum value)SUM (summation)14. Now ask all Sal's andSelect sum (SAL) from EMP;15. Ask how many peopleSe
First, the basic knowledge:Application Scenarios:1> application operation needs to save a series of data with a certain structure (text can be but storage efficiency is low)2> file type:. db (a database is a. db file)3> Path:/data/data/projectpackage/databases/xxx.db4> default other apps cannot access5> data is deleted when the app is uninstalledSqlite:A lightweight relational database server with small installation files (hundreds of k, embedded in Android), multi-os support, multi-lingual supp
Deptno = (select Deptno from department where dname = ' personnel office '); (5) Find the department director of "Wang Fang" department Select Manager from department where Deptno = (select Deptno from emp where ename = ' Wang Fang '); (6) inquiries with "Wang Fang" in the same department of other staff information SELECT * from emp where deptno = (select Deptno from emp where ename = ' Wang Fang ') and ename not to like ' Wang Fang '; (7) Establish a public view of all departments of the comp
employees in department 20thSELECT * from emp where SAL = (SELECT MAX (SAL) from emp where DEPTNO =) and DEPTNO = 20;--Check the average salary level for each department--You can use a subquery as a table to implement a multi-table association query--sql statement Execution process: From-->where-->group by--->having--->select--->order by--select ROUND (AVG (SAL)) Avg_sal from EMP WHERE avg_sal=2073; --Error--1. Get the average salary per departmentSELECT T.deptno,s.gradeFrom (SELECT deptno,roun
1, you must return a value2. Can only be called in an expressionSql> Create or Replace functionfun12 return Number 3 is 4V_sum_sal Emp.sal%type; 5 6 begin 7 Select sum(SAL) intoV_sum_sal fromEmpwhereDeptno=Ten; 8 returnv_sum_sal; 9 End; Ten /FunctionCreatedsql>SQL> Declare 4V_sumsal Emp.sal%type; 5 6 begin 7 8V_sumsal:=fun1; 9Dbms_output.put_line (v_sumsal);Ten One End;Functions with Parameters:In:Sql> Create or Replace functionfun12(V_deptnoinch Number)
'); INSERT into STUDENT values (' 8409 ', ' Zhao ', ' 18 ', ' 101 '); INSERT into STUDENT values (' 8510 ', ' Lily ', ' a ', ' 142 '); select * from STUDENT; select * from DEPARTMENT; SELECT * from class;/* (1) Find all students surnamed Li and sort by their age from small to large. */Select Sname name, Sage age from STUDENT WHERE sname like ' Li% ' order by Sage asc;/* (2) lists theThere are more than two professional names in the department. */Select Dname system name from CLASS C INNER join
Tags: define ACL command set override verify fine ROM BSPSelect Ename,column2 from Scott.emp; Input sal;/substitute scalar;SELECT * FROM tab;SELECT * from scott.emp where sal> sal; 2000SELECT * from Scott.emp where Ename=upper (' salary '); SCOTT;Define Col=commDefine viewing variablesSelect Ename,col from Scott.emp;Undefin col un-defined variablessal=sal is the equivalent of the Define command, the link is broken off.Set Verify off Check environment variable ~Oracle Variable
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.