ZKX's LAB

怎样用SQL语句查询一个数据库中的所有表 sql数据库语句跟踪

2021-04-06知识3

数据库,SQL语句,查询 c group by 系别

数据库 sql语句查询 貌似楼上的兄弟写的有些问题哦,lz试一下吧。有问题再追问吧。1.select t1.sno,t1.sname,t3.scorefrom students t1,sports t2,attending t3where t1.sno=t3.snoand t2.spno=t3.spnoand t2.spname in('滑轮','羽毛球');2.select t1.snofrom student t1where not exists(select*from student t2,attending t3where t2.sno=t3.sno and t2.sno='李磊'and not exists(select*from attending t4where t4.sno=t1.sno and c.spno=t3.spno));3.select t1.sname,count(spno)from student a,(select t1.sno,count(spno)from student t1,attending t2where t1.sno=t2.sno and t2.score>;85group by t1.snohaving count(spno)>;=3)bwhere a.sno=b.sno;

怎样用SQL语句查询一个数据库中的所有表 查询一个数据库中的所有表2113sql语句是show tables;显示所有数据5261库的4102命令是:show databases;要查看某个数据库先1653要进入数据库使用user<;数据库名>;命令;进入数据库之后才能查询数据库中有哪些表。使用以下命令即可查出所有表:show tables;扩展资料mysql数据库的基本sql操作命令介绍:1、显示当前数据库服务器中的数据库列表:mysql>;SHOW DATABASES;2、建立数据库:mysql>;CREATE DATABASE 库名;3、建立数据表:mysql>;USE 库名;mysql>;CREATE TABLE 表名(字段名 VARCHAR(20),字名 CHAR(1));4、删除数据库:mysql>;DROP DATABASE 库名;5、删除数据表:mysql>;DROP TABLE 表名;6、将表中记录清空:mysql>;DELETE FROM 表名;7、往表中插入记录:mysql>;INSERT INTO 表名 VALUES(\"hyq\",\"M\");8、更新表中数据:mysql->;UPDATE 表名 SET 字段名1='a',字段名2='b' WHERE 字段名3='c';9、用文本方式将数据装入数据表中:mysql>;load data local infile\"d:/mysql.txt\"into table 表名;10、导入.sql文件命令:mysql>;USE 数据库名;mysql>;source d:/mysql.sql;

#sql数据库语句基础知识讲解#sql数据库语句跟踪#sql跟踪工具#sql存储过程跟踪讲解#oraclesql跟踪

随机阅读

qrcode
访问手机版