SQL数据库第三章所有例题
《数据库》第三章参考答案

(1)检索 检索LIU老师所授课程的课程号、课程名。 老师所授课程的课程号、 检索 老师所授课程的课程号 课程名。
π CNO,CNAME(σTNAME =‘LIU’(C)) ,
(2) 检索年龄大于 岁的男学生的学号与姓名。 检索年龄大于23岁的男学生的学号与姓名 。 岁的男学生的学号与姓名
πsno,sname
[例 3.11]设有三个关系: 例 设有三个关系: 设有三个关系 学生关系: 学生关系 S(SNO,SNAME,AGE,SEX,SDEPT) ( , , , , ) 学习关系: 学习关系 SC(SNO,CNO,GRADE) ( , , ) 课程关系: 课程关系 C(CNO,CNAME,CDEPT,TNAME) ( , , , ) 试用关系代数表达式表示下列查询语句。 试用关系代数表达式表示下列查询语句。
(7)检索全部学生都选修的课程的课程号与 ) 课程名。 课程名。
πcno
(S))) )
,CNAME
(C
∞ ( πSNO,CNO(SC) , )
÷
π
SNO
(8)检索选修课程包含 )检索选修课程包含LIU老师所授 老师所授 课程的学生学号。 课程的学生学号。
π sno,CNO(SC)
÷πCNO(σTNAME =‘LIU’(C))
(σAGE>’23’ ∧ SEX=‘M’(s)) >
(3)检索学号为 学生所学课程的课程名与 )检索学号为S3学生所学课程的课程名与 任课老师名。 任课老师名。
πCNAME,TNAME(σSNO =‘S3’ ( sc∞c)) ,
( 4) 检索至少选修 ) 检索至少选修LIU老师所授课程中一门 老师所授课程中一门 课的女学生姓名。 课的女学生姓名。
πSNAME(σSEX=‘F’∧TNAME=‘LIU’ (s∞sc ∞c))
SQL经典例题及课件

2019年5月2日星期四
《数据库原理与应用》——第3章 关系数据库的标准语言SQL——东北财经大学 李红
3.1.2 SQL的组成与功能
⑴ 数据定义语言 ⑵ 数据操纵语言 ⑶ 数据控制语言 ⑷ 嵌入式SQL
2019年5月2日星期四
《数据库原理与应用》——第3章 关系数据库的标准语言SQL——东北财经大学 李红
⑴数据定义语言
称为“SQL DDL”。 用来定义RDB的模式、外模式和内模式,以实现对
基本表、视图以及索引文件的定义、修改和删除 等操作。
2019年5月2日星期四
《数据库原理与应用》——第3章 关系数据库的标准语言SQL——东北财经大学 李红
⑵数据操纵语言
称为“SQL DML”。 包括数据查询和数据更新两类。 数据查询:对DB中的数据查询、统计、分组、排
2019年5月2日星期四
《数据库原理与应用》——第3章 关系数据库的标准语言SQL——东北财经大学 李红
SQL对RDB模式的支持
2019年5月2日星期四
《数据库原理与应用》——第3章 关系数据库的标准语言SQL——东北财经大学 李红
3.1.4 SQL基本知识
1. 数据类型 2. 表达式与运算符 3. 函数 4. 语法规定与约定
2019年5月2日星期四
《数据库原理与应用》——第3章 关系数据库的标准语言SQL——东北财经大学 李红
⑴比较运算符
其在SQL语句中用于测试单个的值。包括: =、!=或<>、<、>、<=、>=
用于测试数据相等、不等、小于、大于、小于等于和大于等于 的各种情况。
当条件满足时,返回True,否则返回False。
第三章 关系数据库标准语言SQL语言

