diff --git "a/24\347\224\230\345\220\257\350\210\252/\346\225\260\346\215\256\345\272\223class3.md" "b/24\347\224\230\345\220\257\350\210\252/\346\225\260\346\215\256\345\272\223class3.md" new file mode 100644 index 0000000000000000000000000000000000000000..a1af793dae07a8077721f82a799ba232b067b1d7 --- /dev/null +++ "b/24\347\224\230\345\220\257\350\210\252/\346\225\260\346\215\256\345\272\223class3.md" @@ -0,0 +1,28 @@ +数据库class3 + +```mysql +create database class3; +``` + +表student字段:学号,姓名,性别,爱好,住址,联系方式,邮箱,QQ号 +并新增一条自己的记录。 + +```mysql +use class3; +create table student( +id char(10), +name vachar (5), +sex vachar (2), +hobby varchar(10), +address varchar(100), +number char(11), +e-mail char(30), +qq char (10), +other varchar (100) + ); + insert into student( + id,name,sex,hobby,address,number,e-mail,qq,other + )values(2244310424,甘启航,男,唱跳,安徽,15215559503,gqh20021130@qq.com,2936803841,sybs) + ; +``` + diff --git "a/24\347\224\230\345\220\257\350\210\252/\347\254\254\344\272\214\344\270\252.md" "b/24\347\224\230\345\220\257\350\210\252/\347\254\254\344\272\214\344\270\252.md" new file mode 100644 index 0000000000000000000000000000000000000000..901f9dc591ff0701c4b9bdaefe364d0b0922be49 --- /dev/null +++ "b/24\347\224\230\345\220\257\350\210\252/\347\254\254\344\272\214\344\270\252.md" @@ -0,0 +1,51 @@ +第二个 + +```mysql +create database if not EXISTS test01_market default charset utf8; use test01_market; create table customers( c_num int(11), c_name varchar(50), c_contact varchar(50), c_city varchar(50), c_birth date ); alter table customers MODIFY c_contact varchar(50) after c_birth; alter table customers modify c_name varchar(70); alter table customers change c_contact c_phone; alter table customers add c_gender char(1) after c_name; alter table customers rename to customers_info; alter table customers_info drop c_city; + + +``` + + + +第三个 + +```mysql +Create database if not exists test_library default charset utf8; +Use test_library; +Create table books( b_id int(11) comment'书编号', +b_name varchar(20) comment'书名', +authors varchar(20) comment'作者', +price float comment'价值', +pubdate year comment'发布日期', +note varchar(20)comment'说明', +num int(11) comment'库存' ); +insert into books (b_id,b_name,authors,price,pubdate,note,num) +values (1,Tal of SSS,Dickes,23,1995,novel,11); insert into books values +(2,EmmaT,Jane lura,35,1993,joke,22); +insert into books values (3,Story of Jane,Jane Tim,40,2001,nove,10), +(4,Lovey DayGeorge,Byron,20,2005,novel,30), +(5,Old land,Honore Blade,30,2010,law,0), +(7,Rose Hood,Richardhaggard,28,2008,cartoon,28); +update books set price=price+5 where note=novel; +update books set price=40 where b_name=EmmaT; +delete from books where num=0; +``` + +第四个 + +```mysql + +Create database if not exists test03_booktore default charset utf8; +use test03_booktore; +create table book +( id int auto_increment not null primary key, + title varchar(100) not null, + author varchar(100) not null, + price double(11,2) not null, + sales int(11) not null, + stock int(11) not null, + img_path varchar(100) not null ); + insert into boo; +``` +