数据库设计
数据库设计 ER模型 Entity-Relationship,实体-关系模型。该模型的图形化表示就是ER图。 1.用矩形表示实体。 2.用椭圆表示实体属性。 3.用零星表示是体检关系。 例一:有一个简单的数据库系统,实体有班级、学生、课程。 一个班有若干个学生,一个学生只能属
数据库设计
ER模型
Entity-Relationship,实体-关系模型。该模型的图形化表示就是ER图。
1.用矩形表示实体。
2.用椭圆表示实体属性。
3.用零星表示是体检关系。
例一:有一个简单的数据库系统,实体有班级、学生、课程。
一个班有若干个学生,一个学生只能属于一个班。
一个学生可以选修多门课,一门课有若干学生选修。
将ER图转换为关系数据模型
1.实体的转换
一个实体转化为一个关系模式。实体的属性就是关系模式的属性,主键类同。
2.联系的转换
(1)两实体间1:1的联系可以转换为一个独立的关系模式,也可以与任意一端的关系模式合并。
(2)两实体间1:N的联系可以转换为一个独立的关系模式,也可以与N端对应的关系模式合并。
(3)两实体间M:N的联系,必须为联系产生一个新的关系模式。该模式中至少包含两实体的主键。若联系有属性,也要加入该新的关系模式中。
关系代数
传统的集合运算:并、交、补、差、笛卡尔积。
专门的关系运算:投影(垂直分割)、选择(水平分割)、连接(关系的结合)、除法(笛卡尔积的逆运算)。
笛卡尔积:设元素R和S的属性个数分别为r、s。则R*S={|A属于R,B属于S}。
左右连接、内连接
左外连接是以左边的表为基准。通俗的讲,先将左边的表全部显示出来,然后把右边表中符合条件的数据项拼接上去。
右外连接以右边表为基准。
内连接就是只显示匹配得上的数据项。
示例:
[TEST1@orcl#16-12月-11] SQL>select * from t1;
ID NAME
---------- --------------------
1 aaa
2 bbb
[TEST1@orcl#16-12月-11] SQL>select * from t2;
ID AGE
---------- ----------
1 20
3 30
左外连接:
[TEST1@orcl#16-12月-11] SQL>select * from t1 left join t2 on t1.id=t2.id;
ID NAME ID AGE
---------- -------------------- ---------- ----------
1 aaa 1 20
2 bbb
右外连接:
[TEST1@orcl#16-12月-11] SQL>select * from t1 right join t2 on t1.id=t2.id;
ID NAME ID AGE
---------- -------------------- ---------- ----------
1 aaa 1 20
3 30
内连接:
[TEST1@orcl#16-12月-11] SQL>select * from t1 inner join t2 on t1.id=t2.id;
ID NAME ID AGE
---------- -------------------- ---------- ----------
1 aaa 1 20
关系的规范化
函数依赖。X、Y为关系R中的两个属性。若Y可完全由X唯一确定,则称Y依赖于X。记作X->Y.
索引类型
唯一索引:索引了不能有两行记录行同。非唯一索引:与上述概念相对。
单列索引:索引根据单列创建。
复合索引:索引根据多列创建。
聚集索引:对表进行物理排序的索引。比如汉语字典按拼音字母顺序进行聚集索引。
非聚集索引:不对表进行物理排序的索引。比如汉语字典中偏旁部首的索引。数据库中可有1个聚集索引和多个聚集索引。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

According to news on July 12, the Honor Magic V3 series was officially released today, equipped with the new Honor Vision Soothing Oasis eye protection screen. While the screen itself has high specifications and high quality, it also pioneered the introduction of AI active eye protection technology. It is reported that the traditional way to alleviate myopia is "myopia glasses". The power of myopia glasses is evenly distributed to ensure that the central area of sight is imaged on the retina, but the peripheral area is imaged behind the retina. The retina senses that the image is behind, promoting the eye axis direction. grow later, thereby deepening the degree. At present, one of the main ways to alleviate the development of myopia is the "defocus lens". The central area has a normal power, and the peripheral area is adjusted through optical design partitions, so that the image in the peripheral area falls in front of the retina.

At the forefront of software technology, UIUC Zhang Lingming's group, together with researchers from the BigCode organization, recently announced the StarCoder2-15B-Instruct large code model. This innovative achievement achieved a significant breakthrough in code generation tasks, successfully surpassing CodeLlama-70B-Instruct and reaching the top of the code generation performance list. The unique feature of StarCoder2-15B-Instruct is its pure self-alignment strategy. The entire training process is open, transparent, and completely autonomous and controllable. The model generates thousands of instructions via StarCoder2-15B in response to fine-tuning the StarCoder-15B base model without relying on expensive manual annotation.

According to news on May 13, vivoX100s was officially released tonight. In addition to excellent images, the new phone also performs very well in terms of signal. According to vivo’s official introduction, vivoX100s uses an innovative universal signal amplification system, which is equipped with up to 21 antennas. This design has been re-optimized based on the direct screen to balance many signal requirements such as 5G, 4G, Wi-Fi, GPS, and NFC. This makes vivoX100s the mobile phone with the strongest signal reception capability in vivo’s history. The new phone also uses a unique 360° surround design, with antennas distributed around the body. This design not only enhances the signal strength, but also optimizes various daily holding postures to avoid problems caused by improper holding methods.

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

1. Introduction Over the past few years, YOLOs have become the dominant paradigm in the field of real-time object detection due to its effective balance between computational cost and detection performance. Researchers have explored YOLO's architectural design, optimization goals, data expansion strategies, etc., and have made significant progress. At the same time, relying on non-maximum suppression (NMS) for post-processing hinders end-to-end deployment of YOLO and adversely affects inference latency. In YOLOs, the design of various components lacks comprehensive and thorough inspection, resulting in significant computational redundancy and limiting the capabilities of the model. It offers suboptimal efficiency, and relatively large potential for performance improvement. In this work, the goal is to further improve the performance efficiency boundary of YOLO from both post-processing and model architecture. to this end

According to news on July 29, the Honor X60i mobile phone is officially on sale today, starting at 1,399 yuan. In terms of design, the Honor X60i mobile phone adopts a straight screen design with a hole in the center and almost unbounded ultra-narrow borders on all four sides, which greatly broadens the field of view. Honor X60i parameters Display: 6.7-inch high-definition display Battery: 5000mAh large-capacity battery Processor: Dimensity 6080 processor (TSMC 6nm, 2x2.4G A76+6×2G A55) System: MagicOS8.0 system Other features: 5G signal enhancement, smart capsule, under-screen fingerprint, dual MIC, noise reduction, knowledge Q&A, photography capabilities: rear dual camera system: 50 million pixels main camera, 2 million pixels auxiliary lens, front selfie lens: 8 million pixels, price: 8GB

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

The benchmark YOLO series of target detection systems has once again received a major upgrade. Since the release of YOLOv9 in February this year, the baton of the YOLO (YouOnlyLookOnce) series has been passed to the hands of researchers at Tsinghua University. Last weekend, the news of the launch of YOLOv10 attracted the attention of the AI community. It is considered a breakthrough framework in the field of computer vision and is known for its real-time end-to-end object detection capabilities, continuing the legacy of the YOLO series by providing a powerful solution that combines efficiency and accuracy. Paper address: https://arxiv.org/pdf/2405.14458 Project address: https://github.com/THU-MIG/yo