第三章关系数据库标准语言SQL语言一、选择题1. 在SQL语言中授权的操作是通过________________语句实现的。
C A.CREATEB.REVOKEC.GRANTD.INSERT2. 假定学生关系是S(S#,SNAME,SEX,AGE),课程关系是C(C#,CNAME,TEACHER),学生选课关系是SC(S#,C#,GRADE)。
要查找选修“COMPUTER”课程的“女”学生姓名,将涉及到关系____。
DA.S B.SC,C C.S,SC D.S,C,SC3. 在 MS SQL Server中建立了表 Student(no,name,sex,birthday),no为表的主码,其他属性的默认值为 null。
表中信息如图所示:能够正确执行的插入操作是________。
A No Name Sex Birthday 101 张丽丽女 1967/05/07 102 李芳女 1970/04/14103 王朋男 1982/10/27 A.INSERT INTO student (no,sex) VALUES(102,′男′) B.INSERT INTO student (name,sex) VALUES(′王中′,′男′)D.INSERT INTO student VALUES(106,′王中′,′男′,′1984/03/08′) C.INSERT INTO stude nt VALUES(102,′男′,′王中′,′1984/03/08′) 4. SQL语言中,删除一个表的命令是________。
B A. DELETE B. DROP C. CLEAR D. REMORE 5. 为数据表创建索引的目的是________ AA.提高查询的检索性能B.创建唯一索引C.创建主键D.归类6. 在SQL语言中,条件“RETWEEN 20 AND 30”表示年龄在20到30之间,且________A. 包括20岁和30岁B. 不包括20岁和30岁C. 包括20岁不包括30岁D. 不包括20岁包括30岁7. 为了使索引键的值在基本表中唯一,在建立索引语句中应使用保留字________ AA. UNIQUEB. COUNTC. DISDINCTD. UNION 8. 下面关于SQL语言的说法中,哪一种说法是错误的? ________ AA. 一个SQL数据库就是一个基本表B. SQL语言支持数据库的三级模式结构C. 一个基本表可以跨多个存储文件存放,一个存储文件可以存放一个或多个基本表D. SQL的一个表可以是一个基本表,也可以是一个视图二、简答题1. 什么是基本表?什么是视图?两者的区别和联系是什么?【解答】基本表是本身独立存在的表,在SQL中一个关系就对应一个表。
SQL第三章课后习题答案

--1):创建数据库并进行一些操作:create database studentonprimary (name=sudent_datafilename='C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\student.mdf',size=20,maxsize=50,filegrowth=25%)log on(name=student_log,filename='C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\student_log.LDF',size=3,maxsize=10,filegrowth=1)--2):将数据库student的初始分配空间大小扩充到40Muse studentgoalter database studentmodify file(name=student,size=40)--3):将数据库student的空间压缩到最小容量use studentgodbcc shrinkdatabase('student',2)--4):将student数据库重新设置为只读状态EXEC sp_dboption 'student','read only',false--5):将student数据库改名为scholasticexec sp_renamedb 'student','scholastic'--6):删除scholastic数据库drop database scholastic--7):采用系统存储过程分离和附加数据库create database studentexec sp_detach_db @dbname='student' --从服务器分离student数据库exec sp_attach_db @dbname=N'student'@filename1=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\student_Data.mdf'@filename2=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\student_log.LDF'--本章习题:--1:--(1)、关系数据库以二维表的形式存储数据--(2)、系统数据库和用户数据库--(3)、master,model,mdb,tempdb--master数据库记录了SQL server 2005的所有系统级信息--madel数据库为用户创建新的数据库提供模板--msdb数据库是SQL Server 2005代理服务使用的数据库--tempdb数据库保存所有的临时表和临时存储过程--(4)、使用对象资源管理器创建跟使用T-SQL语句创建用户数据库--(5)、--举例如下:--create database student 创建一个名为student的数据库--on 指定存储数据库数据部分的磁盘文件--primary (NAME=student, 主要的,命名--FILENAME='D:\student.mdf', 存储位置--size=3, 初始大小--maxsize=10, 最大容量--filegrowth=1) 增长方式--LOG on 指定建立数据库的日志文件--(name=student, 命名--filename='D:\student.ldf', 地址--size=1, 初始大小--maxsize=10, 最大容量--filegrowth=1)增长方式--(6)、--在数据库中创建一个数据表,以及对数据表中的某一数据进行修改等操作都是一个事务--事务日志的作用,根据日志文件信息,可以重新执行某些事务,完成某些未完成的事务,将数据库回滚--到之前的缪戈时间状态、复制事务或服务器等。
数据库原理及应用(SQL Server 2008)第三章习题及实验答案

