This is the 14th day of my participation in the genwen Challenge

Introduction to the

The database

SQL Server table record update operation 1, experimental purpose

  1. Master INSERT INTO statements.

  2. Understand the methods of INSERT FROM statements.

  3. Master the methods of UPDATE statements.

  4. Master the methods of DELETE statements. 2. Experimental requirements

  5. Add sample data to each table in the created ESHOP database. 3. Experimental steps

  6. Add two records to the MEMBERS table of the ESHOP database: ‘Jinjin’, ‘Jinjin’, ‘Female’, ‘1982-04-14’, ‘Beijing’,8200.0, ‘jinjin’ ‘liuzc518’, ‘Liu Zhicheng’, ‘male’, ‘1972-05-18’, ‘Hunan Zhuzhou’,3500.0, ‘liuzc518’ SQL code as follows:

USE eshop INSERT INTO members VALUES('jinjin',' jinjin',' jinjin',' jinjin',' jinjin', 'jinjin') INSERT INTO VALUES(' jinjin',' jinjin',' jinjin',' jinjin',' jinjin')Copy the code
  1. Change the name from “Jinjingweiwei” to “Liu Jin”, the SQL code is as follows:
USE eshop UPDATE members SET m_name=' 'WHERE m_name=''Copy the code
  1. Increase m_salary of member whose M_sex is’ male ‘and whose m_address is’ Zhuzhou, Hunan’ by 20%, SQL code as shown below:
USE eshop UPDATE members SET m_salary=m_salary*(1+0.20) WHERE m_sex=' male 'AND m_address=' zhujiang'Copy the code
  1. Delete the member record where m_address (home address) is’ Beijing ‘and the SQL code is as follows:
USE eshop DELETE FROM members WHERE m_address=' Beijing 'Copy the code
  1. Delete all entries from the members table as follows:
USE eshop
DELETE
FROM members
Copy the code
  1. To add all the sample data to the MEMBERS table of the ESHOP database, the SQL code looks like this:
USE eshop INSERT INTO members VALUES('Jinjin', 'Jinjin', 'Jinjin', 'Jinjin', 'Jinjin', 'jinjin') INSERT INTO VALUES('Lfz', 'jinjin', 'jinjin') INSERT INTO VALUES('Lfz', 'jinjin', 'jinjin', 'jinjin') 'lfz0826') INSERT INTO VALUES('liuzc518', 'liuzc518', '男', '1972-05-18', 'zhuzhou ', 3500.0) 'liuzc518') INSERT INTO VALUES('Wangym', 'Wangym', 'female ', '1974-08-06', 'Wangym', 4000.0) 'wangym0806') INSERT INTO VALUES('Zhangzl', 'Zhangzl', '男', 'Zhangzl', 'Zhangzl', 'Zhangzl', 'wangym0806') 'zhangzl') INSERT INTO VALUES('zhao888', 'zhao888', 'zhao888', 'zhao888', 'zhangzl')Copy the code
  1. Add all sample data to the Products table of the ESHOP database with the following SQL code:
USE eshop INSERT INTO products VALUES(' 2005-12-11', '2005-12-11', 7, 8000.0, INSERT INTO sc VALUES(' 2005-05-31', '2005-05-31') INSERT INTO products VALUES(' 014081062 ', '2005-05-20', 63, 703) INSERT INTO products VALUES(' 014081062 ', '2005-05-20', 63, 703) INSERT INTO VALUES(' 2005-05-06', '2005-05-06', 22, 0) INSERT INTO products VALUES(' 2005-05-31', '2005-05-31', 10, 15806) INSERT INTO sc VALUES(' 2005-05-31', '2005-05-31', 10, 806) INSERT INTO VALUES(' 2005-05-31', '2005-05-31') INSERT INTO VALUES(' 2005-05-20', '2005-05-20') INSERT INTO VALUES(' 2005-05-31', '2005-05-31') INSERT INTO VALUES(' 2005-05-31', '2005-05-31', 100, 350.0, '2005-05-31')Copy the code
  1. Add all the sample data to the Orders table of the ESHOP database with the following SQL code:

USE eshop INSERT INTO orders VALUES('0000000001','jinjin', '0910810004', 2, '2005-06-06', '1', '0', '0') INSERT INTO orders VALUES('0000000003','jinjin', '0910810004', 1, '2005-08-09', '1', '1', '1') INSERT INTO orders VALUES('0000000002','lfz', '0910810001', 1, '2005-08-09', '0', '0', '0') INSERT INTO orders VALUES('0000000004','lfz', '0910810004', 2, '2005-06-06', '1', '1', '1') INSERT INTO orders VALUES('0000000005','lfz', '0910810004', 2, '2005-08-09', '1', '1', '1') INSERT INTO orders VALUES('0000000006','liuzc518', '0140810324', 1, '2005-10-09', '0', '0', '0') INSERT INTO orders VALUES('0000000010','liuzc518', '0910810001', 1, '2005-10-09', '1', '1', '0') INSERT INTO orders VALUES('0000000007', 'liuzC518 ', '0910810004', 2, '2005-10-09', '1', '1', '0') INSERT INTO orders VALUES('0000000008','wangym', '0910810001', 1, '2005-08-09', '1', '0', '0') INSERT INTO orders VALUES('0000000009','zhao888', '0240810333', 2, '2005-06-06', '1', '1', '0')Copy the code

subsequent

If you want to know more about the Internet of things and smart home projects, you can pay attention to my project practice column.

If you like, just watch it.

Writing is not easy, thank you for your support.

This article uses the article synchronization assistant to synchronize