Database Experiment Two
1. Create a database
--**************************--*** 1. Building a Database SC * * *--************************** Create db SC Go------------------- -----------using, locating the database SC----------------------------use SC go
2. Create a data table
--**************************--*** 2. Cre
Label:1, the inquiry "001" course is higher than "002" of all students of the school number;Select a. ' s# ' from (select ' s# ', score from SC where ' C # ' = "001") A,(SELECT ' s# ', score from SC where ' C # ' = "002") bwhere A.score>b.score and A. ' s# ' =b. ' s# '; 2, the query average score is more than 60 points of the student's number and average score;Select ' s# ', AVG (score)From SCGROUP BY ' s#
Typical Cases of Database SQL learning: exercises for scores of professional students; for one question ------ which students have chosen course 1 but not course 2? The following SQL statements are written in different ways ~ No mysqldescSC; + ------- + --------------- + ------ + ----- + --------- + ------- + | Field | Type | Null
Typical Cases of Database SQL learning: exercises for scores of professional students; for one question ------ which students have chosen course 1 but not course 2? Th
/7187748Reasons for using systemtap to locate ifconfig dropped data packetsHttp://www.it165.net/ OS /html/201308/5944.htmlExampleHttps://sourceware.org/systemtap/wikiDetailed explanation of System LanguageHttp://blog.csdn.net/linyt/article/details/5204841
#! /Usr/bin/env stap global host_no = 17 global channel = 0 global targetid = 0 global lunid = 15 # determine whether io is delivered to iscsiprobe module ("libiscsi "). function ("iscsi_queuecommand") {if ($ host! = 0 $
Label:SQL Optimization ExperienceAdd: Seeing so many friends interested in SQL optimization, I have re-added the content of the next article to share more knowledge about SQL optimization, Like this article friends give a praise, haha, welcome to exchange, common progress. 2015-4-30 supplement: Very Feel the editor's recommendation, but also to the slow query statement optimization again, and attach the optimization record, welcome to read the article.SceneI use the database is mysql5.6, the fol
the expression. The core problem of optimization is to minimize the amount of data involved in the processing of the tables in the query, thus achieving the goal of optimizing time and space. 2 Principles of Join query optimization 2.1 Use single-table operation as much as possible Given three relationship patterns: (example below) S (sno,sname,sec,birthday,email) C (Cno,cname,creadit,tname) SC (Sno,cno,score) Example: Query 1001 students to t
(-), Cartesian product (x), selection (σ), projection (π), natural connection (??). ), or (∨), and (∧)
Teacher Relationship T (t#,tname,title)
Course Relationship C (c#,cname,t#)
Student Relations S (s#,sname,age,sex)
Course Selection Relationship SC (S#,c#,score)
(1) The study number and achievement of the C2 course number is searched.
SELECT s#, score from SC WHERE C
VIEWD:grant61. To revoke a table s that already exists in the database, available | | c| |.A:delete TABLE SB:delete SC:drop TABLE SD:drop S62. To add a list of CNAME (course name) in basic table S, available | | c| |.A:add TABLE S (CName CHAR (8))B:add TABLE S ALTER (CName CHAR (8))C:alter TABLE S ADD (CName CHAR (8))D:alter TABLE S (ADD CName CHAR (8))63, Student Relations mode Student (sno,sname,sex,age), the attributes of Student respectively indicate student's number, name, gender, age. To
To load your own driver with vc, perform the following steps: 1. to load the driver service, use the following functions: SC _HANDLEWINAPIOpenSCManagerA (_ handler ,__ in_optLPCSTRlpDatabaseName ,__ inDWORDdwDesiredAccess ); create driver service SC _HANDLEWI
To load your own driver with vc, perform the following steps: 1. to load the driver service, use the following functions:
Original works, allow reprint, reprint, please be sure to hyperlink form to indicate the original source of the article, author information and this statement. Otherwise, legal liability will be held. Http://blog.csdn.net/github_27109687/article/details/73810951-Test_huhy Blog A, topic
Student Student Table
Field name
field Type
field meaning
s#
Int
School Number
Sname
varchar
Student Name
Sage
varchar
Student
CREATE TABLE Student(Sno Number (5) is not NULL,sname VARCHAR2 (),Idcard VARCHAR2 (),createtime DATE default sysdate,Nno Number (2),constraint Pk_student primary KEY (SNO));CREATE TABLE Course(CNO Number (5) is not NULL,CNAME VARCHAR2 (+),constraint Pk_course primary KEY (CNO));CREATE TABLE Nativeplace(Nno Number (2) is not NULL,np_name VARCHAR2 (),constraint Pk_nativeplace primary KEY (Nno));CREATE TABLE SC(Sno Number (5) is not NULL,CNO Number (5) i
... Order by Field List DESC (inverted, if directly written in order)
5. Select... From... Limit ". $ start_rowno.", ". ($ pagesize + 1)
Section 2 SQL statement instance application
Database description:
Student (student table ):
Stdid int (11) ID
Son char (5) Student ID
Sname char (20) Name
Ssex tinyint (1) Gender
Sage char (3) Age
System of sdept char (20)
Course (course schedule ):
CouId int (11) ID
CNO char (5) course No.
Cname char (20) Course name
Cpno char (6) electives No.
Ccredit char (
@: Notifies the selected user and computer to manage alarms. If the service stops, programs that use the management alert will not receive them. If this service is disabled, any service directly dependent on it cannot be started.SC config Alerter start = DISABLEDSC stop Alerter
@: Application Experience Lookup Service@: When the application starts, it processes the application compatibility lookup request for the application.@: Suggestion: DisableSC config AeLookupSvc start = DISABLEDSC stop AeL
Known link mode:
S (SNO, sname) Student Relationship. Sno is the student ID, and sname is the name
C (CNO, cname, cteacher) Course relationship. CNO is the course number, cname is the course name, And cteacher is the course teacher
SC (SNO, CNO, scgrade) Course Selection relationship. Scgrade is the score
--- Create a table
Create Table s(Sno varchar (50) not null,Sname varchar (50) not null,
)
Create Table C(CNO varchar (50) not null,Cn
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.