Home > database >  Database on renewal
Database on renewal

Time:09-18

` sage ` datetime DEFAULT NULL,
` Ssex ` varchar (10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Data for table "student", "
#

INSERT INTO ` student ` VALUES (' 01 ', '24-year-old', '1990-01-01 00:00:00' and 'male');

DROP TABLE IF the EXISTS ` emp_pay_trmp `;
The CREATE TABLE ` emp_pay_trmp ` (
` city ` char (20) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL DEFAULT ',
` last_name ` char (23) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL DEFAULT ',
` first_na ` varchar (255) the DEFAULT NULL,
` pay_rate ` double (2, 0) DEFAULT NULL,
` salary ` int (11) the DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Data for table "emp_pay_trmp
"#

INSERT INTO ` emp_pay_trmp ` VALUES (' greenwood ', 'stephens, "Tina", NULL, NULL), (' Indianapolis',' plew ', 'Linda', NULL, NULL), (' whiteland ', 'glass', NULL, NULL, NULL), (' Indianapolis', 'plew', 'Linda', NULL, NULL), (' Indianapolis', 'plew', 'Linda', NULL, NULL), (' Indianapolis', 'plew', 'Linda', NULL, NULL);

#
# Structure for table "employe1
"#

DROP TABLE IF the EXISTS ` employe1 `;
The CREATE TABLE ` employe1 ` (
` emp_id ` char (9) NOT NULL,
` position ` varchar (15) NOT NULL,
` emp_name ` varchar (20) NOT NULL,
` emp_page ` int (10) DEFAULT NULL,
` emp_phone ` int (13) the DEFAULT NULL,
` pay_rate ` double (4, 2) NOT NULL,
The UNIQUE KEY ` emp_phone ` (` emp_id `)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Data for table "employe1
"#

INSERT INTO ` employe1 ` VALUES (' 112 ', 'mysql> Select ', 'XiaoLi, 21112212,99.99), (' 113', '2255', 'war', 456, NULL, 0.00), (' 114 ', '1213', 'Dong Jing', 45, NULL, 59.00), (' 118 ', '1200', 'China', 8966154 6,66.00);

#
# Structure for table "employe2
"#

DROP TABLE IF the EXISTS ` employe2 `;
The CREATE TABLE ` employe2 ` (
` emp_id ` char (9) NOT NULL,
` position ` varchar (15) NOT NULL,
` emp_name ` varchar (20) NOT NULL,
` emp_page ` int (10) DEFAULT NULL,
` emp_phone ` char (12) DEFAULT NULL,
` pay_rate ` double (4, 2) NOT NULL,
The UNIQUE KEY ` emp_phone ` (` emp_phone `)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Data for table "employe2
"#

INSERT INTO ` employe2 ` VALUES (', ', ' ', NULL, NULL, 22.00), (', ' ' ' ', NULL, NULL, 11.00), (' 101 ', ' ' ' ', NULL, NULL, 0.00), (' 101 ', ' ' ' ', NULL, NULL, 0.00);

#
# Structure for table "employee_tb2
"#

DROP TABLE IF the EXISTS ` employee_tb2 `;
The CREATE TABLE ` employee_tb2 ` (
` emp_id ` char (9) NOT NULL,
` emp_name ` varchar (20) NOT NULL,
` emp_page ` int (10) DEFAULT NULL,
` emp_phone ` int (13) the DEFAULT NULL,
PRIMARY KEY (` emp_id `),
The UNIQUE KEY ` emp_phone ` (` emp_phone `)

CodePudding user response:

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Data for table "employee_tb2
"#

INSERT INTO ` employee_tb2 ` VALUES (' 1001 ', '123', NULL, 1000), (' 1002 ', '123', NULL, 1001);

#
# Structure for table "employee_tbl
"#

DROP TABLE IF the EXISTS ` employee_tbl `;
The CREATE TABLE ` employee_tbl ` (
` emp_id ` char (9) NOT NULL,
` emp_name ` varchar (20) NOT NULL,
` emp_page ` int (10) DEFAULT NULL,
PRIMARY KEY (` emp_id `)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Data for table "employee_tbl
"#

INSERT INTO ` employee_tbl ` VALUES (' 101 ', 'dongjinghanng, NULL);

#
# Structure for table "employee1
"#

DROP TABLE IF the EXISTS ` employee1 `;
The CREATE TABLE ` employee1 ` (
` emp_id ` char (9) NOT NULL,
` position ` varchar (15) NOT NULL,
` emp_name ` varchar (20) NOT NULL,
` emp_page ` int (10) DEFAULT NULL,
` emp_phone ` int (13) the DEFAULT NULL,
The UNIQUE KEY ` emp_phone ` (` emp_phone `)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#
# Data for table "employee1
"#

INSERT INTO ` employee1 ` VALUES (' 112 ', ', 'a good', NULL, 123456);

#
# Structure for the TAB

CodePudding user response:

Note: building the table data for interpretation of the late problem sets insert numerical change is bigger, numerical value is for reference only

The alter table student add Snam varchar (10) null;
The alter table student drop Snam;
The create database Test1.//create the database
Use test1.//use the database
The create table Student (//to create table
Student_id char (9) not null,
Student_sname varchar (10) not null,
Student_city varchar (10) not null,
Student_phone integer (10) null);
The alter table student add Student_st varchar (10) null;
The alter table student add Student_age datetime null;

Insert into student values (' 100 ', 'zhao', '1997-01-09', 'Beijing', '1234', 'm');
Insert into student values (' 101 ', 'wang nan', '1997-01-09', 'Beijing', ', ');
Insert into student (Student_sname) values (' gdsa), (' s'), (' SDH);
Select * from student;
The create table employee_tbl (
Emp_id char (9) not null, primary key,
Emp_name varchar (20) not null,
Emp_page integer (10) null);
The create table employee_tbl (
nullnullnullnullnullnull
  • Related