UML Modeling Section
70. What is UML:
Answer: Unified Modeling Language, Unified Modeling Language, is a standard graphical modeling language. is a standard representation of object-oriented analysis and design.
What are the diagrams of UML?
A: class diagram, object graph, use case diagram, sequence diagram, collaboration diagram, State diagram, Activity diagram, Component diagram and deployment diagram .
Symbols in a UML diagram:
For:
Class diagram-three sections, class names, properties and methods, three symbols +public-private #protected
Package diagrams
Interface-can be an origin, or similar to a class diagram, with angle brackets to illustrate interface
Generalization relationship-generalization, which means that is-a is the most important relationship between objects, and subclasses inherit the details of the parent class. Represented by a solid line with a triangular arrow, the arrow points from the subclass to the parent class.
Implementation relationship-interface and implementation of the relationship, with a dotted line with triangular arrows, arrows from the implementation of the class point to the interface.
Dependency-dependancy The weakest relationship, a temporary association, generally refers to a call relationship established by local variables, function parameters, and return values for other objects. Use a dashed line with arrows to point to the class that is dependent from the class you are using.
Affinity-a reference relationship between association objects, that is, the properties of a class. Includes general associations, aggregations, and combinations. Implements an arrow representation.
Aggregation Relationship-Aggregation Strong association, indicating has-a, unstable containment relationship, without the whole, the local can still exist, using hollow diamond, from the local point to the whole.
Combinatorial relationships-composition,contains-a strongly contained relationships, the whole determines the local life cycle, represented by a solid diamond, from the local point to the whole.
73. The design pattern is divided into the creation design pattern, the behavior type design pattern and the structural pattern design mode.
Database section:
74. What is the design paradigm:
A: The database paradigm refers to the design principles that should be adhered to when designing a database. Common has the first paradigm 1NF, the second paradigm 2NF, the third normal form 3NF, the fourth normal form 4NF, the five normal form 5NF and the BCNF paradigm.
The first paradigm: the basic requirements of relational databases require that each column be an indivisible basic data item.
Second Normal: The row value is completely dependent on the primary key.
The third paradigm: for the place redundancy, requires that the table cannot exist except the primary key.
75. What is a database transaction:
A: A transaction is a sequence of operations, either all executed or not executed, indivisible. Critical operations, transaction commits, and transaction rollback. With four properties, atomicity atomicity, consistency consistency, independence isolation, persistence durability
76. What is the SQL language:
A: Structured Query language SQL is a language between relational algebra and relational calculus, which implements data definition DDL, data manipulation DML, and data control functions.
77. Common SQL Operations:
Student (s#,sname,sage,ssex) Student Table Course (c#,cname,t#) Timetable SC (s#,c#,score) score table teacher (t#,tname) Teacher's Table1Query001"Course ratio"002"The school number of all students with high academic performance;Selecta.s# from(SelectS#,score fromScwhereC#=’001) A, (SelectS#,score fromScwhereC#=’002) bwhereA.score>B.score anda.s#=b.s#;2, the average score is more than 60 points of the students ' study number and average score;Selects#,avg(Score) fromSCGroup bys# having avg(score)> -; 3, query All students of the school number, name, number of courses selected, total;SelectStudent.s#,student.sname,Count(SC. C #),sum(Score) fromStudent Left Outer JoinSc onstudent.s#=sc.s#Group byStudent.s#,sname4, the number of teachers who queried the surname "Li";Select Count(distinct(tname)) fromTeacherwhereTname like' Lee%';5, inquiry did not learn the "cotyledons" teacher class students of the school number, name;SelectStudent.s#,student.sname fromStudentwheres# not inch(Select distinct(SC. s#) fromSc,course,teacherwhereSc. C#=course.c# andteacher.t#=course.t# andTeacher.tname=' cotyledons '); 6, inquiry learning "001"And I've learned the numbers."002The student's number and name of the course;SelectStudent.s#,student.sname fromSTUDENT,SCwherestudent.s#=Sc. s# andSc. C#=’001′ and exists(Select * fromSc assc_2wheresc_2.s#=Sc. s# andsc_2.c#=’002);7, inquiring about the students ' study number and name of all the classes taught by the "cotyledons" teacher;SelectS#,sname fromStudentwheres#inch(Selects# fromSC, Course, TeacherwhereSc. C#=course.c# andteacher.t#=course.t# andTeacher.tname=' Cotyledons 'Group bys# having Count(SC. C #)=(Select Count(C #) fromCourse,teacherwhereteacher.t#=course.t# andTname=' cotyledons ')); 8, check all the course scores less than 60 points of the student's number, name;SelectS#,sname fromStudentwheres# not inch(Selectstudent.s# fromStudent,scwheres.s#=Sc. s# andScore> -); 9, the inquiry did not learn all classes of the students of the school number, name;SelectStudent.s#,student.sname fromSTUDENT,SCwherestudent.s#=sc.s#Group byStudent.s#,student.sname having Count(C #)<(Select Count(C #) fromCourse); Ten, inquire at least one course and study number as "1001"Students learn the same student's number and name;SelectS#,sname fromSTUDENT,SCwherestudent.s#=Sc. s# andC#inch(SelectC# fromScwheres#='1001'); One, delete the SC table record of "cotyledons" teacher class; Delect SC fromCourse, Teacherwherecourse.c#=Sc. C# andcourse.t#=teacher.t# andTname='cotyledons'; A, query the highest and lowest score of each section: Show as follows: Course ID, highest score, lowest scoreSELECTl.c# course id,l.score highest score, R.score minimum score fromSC L, SC RWHEREl.c#=r.c# andL.score=(SELECT MAX(Il.score) fromSC il,student IMWHEREIL. C#=l.c# andIM. s#=IL. s#GROUP byIL. C #) andR.score=(SELECT MIN(Ir.score) fromSC IRWHEREIR. C#=r.c#GROUP byIR. C #); -, check the records of the top three grades of each section: (regardless of the performance of the situation)SELECTT1. s# asStudent Id,t1. C# asCourse Id,score asscore fromSC T1WHEREScoreinch(SELECT TOP 3score fromSCWHERET1. C#=C #ORDER byScoreDESC)ORDER byt1. C #; Query A (id,name) table in the 31st to 40th record, ID as the primary key may not be continuous growth of the column, the complete query statement is as follows: Method one:Select Top Ten * fromAwhereId>(Select Max(ID) from(Select Top -Id fromAOrder byID) T)Order byID Method Two:Select Top Ten * fromAwhereId not inch(Select Top -Id fromAOrder byID)Order byId
Review of basic knowledge of C + + (v)