********删除记录问题********

abcde_aspnet abcde_aspnet 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
姓名 工作时间 所在公司 所在部门
张某 200101--200201||200301--200401|| a公司||b公司|| a公司a部门||b公司b部门||

所在职位
a公司a职位||b公司b职位||


我想通过页面提交的方式,删除张某在a公司工作的相关信息,如何写sql代码?
...全文

相关推荐

学生数据管理系统(包括插入,删除,修改等)

#include <stdio.h> #include "string.h" int N,i; FILE *fp; struct student {char num[10]; char name[8]; char sex[5]; int age; char addr[15]; int score; }stu[100]; void input() /*输入学生数据的资料*/ {printf("Input the student data %d:\n",i+1); /*输入一个学生的数据*/ printf("NO.:"); scanf("%s",stu[i].num); /*输入号数*/ printf("name:"); scanf("%s",stu[i].name); /*姓名*/ printf("sex:"); scanf("%s",stu[i].sex); /*性别*/ printf("age:"); scanf("%d",&stu[i].age); /*年龄*/ printf("address:"); scanf("%s",stu[i].addr); /*家庭地址*/ printf("score:"); scanf("%d",&stu[i].score); /*分数*/ printf("\n"); } void add() /*在ouru的文件后添加学生数据*/ { if((fp=fopen("ouru","ab"))==NULL) /*以读写的二进制形式打开ouru文件*/ {printf("Cann't open the file\n"); return;} printf("How many data do you want:"); /*输入需要添加几个学生的数据和具体的资料*/ scanf("%d",&N); for(i=0;i<N;i++) /*向ouru文件中加入添加学生的数据的个数*/ input(); for(i=0;i<N;i++) if(fwrite(&stu[i],sizeof(struct student),1,fp)!=1) printf("File error\n"); fclose(fp); } void save() /*保存学生的数据到ouru文件中*/ { int i; if((fp=fopen("ouru","wb"))==NULL) /*打开ouru文件*/ {printf("Cann't open the file\n"); return;} for(i=0;i<N;i++) /*把学生的数据写入到ouru 文件中*/ if(fwrite(&stu[i],sizeof(struct student),1,fp)!=1) printf("File write error\n"); fclose(fp); } void insert() /*在ouru文件中插入学生的数据*/ {char positions[10]; int a,b; if((fp=fopen("ouru","r+"))==NULL) /*以读写打开ouru文件*/ {printf("Can not open file!"); return;} for(i=0;(fread(&stu[i],sizeof(struct student),1,fp))!=0;i++); /*读取文件并计算文件中有多少个学生的数据*/ printf("Which position do you want to insert:"); scanf("%s",positions); for(a=0;a<i;a++) /*确定插入的位置*/ if(strcmp(positions,stu[a].num)==0)break; a=a+1; fseek(fp,sizeof(struct student)*(a+1),0); /*将指针指向要插入位置的后一位*/ for(b=a;b<i;b++) fwrite(&stu[b],sizeof(struct student),1,fp); /*将插入后的学生数据向后移动一位*/ i=a; input(); fseek(fp,sizeof(struct student)*a,0); /*将指针指向要插入的位置*/ fwrite(&stu[a],sizeof(struct student),1,fp); /*将插入的数据保存到ouru文件里*/ fclose(fp);} void change() /*修改ouru文件中的某个学生的数据*/ { char positions[10]; if((fp=fopen("ouru","rb+"))==NULL) /*以读写打开二进制ouru文件*/ {printf("Can not open the file\n"); return;} printf("What data do you want to modify:"); /*输入要修改学生的号码*/ scanf("%s",positions); for(i=0;(fread(&stu[i],sizeof(struct student),1,fp))!=0;i++) /*找出要修改的数据*/ if(strcmp(stu[i].num,positions)==0) {fseek(fp,sizeof(struct student)*i,0); /*将指针指向要修改的资料*/ input(); fwrite(&stu[i],sizeof(struct student),1,fp); /*将修改的数据保存*/ break;} fclose(fp); } void del() /*删除ouru中的某个学生的数据*/ {int a,b,f; char positions[10]; if((fp=fopen("ouru","rb+"))==NULL) /*以读写打开ouru文件*/ {printf("Can not open file!"); return;} printf("Input the deleted number:"); /*输入要删除的学生号码*/ scanf("%s",positions); for(i=0;fread(&stu[i],sizeof(struct student),1,fp)!=0;i++); /*查找文件中有多少个学生的数据*/ f=i; for(a=0;a<i;a++) /*找出要删除的学生的数据并把后面的数据全都向前移一位*/ {if(strcmp(positions,stu[a].num)==0) { for(b=a;b<i;b++) {strcpy(stu[b].num,stu[b+1].num); strcpy(stu[b].name,stu[b+1].name); strcpy(stu[b].sex,stu[b+1].sex); stu[b].age=stu[b+1].age; strcpy(stu[b].addr,stu[b+1].addr); stu[b].score=stu[b+1].score;} f=f-1; break;} } fclose(fp); fopen("ouru","w"); /*将删除后的结果保存到ouru文件里*/ for(a=0;a<f;a++) fwrite(&stu[a],sizeof(struct student),1,fp); fclose(fp);} void examine() /*查看ouru文件中的资料*/ {int i; if((fp=fopen("ouru","r"))==NULL) /*以只读的方式打开ouru文件*/ {printf("Cannot open the file\n"); return;} printf("\n"); printf("num name sex age addr score\n"); /*读取各个学生数据的同时把它们显示出来*/ for(i=0;(fread(&stu[i],sizeof(struct student),1,fp))!=0;i++) {printf("%-10s%-10s%-8s%-9d%-17s%d\n",stu[i].num,stu[i].name,stu[i].sex,stu[i].age,stu[i].addr,stu[i].score);} printf("\n"); fclose(fp); } main() {int choose; /*显示主界面*/ printf("********************************************************************************\n"); printf("--------------------------------------------------------------------------------\n\n"); printf(" Welcome to the student system\n"); printf(" Producer:ouru\tRegistration number:03011123\n"); printf("\n\n--------------------------------------------------------------------------------\n"); printf("********************************************************************************\n"); printf("Please the choice:\n"); printf("\t\t\t1. Input the student data\n"); printf("\t\t\t2. Add the new studetn data\n"); printf("\t\t\t3. Change a data\n"); printf("\t\t\t4. Insert a new data\n"); printf("\t\t\t5. Delete the student data\n"); printf("\t\t\t6. Manifestation student data\n"); printf("\t\t\t7. Main menu\n"); printf("\t\t\t8. exit\n\n\n"); scanf("%d",&choose); /*选择想要操作的选项*/ while(choose!=8) /*当选择8的时候不再循环并退出*/ { switch(choose) {case 1:printf("Please input the student total:"); /*当choose为下面的数时执行相应的功能*/ scanf("%d",&N); for(i=0;i<N;i++) input(); save();break; case 2:add();break; case 3:change();break; case 4:insert();break; case 5:del();break; case 6:examine();break; case 7:printf("\n\n\nPlease the choice:\n"); printf("\t\t\t1. Input the student data\n"); printf("\t\t\t2. Add the new studetn data\n"); printf("\t\t\t3. Change a data\n"); printf("\t\t\t4. Insert a new data\n"); printf("\t\t\t5. Delete the student data\n"); printf("\t\t\t6. Manifestation student data\n"); printf("\t\t\t7. Main menu\n"); printf("\t\t\t8. exit\n\n\n");break; default :printf("error\n");} scanf("%d",&choose); } }

