数据库的特性

Persistence (allowing access later, after it was created)
Shared source of truth accessible by many users
Ability to store many types of data (efficiently)
Concurrency control (handling multiple db actions at once)


Relational Databases

  • All data is stored in tables
  • Every table is characterized by a list of columns with data types per column, and its set of data (organized in rows)
  • Comes with rules for enforcing data integrity such as constraints and triggers.

Primary Key

  • The primary key is the unique identifier for the entire row, referring to one or more columns.
  • If there are more multiple columns for the primary key, then the set of primary key columns is known as a composite key.

Foreign Key

  • A primary key in another (foreign) table.
  • Foreign keys are used to map relationships between tables.

A SELECT statement is used to query the database for slices of data.

SQL (Structured Query Language)

  • The standard language for communicating with a relational database.
  • Every relational database system has its own “flavor” of SQL it implements because they are not 100% compliant with the SQL standard.
  • Each flavor is called a dialect that is unique per database management system.

Inner joins between two tables returns rows of data that exist across all joined tables, excluding rows that may only exist in one of the tables but not the other table.

Outer joins return every row that exists in the left (in a left outer join) or right (in a right outer join) joined table, while rendering NULL values on rows whose foreign key does not match a record in the other (right or left) table.


Relational database systems follow a client-server model:
Servers, Clients, Hosts

  • In a Client-Server Model, a server serves many clients
  • Servers and clients are programs that run on hosts
  • Hosts are computers connected over a network (like the internet!)

Requests and Responses

  • A client sends a request to the server
  • The server’s job is to fulfill the request with a response it sends back to the client.
  • Requests and responses are served via a communication protocol, which sets up the expectations and rules for how the communication occurs between servers and clients.

Relational Database Clients

  • A database client is any program that sends requests to a database
  • In some cases, the database client is a web server! When your browser makes a request, the web server acts as a server (fulfilling that request), but when the web server requests data from the database, it is acting as a client to that database - and the database is the server (because it is fulfilling the request).

Basically, we call things clients when they are making a request and servers when they are fulfilling a request. Since a web server can do both, it sometimes acts as a server and sometimes acts as a client.


The web server receives a request from the client and sends a request to the database, which sends back a response to the web server, which then sends back a response to the client.


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值