第三章习题及实验答案习题答案一、选择题1、A2、A3、C二、填空题1、程序2、MIN、SUM3、CONTINUE、BREAK三、简答题1、可以使用的运算符可以分为算术运算符、逻辑运算符、赋值运算符、字符串串联运算符、按位运算符、一元运算符及比较运算符等。
2、用户自定义函数可分为:标量函数和表值函数。
可使用CREATE FUNCTION语句创建函数,在调用用户自定义函数时,如果调用的是标量函数,则必须提供架构名。
如果调用的是表值函数,则可以不提供架构名。
用户可以将调用的函数用在赋值语句中,或作为表达式的操作数,或用在SQL命令中。
3、批处理是包含一个或多个Transaction-SQL语句的组,从应用程序一次性的发送到SQL Server执行。
批处理是使用GO语句将多条SQL语句进行分隔,其中每两个GO之间的SQL 语句就是一个批处理单元。
一个批处理中可以包含一条语句,也可以包含多条语句。
4、在SQL Server系统中,可以使用的流程控制语句有BEGIN…..END、IF…ELSE、CASE、WHILE…..CONTINUE….BREAK、GOTO、W AITFOR、RETURN等。
BEGIN…..END….: 在条件语句和循环语句等流程控制语句中,当符合特定条件需要执行两个或多个语句时,就应该使用BEGIN…END语句将这些语句组合在一起。
IF…..ELSE….: IF….ELSE语句是条件判断语句。
CASE:用于多重选择的条件判断语句,结果返回单个值。
在CASE中可根据表达式的值选择相应的结果。
WHILE…..CONTINUE….BREAK: SQL语言中的循环语句,用来重复执行SQL语句或语句块。
GOTO: SQL程序中的无条件跳转语句,可以使程序直接跳到指定的标识符位置处继续执行。
WAITFOR: SQL中起暂停正在执行的语句、语句块或者存储过程的调用,直到某时间、时间间隔到达后才继续执行。
《数据库系统概论》第3章所有例题实现代码

