Tagged

database mysql

A collection of 14 posts

database mysql

Mysql learning-Chapter 1 (table design forgets the paradigm standard, primary key design)

First normal formAll attributes are required to be inseparable basic data items; Second normal formResolve partial dependence; Third normal formSolve transitive dependencies. Engineering table structure designEach table must have a primary key (self-incremented primary key design, UUID primary key design, business custom generated primary key) Eliminate the possibility of redundant

database mysql

mysql subquery

One, subqueryThe select statement embedded in other SQL statements is also called nested query Two, single-line subqueryA subquery statement that returns only one row of data. -- 子查询-- 查询与小王同一部门的员工-- 先查询小王所属部门编号-- 把SELECT deptno FROM emp WHERE ename = '小王'当作一个子查询使用SELECT deptno FROM emp WHERE ename = '小王'SELECT*FROM emp WHERE deptno= (SELECT deptno FROM