当前位置:网站首页>Database Experiment 1. Database creation and basic query
Database Experiment 1. Database creation and basic query
2022-04-21 07:58:00 【Vijurria】
(1) use update Statement modification student In the table 1 Bar record , Record the : full name 、 Gender and college attributes are changed to the true information of the students doing the experiment , Other attribute values cannot be modified .
update student
set sname='Vijurria',ssex=' Woman ',sdept=' Business School '
where sno='201215121';
(2) Query age is greater than or equal to 19 Years old and less than or equal to 21 Information for all students aged .
select *
from student
where sage>=19 and sage<=21;
(3) Query that the course name contains “ data ” Two character course number and course name .
select cno,cname
from course
where cname LIKE'% data %';
(4) Check the penultimate of all student names 2 The word is “ writing ” Information about our students .
select*
from student
where sname LIKE'% writing _';
(5) Query the number of courses selected by each student , The query result includes the student number , Number of courses selected , And sort them in descending order according to the number of courses selected .
select sno,count(cno)
from sc
group by sno
order by count(cno) desc;
(6) Check the highest score of each course , The query result includes course number 、 The highest score in this course , And the result only shows that the highest score is greater than or equal to 95 Information about .
select cno,max(grade)
from sc
group by cno
having max(grade)>=95;
(7) towards student Insert in table 1 Bar record , The recorded value is :('201215999',' linghu chong ',' male ',21,' Performance Academy ')
insert
into student(sno,sname,ssex,sage,sdept)
value ('201215999',' linghu chong ',' male ','21',' Performance Academy ');
(8) towards student Add... To the list favorite( hobby ) Column , Its data type is varchar(200), That is, the maximum length is 200 Variable length data type .
alter table student add sfavorite varchar(200);
(9) to student Tabular sname Property adds a uniqueness (unique) Constraints .
alter table student add UNIQUE(sname);
版权声明
本文为[Vijurria]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210700320517.html
边栏推荐
- 2022年危险化学品生产单位安全生产管理人员考试模拟100题模拟考试平台操作
- 显示器选购参考天梯
- Bluetooth profile specification (AVRCP chapter) 5.1 connection and release of vctp
- 343. Find the product of decomposed integers and maximize integer break
- Yolov5 5.0调用本地摄像头
- 2022起重机械指挥特种作业证考试题库及模拟考试
- leetcode题目--120.三角形最小长度和,简单dp
- High availability system design
- 蓝牙开源协议栈BTstack汇总
- Unable to infer base url. This is common when using dynamic servlet registration or when the API is
猜你喜欢
![[image fusion] image fusion based on Laplace pyramid + wavelet transform, including Matlab source code](/img/05/ea5838603be3b09066a80a6b22f41e.png)
[image fusion] image fusion based on Laplace pyramid + wavelet transform, including Matlab source code

【以太网交换安全】---端口安全及MAC地址飘移防止与检测

Server deployment SVN environment

Record the problems and solutions encountered in using fastjson message converter

Introduction to zephyr 1.0 of Internet of things operating system zephyr (Introduction)

Leetcode topic -- 120 Minimum length sum of triangles, simple DP

Advanced C language pointer (1. First and second order pointers)

2022起重机械指挥特种作业证考试题库及模拟考试

Introduction to btstack 1.0 of Bluetooth open source protocol stack

kubesphere3. 0 forgot admin password
随机推荐
Unity性能优化之UI
2022年危险化学品生产单位安全生产管理人员考试模拟100题模拟考试平台操作
[image fusion] image fusion based on curvelet transform (evaluation index), including Matlab source code
Postgre (PG) - SQL script record
Introduction to QT 5.12 actual combat
Leetcode topic -- 120 Minimum length sum of triangles, simple DP
Server deployment SVN environment
类中的泛型以及泛型类型
Common SQL
PHP infinite classification (recursive)
kubesphere3.0忘记admin的密码
leetcode 19. Delete the penultimate node of the linked list
Set Google chrome dark black background
sys.stdin.readline和readlines以及input()
An entity class maps a field
Files and Directories
无意中发现了一位清华妹子的资料库!
Introduction to threads -- thread class -- several ways to start threads
数据库实验一、数据库的创建及基本查询
PHP RSA encryption