insert
into student(sno,sname,s***,sdept,sage) values(『201215128』,『陳冬』,『男』,『is』,18);
建表時規定學號唯一,而在建表時已經加入了該學號,所以不能有兩個相同學號。
3.70
insert into student(sno,sname,s***,sdept,sage) values(『201215126』,『張成民』,『男』,18,『cs』);
3.71
insert into sc(sno,cno) values(『201215128』,『1』);
關聯式資料庫管理系統將在新插入記錄的grade列上自動地賦空值
3.16
select sno,sname from student;
從student表中取乙個元組,取出該元組在屬性sno和sname上的值,形成乙個新的元組作為輸出。對student表中的所有元組做相同的處理,最後形成乙個結果關係作為輸出。
3.17
select sno,sname,
sdept from student;
3.18
select sno,sname,s***,sage,sdept from student;
等價於select * from student;
查詢student表中的所有資訊
3.19
select sname,2014-sage
from student
通過當年年份和學生年齡查詢其出生年份
3.20
select sname,『year of birth:』,2014-sage,lower(sdept) from student
3.21
select sno from sc;
/等價於/
select all sno from sc;
如果沒有指定distinct,即使sno有重複也會顯示。如果指定distingct,則重複的不顯示。
3.22
select sname from student where sdept=『cs』
3.23
select sname,sage from student where sage<20查詢所有年齡在20歲以下的學生姓名及其年齡
3.24
select distinct sno
from sc
where grade<60
查詢所有成績不及格的學生的學號
3.25
select sname,sdept,sage from student where sage between 20 and 23
查詢年齡在20-30歲之間的學生姓名,系別和年齡
3.26
select sname,sdept,sage from student where sage not between 20 and 23
查詢年齡不在20-23歲之間的學生的姓名,系別和年齡
3.27
select sname,s*** from student where sdept in(『cs』,『ma』,『is』);
in裡面的屬性之間的關係可以理解為or,即學生表中的學生的專業只要滿足in中三個裡面其中之一即可顯示。
3.28
select sname,s*** from student where sdept not in(『cs』,『ma』,『is』);
與27相比,28在in前面加了not,類似between,如果student**中的學生的專業均不屬於該三個型別之一,即可顯示查詢。
第五次作業
一 問題及 include using namespace std class time void add a minute void add an hour void add seconds int n void add minutes int n void add hours int n voi...
第五次作業
當我們在討論多型性的時候,通常會用過載函式進行舉例,而這次發現的問題主要在過載運算子上,因此我希望通過對過載運算子的測試來得出乙個結論。我們想知道為什麼前置運算子和後置運算子會有區別,因此設計了乙個實驗來證明它 得到最終結果如預期那樣。通過這次作業,我能感受到前置和後置運算子的區別,通過x 和y x...
第五次作業
1.this和 super各有幾種用法?this 當成員變數和區域性變數重名時,在方法中使用this時,表示的是該方法所在類中的成員變數。this是當前物件自己 把自己當作引數傳遞時,也可以用this.this作當前引數進行傳遞 當在匿名類中用this時,這個this則指的是匿名類或內部類本身。這時...