要求
1、合理设计数据表,正确连接MySQL数据库。
2、主界面能够选择:学生表查询、学生表录入、课程表查询、课程表录入、成绩表查询、成绩表录入六大功能。
3、学生表录入页面可以按学号查询某学生详细信息,可以添加、修改、删除一个学生的信息。
4、学生表查询界面能够显示全部学生表信息,可以按照表中3个字段进行查询信息,有分页导航功能。
5、课程表录入页面可以按课程号查询某课程的详细信息,可以添加、修改、删除一个课程的信息。
6、课程表查询界面能够显示全部课程表信息,可以按照表中2个字段进行查询信息,有分页导航功能。
7、成绩表录入页面能够录入成绩。
8、成绩表查询界面能够查询成绩。
9、设计新颖,说明文档逻辑清楚,内容完整。
代码
- index.php
<html>
<head>
<title>学生成绩管理系统</title>
</head>
<body>
<style type="text/css">
body{
background:url("888.jpg") no-repeat;
background-size: 100%;
}
div{
font-size: 24px;
font-weight: bold;
color:
margin-bottom: 10px;
}
</style>
<div>
<li><a href="kccx.php" target="test">课程表查询</a></li>
<li><a href="kcb.php" target="test">课程表录入</a></li>
<li><a href="xscx.php" target="test">学生表查询</a></li>
<li><a href="xsb.php" target="test">学生表录入</a></li>
<li><a href="cjcx.php" target="test">成绩表查询</a></li>
<li><a href="cjb.php" target="test">成绩表录入</a></li>
<tr>
<td align="center" valign="middle">
<iframe src="" height="800px" width="1200px" name="test" id="test" scrolling="yes" frameborder="0"></iframe>
</td>
</tr>
</div>
</body>
</html>
- cjb.php
<html>
<head>
<title>成绩表信息更新</title>
<style type="text/css">
table{
margin:0 auto;}
td{
text-align:center;}
</style>
</head>
<body>
<h1 style="text-align: center;color: #ffcccc;">成绩表录入</h1>
<form name="frm1" method="post">
<table align="center">
<tr>
<td width="120"><span>根据课程号查询:</span></td>
<td>
<input name="KCNumber" id="KCNumber" type="text">
<input type="submit" name="test" value="查找">
</td>
</tr>
</table>
</form>
$conn= mysqli_connect("localhost","root","123456","XSCJ");
mysqli_set_charset($conn,"utf8");
$KCNumber=@$_POST['KCNumber'];
$sql="select * from cjb where 课程号='$KCNumber'";
$result= mysqli_query($conn,$sql);
$row=@mysqli_fetch_array($result);
if (($KCNumber!=NULL)&&(!$row))
echo "";
?>
<form name="frm2" method="post" enctype="multipart/form-data">
<table border="1" align="center">
<tr>
<td><span>课程号:</span></td>
<td>
<input name="KCNum" type="text" value="$row['课程号'];?>">
<input name="h_KCNum" type="hidden" value="$row['课程号'];?>">
</td>
</tr>
<tr>
<td><span>课程名:</span></td>
<td><input name="KCName" type="text" value="$row['课程名'];?>"></td>
</tr>
<tr>
<td><span>成绩:</span></td>
<td><input name="CJ" type="text" value="$row['成绩'];?>"></td>
</tr>
<tr>
<td align="center" colspan="2">
<input name="b" type="submit" value="修改">
<input name="b" type="submit" value="添加">
<input name="b" type="submit" value="删除">
</td>
</tr>
</table>
</form>
</body>
</html>
$KCH=@$_POST['KCNum'];
$h_KCH=@$_POST['h_KCNum'];
$KCM=@$_POST['KCName'];
$CJ=@$_POST['CJ'];
function test($KCH,$KCM,$CJ)
{
if (!$KCH)
echo "";
elseif (!$KCM)
echo "";
elseif (!is_numeric($CJ))
echo "";
}
if (@$_POST["b"]=='修改')
{
test($KCH,$KCM,$CJ);
if($KCH!=$h_KCH)
echo "";
else {
$update_sql="update CJB set 课程名='$KCM',成绩='$CJ' where 课程号='$KCH'";
$update_result= mysqli_query($conn,$update_sql);
if (mysqli_affected_rows($conn)!=0)
echo "";
else
echo "";
}
}
if (@$_POST["b"]=='添加')
{
test($KCH, $KCM, $CJ);
$s_sql="select 课程号 from cjb where 课程号='$KCH'";
$s_result= mysqli_query($conn, $s_sql);
$s_row=@mysqli_fetch_array($s_result);
if ($s_row)
echo "";
else {
$insert_sql="insert into cjb (课程号,课程名,成绩) values('$KCH','$KCM',$CJ)";
$insert_result= mysqli_query($conn,$insert_sql)or die('添加失败!');
if(mysqli_affected_rows($conn)!=0)
echo "";
}
}
if (@$_POST["b"]=='删除')
{
if(!$KCH)
{
echo "";
}
else {
$d_sql="select 课程号 from cjb where 课程号='$KCH'";
$d_result= mysqli_query($conn,$d_sql);
$d_row= mysqli_fetch_array($d_result);
if (!$d_row)
echo "";
else {
$del_sql="delete from cjb where 课程号='$KCH'";
$del_result= mysqli_query($conn,$del_sql)or die('删除失败!');
if (mysqli_affected_rows($conn)!=0)
echo "";
}
}
}
?>
- cjcx.php
<html>
<head>
<title>成绩查询</title>
<style type="text/css">
div{
text-align: center;
font-size: 24px;
font-weight: bold;
color: "#008000";
}
table{
width: 300px;
}
</style>
</head>
<body>
<h1 style="text-align: center;color: #ffcccc;">成绩表操作</h1>
<form name="frm1" method="get">
<table align="center">
<tr>
<td nowrap bgcolor="#ccc">课程号:</td>
<td><input name="KCNumber" size="13" type="text"></td>
<td nowrap bgcolor="#ccc">课程名:</td>
<td><input name="KCName" size="13" type="text"></td>
<td nowrap bgcolor="#ccc">成绩:</td>
<td><input name="CJ" size="13" type="text"></td>
<td nowrap>
<input type="submit" name="Query" value="查询">
</td>
</tr>
</table>
</form>
$conn= mysqli_connect("localhost","root","123456","XSCJ");
mysqli_set_charset($conn,"utf8");
$KCNumber=@$_GET['KCNumber'];
$KCName=@$_GET['KCName'];
$CJ=@$_GET['CJ'];
function getsql($KCNumber,$KCName,$CJ){
$sql="select *from CJB where ";
$note=0;
if($KCNumber){
$sql.="课程号 like'%$KCNumber%'";
$note=1;
}
if($KCName){
if($note==1){
$sql.=" and 课程名 like '%$KCName%'";
echo "";
} else {
$sql.="课程名 like '%$KCName%'";
}
$note=1;
}
if($CJ){
if($note==1){
$sql.=" and 成绩 like '%$CJ%'";
echo "";
} else {
$sql.="成绩 like '%$CJ%'";
}
$note=1;
}
if($note==0){
$sql="select * from cjb";
}
return $sql;
}
$sql=getsql ($KCNumber,$KCName,$CJ);
$result= mysqli_query($conn,$sql);
$total=mysqli_num_rows($result);
if(!$result){
printf("Error: %s\n", mysqli_error($conn));
exit();
}
$page= isset($_GET['page'])?intval($_GET['page']):1;
$num=3;
$url='cjcx.php';
$pagenum=ceil($total/$num);
$page=min($pagenum,$page);
$prepg=$page-1;
$nextpg=($page==$pagenum?0:$page+1);
$new_sql=$sql." limit ".($page-1)*$num.",".$num;
$new_result= mysqli_query($conn, $new_sql);
if($new_row=@mysqli_fetch_array($new_result)){
echo "
学生成绩查询结果
";
echo "
";
echo "";
echo "课程号 | ";
echo "课程名 | ";
echo "成绩 |
";
do{
list($KCH,$KCM,$CJ)=$new_row;
echo "$KCH | ";
echo "$KCM | ";
echo "$CJ |
";
}while($new_row= mysqli_fetch_array($new_result));
echo "
";
$pagenav="";
if($prepg){
$pagenav.="上一页";
}
for($i=1;$i<=$pagenum;$i++){
if($page==$i){
$pagenav.=$i." ";
} else {
$pagenav.="$i";
}
}
if($nextpg){
$pagenav.="下一页";
}
$pagenav.="共(".$pagenum.")页";
echo "
".$pagenav."
";
}
?>
- kcb.php
<html>
<head>
<meta charset="UTF-8">
<title>课程信息更新</title>
<style type="text/css">
table{
margin:0 auto;}
td{
text-align:center;}
</style>
</head>
<body>
<h1 style="text-align: center;color: #ffcccc;">课程表录入</h1>
<form name="frm1" method="post">
<table align="center">
<tr>
<td width="120"><span>根据课程号查询:</span></td>
<td>
<input name="KCNumber" id="KCNumber" type="text">
<input type="submit" name="test" value="查找">
</td>
</tr>
</table>
</form>
$conn= mysqli_connect("localhost","root","123456","XSCJ");
mysqli_set_charset($conn,"utf8");
$KCNumber=@$_POST['KCNumber'];
$sql="select * from KCB where 课程号='$KCNumber'";
$result= mysqli_query($conn,$sql);
$row=@mysqli_fetch_array($result);
if (($KCNumber!=NULL)&&(!$row))
echo "";
?>
<form name="frm2" method="post">
<table border="1" align="center">
<tr>
<td><span>课程号:</span></td>
<td>
<input name="KCNum" type="text" value="$row['课程号'];?>">
<input name="h_KCNum" type="hidden" value="$row['课程号'];?>">
</td>
</tr>
<tr>
<td><span>课程名:</span></td>
<td><input name="KCName" type="text" value="$row['课程名'];?>"></td>
</tr>
<tr>
<td><span>开课学期:</span></td>
<td><input name="KCTerm" type="text" value="$row['开课学期'];?>"></td>
</tr>
<tr>
<td><span>学时:</span></td>
<td><input name="KCtime" type="text" value="$row['学时'];?>"></td>
</tr>
<tr>
<td><span>学分:</span></td>
<td><input name="KCCredit" type="text" value="$row['学分'];?>"></td>
</tr>
<tr>
<td align="center" colspan="2">
<input name="b" type="submit" value="修改">
<input name="b" type="submit" value="添加">
<input name="b" type="submit" value="删除">
</td>
</tr>
</table>
</form>
</body>
</html>
$KCH=@$_POST['KCNum'];
$h_KCH=@$_POST['h_KCNum'];
$KCM=@$_POST['KCName'];
$KKXQ=@$_POST['KCTerm'];
$XS=@$_POST['KCtime'];
$XF=@$_POST['KCCredit'];
function test($KCH,$KCM,$KKXQ,$XF)
{
if (!$KCH)
echo "";
elseif (!$KCM)
echo "";
elseif ($KKXQ>8||$KKXQ<1)
echo "";
elseif (!is_numeric($XF))
echo "";
}
if (@$_POST["b"]=='修改')
{
test($KCH,$KCM,$KKXQ,$XF);
if($KCH!=$h_KCH)
echo "";
else {
$update_sql="update KCB set 课程名='$KCM',开课学期='$KKXQ',学时='$XS',学分='$XF' where 课程号='$KCH'";
$update_result= mysqli_query($conn,$update_sql);
if (mysqli_affected_rows($conn)!=0)
echo "";
else
echo "";
}
}
if (@$_POST["b"]=='添加')
{
test($KCH, $KCM, $KKXQ, $XF);
$s_sql="select 课程号 from KCB where 课程号='$KCH'";
$s_result= mysqli_query($conn, $s_sql);
$s_row=@mysqli_fetch_array($s_result);
if ($s_row)
echo "";
else {
$insert_sql="insert into KCB(课程号,课程名,开课学期,学时,学分) values('$KCH','$KCM',$KKXQ,$XS,$XF)";
$insert_result= mysqli_query($conn,$insert_sql)or die('添加失败!');
if(mysqli_affected_rows($conn)!=0)
echo "";
}
}
if (@$_POST["b"]=='删除')
{
if(!$KCH)
{
echo "";
}
else {
$d_sql="select 课程号 from KCB where 课程号='$KCH'";
$d_result= mysqli_query($conn,$d_sql);
$d_row= mysqli_fetch_array($d_result);
if (!$d_row)
echo "";
else {
$del_sql="delete from KCB where 课程号='$KCH'";
$del_result= mysqli_query($conn,$del_sql)or die('删除失败!');
if (mysqli_affected_rows($conn)!=0)
echo "";
}
}
}
?>
- kccx.php
<html>
<head>
<title>课程信息查询</title>
<style type="text/css">
div{
text-align: center;
font-size: 24px;
font-weight: bold;
color: "#008000";
}
table{
width: 300px;
}
</style>
</head>
<body>
<h1 style="text-align: center;color: #ffcccc;">课程表操作</h1>
<form name="frm1" method="get">
<table align="center">
<tr>
<td nowrap bgcolor="#ccc">课程号:</td>
<td><input name="KCNumber" size="13" type="text"></td>
<td nowrap bgcolor="#ccc">课程名:</td>
<td><input name="KCName" size="13" type="text"></td>
<td nowrap bgcolor="#ccc">学分:</td>
<td><input name="XF" size="13" type="text"></td>
<td nowrap>
<input type="submit" name="Query" value="查询">
</td>
</tr>
</table>
</form>
$conn= mysqli_connect("localhost","root","123456","XSCJ");
mysqli_set_charset($conn,"utf8");
$KCNumber=@$_GET['KCNumber'];
$KCName=@$_GET['KCName'];
$XF=@$_GET['XF'];
function getsql($KCNumber,$KCName,$XF){
$sql="select *from kcb where ";
$note=0;
if($KCNumber){
$sql.="课程号 like'%$KCNumber%'";
$note=1;
}
if($KCName){
if($note==1){
$sql.=" and 课程名 like '%$KCName%'";
} else {
$sql.="课程名 like '%$KCName%'";
}
$note=1;
}
if($XF){
if($note==1){
$sql.=" and 学分 like '%$XF%'";
} else {
$sql.="学分 like '%$XF%'";
}
$note=1;
}
if($note==0){
$sql="select * from kcb";
}
return $sql;
}
$sql=getsql ($KCNumber,$KCName,$XF);
$result= mysqli_query($conn,$sql);
$total= mysqli_num_rows($result);
$page= isset($_GET['page'])?intval($_GET['page']):1;
$num=3;
$url='kccx.php';
$pagenum=ceil($total/$num);
$page=min($pagenum,$page);
$prepg=$page-1;
$nextpg=($page==$pagenum?0:$page+1);
$new_sql=$sql." limit ".($page-1)*$num.",".$num;
$new_result= mysqli_query($conn, $new_sql);
if($new_row=@mysqli_fetch_array($new_result)){
echo "
学生信息查询结果
";
echo "
";
echo "";
echo "课程号 | ";
echo "课程名 | ";
echo "开课学期 | ";
echo "学时 | ";
echo "学分 |
";
do{
list($KCH,$KCM,$KKXQ,$XS,$XF)=$new_row;
echo "$KCH | ";
echo "$KCM | ";
echo "$KKXQ | ";
echo "$XS | ";
echo "$XF |
";
}while($new_row= mysqli_fetch_array($new_result));
echo "
";
$pagenav="";
if($prepg){
$pagenav.="上一页";
}
for($i=1;$i<=$pagenum;$i++){
if($page==$i){
$pagenav.=$i." ";
} else {
$pagenav.="$i";
}
}
if($nextpg){
$pagenav.="下一页";
}
$pagenav.="共(".$pagenum.")页";
echo "
".$pagenav."
";
}
?>
- showpicture.php
session_start();
$image=$_SESSION['image'];
echo $image;
session_destroy();
?>
- xsb.php
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>学生信息更新</title>
<style type="text/css">
table{
margin:0 auto;}
td{
text-align:center;}
</style>
</head>
<body>
<h1 style="text-align: center;color: #ffcccc;">学生表录入</h1>
<form name="frm1" method="post" >
<table align="center" >
<tr>
<td width="100"><span>根据学号查询:</span></td>
<td>
<input name="StuNumber" id="StuNumber" type="text">
<input type="submit" name="test" value="查找">
</td>
</tr>
</table>
</form>
<br>
$conn = mysqli_connect("localhost", "root", "123456", "XSCJ");
mysqli_set_charset($conn, "set names 'utf8'");
session_start();
$number = @$_POST['StuNumber'];
$_SESSION['number']=$number;
$sql = "select * from xsb where 学号='$number'";
$result = mysqli_query($conn, $sql);
$row = @mysqli_fetch_array($result);
$row['照片'];
$image=$row['照片'];
$_SESSION['image']=$image;
?>
<form name="frm2" method="post" enctype="multipart/form-data">
<table border="1" align="center">
<tr>
<td><span>学号:</span></td>
<td>
<input name="StuNum" type="text" value="$row['学号']; ?>">
<input name="h_StuNum" type="hidden" value="$row['学号']; ?>">
</td>
</tr>
<tr>
<td><span>姓名:</span></td>
<td><input name="StuName" type="text" value="$row['姓名']; ?>"></td>
</tr>
<tr>
<td><span>性别:</span></td>
<td><input name="XB" type="text" value="$row['性别']; ?>"></td>
</tr>
<tr>
<td><span>学生照片:</span></td>
<td align="center">
if($row['照片']){
echo "";
}else{
echo "暂无照片
";
}
?>
<br><input type="file" name="file">
</td>
</tr>
<td align="center" colspan="2">
<input name="b" type="submit" value="修改">
<input name="b" type="submit" value="添加">
<input name="b" type="submit" value="删除">
</td>
</tr>
</table>
</form>
</body>
</html>
$num = @$_POST['StuNum'];
$XH=@$_POST['h_StuNum'];
$name = @$_POST['StuName'];
$XB = @$_POST['Sex'];
$tmp_file=@$_FILES["file"]["tmp_name"];
$handle=@fopen($tmp_file,'r');
$picture=@addslashes(fread($handle, filesize($tmp_file)));
if (@$_POST["b"] == '修改')
{
if ($num!=$XH){
echo "";
}
else {
if(!$tmp_file){
$update_sql="update xsb set 姓名='$name' where 学号='$XH'";
}
else {
$update_sql="update xsb set 姓名='$name',照片='$picture' where 学号='$XH'";
}
$update_result= mysqli_query($conn,$update_sql);
if (mysqli_affected_rows($conn) != 0){
echo "";
} else {
echo "";
}
}
}
if (@$_POST["b"] == '添加') {
$se_sql = "select 学号 from xsb where 学号='$num'";
$se_result = mysqli_query($conn, $se_sql);
$se_row = @mysqli_fetch_array($se_result);
if ($se_row){
echo "";
}
else {
if(!$tmp_file){
$insert_sql = "insert into xsb(学号,姓名,照片) values ('$num','$name',NULL)";
}
else {
$insert_sql = "insert into xsb(学号,姓名,照片) values ('$num','$name','$picture')";
}
$insert_result = mysqli_query($conn, $insert_sql);
if (mysqli_affected_rows($conn) != 0){
echo "";
} else {
echo "";
}
}
}
if (@$_POST["b"] == '删除') {
if ($num==null) {
echo "";
} else {
$de_sql = "select 学号 from xsb where 学号='$num'";
$de_result = mysqli_query($conn, $de_sql);
$de_row = mysqli_fetch_array($de_result);
if (!$de_row)
echo "";
else {
$del_sql = "delete from xsb where 学号='$num'";
$del_result = mysqli_query($conn, $del_sql);
if (mysqli_affected_rows($conn) != 0)
echo "";
}
}
}
?>
- xscx.php
<html>
<head>
<title>学生信息查询</title>
<style type="text/css">
div{
text-align: center;
font-size: 24px;
font-weight: bold;
color: "#008000";
}
table{
width: 300px;
}
</style>
</head>
<body>
<h1 style="text-align: center;color: #ffcccc;">学生表操作</h1>
<form name="frm1" method="get">
<table align="center">
<tr>
<td nowrap bgcolor="#ccc">学号:</td>
<td><input name="StuNumber" size="13" type="text"></td>
<td nowrap bgcolor="#ccc">姓名:</td>
<td><input name="StuName" size="13" type="text"></td>
<td nowrap bgcolor="#ccc">性别:</td>
<td><input name="XB" size="13" type="text"></td>
<td>
<input type="submit" name="Query" value="查询">
</td>
</tr>
</table>
</form>
</html>
$conn= mysqli_connect("localhost","root","123456","xscj");
mysqli_set_charset($conn,"utf8");
$StuNumber=@$_GET['StuNumber'];
$StuName=@$_GET['StuName'];
$XB=@$_GET['XB'];
function getsql($StuNum,$StuNa,$XB){
$sql="select * from xsb where ";
$note=0;
if($StuNum){
$sql.="学号 like '%$StuNum%'";
$note+=1;
}
if($StuNa){
if($note==1){
$sql.=" and 姓名 like '%$StuNa%'";
} else {
$sql.="姓名 like '%$StuNa%'";
}
$note+=1;
}
if($XB){
if($note!=0) {
$sql.=" and 性别 like '%$XB%'";
} else {
$sql.="性别 like '%$XB%'";
}
$note+=1;
}
if($note==0){
$sql="select * from xsb";
}
return $sql;
}
$sql=getsql ($StuNumber,$StuName,$XB);
$result= mysqli_query($conn,$sql);
if(!$result){
printf("Error: %s\n", mysqli_error($conn));
exit();
}
$total= mysqli_num_rows($result);
$page= isset($_GET['page'])?intval($_GET['page']):1;
$num=3;
$url='xscx.php';
$pagenum=ceil($total/$num);
$page=min($pagenum,$page);
$prepg=$page-1;
$nextpg=($page==$pagenum?0:$page+1);
$new_sql=$sql." limit ".($page-1)*$num.",".$num;
$new_result= mysqli_query($conn, $new_sql);
if($new_row=@mysqli_fetch_array($new_result)){
echo ""
;
echo "
学生信息查询结果
";
echo "
";
echo "";
echo "学号 | ";
echo "";
echo "";
echo "
姓名 | ";
echo "性别 | ";
echo "
";
echo "";
do{
list($XH,$XM,$XB)=$new_row;
echo "";
echo "$XH | ";
echo "$XM | ";
echo "$XB | ";
echo "
";
}while($new_row= mysqli_fetch_array($new_result));
echo "
";
$pagenav="";
if($prepg){
$pagenav.="上一页";
}
for($i=1;$i<=$pagenum;$i++){
if($page==$i){
$pagenav.=$i." ";
} else {
$pagenav.="$i";
}
}
if($nextpg){
$pagenav.="下一页";
}
$pagenav.="共(".$pagenum.")页";
echo "
".$pagenav."
";
}
?>
显示
- 开始界面
- 课程表查询界面
可根据课程号 课程名 学分查询
- 课程表录入界面
- 学生表查询界面
- 学生表录入界面
- 成绩表查询界面
- 成绩表录入界面
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
;
;
;
;
CREATE TABLE `cjb` (
`课程号` char(3) NOT NULL,
`课程名` char(16) DEFAULT NULL,
`成绩` int(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `cjb` (`课程号`, `课程名`, `成绩`) VALUES
('001', '数学', 98),
('002', '英语', 97),
('003', '语文', 96),
('004', '虚拟机', 95),
('005', '网络安全', 94),
('006', 'php', 100);
CREATE TABLE `kcb` (
`课程号` char(3) NOT NULL,
`课程名` char(16) NOT NULL,
`开课学期` tinyint(1) DEFAULT '1',
`学时` tinyint(1) DEFAULT NULL,
`学分` int(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `kcb` (`课程号`, `课程名`, `开课学期`, `学时`, `学分`) VALUES
('001', '数学', 6, 30, 100),
('002', '英语', 1, 20, 100),
('003', '语文', 2, 10, 100),
('004', '虚拟机', 3, 10, 100),
('005', '网络安全', 1, NULL, 100),
('006', 'php', 5, 11, 100);
CREATE TABLE `xsb` (
`学号` char(6) NOT NULL,
`姓名` char(8) NOT NULL,
`性别` enum('男','女') DEFAULT '男',
`照片` blob
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `xsb` (`学号`, `姓名`, `性别`, `照片`) VALUES
INSERT INTO `xsb` (`学号`, `姓名`, `性别`, `照片`) VALUES
INSERT INTO `xsb` (`学号`, `姓名`, `性别`, `照片`) VALUES
('367', '哎呀', '女', NULL),
('368', '克斯', '男', NULL),
('387', '娜娜', '女', NULL);
ALTER TABLE `cjb`
ADD PRIMARY KEY (`课程号`) USING BTREE;
ALTER TABLE `kcb`
ADD PRIMARY KEY (`课程号`);
ALTER TABLE `xsb`
ADD PRIMARY KEY (`学号`);
COMMIT;
;
;
;