查看已创建的数据库:select datname from pg_database; 查看所有数据库的详细信息:select * from pg_database 创建数据库:create database wzxdb 删除数据库:drop database wzxdb; 查看已创建的用户:select usename from pg_user; 创建用户并且指定密码:create user wzx with password '123456' 删除用户:drop user wzx; 修改用户…
一.SQL操作 查询已创建的数据库:SELECT datname FROM pg_database; 创建数据库:CREATE DATABASE wzxdb; 删除数据库:DROP DATABASE wzxdb; 查看已创建用户:SELECT usename FROM pg_user; 创建用户并指定密码:CREATE USER wzx WITH PASSWORD '123456'; 删除用户:drop user wzx; 修改用户密码:ALTER USER wzx WITH PASSWORD…
数据库的创建和sql语句增删改查 1. 载入驱动. 2. 连接数据库. 3. 操作数据库. 创建表: create table person( _id integer primary key, name varchar(20), age integer ); 加入: insert into person(name, age) values('lisi', 19); 删除: delete from person where _id = 1; 改动: update person set name =…
1.表操作: create table tableName (id int(6) not null primary key auto_increatment,name varchar(10) not null,value double(10,2) not null ); # 创建表 show columns from tableName; # 查看表结构 drop table tableName; # 删除表 alter table tableName add/drop/modify col…