SQL and Database Systems 基本知识
Relational Database Basic Concepts
- Databases
Relational Databases Management System consists of one or more databases.
- Entity
Entities are converted to tables as the physical design stage.
- Data Type
The common data type are boolean ,integer,float,currency,string,date and time.
- DDL
DDL stands for Data Definition language. DDL commands can be used to create,modify database structures,Sample commands are CREATE,ALTER and DROP.
- DML
DML stands for Data Manipulation Language. DML commands can be used to insert data into database tables,retrieve or modify data,deleting data in database.Sample DML commands are INSERT,DELETE and UPDATE.
- DCL
DCL stands for Data Control Language. DCL commands can be used to create rights and permissions. Sample DCL commands are GRANT and REVOKE.
- Query
SQL developers can use a query to get data or information from one or more database tables.
- Attributes
Types of Attributes:
- Simple attribute
An attribute that cannot be divided into subparts.
- Composite attribute
An attribute that can be divided into simple attributes.
- Derived attribute
An attribute whose value can be derived(calculated) from other attribute.
- Single-value attribute
An attribute contains a single value.
- Multi-value attribute
An attribute have more than one values.
- Tables
Each database contains collection of tables.
- Fields(Columns)
Each table consists of smaller entities called fields or columns.
- Records(Rows)
Each table consists of one or more records(rows)
- Primary Key
Each table can have only one primary key.
- Foreign Key
Database tables might be related by (foreign key) common column(s)
- NULL
Null value is a field with no value.
- Constraints
Constraints define rules to restrict what values can be stored in columns.
Common Constraints
- NOT NULL
A column does not accept NULL values.
- DEFAULT
Set a default value to a column when no value is specified to a column.
- UNIQUE
No duplicated values in a column
- Primary Key
A column or a combination of columns that uniquely defines a row.The primary key column can not contain a NULL value.
- Foreign Key
A foreign key in one table point to a candidate key in another table.
- CHECK
Check whether the value is valid or not
- Data Integrity
- Entity Integrity
No duplicate records in a table
- Referential Integrity
Referential integrity is violated when deleting a row that is referenced by a foreign key in another table.
- Entity Relational Diagram(ERD)
- Types of Relationships
- One-to-Many Relationships
- Many-to-Many Relationships
- One-to-One Relationships
- Self-Referencing Relationships
相关文章
- 《ASP.NET MVC4 WEB编程》学习笔记------Entity Framework的Database First、Model First和Code Only三种开发模式
- [AngularFire 2] Object Observables - How to Read Objects from a Firebase Database?
- 曾文旌的私房菜:开源数据库Greenplum Database的实现解析
- [SQL] sql server中如何查看执行效率不高的语句
- Etcd故障排除--recovering backend from snapshot error: failed to find database snapshot file (snap: snaps
- 蒙牛 customer Project Support - 同时更新两个database table
- SAP HANA Database Explorer 里的 SQL 语句如何排错 trouble shoot
- 未能正确加载“VSTS for Database Professionals Sql Server Data-tier Application”包。
- Atitti 编程语言高级 api 与高级知识 堆栈api 异常api Meta anno注解元数据api Ref 反射api Database meta api 字节码库如果你正在编写一个框架或者
- Database之SQL:自定义创建数据库的各种表demo集合(以方便理解和分析sql的各种增删改查语法的具体用法)
- Database之SQL:RDBMS关系型数据库的简介、SQL语言的简介(原理/各大方言对比)、基础(SQL执行顺序/五大类函数/索引/视图/事务/安全/存储过程/游标/优化)之详细攻略
- Database之SQLSever:SQL函数(字符串函数、数学函数、文本和图像函数、日期和时间函数、系统函数等)相关概念及其相关案例之详细攻略
- Database之SQL:SQL之over partition by开窗函数的简介、使用方法(求各班级内各自排名/求各班级内第一名/求各班级内分数递增和等案例解析)之详细攻略
- Database之SQLSever:SQL函数(字符串函数、数学函数、文本和图像函数、日期和时间函数、系统函数等)相关概念及其相关案例之详细攻略
- Database之SQL:SQL语句操作三类(数据定义语句DDL/数据操作语句DML/数据控制语句DCL/其他基本语句、流程控制语句、批处理语句)概念及其代码实现案例之详细攻略
- Database之SQLSever:SQL命令实现理解索引、规则、默认概念及其相关案例之详细攻略
- Database之SQL:SQL命令实现理解外键、约束(非空约束/唯一性约束/CHECK约束/主键约束/外键约束/查询约束)的概念及其相关案例之详细攻略
- Database之SQLSever:SQLSever数据表管理(GUI法/SQL语句命令法两种方法实现建立表、修改表,以及增、删、改、查)之详细攻略
- sql 精读(四) 标准 SQL 中聚合分析功能示例
- Oracle PL/SQL中的循环处理(sql for循环)
- MySQL Creating and using a Database
- How to create and configure a Pluggable Database(PDB) in Oracle 12c Release 12.2
- 使用RMAN Convert Database命令实现跨平台的数据库迁移
- [ Azure - Database ] 在Azure虚拟机中安装MySQL客户端