MySQL 資料庫 資料表

2021-09-17 04:49:52 字數 1775 閱讀 4094

1:檢視原始資料庫information_schema中的表,並顯示出views表的字段結構屬性資訊

第一步:檢視所有的資料庫:show databases;(如圖一)

第二步:檢視information_schema**內容(如圖二)

第三步:檢視views**結構(如圖三)

2:建立乙個offcn資料庫,並建立乙個students表,欄位為id,name,age,phone,height

一、建立offcn資料庫

二、使用offcn資料庫

三、建立students**

3:檢視students表的表結構

eg:輸入desc students;

4:在上題建立的students表中,隨意插入5條資料

eg:新增資料是insert into students(表名) values(值)如圖

5:查詢所有建立的資料

檢視**student s中所有的記錄:select * from student

6:將students表名修改為students_details

修改表名用alter table students rename to students_details ;

7:將students_details中height欄位刪除

刪除字段:alter table students_details drop height;

8:在students_details裡新增乙個新字段,欄位名為***,並增加兩條資料。

新增字段:alter table students_details add *** varchar(20);

新增兩條資料:insert into students_details (***) values(『men』)

9:刪除students_details表

刪除表名:drop table students_details;

10:刪除offcn資料庫

刪除資料庫:drop database offcn;

MySQL資料庫學習 資料表

1.開啟資料庫 use 資料庫名 2.檢視開啟的資料庫 select database 3.建立資料表 create table if not exists 表名 列名 資料型別 約束條件 4.檢視資料表結構 show columns from 表名 5.插入資料 insert into 表名 列名...

mysql庫和表 mysql資料庫和資料表

mysql資料庫可支援要求最苛刻的 web 電子商務和聯機事務處理 oltp 應用程式。它是乙個全面整合 事務安全 符合 acid 的資料庫,具備全面的提交 回滾 崩潰恢復和行級鎖定功能。mysql 憑藉其易用性 擴充套件力和效能,成為全球最受歡迎的開源資料庫。全球許多流量最大的 都依託於mysql...

mysql資料庫資料表匯出匯入

作業系統 windows mysql 版本 5.7 通過windows命令進行操作,cd mysql安裝目錄下的bin路徑 匯出語句 mysqldump h localhost u username p dbname tablename filename.sql 匯入語句 mysql h local...