dos命令行怎么查询mysql数据库

dos命令行怎么查询mysql数据库,第1张

mysql数据的查询是通过sql语句来实现的,常用的查询 *** 作如下:

1、连接数据库

mysql -u 用户名 -p 用户密码

说明:可以在命令中直接接入密码,也可以不加入密码。

2、查看所有数据库

show databases

3、选择数据库

use databasename

3、查看该数据库下所有表

show tables

4、查看表的区段

describe 表名

5、查询表数据

select  字段名 from 表名

学生信息管理系统(C++源代码)

#include <stdio.h>

#include <stdlib.h>

#include <malloc.h>

#include <dos.h>

#include <string.h>

#include <mem.h>

#include <conio.h>

#include <GRAPHICS.H>

#include <time.h>

我郁闷,太长了,贴不上来

基本原理和这个通讯录数据处理程序相似,提问者稍加修改就可以使用。

clear

set safe off

use txl

text

※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※

※ 1.输入 2.修改 3.插入 4.删除 ※

※ 5.按姓名升序显示 6.按邮政编码升序显示 ※

※ 7.按姓名查询 8.退出 ※

※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※

endtext

input "请按数字键选择" to aa

do case

case aa=1

go bott

accept "请输入姓名:" to xm

accept "请输入性别:" to xb

accept "请输入电话号码:" to dhhm

accept "请输入家庭住址:" to jtzz

accept "请输入工作单位:" to gzdw

accept "请输入邮政编码:" to yzbm

repl 姓名 with xm,性别 with xb, 电话号码 with dhhm,家庭住址 with jtzz,工作单位 with gzdw,邮政编码 with yzbm

case aa=2

input"请输入您要修改的记录的编号:" to c

go c

? "请修改第"+str(c,1)+"个人的数据!"

disp

accept "请输入姓名:" to xm

accept "请输入性别:" to xb

accept "请输入电话号码:" to dhhm

accept "请输入家庭住址:" to jtzz

accept "请输入工作单位:" to gzdw

accept "请输入邮政编码:" to yzbm

repl 姓名 with xm,性别 with xb, 电话号码 with dhhm,家庭住址 with jtzz,工作单位 with gzdw,邮政编码 with yzbm

case aa=3

append blank

accept "请输入姓名:" to xm

accept "请输入性别:" to xb

accept "请输入电话号码:" to dhhm

accept "请输入家庭住址:" to jtzz

accept "请输入工作单位:" to gzdw

accept "请输入邮政编码:" to yzbm

repl 姓名 with xm,性别 with xb, 电话号码 with dhhm,家庭住址 with jtzz,工作单位 with gzdw,邮政编码 with yzbm

case aa=4

input "请输入您想要删除的记录号" to d

go d

delete

accept "确认删除请按小写字母y,否则取消删除)" to e

if e="y"

pack

else

recall

endif

case aa=5

index on 姓名 to xm

list

case aa=6

index on 邮政编码 to yzbm

list

case aa=7

accept "请输入您要查询的姓名" to f

list for 姓名=f

case aa=8

wait "系统即将关闭" window timeout 3

exit

othe

messagebox("请重新选择",0+64,"出错了")

endc

set safe on

*这个程序能完成任务,不过界面不好。可以这样修改:

*新建一个表单(主表单,表单1),增加8个按钮,每个按钮的名称caption同上面程序中的菜单;再增加一个按钮,caption为“退出”,保存表单1。

*新建一个数据处理表单(表单2),向表单添加标签,caption为“姓名”,再增加一个文本控件text1,用来处理“姓名”数据;继续向表单添加标签,caption为“性别”,增加一个文本控件text2,用来处理“性别”数据;.........向表单添加标签,caption为“邮政编码”,再增加一个文本控件text6,用来处理“邮政编码”数据。把标签和文本控件适当整理齐整。增加一个按钮,caption 为“保存”,再增加一个按钮,caption为“退出”,

双击表单空白处,出现load事件,输入

thisform.text1.value=xm

thisform.text2.value=xb

thisform.text3.value=dhhm

thisform.text4.value=jtzz

thisform.text5.value=gzdw

thisform.text6.value=yzbm

输入完毕,关闭load事件,这是给表单2的几个控件赋初值。

双击“退出”按钮,输入

thisform.release

关闭事件,双击“保存”按钮,输入

repl 姓名 with thisform.text1.value,

性别 with thisform.text2.value,

电话号码 with thisform.text2.value,

家庭住址 with thisform.text2.value,

工作单位 with thisform.text2.value,

邮政编码 with thisform.text2.value

保存表单2。

打开表单1,双击表单的空白处,出现load事件,输入:

set safe off

use txl

public xm,xb,dhhm,jtzz,gzdw,yzbm

双击“输入”按钮,输入

go bott

*下面给表单2赋初值

xm=姓名

xb=性别

dhhm=电话号码

jtzz=家庭住址

gzdw=工作单位

yzdm=邮政编码

do form 表单2

双击“修改”按钮,输入

input"请输入您要修改的记录的编号:" to c

go c

*下面给表单2赋初值

xm=姓名

xb=性别

dhhm=电话号码

jtzz=家庭住址

gzdw=工作单位

yzdm=邮政编码

do form 表单2

双击“插入”按钮,输入

appe blank

*下面给表单2赋初值

xm=姓名

xb=性别

dhhm=电话号码

jtzz=家庭住址

gzdw=工作单位

yzdm=邮政编码

do form 表单2

双击“删除”按钮,输入

input "请输入您想要删除的记录号" to d

go d

delete

accept "确认删除请按小写字母y,否则取消删除)" to e

if e="y"

pack

else

recall

endif

双击“按姓名升序显示”按钮,输入

index on 姓名 to xm

brow

双击“按邮政编码升序显示”按钮,输入

index on 邮政编码 to yzbm

brow

双击“按姓名查询”按钮,输入

accept "请输入您要查询的姓名" to f

brow for 姓名=f

双击“退出”按钮,输入

close data

set safe on

thisform.release


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/10860922.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-11
下一篇 2023-05-11

发表评论

登录后才能评论

评论列表(0条)

保存