-- 0.刪除 jt_db drop database if exists jt_db; -- 1.創(chuàng)建數(shù)據(jù)庫(kù) jt_db create database jt_db; -- 2.選中 jt_db 數(shù)據(jù)庫(kù) use jt_db; -- 3.在 jt_db 庫(kù)中創(chuàng)建 account 表(銀行賬戶表), 要求有id(主鍵),name(姓名),money(賬戶金額) create table account( id int primary key auto_increment, name varchar(50), money double ); -- 4.往 account 表中, 插入3條記錄 insert into account values(null, 'tony', 1000); insert into account values(null, 'andy', 1000); insert into account values(null, 'tom', 1000); -- 5.在 jt_db 庫(kù)中創(chuàng)建 user 表 create table user( id int primary key auto_increment, username varchar(50), password varchar(50) ); -- 6.往 user 表中, 插入2條記錄 insert into user values(null, 'zhangsan', '123'); insert into user values(null, 'lisi', '123');
|
|
來(lái)自: 金銀寶100 > 《JDBC知識(shí)點(diǎn)》