吉林大学《数据库系统原理》实验报告一

《数据库系统原理》实验报告

姓名:                    学号:

一、实验内容及数据记录

1、考核内容:

1)建立数据库bank。

2)建立表结构,如表

 

2、考核内容:

1)建立主键约束

2)建立Check约束

3)建立外键约束

 

3、考核内容:根据下面图示内容,用SQL语句建表结构,录入数据,并完成查询。

数据库关系:

 

实验步骤:

1.        创建数据库,创建表

2.        插入数据

3.        发布相关命令语句完成1-16小问操作。

 

 

1、Find the name, loan number and loan amountof all customers; rename the column name loan_number as loan_id.

2、Find the names of all customers whosestreet includes the substring “Main”.

3、Find all customers who have a loan, anaccount, or both:

4、Find all customers who have both a loanand an account.

5、Find all customers who have an account butno loan.

6、Find the average account balance at thePerryridge branch.

7、Find the number of tuples in the customerrelation.

8、Find the number of depositors in the bank.

9、Find the number of depositors for eachbranch.

10、           Find the names of all branches where the average account balanceis more than $1,200.

11、Find all loan number which appear in the loanrelation with null values for amount.

12、Find all customers who have both an accountand a loan at the bank.

13、Find all customers who have a loan at thebank but do not have an account at the bank

14、Find all customers who have both anaccount and a loan at the Perryridge branch

15、Find all branches that have greater assetsthan some branch located in Brooklyn.

16、Find the names of all branches that havegreater assets than all branches located in Brooklyn.

二、实验过程中遇到哪些问题,如何解决的?

你可能感兴趣的:(数据库)