5003 Storing and Retrieving Data

本文介绍了数据库的基本概念,包括数据库系统、数据模型、数据库概述、数据抽象、数据独立性和数据库语言。重点讨论了关系数据模型,强调了关系、属性、键和关系类型。还提到了数据定义语言(DDL)和数据操纵语言(DML),并概述了数据库设计过程,如实体关系模型和关系模型在数据库设计中的应用。
摘要由CSDN通过智能技术生成

Storing and Retrieving Data

First class

生僻单词

retrieve
Concurrency
extraneous
diamond
tuple

What is database

A database system consists of two components
Database (DB) and Database Management System (DBMS)
The DB contains the data
The DBMS is software that stores, manages and
retrieves the information in the DB

Database Overview

Data Models

database

A database models a real-world enterprise, e.g. CityU

data model

A data model is a formal language for describing data

schema

A schema is a description of a particular collection of data using a particular data model

The most widely used data model is the relational data model

relational data model

The main concept relation, essentially a table with rows and columns
Each relation has a schema, e.g. Enrolled(sid: string, cid:
string, gpa: real)

Data Abstraction

Physical schema

Relations stored as unordered files.
Index on first column of Students.

Conceptual (or logical) schema

Courses(cid: string, cname:string, credits:integer)
Students(sid: string, name: string, login: string, age: integer, gpa:real)
Enrolled(sid:string, cid:string, grade:string)

External (or view) schema

Course_info(cid:string,enrollment:integer)

Data Independence

Physical data independence

Allows the physical schema to be modified without rewriting application programs
e.g. adding or removing an index or moving
a file to a different disk

Logical data independence

Allows the logical schema to be modified without rewriting application programs
e.g. adding an attribute to a relation

Efficient Access

Concurrency Control

Data Integrity

Transactions

A transaction is a sequence of reads and writes to the DB caused by one execution of a user program

Transactions must have the ACID properties:
Atomic: all or nothing
Consistent: the DB must be in a consistent state after
the transaction
Isolated: transactions are performed serially
Durable: the effects of a transaction are permanent

Database Languages

Database Languages

A database language is divided into two parts
Data definition language (DDL)
Data manipulation language (DML)
Structured query language (SQL) is both a DDL and a DML

Data definition language (DDL)

The DDL allows entire databases to be created, and allows integrity constraints to be specified
Domain constraints
Referential integrity
Assertions
Authorization

The DDL is also used to modify existing DB schema
Addition of new tables
Deletion of tables
Addition of attributes

Data manipulation language (DML)

The DML allows users to access or change data in a database

Retrieve information stored in the database
Insert new information into database
Delete information from the database
Modify information stored in the database

Database Users

SDSC5003

SDSC5003 Topics

DB specification and implementation
Database design – the relational model and the ER model
Creating and accessing a database
Relational algebra
Creating and querying a DB using SQL
Query optimization, transaction processing, …
Database application development
Spark/Hadoop (more of data processing systems)
Basic programming model

Exercise

Which of the following plays an important role in representing information about the real world in a database?

  1. The data definition language.
  2. The data manipulation lan
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值