course (-59) Good (-80) Excellent (-100) Select Subject, (selectcountfromwhere and as failed, ( Select Count from where between and and as benign, (selectcountfromwhere and as excellent from Group by subject 13. Mathematics: Zhang San (50 points), John Doe (90 points), Harry (90 points), Zhao Liu (76 points) Declare @s varchar (1000) Set @s='select@s =@s+', '+name+' ('+convert (varchar(), score) +' points 'fromwhere subject=' mathematics ' Set
Tags: SQL statementsDevelopment Course do practice Student Guide 051 les01 pptOracle often connects two tables, called a third paradigm, such as something with an ID characterThe following is the command for the SQL statementSELECT * from departments; Department tableSELECT * FROM Employees; Employee tableSelect Employee_id,rowid,rownum from Employeeswhere employ
After more than half a year of hard work, the book ASP. NET 3.5 + SQL Server website modular development full recording was finally successfully published by Tsinghua University Press.
The first time such books were published, there may inevitably be a lot of mistakes, but we hope that the majority of readers will not correct or criticize them. The readers of this book are: beginners and intermediate website developers, taking into account some basic
There is a student table with three columns in total. The first column is the student ID column, which stores the student ID of the Course Selection. You can repeat it to allow one student to select multiple courses.
The second column is the course column, that is, the name of the course selected.
The third column is the score column, that is, the score of the
An SQL statement is used to query the names of students whose scores are greater than 80 in each course. There are three tables: S, C, and SC S (Sno, Sname) C (Cno, Cname) SC (Sno, Cno, grade) -------------------------------------------------- problem: use an SQL statement to query the names of students whose scores are greater than 80 in each
('John Doe','Mathematics',' -'); - INSERT into' Grade 'VALUES('Harry','language','Bayi'); + INSERT into' Grade 'VALUES('Harry','Mathematics',' -'); A INSERT into' Grade 'VALUES('Harry','English',' -'); at SETForeign_key_checks=1;View CodeCheck the names of students who have more than 80 points for each course:1 Select distinct from where not inch (Selectdistinctfromwhere score);View CodeThere is also a simple notation:1 Select from Group by ha
In SQL Sever 2008, if you need to query the top 3 of each course, the implementation is as follows:Existing score table (result), column (Studentno, subjectno account number, Studentresult student score)Method One:SELECT distinct b.* Fromresult as RCross APPLY (SELECT TOP (3) *from Result WHERE r.subjectno= subjectno ORDER by Studentresult DESC) as BOrder by Subjectno, Studentresult descCross apply () use t
();}2. Parameters of the array typeProgram codeSELECT * from T_blog where ID in#{item}Correspondence MapperProgram codePublic list3. Parameters of the Map typeProgram codeSELECT * from T_blog where title like "%" #{title} "%" and ID in#{item}The mapper should be such an interface:Program codePublic listthrough the above method, we can complete the general MyBatis dynamic SQL statement. The most common is if where foreach these, must focus on masterin
Tags: Oracle training Oracle Video Oracle Database tutorial Oracle Video Tutorial Oracle Video tutorial goals NBSP;NBSP;NBSP; Oracle video tutorial, wind Brother this set of Oracle Tutorial Training learning Oracle Sql*loader Concepts and usage and sql* Loader two cases, while the courseware with nearly 20 cases for everyone to practice their own. Applicable people It related practitioners, Oracle d
statement queries the number of employees in the department, where the ID and name of the employee are from the employee table, people_num from the Department table:The other Connection statement format is using the join on syntax, which is equivalent to the following statement:SELECT id,name,people_numFROM employee JOIN departmentON employee.in_dpt = department.dpt_nameORDER BY id;The result is the same as the statement just now.Second, practice1, using the method of connection query, the numb
Label:Today, I mainly review the previous sub-query, and then learn the connection query join on the content.Such as: Select Renyuan.code,name,age, Sex, Bumen.bname,bceo from Renyuan,bumen where Renyuan.bc=bumen.bcodeWrite the above query statement as a connection query:Select Renyuan.code,name,age, Sex, Bumen.bname,bceo from Renyuan joins Bumen on Renyuan.bc=bumen.bcodeAfter that, I learned about local variables.Cases:DECLARE @code intSet @code =10003Select age from Renyuan where [email protec
Label:Build table: 1 Create TableScore (2Namevarchar( -),
3Coursevarchar( -),
4Scoreint)
5
6 Go
7
8 Insertscore9 Select 'Hanmeimei','Chinese',Bayi Union All
Ten Select 'Hanmeimei','Mathematics', the Union All
One Select 'Hanmeimei',' History',Bayi Union All
A Select 'Hanmeimei','Geography', the Union All
- Select 'Lilei','Chinese', the Union All
- Select 'Lilei','Mathematics', - Union All
the Select 'Jimgreen','Chinese',Bayi Union All
- Select 'Jimgreen','Mathematics', -
Tags: pt-killPercona Pt-kill Lite VersionAdd more slow SQL Mail alerts after killing is sentNote: The official original version of the default is killed by the SQL will not send mail, which will not be able to notify the development of timely, the troubleshooting problems caused confusion.Students who purchase a course can log inHttp://edu.51cto.com/
Tags: str utf8mb4 greater than ADE where name group drop coreUse an SQL statement to find out the names of students with more than 80 points in each course, with the following data table structure: The table SQL is built as follows: SETForeign_key_checks=0; -- ----------------------------
--Table structure for grade
-- ----------------------------
DROP TABLE IF
Label:Name Kecheng FenshuZhang San language 81Zhang San Mathematics 75John Doe Language 76John Doe Mathematics 90Harry Language 81Harry Mathematics 100Harry English 90 Method One: ideas: If you can get a table, by the student's name, language scores, math scores, English scores of the table, the rest is in the where conditions to filter and can get the desired results. specific measures: through the self-linking method, with "name" as the connection condition, since the connection three time
the cache are output to a file;Spool off means that the cache is closed and the file is saved on its own initiative; [Email protected] ~]$ Sqlplus/as SYSDBA Sql*plus:release 10.2.0.1.0-production on Wed June 18 13:52:25 2014 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-productionWith the partitioning, OLAP and Data Mining options [Email Protected]>spool/home/oracl
); insert INTO Employee (Id,name) Span class= "Hljs-keyword" >values (03, ' Rose '); You've noticed that some data needs to be enclosed in single quotes, such as the names of Tom, Jack, and Rose, because their data types are char type. In addition, Varchar,text,date,time,enum and other types of data also require single-quote decoration, while int,float,double and so on are not required.The first statement is a bit more than the second: (Id,name,phone) This parenthesis is the data to be added
The only reason for backupThe only reason for the backup is that we can restore when I first became a SQL Server database administrator, as long as the backup work can run successfully, I feel that everything is fine. I'll look at the SQL Server Agent to make sure those jobs are running, and that's it.I think as long as the disaster occurred, I just need to do a recovery. How hard can this be? Theoretically
13 Tuesday course 2018.01.15 mysql user management, common SQL statements, mysql database backup and recovery,
13.4 mysql user management
By default, mysql has a root user, but the root directory permission is too high, which is dangerous. Therefore, you need to create a new user and grant it the corresponding permissions.
User Creation Method
Grant indicates authorization. all indicates all permissions.
,state)User gas Consumption chart: Gas_consume (uno,time,gid,num,state)Employee Information Sheet: Employee (WNO,PASSWD)Permission table: Rights (Rightid,comment,function)Employee Permissions Table: Staffrignt (Wno,rightid)Analysis:
Initial status information is automatically generated in the energy consumption record when the user registers
The Permissions table design contains: Permission number, description and function, when adding permissions, only need to add a row, employees
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.