Task06: comprehensive exercises - 10 classic questions - exercises

This note is the learning content of Alibaba cloud Tianchi Longzhu program SQL training camp. The link is: https://tianchi.aliyun.com/specials/promotion/aicampsql Exercise 1 Please use the quarterly revenue forecast data sets "Income Statement.xls", "Company Operating.xlsx" and "Market Data.xlsx" of A-share liste ...

Added by planetsim on Sun, 20 Feb 2022 10:25:19 +0200

MySQL foundation summary

1, Connection query Classification according to the way of table connection: Internal connection: equivalent connection, non equivalent connection and self connection External connection: left external connection (left connection), right external connection (right connection) Syntax: join ... on ... select ... from Table name 1 join Table na ...

Added by rvdb86 on Sat, 19 Feb 2022 20:54:22 +0200

02. MySql single table & constraint & Transaction

1. DQL operation sheet 1.1 create database and copy tables Create a new db2 database CREATE DATABASE db2 CHARACTER SET utf8; Copy the emp table in the db1 database to the current db2 database 1.2 sorting The sorting effect of the query can only be displayed through the order clause, and the sorting effect will not be displayed thro ...

Added by ol4pr0 on Sat, 19 Feb 2022 20:40:09 +0200

How to prevent SQL injection?

Referring to owasp, this paper focuses on providing clear, simple and operable guidance to prevent SQL injection vulnerabilities in applications. Unfortunately, SQL injection attacks are common due to two factors: Significant prevalence of SQL injection vulnerabilities The attractiveness of the target (i.e. the database usually contains all ...

Added by Eiolon on Fri, 18 Feb 2022 19:48:38 +0200

Mybatis study notes

0. Case environment 0.1 case data initialization sql CREATE DATABASE /*!32312 IF NOT EXISTS*/`mybatis_db` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `mybatis_db`; DROP TABLE IF EXISTS `orders`; CREATE TABLE `orders` ( `id` int(11) NOT NULL AUTO_INCREMENT, `createtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMEST ...

Added by jaymc on Fri, 18 Feb 2022 10:35:45 +0200

SQL | question brushing | cumulative summation problem

1, The maximum number of visits per user in a single month as of the end of each month and the total number of visits accumulated to that month 1. Create table CREATE TABLE IF NOT EXISTS visits( userid VARCHAR(10), datetime1 DATETIME, visits INT)ENGINE=InnoDB DEFAULT CHARSET=utf8; 2. Insert data INSERT INTO visits VALUES('A','2021-01-03 14 ...

Added by xeonman13 on Thu, 17 Feb 2022 23:38:08 +0200

Get data from a specific week relative to the date in SQL

catalogue introduce background So we need to be more complicated Points of interest A QA question needs "last week's data", which makes me think. Using the DATEADD function with a "WW" interval is easy, but it subtracts 7 days from today. This is different from "last week", because "last week" sta ...

Added by eldee on Thu, 17 Feb 2022 16:19:17 +0200

Explain in detail the whole process of MySQL high availability switching troubleshooting caused by slow SQL failure

In the later operation and maintenance of MySQL database, DBAs sometimes encounter such a phenomenon: when troubleshooting the problem, they find that the active and standby MySQL has been switched, and it is normal to check the MySQL service. DBAs have not done the switching operation, and the server has not been maintained. Fortunately, the b ...

Added by glennn3 on Thu, 17 Feb 2022 14:19:18 +0200

Database design of commodity management system -- SQL Server

Links 1. Database design of student achievement management system - MySQL Database design of student achievement management system - MySQL 2. Medical information management system database – MySQL Medical information management system database – MySQL 3. Mail management database design – MySQL Mail management databas ...

Added by antonbrk on Wed, 16 Feb 2022 14:06:05 +0200

SQL sever basic learning 3 (aggregation and sorting)

I Aggregate query Aggregate functionmeaningcount()Calculate the number of records (rows) in the tablesum()Calculate the total value of the values in the value column in the tableavg()Calculate the average of the data in the value column in the tablemax()Find the maximum value of data in any column in the tablemin()Find the minimum value of d ...

Added by Christopher on Wed, 16 Feb 2022 11:43:43 +0200