diff --git a/数据库/头歌/数据的更改/数据的更改.sh b/数据库/头歌/数据的更改/数据的更改.sh new file mode 100644 index 0000000..a24409e --- /dev/null +++ b/数据库/头歌/数据的更改/数据的更改.sh @@ -0,0 +1,36 @@ +-- ********** create database ********** -- +-- ********** Begin ********** -- +create database Books +-- ********** End ********** -- +go + +use Books +go + +-- ********** create table ********** -- +-- ********** Begin ********** -- +create table prices +( + ID int IDENTITY(1,1) not null, + Name varchar(20) not null, + price varchar(30) not null +) +-- ********** End ********** -- +go + +SET NOCOUNT ON + +-- ********** insert ********** -- +-- ********** Begin ********** -- +insert into prices (Name, price) values ('Harry Potter', '$128') +insert into prices (Name, price) values ('Walden', '$5') +-- ********** End ********** -- +go + +SET NOCOUNT ON + +-- ********** update ********** -- +-- ********** Begin ********** -- +update prices set price = '$6' where Name = 'Walden' +-- ********** End ********** -- +go \ No newline at end of file