day1 practice

# Dropping a database, if
the DROP DATABASE the IF EXISTS an xz;
# Create database
the CREATE DATABASE an xz;
# The database is
the USE an xz;
# Create a table stored user data
the CREATE TABLE User (
UID the INT,
the uname VARCHAR (16),
upwd VARCHAR ( 132),
In Email VARCHAR (32),
Phone VARCHAR (. 11),
Sex VARCHAR (. 1), # M / F.
the userName VARCHAR (. 6),
registerTime VARCHAR (10),
isOnline VARCHAR (. 1)

);

# Insert data
the INSERT the INTO User the VALUES
( '. 1', 'dingding', '123456', '[email protected]', '18,112,345,678', 'M', 'John Doe', '2018-10-20', ' N '),
(' 2 ',' dangdang ',' 123456 ',' [email protected] ',' 18,388,888,888 ',' F. ',' Xiaofang ',' 2017-12-19 ',' Y ') ,
( '. 3', 'jingjing', '654321', '[email protected]', '19,912,345,678', 'M', 'founding', '2018-6-1', 'N ');

 

Modify number data # 3
the UPDATE = User isOnline the SET 'the Y', registerTime = '2019-3-1' the WHERE UID = '3';
# delete the data number 2
DELETE FROM user WHERE uid = '2 ';

# All user data query
SELECT * FROM user;

 

Guess you like

Origin www.cnblogs.com/upholdxz/p/11671538.html