【WEEK5】 【DAY3】Introduction to Databases【English Version】

本文介绍了数据库的基本概念,包括其作为数据仓库的作用以及关系型数据库(如MySQL)和非关系型数据库的区别。详细讲解了MySQL的安装、Navicat的使用方法,以及基本的数据库操作命令,适合初学者了解数据库管理的基础知识。
摘要由CSDN通过智能技术生成

2024.3.27 Wednesday

1. What is a database, and why study databases

1.1. Why study databases

  1. Job skill requirements
  2. In today’s world, those who control data control the world
  3. Methods of storing data
  4. How to preserve vast amounts of data in programs and websites for a long time?
  5. The database is almost the most core existence in the software system. DBA (database administrator)

1.2. What is a database

1.2.1. Database (DataBase, abbreviated as DB)

1.2.2. Concept: A collection of large amounts of data that is organized and shareable, stored long-term in a computer, and is a data “warehouse”

1.2.3. Function: Save, and securely manage data (such as: addition, deletion, modification, querying, etc.), reduce redundancy…

1.2.4. Overview of databases:

1.2.4.1. Relational Databases (SQL)

Classics include: MySQL, Oracle, SQL Server, SQLite, DB2, etc.
Relational databases establish relationships between tables through foreign keys, such as: student information tables, attendance tables

1.2.4.2. Non-relational Databases (NOSQL) i.e., not only sql

Classics include: Redis, MongoDB, etc.
Non-relational databases typically refer to data stored in the form of objects within the database, with the relationships between objects determined by each object’s own attributes

1.3. Database Management System (DBMS)

Database management software, scientifically organize and store data, efficiently retrieve and maintain data
Insert image description here

1.4. Introduction to MySQL

1.4.1. Concept: A popular open-source, free relational database

1.4.2. History: Developed by the Swedish company MySQL AB, now a product of Oracle Corporation.

1.4.3. Features:

  1. Free, open-source database
  2. Compact, fully featured
  3. Convenient to use
  4. Can run on Windows or Linux operating systems
  5. Suitable for small to medium-sized and even large-scale web applications

1.4.4. Official website: https://www.mysql.com/

1.5. Installation of MySQL

Insert image description here

1.6. Installation and Connection of Navicat

1.7. Operations with Navicat premium

1.7.1. Query history: ctrl+L

1.7.2. Create a new table: Right-click on “Tables” to add, Navicat’s column names are in ‘Field’-‘Name’

Change table name: https://blog.csdn.net/2301_76297780/article/details/135304914

1.7.3. View tables, add records

Right-click on a specific table and click “Open Table”, enter the desired content in the blank area
Insert image description hereInsert image description here
Operate on a table: Click on that table and select the specific operation purpose, such as: Open Table (open a table filled with specific content), Design Table (modify row and column content), Create Table…
Insert image description here

1.8. Connecting to the Database

1.8.1. Command-line connection

mysql -u root -proot
or mysql -u root -p
After “Enter password:” appears, type root (the login password of the local machine)
https://blog.csdn.net/qq_41918166/article/details/109455467

1.8.2. View all databases show databases;

Insert image description here
All statements must end with a semicolon

1.8.3. Switch to database “school” use school

Insert image description here

1.8.4. View all tables in the database show tables;

Insert image description here

1.8.5. Display all information in the table describe student;

Insert image description here

1.8.6. Create a new table create database westos;

Insert image description here
Check it out:
Insert image description here
Refresh to display:
Insert image description here

1.9. Several basic database operation commands:

update user set password=password('123456') where user='root'; -- Change password
flush privileges; -- Refresh database
show databases; -- Show all databases
use dbname; -- Open a certain database
show tables; -- Display all tables in the mysql database
describe user; -- Display column information of the user table in mysql database
create database name; -- Create a database
use databasename; -- Select a database

exit; -- Exit MySQL
? Command keyword: Seeking help
-- Represents a comment (single line)
/* Multi-line comment
Write whatever you want
*/
  • 32
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值