Tags: MySQLThis article mainly introduces the query syntax of MySQL in Where,group by, order BY, Limit,join,union, union All, child table and so on.Test data preparationCREATE TABLE EMP (empno numeric (4) NOT NULL, ename varchar, job varchar (9), Mgr Numeric (4), hired
Ate datetime, Sal numeric (7, 2), Comm Numeric (7, 2), Deptno numeric (2));
CREATE TABLE Dept (deptno Numeric (2), dname varchar, loc varchar (13));
CREATE TABLE Salgrade (grade numeric, losal numeric, hisal numeric);
INSERT IN
Recently practiced a SQL to share to everyone,First on the topic:--Department tableCREATE TABLE DEPT (DEPTNO INT PRIMARY KEY,--Department numberDname VARCHAR (14),--Department nameLOC VARCHAR (13)); --Department AddressINSERT into DEPT VALUES (' ACCOUNTING ', ' NEW YORK ');INSERT into DEPT VALUES ("DALLAS");INSERT into DEPT VALUES (' SALES ', ' CHICAGO ');INSERT into DEPT VALUES (+, ' OPERATIONS ', ' BOSTON ');--Employee tableCREATE TABLE EMP(EMPNO IN
of rows */ProcSQL Noprint; Select Count(*) into: NumRows fromSasuser.schedulewhere Year(begin_date)=2002;%Let NumRows=NumRows; / * Eliminate the blanks * /%Put there isNumRows Coursesinch 2002; SelectCourse_code, location, begin_date format=Mmddyy10. into: CRSID1-: Crsidnumrows,:p Lace1-:p Lacenumrows,:d ate1-:d ateNumRows fromSasuser.schedulewhere Year(begin_date)=2002 Order bybegin_date;%put _user_;quit;CreateOne macro variable that would Hold all values of a certain data set var
Some sub-queries
select empno, ename from emp where mgr in
(select empno from emp where job=‘MANAGER‘);
select * from dept where Deptno not in ( select distinct deptno from EMP
select * from dept where deptno not in (select deptno from emp);
select empno, ename, sal from emp where mgr=
(select empno from emp where ename=‘SCOTT‘);
select * from emp where sal > 1.4*
(select avg(sal) from emp);
insert into dept(deptno, d
mydept; synonyms have been deleted. SQL> Select * frommydept; # #删除共有同义词, the private ones are still there DEPTNO dname LOC---------- -------------- ------------- TenACCOUNTING NEW YORK -DALLAS -SALES CHICAGO +OPERATIONS Bostonsql> Dropsynonym mydept; synonyms have been deleted.SQL> Select * frommydept;Select * frommydept*Section1line error: ORA-00942: Table or view does not existTo view a synonym view:Sql> Select * fromuser_synonyms; Synon
executed 3 times and 1 times respectively, indicating that the execution plan was reused.3.2 Execution of the following 3 statements select * person.address where addressid = 1 go select * from person.address Span style= "color: #0000ff;" >where addressid = 2 go select * from Person.Address where addressid = 3 go As a result, a plan cache is generated for each adhoc query, respectively3.3 Perform the following parameters query 2 timesexec sp_executesql n'select * from perso
The RowType types in PL/SQL are very useful and flexible, and now find RowType in INSERT and UPDATE statements that can save a lot of code, especially when it comes to copy and update. In Google's search results, I look at the foreign language to see the dizzy dizzy when found, surprise Ah! There is no such book in the Oracle's official website, and I don't know how.DeclareV_dept Dept%rowtype;BeginV_dept.deptno: = 60;V_dept.dname: = ' sample ';V_dept.loc: = ' Chicago ';INSERT INTO dept values V_
by changes in the table structure.Records can be assigned as a wholeRowType ReferenceRowType Reference Read data into the RowType type Create table testtable ();R Testtable%rowtype; Select * into R from TestTable where pno= ...;RowType type data into the table Insert into Testtable2 values r;
-----------------------------------------------------
-----------------------------------------------------DECLARE v_dept Dept%rowtype; begin V_dept.deptno: = ;V_dept.dname: = ' sample '; V_dept.loc: =
Label:First, the conceptModel Model:
A model that describes relational data. is a set of data stores that are stored in a specific technology, such as Oracle. For example, when the technology is Oracle, the scheme corresponding to the database
DataStore: Data Storage
A model contains metadata that corresponds to a table or view in the scheme in which the model resides. Can be imported from a real environment via reverse engineering (reverse-engineered) or created in ODI
---------- -------------- ------------- Ten ACCOUNTING NEW YORK DALLAS SALES CHICAGO OPERATIONS BOSTON Sql> *************************************************************************************************************** **************************** Analysis of data pump export data in oracle10g *************************************************************************************************************** **************************** The data pump in
Backup and recovery MongoDB1makesureallprocesswhichiswritingmongodbarestopped. 2dumpdatabasefromGAMONGODB81sudo. mongodump -- hostgamongodb91: 27017 -- usernameGAEditor -- password9AEd! T0r -- outdataBondPrice_backup3compressback
Backup and recovery MongoDB 1 make sure all process which is writing mongodb are stopped. 2 dump database from GAMONGODB81 sudo./mongodump -- host gamongodb91: 27017 -- username GAEditor -- password 9AEd! T0r -- out/data/BondPrice_backup 3 compress back
Back up and r
"Flash ".After a vro is opened for several seconds, a boot message is sent to the console. 4. This message is displayed on Dallas, A 2520 router. Figure 4In Figure 4, based on the report of this message, it has found and started the boot software. Boot software may be located in two locations on the vro: read-only memory (ROM) or boot flash memory. For vrouters of the 2500 series, the boot software is stored in the ROM.In the figure, the message sho
supports common file formats, this universal interface makes it easy to transfer data between different systems.
Among the three commands, export is the simplest. Because data is transferred from a table to a file, there is usually no error or illegal data.
Before explaining commands, first introduce the file format.
1. asc -- a non-bounded ascii file, which is an ascii plain stream. The rows in the data stream are separated by line delimiters, and each column in the row is defined by the start
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.