Group functions: Processing a set of data, returning a value for each set of data
Common group functions: Count () avg () max () min () sum ()
Count () function1. Count (*): Returns the total number of rows without removing null values2. Count (column): Returns the number of non-null rowsSelect from EMP; Count (*) Count (SAL) count (COMM)------------------------------- 43. Except for the count (*) exception, the other group
1. Select * from EMP;
2. Select Empno, ename, job from EMP;
3. Select empno number, ename name, job work from EMP;
4. Select Job from EMP;
5. Select distinct job from EMP;
6. Select distinct empno, job from EMP;Note: Because the employee number is not duplicated, it is not possible to eliminate duplicate columns by proving that all the columns are not duplicated at this time.
7. Query the employee's number, name, work, but display the format: 7369 employee, name is: Smith, work is: clearSe
Label:querying an existing database: select name from V$database;Unlock users Scott:alter user scott account unlock; Normal user connection: Conn Scott default password: Tiger General Administrator: System/system Super admin: Sys/sysdisconnecting: DisconnectCurrent User: Show user View all objects under the user: the SELECT * from Tab;dual table is a virtual table within Oracle, with many magicalsingle-line functionFuzzy Query% represents 0 or more characters _ represents a character for a speci
result is displayed:
This is the SQL statement tracked by the SQL profile.
The injection code is as follows:
select COUNT(*) from Users where Password = 'a' and UserName = 'b' or 1=1—'
Here, someone sets UserName to"B 'or 1 = 1-".
The actual executed SQL statement is changed to the following:
We can see that SQL injection is successful.
Many people knowParameterized QueryThe above injection problems can be avoided, such as the following code:
Class Program {private static string connect
With the popularity of Ajax, Ajax is now widely used in projects. It can be said that AJAX is widely used. It is difficult to manage because of a large number of Ajax requests. As a result, we often send requests in a unified manner, with a unique page or portal. So there are the following similarCode:
Public Partial Class Ajax: system. Web. UI. Page { Protected Void Page_load ( Object Sender, eventargs e ){ String Comm = request ["
:
The authentication method must be "forms" (Authentication mode = "forms ").
Add a custom provider named accessmembershipprovider by using the
When the requiresquestionandanswer attribute is set to true, it indicates that the question and answer to be answered must be entered during new registration.
Connectionstring, indicating the connection string for database connection.
Defaultprovider attribute, indicating which provider is used by the system by default, because multiple provid
command Using (Sqlitecommand comm = Conn. createcommand ()) { // Open Database Link Conn. open (); // Insert data Comm. commandtext = " Insert into [T] values (10, 'Hello 9 ') " ;Comm. executenonquery (); // Update Data Comm. commandtext = " Update [T] Set Name = 'Hello 10' where id
are directories, recursion applies to each file and directory. 1.2 comm syntax: comm [-123] file1 file2 note: this command compares two sorted files. File1 and file2 are sorted files. Comm reads the two files and generates three output columns: only the rows that appear in file1, only the rows that appear in file2, and the rows that exist in both files. If the f
% ';3.5 query student records whose names contain the letter ""Select * from stu where sname like '% a % ';//-----------------------------------------------------------------4.1 remove duplicate recordsKeywords: distinct => remove duplicate Query Result Records.Select gender from stu ;=> a large number of repeated records appearSelect distinct gender from stu; => remove duplicate records4.2 view the sum of the employee's monthly salary and CommissionSelect sal * 12 +
1. Without GUI1.1 diff
Diff can compare two foldersSyntax: diff [Option] file1 file2 Description: This Command tells you which lines of file1 and file2 need to be modified to make the two files consistent. If "-" is used to represent file1 or fiie2, it indicates the standard input. If file1 or file2 is a directory, diff compares the files with the same name in the directory. Example: diff/usr/xu mine
The options are as follows:
-B ignores the spaces at the end of the line, and one or more space
Makefile and makefile are equivalent.
$ MV makefile
$ Make
Gcc-C main. c
Gcc-C Liu. c
Gcc-C generatedatafile. c
Gcc-G main. O Liu. O generatedatafile. O-o Liu
-L/usr/local/MySQL/lib/MySQL-lmysqlclient-LZ
Rm-f *. o
Makefile format
Depend
MAKEFILE file format -------- use the section (rule) as the basic structure
$ Cat makefileLibs =-L/usr/local/MySQL/lib/MySQL-lmysqlclient-LZALL: LiuCleanTwo sections of all dependLiu: Main. O Liu. oGeneratedatafile. oLiu dependGcc-G $? -
query Syntax:Select *| column name from table name where condition;9. Comparison operators> Greater than= equals>= greater than or equal to! = or 10.IS null and is NOT NULLFind employees who can get a monthly bonusSelect Empno,ename,comm from EMP where comm are NOT null;Inquire about employees without bonusesSelect Empno,ename,comm from emp where
Select Basic Query statementBasic query statements using tables from the Scott user in OracleSELECT * from EMP;--The number of the employee who listed the position as manager, name--Select Empno,ename from emp where job = ' MANAGER ';--like Fuzzy Query I don't know, either.SELECT * from EMP WHERE ename like '%*_% ' ESCAPE ' * ';--Finding employees with bonuses above their salariesSELECT * FROM EMP where comm>sal;--Find out the sum of each employee's s
minimum value from EMP;(3) To find out the total number of employeesSelect COUNT (*) as total number from EMP;(4) Query department number (remove duplicates)Select COUNT (Distinct DEPTNO) as sector number from EMP;(5) Row to columnSet line widthSet Linesize 200Name of employee in Col Department for A60Select Deptno as department number, the name of the employee in the Wm_concat (ename) as department from the EMP Group by DEPTNO;(6) Grouping function and null valueA, the average salary of the st
Tags: performance comm foreground position stage merge type Insert GlobalIndex, index creation, modification, deletion2007-10-05 13:29 Source: User reviews 0 Views 2986IndexAn index is an object in a relational database that is used to hold each record, and the main purpose is to speed up the reading speed and integrity checks of the data. Indexing is a highly technical and demanding task. Generally in the database design phase with the database struc
Routine collection of commonly used SQL query statements and SQL statements
Common SQL query statements are as follows:
1. Simple query statements
1. view the table structure
SQL> DESC emp;
2. query all columns
SQL> SELECT * FROM emp;
3. query specified Columns
SQL> SELECT empmo, ename, mgr FROM emp;
SQL> SELECT DISTINCT mgr FROM emp; only items with different results are displayed
4. query the specified row
SQL> SELECT * FROM emp WHERE job = 'cler ';
5. Use arithmetic expressions
SQL> SELECT en
name), MIN (column name)
5.2 NVL (exp1, exp2)
If exp1 is NULL, exp2 is used. Same as isNull () in SQL Server.
Example: Calculate the income of each person in the emp table (salary + bonus)
SELECT sal + NVL (comm, 0) FROM emp;
Note:
SELECT t. *, rownum from emp t order by sal + NVL (comm, 0 );
Use the ROWNUM semicolon before sorting. The result will cause ROWNUM confusion.
5.3 NVL (exp1, exp2, exp3)
If exp1
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.