用SQL设计图书馆信息系统
发布网友
发布时间:2023-09-19 12:50
我来回答
共3个回答
热心网友
时间:2024-12-02 19:53
CREATE TABLE books (
book_id int,
book_name varchar(60),
publisher varchar(60),
author varchar(60),
in_time datatime);
CREATE TABLE reader (
p_id int,
p_name varchar(60),
p_no varchar(60),
p_sex char(1),
is_return char(1),
p_money number(10,2));
CREATE TABLE b_infor (
b_id int,
book_id int,
p_id int,
b_time datetime,
n_time datetime,
is_returned char(1));
CREATE TABLE r_infor (
r_id int,
book_id int,
r_time datetime,
m_date int,
r_money number(10,2));
1,select * from reader where p_name ='姓名';
2,select p_name from reader where is_return=1;
3,select sum(r_money) from r_infor a,b_infor b
where a.book_id=b.book_id and b.p_id='读者号';
4,select distinct b.book_name from b_infor a,books b where a.book_id=b.book_id;
热心网友
时间:2024-12-02 19:53
创建五个表,写四条SQL搞定,哈哈~~
为了100分!我。。。。。。不干!
热心网友
时间:2024-12-02 19:54
http://www.baidu.com/s?bs=filetype%3Aall+%CD%BC%CA%E9%B9%DD%B9%DC%C0%ED%CF%B5%CD%B3&f=8&wd=filetype%3Aall+SQL%CD%BC%CA%E9%B9%DD%B9%DC%C0%ED%CF%B5%CD%B3