3.3数据定义中的例题创建student,course,sc三个母表的代码如下:CREATE T ABLE student(sno CHAR(9) PRIMARY KEY,/*列级完整性约束,设置sno属性为主码*/ sname CHAR(20) not null,/*列级完整性约束,要求sname属性的值唯一*/ssex CHAR(2) DEFAULT '男' CHECK(ssex IN ('男','女')),/*DEFAULT默认值约束,CHECK约束限制ssex属性的取值范围*/ sage SMALLINT CHECK(sage>=15 AND sage<=45),/*检查约束的实现*/sdept CHAR(20));CREATE T ABLE course(cno CHAR(4) ,cname CHAR(40),cpno CHAR(4),ccredit SMALLINT,PRIMARY KEY(cno),/*也可以在表级约束上设置主码*/);CREATE T ABLE sc(sno CHAR(9),cno CHAR(4),grade SMALLINT CHECK((grade IS NULL)OR(grade BETWEEN 0 AND 100)), PRIMARY KEY(sno,cno),/*主码约束的实现*/FOREIGN KEY(sno) REFERENCES student(sno),/*表级完速性约束,sno是表的外码,被参照表是student,被参照列是sno*/ FOREIGN KEY(cno) REFERENCES course(cno)/*表级完速性约束,cno是表的外码,被参照表是course,被参照列是cno*//*外码约束的实现,表明sno和cno都是表sc的外码*/);/*下列语句向student表插入记录*/INSERT INTO student V ALUES('200215121','李勇','男',20,'CS')INSERT INTO student V ALUES('200215122','刘晨','女',19,'CS')INSERT INTO student V ALUES('200215123','王敏','女',18,'MA')INSERT INTO student V ALUES('200215125','张立','男',19,'IS')/*下列语句向course表插入记录*/INSERT INTO course V ALUES('1','数据库','5',4)INSERT INTO course V ALUES('2','数学',null,2)INSERT INTO course V ALUES('3','信息系统','1',4)INSERT INTO course V ALUES('4','操作系统','6',3)INSERT INTO course V ALUES('5','数据结构','7',4)INSERT INTO course V ALUES('6','数据处理',null,2)INSERT INTO course V ALUES('7','PASCAL语言','6',4)/*下列语句向sc表插入记录*/INSERT INTO sc V ALUES('200215121','1',92)INSERT INTO sc V ALUES('200215121','2',85)INSERT INTO sc V ALUES('200215121','3',88)INSERT INTO sc V ALUES('200215122','2',90)INSERT INTO sc V ALUES('200215122','3',80)【例8】alter table student add s_entrance datet改为:alter table student add s_entrance datetime/*SQL SERVER中的日期类型用datetime表示*/【例9】alter table student alter column sage int/*显示:服务器: 消息5074,级别16,状态6,行 1对象'CK__student__sage__1CF15040' 依赖于列'sage'。
数据库原理第三章练习

第三章SQL语言一、选择题:1、SQL语言是的语言,易学习。
A.过程化 B.非过程化C.格式化 D.导航式2、SQL语言是语言。
A.层次数据库 B.网络数据库C.关系数据库 D.非数据库3、SQL语言具有的功能。
2、关系规范化,数据操纵,数据控制B.数据定义,数据操纵,数据控制C.数据定义,关系规范化,数据控制D.数据定义,关系规范化,数据操纵4、SQL语言具有两种使用方式,分别称为交互式SQL和。
A.提示式SQL B.多用户SQLC.嵌入式SQL D.解释式SQL5、SQL语言中,实现数据检索的语句是。
A.SELECT B.INSERTC.UPDATE D.DELETE6、下列SQL语句中,修改表结构的是。
A.ALTER B.CREATEC.UPDATE D.DELETE7、SQL中,与“NOT IN”等价的操作符是。
A.=SOME B.<>SOMEC.=ALL D.<>ALL8、假设有三个基本表:学生表S、课程表C、学生选课表SC,它们的结构如下:S(S#,SN,SEX,AGE,DEPT)C(C#,CN)SC(S#,C#,GRADE)检索所有比“王华”年龄大的学生姓名、年龄和性别。
正确的SQL语句是。
A.SELECT SN,AGE,SEXFROM SWHERE AGE>(SELECT AGE FROM SWHERE SN=”王华”)B.SELECT SN,AGE,SEXFROM SWHERE SN=”王华”C.SELECT SN,AGE,SEXFROM SWHERE AGE>(SELECT AGEWHERE SN=”王华”)D.SELECT SN,AGE,SEXFROM SWHERE AGE>王华.AGE9、检索选修课程”C2”的学生中成绩最高的学生的学号。
正确的SELECT语句是。
A.SELECT S#FROM SCWHERE C#=”C2” AND GRADE>=(SELECT GRADE FROM SCWHERE C#= “C2”)B.SELECT S#FROM SCWHERE C#=”C2” AND GRADE IN(SELECT GRADE FROM SCWHERE C#= “C2”)C.SELECT S#FROM SCWHERE C#=”C2” AND GRADE NOT IN(SELECT GRADE FROM SCWHERE C#= “C2”)D.SELECT S#FROM SCWHERE C#=”C2” AND GRADE>=ALL(SELECT GRADE FROM SCWHERE C#= “C2”)10、检索学生姓名及其所选修课程的课程号和成绩。
(完整版)第三章SQL练习题参考答案

11、针对以上四个表,用SQL语言完成以下各项操作:①给学生表增加一属性Nation(民族),数据类型为Varchar(20);Alter table studentadd Nation Varchar(20);②删除学生表中新增的属性Nation;Alter table studentdrop column Nation;③向成绩表中插入记录(”2001110”,”3”,80);insert into Gradevalues('2001103','3',80);④修改学号为”2001103”的学生的成绩为70分;update Gradeset Gmark=70where Sno='2001103';⑤删除学号为”2001110”的学生的成绩记录;delete Gradewhere Sno='2001110';⑥为学生表创建一个名为,以班级号的升序排序;create index IX_Class on student(Clno ASC);⑦删除IX_Class索引Drop index IX_Class12、针对以上四个表,用SQL语言完成以下各项查询:①找出所有被学生选修了的课程号;select distinct cnofrom grade;②找出01311班女学生的个人信息;select *from studentwhere clno=01311 and ssex='女';③找出01311班、01312班的学生姓名、性别、出生年份;Select sname,ssex, year(getdata())-sage as ‘出生年份’from studentwhere clno in('01311','01312');④找出所有姓李的学生的个人信息;Select *from studentwhere sname like ’李%’;⑤找出学生李勇所在班级的学生人数;Select count(*)from studentwhere clno in (select clnofrom studentwhere sname= '李勇');⑥找出课程名为操作系统的平均成绩、最高分、最低分;Select avg(gmark),max(gmark),min(gmark)from gradewhere cno =(select cnofrom coursewhere cname='操作系统');⑦找出选修了课程的学生人数;Select count(distinct sno)from grade;⑧找出选修了课程操作系统的学生人数;Select count(sno)from gradewhere cno =(select cnofrom coursewhere cname='操作系统');⑨找出2000级计算机软件班的成绩为空的学生姓名。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
3.3Simple Select StatementsEXAMPLE 3.3.1find the aid values and names of agents that are based in New York.EXAMPLE 3.3.3Retrieve all pid values of parts for which orders are placed.EXAMPLE 3.3.4retrieve all customer-agent name pairs, (cname, aname), where the customer places an order through the agent.EXAMPLE 3.3.5Retrieve a “table" based on the orders table, with columns ordno, cid, aid, pid, and profit, where profit is calculated from quantity and price of the product sold by subtracting 60% for wholesale cost, the discount for the customer, and the percent commission for the agent.EXAMPLE 3.3.6all pairs of customers based in the same city.EXAMPLE 3.3.7find pid values of products that have been ordered by at least two customers.EXAMPLE 3.3.8Get cid values of customers who order a product for which an order isalso placed by agent a06.3.4SubqueriesEXAMPLE 3.4.1Get cid values of customers who place orders with agents in Duluth or Dallas.EXAMPLE 3.4.2to retrieve all information concerning agents based in Duluth or Dallas (very close to the Subquery in the previous example).EXAMPLE 3.4.3to determine the names and discounts of all customers who place orders through agents in Duluth or Dallas.EXAMPLE 3.4.4to find the names of customers who order product p05.EXAMPLE 3.4.5Get the names of customers who order product p07 from agent a03.EXAMPLE 3.4.6to retrieve ordno values for all orders placed by customers in Duluth through agents in New York.EXAMPLE 3.4.7find aid values of agents with a minimum percent commission.EXAMPLE 3.4.8find all customers who have the same discount as that of any of the customers in Dallas or Boston.EXAMPLE 3.4.9Get cid values of customers with discnt smaller than those of any customers who live in Duluth.EXAMPLE 3.4.10Retrieve all customer names where the customer places an order through agent a05.EXAMPLE 3.4.11Get cid values of customers who order both products p01 and p07.EXAMPLE 3.4.12Retrieve all customer names where the customer does not place an order through agent a05.EXAMPLE 3.4.13retrieving all customer names where the customer does not place an order through agent a05, but using the two equivalent NOT IN and <>ALL predicates in place of NOT EXISTS.EXAMPLE 3.4.14Find cid values of customers who do not place any order through agent a03.EXAMPLE 3.4.15Retrieve the city names containing customers who order product p01.3.5UNION Operators and FOR ALL Conditions EXAMPLE 3.5.1to create a list of cities where either a customer or an agent, or both, is based.EXAMPLE 3.5.2Get the cid values of customers who place orders with all agents based inNew York.EXAMPLE 3.5.3Get the aid values of agents in New York or Duluth who place orders for all products costing more than a dollar.EXAMPLE 3.5.4Find aid values of agents who place orders for product p01 as well as for all products costing more than a dollar.EXAMPLE 3.5.5find cl d values for customers with the following property: if customer c006 orders a particular product, so does the customer under consideration.EXAMPLE 3.5.6Find pid values of products supplied to all customers in Duluth.3.6 Some Advanced SQL SyntaxEXAMPLE 3.6.1Request cid values of customers who order both products p01 andp07.EXAMPLE 3.6.2Retrieve all customer names where the customer does not place an order through agent a05.EXAMPLE 3.6.3Retrieve all customer names where the customer places at least two orders for the same product.EXAMPLE 3.6.4to retrieve all customers who purchased at least one product costing less than $0.50.3.7 Set Functions in SQL EXAMPLE 3.7.1determine the total dollar amount of all orders.EXAMPLE 3.7.2To determine the total quantity of product p03 that has been ordered.EXAMPLE 3.7.4Get the number of cities where customers are based.EXAMPLE 3.7.5List the cid values of alt customers who have a discount less than the maximum discount.EXAMPLE 3.7.6Find products ordered by at least two customers.EXAMPLE 3.7.7Add a row with specified values for columns cid, cname, and city (c007, Windix, Dallas, null)to the customers table.insertinto customers(cid,cname,city)values ('c007','Windix','Dallas')EXAMPLE 3.7.9After inserting the row (c007, Windix, Dallas, null) to the customers table in Example 3.7.7, assume that we wish to find the average discount of all customers.select avg(discnt)from customers3.8 Groups of Rows in SQLEXAMPLE 3.8.1to calculate the total product quantity ordered of each individual product by each individual agent.EXAMPLE 3.8.2Print out the agent name and agent identification number, and the product name and product identification number, together with the total quantity each agent supplies of that product to customers c002 and c003.EXAMPLE 3.8.3Print out all product and agent IDs and the total quantity ordered of the product by the agent, when this quantity exceeds 1000.EXAMPLE 3.8.4Provide pid values of all products purchased by at least two customers.EXAMPLE 3.8.5find the average, over all agents, of the maximum dollar sales made by each agent.3.9 A Complete Description of SQL Select EXAMPLE 3.9.1List all customers, agents, and the dollar sales for pairs of customers andagents, and order the result from largest to smallest sales totals. Retain only those pairs for which the dollar amount is at least equal to 900.00.EXAMPLE 3.9.2listed the cid values of all customers with a discount less than the maximum discount.EXAMPLE 3.9.3Retrieve the maximum discount of all customers.EXAMPLE 3.9.4Retrieve all data about customers whose cname begins with the letter “A”.EXAMPLE 3.9.5Retrieve cid values of customers whose cname does not have a third letter equal to “%”.EXAMPLE 3.9.6Retrieve cid values of customers whose cname begins “Tip_” and has an arbitrary number of characters following.EXAMPLE 3.9.7Retrieve cid values of customers whose cname starts with the sequence “ab\”.3.10 Insert, Update, and Delete Statements EXAMPLE 3.10.1Add a row with specified values to the orders table, setting the qty and dollars columns null.insert into orders (ordno, month, cid, aid, pid)values (1107, ‘aug’, ‘c006’, ‘a04’, ‘p01’)EXAMPLE 3.10.2Create a new table called swcusts of Southwestern customers, and insert into it all customers from Dallas and Austin.CREATE TABLE [dbo].[swcusts]([cid] [char](4) NOT NULL,[cname] [char](10) NULL,[city] [char](13) NULL,[discnt] [real] NULL,PRIMARY KEY([cid]))insert into swcustsselect * from customerswhere city in (‘Dallas’, ‘Austin’)EXAMPLE 3.10.3Give all agents in New York a 10% raise in the percent commission they earn on an order.update agents set percent = 1.1 * percent where city = ‘New York’EXAMPLE 3.10.4Give all customers who have total orders of more than $1000 a 10% increase in the discnt.Update customers set discnt =1.1* discntwhere cid in(selectcid from orders group by cid having sum(dollars) > 1000) EXAMPLE 3.10.5Update the discnt values in rows of the swcusts table created in Example 3.10.2 with more up-to-date di sent values from the customers table. (题目好像打错了) with more up-to-date di sent values?Update swcusts set discnt=(select discnt from customers where cid=swcust.cid)EXAMPLE 3.10.6Delete all agents in New York.delete from agents where city = ‘New York’EXAMPLE 3.10.7Delete all agents who have total orders of less than $600.delete from agents where aid in (select aid from ordersgroup by aid having sum(dollars)<600)3.11 The Power of the Select Statement EXAMPLE 3.11.2Retrieve the names of customers who order products costing $0.50.EXAMPLE 3.11.4find the average, over all agents, of the total dollar sales by agent.。