Mysql——创建数据库,对表的创建及字段定义、数据录入、字段增加及删除、重命名表。

一.创建数据库

create database db_classics default charset=utf8mb4;//创建数据库
use db_classics;//使用该数据库

二.对表的创建及字段定义

create table if not exists t_hero (
id int primary key auto_increment,
Name varchar(100) not null unique,
Nickname varchar(100) not null unique,
Age int not null unique,
Address text not null unique,
club varchar(100) not null unique,
weapon varchar(100) not null unique,
bloc varchar(100) not null unique
);

 三.数据录入

insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(1,“孙悟空”,”齐天大圣”,600,”花果山水帘洞”,”取经大队”,”金箍棒”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(2,“唐僧”,”金蝉子”,30,”东土大唐”,”取经大队”,”禅杖”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(3,“猪八戒”,”天蓬元帅”,800,”高老庄”,”取经大队”,”九齿钉耙”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(4,“沙悟净”,”卷帘大将”,700,”流沙河”,”取经大队”,”降妖宝杖”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(5,“玉帝”,”玉皇大帝”,30000,”天庭”,”神界”,”开天斧”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(6,“白龙马”,”龙王三太子”,500,”西海龙宫”,”取经大队”,”龙泉宝剑”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(7,“如来佛祖”,”释迦牟尼尊者”,99999,”西天灵山”,”佛教”,”舍利子”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(8,“观影菩萨”,”观世音菩萨”,10000,”南海普陀落伽山潮音洞”,”佛教”,”玉净瓶”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(9,“黑熊怪”,”黑风怪”,500,”黑风洞”,”妖怪”,”黑缨枪”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(10,“红孩儿”,”圣婴大王”,400,”钻头号山”,”妖界”,”火尖枪”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(11,“牛魔王”,”大力牛魔王”,2000,”翠云山芭蕉洞”,”妖界”,”混铁棍”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(12,“铁扇公主”,”罗莎女”,1800,”翠云山芭蕉洞”,”妖界”,”芭蕉扇”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(13,“镇元子”,”镇元大仙”,20000,”五庄观”,”神界”,”拂尘”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(14,“菩提老祖”,”须菩提祖师”,20000,”灵台方寸山斜月三星洞”,”神界”,”拂尘”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(15,“白骨精”,”白骨夫人”,1000,”白虎岭”,”妖界”,”白骨剑”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(16,“金角大王”,”大大王”,800,”平顶山莲花洞”,”妖界”,”紫金红葫芦”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(17,“银角大王”,”二大王”,700,”平顶山莲花洞”,”妖界”,”羊脂玉净瓶”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(18,“哪吒”,”哪吒三太子”,800,”天庭”,”神界”,”风火轮”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(19,“杨戬”,”二郎神”,2000,”天庭”,”神界”,”三尖双刃刀”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(20,“太上老君”,”太上祖道”,20000,”天庭”,”神界”,”拂尘”,”西游记”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(21,“刘备”,”刘玄德”,40,” 涿郡涿县”,”蜀国”,”双股剑”,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(22,“关羽”,”关云长”,35,”河东郡解良县”,”蜀国”,”青龙偃月刀”,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(23,“张飞”,”张益德”,32,”涿郡”,”蜀国”,”丈八蛇矛”,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(24,“诸葛亮”,”诸葛孔明”,27,”徐州琅琊阳都”,”蜀国”,””,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(25,“赵云”,”赵子龙”,29,”常山真定”,”蜀国”,”涯角枪”,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(26,“黄忠”,”黄汉升”,50,”南阳”,”蜀国”,”凤嘴刀”,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(27,“马超”,”马孟起”,30,”扶风茂陵”,”蜀国”,”马骑枪”,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(28,“曹操”,”曹孟德”,46,”沛国谯县”,”魏国”,”倚天剑和青釭剑”,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(29,“庞统”,”庞士元”,29,”襄阳”,”蜀国”,””,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(30,“夏侯惇”,”夏元让”,35,” 沛国谯县”,”魏国”,”长枪”,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(31,“司马懿”,”司仲达”,29,”河内温县”,”魏国”,””,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(32,“典韦”,”古之恶来”,30,”陈留己吾”,”魏国”,”大双戟”,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(33,“孙坚”,”孙文台”,40,”吴郡富春”,”吴国”,”长剑”,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(34,“孙策”,”孙伯符”,20,”吴郡富春”,”吴国”,”长剑”,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(35,“孙权”,”孙仲谋”,13,”吴郡富春”,”吴国”,”双剑”,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(36,“黄盖”,”黄公覆”,29,”零陵郡泉陵”,”吴国”,”大双戟”,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(37,“周瑜”,”周公瑾”,28,”庐江郡舒”,”吴国”,””,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(38,“吕蒙”,”吕子明”,32,”汝南富陂”,”吴国”,”长枪”,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(39,“吕布”,”吕奉先”,33,”五原九元”,”魏国”,”方天画戟”,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(40,“徐庶”,”徐元直”,37,”颍川郡长社”,”蜀国”,””,”三国演义”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(41,“光头强”,”强哥”,32,”狗熊零”,”伐木组”,”电锯”,”熊出没”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(42,“凯”,”曙光凯”,37,”四川”,”长城守卫”,”曙光刀”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(43,“花木兰”,”巾帼英雄”,29,”四川”,”长城守卫”,”木兰刀”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(44,“苏烈”,”苏大强”,37,”四川”,”长城守卫”,”大柱”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(45,“百里守约”,”狙击手”,26,”陕西”,”长城守卫”,”狙击枪”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(46,“百里玄策”,”暗影勾手”,28,”陕西”,”长城守卫”,”暗影镰刀”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(47,“李白”,”青年居士”,28,”四川”,”长安”,”大河之剑”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(48,“盾山”,”铁石头”,56,”四川”,”长城守卫”,”坚固之盾”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(49,“李信”,”光暗信”,35,”湖南”,”长城守卫”,”长剑”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(50,“沈梦溪”,”炸弹人”,22,”湖北”,”长城守卫”,”投掷炸弹”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(51,“伽罗”,”长空射手”,26,”重庆”,”长城守卫”,”长空之弓”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(52,“兰陵王”,”暗影刺客”,37,”新疆”,”长城守卫”,”匕首”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(53,“明世隐”,”万能医疗箱”,35,”新疆”,”尧天”,”明镜”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(54,“裴擒虎”,”猛虎勇士”,29,””,”尧天”,”虎爪”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(55,“公孙离”,”盛世舞姬”,26,”新疆”,”尧天”,”雨伞”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(56,“杨玉环”,”杨贵妃”,35,”新疆”,”尧天”,”琵琶”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(57,“弈星”,”天元之弈”,28,”陕西”,”尧天”,”棋盘”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(58,“盘古”,”元始天王”,100000000,”四川”,”日之塔”,”开天斧”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(59,“女娲”,”创世女神”,100000000,”新疆”,”日之塔”,”混沌无极刀”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(60,“后裔”,”逐日者”,80000000,”新疆”,”日之塔”,”逐日之弓”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(61,“太乙真人”,”清微教主”,6000000,”陕西”,”日之塔”,”炼金瓶”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(62,“姜子牙”,”姜太公”,75,”陕西”,”日之塔”,”封神榜”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(63,“曜”,”东方曜”,2000,”北京”,”稷下星之队”,”光剑”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(64,“李元芳”,”水生”,30,”北京”,”长安”,”飞轮”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(65,“狄仁杰”,”断案大师”,46,”北京”,”长安”,”亢龙锏”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(66,“上官婉儿”,”上官昭容”,30,”陕西”,”长安”,”毛笔”,”王者荣耀”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(67,“宋江”,”及时雨”,42,”陕西”,”梁山好汉”,”长剑”,”水浒传”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(68,“晁盖”,”托塔天王”,40,”陕西”,”梁山好汉”,”长剑”,”水浒传”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(69,“卢俊义”,”玉麒麟”,38,”陕西”,”梁山好汉”,”长枪”,”水浒传”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(70,“林冲”,”豹子头”,40,”陕西”,”梁山好汉”,”长枪”,”水浒传”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(71,“李逵”,”黑旋风”,40,”四川”,”梁山好汉”,”双斧”,”水浒传”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(72,“鲁智深”,”花和尚”,36,”四川”,”梁山好汉”,”禅杖”,”水浒传”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(73,“武松”,”行者”,38,”重庆”,”梁山好汉”,”双刀”,”水浒传”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(74,“杨志”,”青面兽”,35,”重庆”,”梁山好汉”,”长枪”,”水浒传”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(75,“吴用”,”智多星”,39,”重庆”,”梁山好汉”,”长剑”,”水浒传”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(76,“土行孙”,”遁地者”,30,”陕西”,”伐纣队伍”,”捆仙绳”,”封神榜”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(77,“姬发”,”周武王”,21,”重庆”,”伐纣队伍”,”长剑”,”封神榜”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(78,“邓婵玉”,”六合星君”,26,”陕西”,”伐纣队伍”,”双刀”,”封神榜”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(79,“闻仲”,”闻太师”,55,”湖北”,”纣王队伍”,”雌雄蛟龙双鞭”,”封神榜”);
insert into t_hero(id, Name, Nickname, Age, Address,job,weapon,bloc) values(80,“纣王”,”子受”,40,”陕西”,”纣王队伍”,”长剑”,”水浒传”);

 四.字段增加及删除

增加字段
Alter table t_hero add gender enum('男', '女') default '女';
Alter table t_hero add classes varchar(100);删除字段
Alter table t_hero drop classes;

五.重命名表 

alter table t_hero rename hero;

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/150751.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

机器视觉工程师,公司设置奖金,真的为了奖励你吗?其实和你没关系

​据说某家大厂,超额罚款,有奖有罚很正常,但是我觉得你罚款代理商员工就不一样了,把代理商当成你的员工,我就觉得这些大厂的脑回路有问题。 有人从来没听说过项目奖金,更没有奖金。那么为什么设置奖金呢&a…

深入浅出,SpringBoot整合Quartz实现定时任务与Redis健康检测(二)

前言 在上一篇深入浅出,SpringBoot整合Quartz实现定时任务与Redis健康检测(一)_往事如烟隔多年的博客-CSDN博客 文章中对SpringBoot整合Quartz做了初步的介绍以及提供了一个基本的使用例子,因为实际各自的需求任务不尽相同因此并…

Neo4j深度学习

Neo4j的简介 Neo4j是用Java实现的开源NoSQL图数据库。从2003年开始开发,2007年正式发布第一版,其源码托管于GitHtb。Neo4j作为图数据库中的代表产品,已经在众多的行业项目中进行了应用,如:网络管理、软件分析、组织和…

电梯安全监测丨S271W无线水浸传感器用于电梯机房/电梯基坑水浸监测

城市化进程中,电梯与我们的生活息息相关。高层住宅、医院、商场、学校、车站等各种商业体建筑、公共建筑中电梯为我们生活工作提供了诸多便利。 保障电梯系统的安全至关重要!特别是电梯机房和电梯基坑可通过智能化改造提高其安全性和稳定性。例如在暴风…

参与现场问题解决总结(Kafka、Hbase)

一. 背景 Kafka和Hbase在现场应用广泛,现场问题也较多,本季度通过对现场问题就行跟踪和总结,同时结合一些调研,尝试提高难点问题的解决效率,从而提高客户和现场满意度。非难点问题(历史遇到过问题&#xf…

乌班图22.04 kubeadm简单搭建k8s集群

1. 我遇到的问题 任何部署类问题实际上对于萌新来说都不算简单,因为没有经验,这里我简单将部署的步骤和想法给大家讲述一下 2. 简单安装步骤 准备 3台标准安装的乌班图server22.04(采用vm虚拟机安装,ip为192.168.50.3&#xff0…

Flutter横屏实践

1、Flutter设置横屏 // 强制横屏 SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft,DeviceOrientation.landscapeRight ]); // 强制竖屏 SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);另…

chromedriver下载与安装方法

下载与安装: 1.查看Chrome浏览器版本 首先,需要检查Chrome浏览器的版本。请按照以下步骤进行: 打开Chrome浏览器。 点击浏览器右上角的菜单图标(三个垂直点)。 选择“帮助”(Help)。 在下拉菜单中选择“…

el-table进阶(每条数据分行或合并)

最麻烦的还是css样式&#xff0c;表格样式自己调吧 <!-- ——————————————————————————————————根据数据拓展表格—————————————————————————————————— --> <div style"display: flex"&…

Python编程:创建图像浏览器应用程序

介绍&#xff1a; 图像浏览器应用程序是一种非常常见和实用的工具。它们使用户能够轻松地浏览和管理计算机中的图像文件。本文将介绍如何使用Python编程语言和wxPython库创建一个简单的图像浏览器应用程序。我们将学习如何利用Python的os模块进行文件和文件夹操作&#xff0c;以…

【探索AI潜能,连结现代通讯】相隔万里,我们与AI一同赏月。

1️⃣写在前面 近年来&#xff0c;AI得到了迅猛的发展&#xff0c;尤其是大模型的出现受到了广泛的关注和讨论&#x1f680;。ChatGPT、文心一言等纷纷登场&#xff0c;可谓是百家争鸣❗ 而AI大模型所延申出的子项目如AI绘画、AI写作等&#xff0c;在各自的领域展示出了惊人的…

Linux和Hadoop的学习

目录 1. Linux的常用快捷键2. Hadoop集群部署问题汇总 1. Linux的常用快捷键 复制&#xff1a;CtrlshiftC 粘贴&#xff1a;CtrlshiftV TAB&#xff1a;补全命令 编写输入&#xff1a;i 退出编写&#xff1a;esc 保存并退出&#xff1a;shift&#xff1a; 2. Hadoop集群部署问…

趣味工具箱小程序源码

趣味工具箱小程序源码&#xff0c;支持功能去水印&#xff0c;精选壁纸&#xff0c;图片压缩&#xff0c;文字生成二维码&#xff0c;图片加水印&#xff0c;模拟来电&#xff0c;手持弹幕&#xff0c;掷骰子…等 使用小工具&#xff0c;一个小程序有几十个功能。 源码下载&am…

2023全新小红书图集和视频解析去水印网站源码

2023全新小红书图集和视频解析去水印网站源码 小红书视频图集解析网站源码&#xff0c;在红书看到好看的图片以及好看的头像&#xff0c;但是直接下载又有水印就非常难受&#xff0c;这个可以一键解析去除水印&#xff0c;支持统计解析次数&#xff0c;本地接口。 源码下载&a…

【浅谈IDE宏指令录制】为加速chrome扩展国际化,我从vscode回归notepad++

vscode 的宏录制功能 —— 差强人意 安装vscode开源扩展&#xff1a;https://github.com/C10udburst/macros-vscode.git 可开启类似于 notetepad 的宏录制与回放功能&#xff01;比如录制字符串替换&#xff0c;能记录操作之时&#xff0c;替换对话框中的文本&#xff01;&am…

(论文调研) Multi-task的网络结构 在图像去噪问题中的应用

1.SNIDER: Single Noisy Image Denoising and Rectification for Improving License Plate Recognition 这是一篇用于实现端到端的车牌恢复 (LPR: License Plate Recognition) 网络, 其中使用去噪和校正网络来生成清晰的恢复图像, 以实现稳健的 LPR 性能. 这个网络的名称为SN…

知识图谱1_2——下载neo4j客户端

客户端下载 这里展现一种通过客户端进行操作的方法 https://neo4j.com/download/ 下载desktop客户端 填写完成后开始下载 下载完成后&#xff0c;在命令行输入 chmod x <文件名> #给予文件权限 sudo add-apt-repository universe #安装.appimage所需的包fuse&#x…

CSS点击切换或隐藏盒子的卷起、展开效果

<template><div class"main"><el-button click"onCllick">切换</el-button><transition name"slideDown"><div class"info" v-if"isShow">1111</div></transition></di…

【AI视野·今日Robot 机器人论文速览 第四十八期】Thu, 5 Oct 2023

AI视野今日CS.Robotics 机器人学论文速览 Thu, 5 Oct 2023 Totally 32 papers &#x1f449;上期速览✈更多精彩请移步主页 Daily Robotics Papers LanguageMPC: Large Language Models as Decision Makers for Autonomous Driving Authors Hao Sha, Yao Mu, Yuxuan Jiang, Li…

select实现服务器并发

select的TCP服务器代码 #include <stdio.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <arpa/inet.h> #include <netinet/in.h> #include <sys/select.h> #include…