wangjing45431

【信息科学与工程学】【运营科学】第二篇 C4信息与通信网络运营 (C4) ——数据中心网络运营04

典型值:λ1​∈[−0.02,−0.01], λ2​∈[−0.01,0], η1​,η3​∈[0.1,0.3], η2​,η4​∈[0.05,0.15]参数:δ1​∈[−0.8,−0.3], δ2​∈[−0.5,−0.2], δ3​∈[−0.4,−0.1], δ4​∈[−0.6,−0.2]参数:φ1​∈[0.1,0.3], φ2​∈[−0.2,−0.05], φ3​∈[−0.1,0.1], φ4​∈[−0.3,−0.1]参数:α∈[0.3,0.6], β∈[0.2,0.4], γ∈[0.01,0.03]

flyair_China

【信息科学与工程学】【数据中心】【通信工程】 第六篇 智算中心Infiniband组网

维度训练区(IB网络)推理区(IB网络)公共服务区(VxLAN)存储区(IB存储网络)管理区(以太网)网络技术​InfiniBand HDR 200G/NDR 400GInfiniBand HDR 200G以太网VxLAN/EVPNInfiniBand HDR 200G + NVMe-oF以太网10/25G拓扑架构​双层Fat-Tree优化双层Fat-Tree简化三层CLOS(Spine-Leaf)专用IB存储Fabric双层CLOS交换层数​2层(Leaf-Spine)2层(Leaf-Spine)3层(A

flyair_China

【信息科学与工程学】【数据科学】数据科学领域 第六篇 算法设计 07 堆、栈、表、矩阵、集合、队列、数组、字符串、树、图、动态规划、结构体、元组的算法01

当前段必须包含所有字符的最后出现位置。1. 字符串分割成最多片段2. 基因序列功能域划分3. 文本段落划分4. 音频声道分离5. 图像色彩分区6. 社交网络社群划分7. 蛋白质结构域8. 音乐乐章分段9. 代码模块划分10. 章节划分特征:一次扫描,贪心确定边界。

flyair_China

【信息科学与工程学】【数据中心】第三十二篇 云数据中心的计算/存储/网络的核心挑战01

状态方程: SOCk+1​=SOCk​−Qn​ik​Δt​;: 三相电流变换到αβ坐标系: iα​=32​​(ia​−21​ib​−21​ic​), iβ​=32​​(23​​ib​−23​​ic​). 计算瞬时有功功率p和无功功率q,经低通滤波器分离直流分量,反变换得基波电流,差值即为谐波指令。: 节点i的信念 bi​(xi​)=ϕi​(xi​)∏j∈N(i)​mji​(xi​), 消息 mij​(xj​)=∑xi​​ϕi​(xi​)ψij​(xi​,xj​)∏k∈N(i)\j​mki​(xi​).

flyair_China
评论 10
收藏 已收藏
分享
返回顶部
abcde_aspnet
ASP 28,401 成员 356,940 内容