Review before the test post interview [Database + Linux basic knowledge articles]

Mysql

1. Select statement

select conpany_id,company_name from company表 where
select * from 表 order by age DESC limit(0,5)
select * from 表 order by 字段

2. Delete the statement

delete from table where value and value

3. Insert statement

insert into table (field) values ​​(id=19,name='Xiaolong')

4. Update statement

update emp(table) set salary=salary*1.1 where dept_id in (select dept_id from dept where dept_name='human resources')
raise the salary of all members of the human resources department by 10%

5. Association query

左关联 select * from A left join B on A.aID = B.bID
右关联 select * from A right join B on A.aID = B.bID
内关联 select * from A inner join B on A.aID = B.bID

6. Statistics query

Query current companies with products, and the company id is greater than 1
select company_id, count(company_id) as company_ids, sum(company_id) as company_id_sum from sku group by company_id having company_ids> 1;

7. View

This piece can only be supplemented later. The basic requirements of large companies will need to be mastered at work.

Linux

Linux basic instructions

1. ls folder view the folder directory list
ll
ls -l display the detailed content of the file
ls -a display hidden files
ls -r reverse display (file name reverse display)
ls -l -r -t reverse display by time == ls- lrt display in chronological order

2. Cat file name to view the content of the current file (usually used to view files with less content)
tail displays the last ten lines, head displays the first ten lines
tail -f 20160921.logs: view the changing log
tail -3000 catalina.out: View the data
history of the first 3000 rows : View the list of used commands

3. cp copy
cp -p time copy
cp -a permissions, time copy
cp file1 file2 file3 dir: copy files file1, file2, file3 to the directory dir

4. mv file/folder path (A) file/folder path (B) modify A to B
mv /dirc /tmp move /dirc to the directory /tmp
mv file1 file2 file3 dir: file file1, file2, file3 Move to the directory dir

5. ps -ef|grep java - View the process that contains the process sent by Java
kill -9 Process id Kill the process with id 9

6, mkdir create directory rmdir delete empty directory
rm delete command

7. cd switch directory
cd-return to the previous file directory
cd …/ enter the upper-level directory
cd /etc enter the etc directory
cd ~: the current user's home folder

8. Transaction: one http message sending and receiving

9, tar -czvf package
tar -xzvf unpack

10. pwd displays the name of the current directory,
clears the screen,
ctrl+c, pushes completely, and exits the current command

11. Top view the health status of the Linux system
Commonly used commands to view server conditions

12. netstat -tunlp|grep 9990 view port number usage

13, vi modify the file to open the log file

14. Less log file name-page display file content
enter, line feed q exit,
up and down arrows point to switch between up and down pages,
left and right → point to switch between up and down
more: file name# page to display file content

15. Find -name file name: find the matching file name

16, chmod changes file permissions

Guess you like

Origin blog.csdn.net/Yorkie_Lin/article/details/105784940