当前位置:文档之家› A RealTime Database Testbed and Performance Evaluation

A RealTime Database Testbed and Performance Evaluation

A RealTime Database Testbed and Performance Evaluation
A RealTime Database Testbed and Performance Evaluation

A Real-Time Database Testbed and Performance Evaluation?

Kyoung-Don Kang,Phillip H.Sin,and Jisu Oh Department of Computer Science

State University of New York at Binghamton {kang,joh}@https://www.doczj.com/doc/157855147.html,,

bj94041@https://www.doczj.com/doc/157855147.html,

Sang H.Son Department of Computer Science University of Virginia

son@https://www.doczj.com/doc/157855147.html,

Abstract

A lot of real-time database(RTDB)research has been done to process transactions in a timely fashion using fresh data re?ecting the current real world status. However,most existing RTD

B work is based on simula-tions.Due to the absence of a publicly available RTDB testbed,it is very hard to evaluate real-time data man-agement techniques in a realistic environment.To ad-dress the problem,we design and develop an initial ver-sion of a RTDB testbed,called Chronos,atop an open source database[5].We develop soft real-time database workloads that model online stock trades,providing sev-eral knobs to specify workloads for RTDB performance evaluation.In addition,we develop a QoS management scheme in Chronos to detect overload and reduce work-loads,via admission control and adaptive temporal data updates,under overload.From the extensive experi-ments using the stock trading workloads developed in Chronos,we observe that adaptive updates can consid-erably improve the transaction timeliness.We also ob-serve that admission control can only enhance the time-liness under severe overload,possibly causing underuti-lization problems for moderate workloads.Overall,we observe several results di?erent from simulation-based work,warranting the need for RTDB performance eval-uation in a real database system.

1Introduction

In a number of real-time applications,e.g.,stock trading,agile manufacturing,and tra?c control,real-time databases(RTDBs)are required to process trans-actions in a timely fashion using a large number of tem-poral data,e.g.,current stock prices or tra?c sensor ?This work was supported,in part,by NSF grants CNS-0614771and CNS-0614886.data,representing the real world status.RTDBs can relieve the di?culty of developing data-intensive real-time applications by supporting the logical and tempo-ral consistency of data via transactions.Also,in these applications,RTDBs can signi?cantly outperform ex-isting non-real-time databases(non-RTDBs)unaware of timing and data freshness,i.e.,temporal consistency, requirements[14,15].

RTDBs have been studied for more than a decade producing key results;however,most existing work on RTDBs is based on simulations[15],which have limita-tions in modeling realistic workloads and real database system dynamics.Very little prior work such as[1,8] has been done to evaluate real-time data management techniques in real database systems.There are several commercial RTDB products[9,17,12],but they are not open to the public.They do not apply the lat-est RTDB technology too.The lack of an open RTDB benchmark is an obstacle for more active RTDB re-search and application development in a realistic envi-ronment.To shed light on the problem,we design and develop a RTDB testbed,called Chronos,on top of Berkeley DB[5].To our best knowledge,Chronos is the?rst open source RTDB testbed.

Chronos models online stock trading,which is a data-intensive soft real-time application.A stock bro-kerage service consists of a large number of clients and their transactions for online quotes and trades needed to track,evaluate,and manage investments.Databases are a key component of such services as stock broker-age,because they support the ACID(atomicity,consis-tency,isolation,and durability)properties of transac-tions essential for trades[14].Real-time data services are required to process transactions within the speci-?ed delay bound,e.g.,3s,and maintain the freshness of stock prices in addition to supporting the ACID prop-erties.Note that we do not consider individual trans-action deadlines,because most online transactions are not associated with separate deadlines.Instead,it is

desired for a RTDB to process as many trade trans-actions as possible within a systemwide delay bound to avoid losing a majority of clients due to excessive service delays[4,20].

Although there are existing non-RTDB testbeds such as the TPC(Transaction Processing Performance Council)benchmarks[18],they mainly focus on the average response time and throughput(i.e.,transac-tions/minute),which are not RTDB performance met-rics[16,15].They do not consider data freshness con-straints and timing requirements expressed by dead-lines or a response time bound.Due to the complex-ity,it is very hard to modify non-RTDB benchmarks for RTDB performance evaluation.Further,most of them are proprietary.For these reasons,we develop a novel RTDB testbed to directly consider timing and freshness requirements by modeling stock trade work-loads.Chronos provides several knobs by which one can control transaction and update workloads applied to Chronos for timeliness and freshness evaluation un-der di?erent load conditions.Overall,Chronos is a starting point to develop a realistic RTDB testbed.

We also develop a RTDB QoS management scheme in Chronos to detect overload and adjust the work-load to process as many trade transactions as possible within the desired delay bound for real-time data ser-vices.To detect overload and determine the required workload adjustment,we compute the degree of tim-ing constraint violation based on the di?erence between the actual response time and the desired delay bound. Chronos applies admission control to avoid database thrashing under overload[8,10]considering the degree of timing constraint violations rather than relying on (estimated)transaction execution times[8,7,2],which are hard to predict in databases involving transaction aborts and restarts[14].

Frequent temporal data updates in RTDBs can con-sume a lot of system resources[1,7].However,trans-actions do not always access all temporal data in a uni-form manner.Hot data,e.g.,popular stock prices,can be accessed more often than cold data.To improve the transaction timeliness under overload,cold data can be updated less frequently as long as the freshness of tem-poral data accessed by user transactions is not a?ected by more than the speci?ed bound[7].Speci?cally,we reduce the overhead of the adaptive update policy[7]to e?ciently adjust update workloads when overloaded.

For performance evaluation,we have undertaken ex-tensive experiments using the developed stock trading workloads in Chronos to compare the performance of admission control and adaptive temporal data updates to a baseline approach,which simply accepts all in-coming tasks and updates every temporal data with-out relaxing the freshness constraints,similar to most existing database systems with no QoS management. Our adaptive update scheme can considerably improve the transaction timeliness,while supporting the de-sired freshness requirements,compared to the base-line.On the other hand,we observe that admission control is only e?ective under severe overload di?er-ent from simulation-based RTDB QoS work including [7,2].Admission control generally achieves the best average response time;however,for moderate work-loads,it achieves a lower success rate,i.e.,the num-ber of timely transactions that?nish within the delay bound per unit time,than the baseline and adaptive update scheme.We have found other results di?erent from the simulation-based work too.From these re-sults,we observe that(1)RTDB performance needs to be evaluated in a real database system rather than by simulations;and(2)Database speci?c nature should be considered for RTDB QoS management.Although admission control is known to be e?ective for overload protection in real-time systems[6],it may not be di-rectly applicable to RTDB performance management unless transaction execution times,arrival patterns, and data access patterns are known in advance.

The remainder of this paper is organized as follows. Related work is discussed in Section2.Our RTDB architecture,QoS management scheme,and database schema and workloads modeling stock trading are dis-cussed in Section3.Performance evaluation results are described in Section4.Finally,Section5concludes the paper and discusses future work.

2Related Work

Real-time transaction processing is not fast transac-tion processing[16].Simplistic fast processing could actually reduce the transaction timeliness.A sig-ni?cant amount of research has been done in real-time transaction scheduling and concurrency control to support the transaction timeliness in RTDBs[3,15]. However,most existing work is based on simulations. Therefore,realistic experiments are required to com-pare and verify existing core techniques for RTDB per-formance management.

STRIP(STanford Real-time Information Processor) [1]is a real-time database system originally devel-oped for research and commercialized later.A RTDB benchmark[11]has been designed for avionics systems. BeeHive[8]is a recent e?ort for developing a RTDB testbed.It supports advanced real-time transaction scheduling based on the data deadline and forced wait concepts[21].In addition,commercial RTDB systems, e.g.,EagleSpeed[9],Polyhedra[12],and TimesTen,are

developed[17].However,none of these systems is pub-licly available.

Adelberg et.al.[1]observe that there is a trade-o?between transaction timeliness and data freshness. Data freshness can be improved if temporal data up-dates receive a higher priority than user transactions, but the timeliness of user transactions can be reduced as a result.Based on this observation,an adaptive update policy is developed for aperiodic temporal data updates in UNIT[13].In Chronos,we consider peri-odic temporal updates commonly used in RTDBs for data temporal consistency[14,15].

Via simulation,RTDB QoS issues[7,2]have re-cently been studied.These approaches aim to sup-port the desired transaction timeliness and data fresh-ness for dynamic workloads by feedback control and QoS management techniques such as adaptive tempo-ral data updates,imprecise transaction processing,ser-vice di?erentiation,and admission control.In the fu-ture,we will evaluate key techniques for RTDB QoS management in Chronos.As a start,in this paper,we apply admission control and adaptive temporal data updates to improve the timeliness of soft real-time transactions under overload.

3Real-Time Database Testbed Design and QoS Management

In this section,Chronos architecture,Chronos schema and transactions,and overload detection and management schemes are discussed.

3.1Chronos

Architecture

Figure1.Chronos Structure

Figure1shows the overall structure of Chronos con-sisted of the admission control(AC),adaptive update (AU),transaction scheduling(TS),concurrency control (CC),performance monitoring,and QoS management components.Chronos users can con?gure to turn on or o?these components individually for performance evaluation purposes.In Chronos,periodic temporal data updates in Q0receive a higher priority than user transactions in Q1to ensure the required data fresh-ness,similar to[14,7,21].Transactions in each queue is scheduled in a FCFS manner.For concurrency con-trol,we currently apply2PL provided by Berkeley DB.

A transaction can be blocked,aborted,and restarted due to data con?icts.Once blocked,it waits for the con?icting transaction(s)to?nish in the block queue. One can replace FCFS and2PL with real-time transac-tion scheduling and concurrency control mechanisms. This is reserved for our future work.The performance monitor detects overload by periodically computing the performance error,i.e.,the di?erence between the mea-sured response time and the desired delay bound.In proportion to the error,the QoS manager shown in Figure1computes the required workload adjustment to be used for admission control and adaptive updates under overload.

Chronos follows the client-server model.To receive RTDB services,a client thread?rst needs to send the server a TCP connection request.It suspends until the server accepts the connection request and allocates a server thread.When the connection is established,the client thread sends a transaction or query(i.e.,read-only transaction)processing request and suspends un-til the corresponding server thread?nishes processing the transaction and returns the result.After receiving the result,the client thread waits for a think time uni-formly selected in a con?gurable range,e.g.,[0.5s,1s], before issuing another request,similar to[19,4,20]. For performance evaluation purposes,one can specify the number of maximum client processes and threads. As more client processes and threads are created,the workload generally increases due to more data/resource contention caused by concurrent transactions.In this way,we can model realistic workloads in which hun-dreds of(or more)concurrent transactions compete for data and resources.

Update transactions in Figure1periodically update the3,000stock data in the Chronos server by pulling and processing the corresponding stock prices from Ya-hoo!Finance[22].(Most free quote services including Yahoo do not provide push services where the data provider disseminates data.)Currently,there are100 update threads in a Chronos server.Each thread pe-riodically wakes up to pull prede?ned30stock prices from Yahoo!Finance.One can specify the update pe-riods of temporal data,i.e.,stock prices in this pa-per,to determine the freshness requirements of tempo-

ral data[14,7]and corresponding update workloads. By assigning short update periods,one can increase the update workload.Also,one can allocate more up-date threads to further increase the number of temporal data and update workloads.Thus,the current version of Chronos provides three knobs for workload speci?ca-tion:(1)the number of client threads,(2)the number of temporal data and update threads in the Chronos server,and(3)the update periods of temporal data.

3.2Database Schema and Transactions

Chronos consists of seven tables.In this paper,we only consider data access to the four tables:Stocks, Quotes,QuoteHist(Quote History),and Portfolios. The small number of tables does not limit the capabil-ity of RTDB performance evaluation,since complicated tables such as Quotes and Portfolios should be updated very frequently,while Stocks and QuoteHist tables are necessary to make trade decisions.TPC-C[19],which is a well known benchmark for online transaction pro-cessing modeling data warehousing,also supports?ve types of transactions on fewer than10tables,similar to https://www.doczj.com/doc/157855147.html,pared to TPC-C,our testbed more closely models RTDB transactions involving signi?cant periodic temporal data updates and timing constraints as discussed before.Speci?cally,Chronos consists of the following tables and data attributes:

?The Stocks table consists of the stock symbol,full name,and ID for each company.

?In the Quotes table,the company ID can be used to uniquely identify a company’s current quote in-formation.This table’s columns correspond to the Yahoo!Finance quotes’attributes.It is most com-plicated in Chronos;it consists of17columns in-cluding the current price,trade time,low and high price of the day,percentage of price change,bid-ding price,asking price,trade volume,and market capitalization for each company.For more details, refer to[22].

?The QuoteHist table keeps track of historical val-ues for each company.It has the same structure as the Quotes table.A new quote data is appended to QuoteHist for every update.Thus,a user can query stock price trends,which can be important for making investment decisions.Querying and updating QuoteHist can create substantial I/O op-erations as the number of history data in the table grows,a?ecting Chronos performance.

?The Portfolios table has the account ID,com-pany ID,and own?ag to list all stock purchases

and sale orders for each client.One account ID can correspond to multiple rows,i.e.,portfolios.

In the current version of Chronos,each client is associated with50?100portfolios.

?The Accounts table maintains login information of each client consisted of the account ID,user name,and password attributes.

?The Currencies table lists92country’s currencies and their exchange rates for US dollar.It consists of the country name,currency name,and exchange rate attributes.

?The Personal table is composed of the account ID,last name,?rst name,address,address2,city, state,country,phone number,and email address attributes.

In addition to temporal data updates,Chronos sup-ports four types of user transactions that can read, write,insert,and delete data to model stock trades.?VIEW-STOCK:A client can request,via this trans-action,to select a speci?ed set of companies’in-formation and their associated stock quotes.?VIEW-PORTFOLIO:A client can request to select his/her portfolios and see the associated stock quotes.

?PURCHASE:A client can place a purchase order for selected stocks.

?SALE:A client can require program trading,in which the server automatically trades the speci?ed stock items in his/her portfolios when the values of the stocks in a portfolio change by more than a speci?ed threshold.

After establishing a connection with the server,a client thread can request one of these transactions at a time,possibly requesting a sequence of transactions dispersed by think times before closing the connec-tion.Clearly,our schema and transactions are not the only way of designing and developing a RTDB testbed. Other schema and transactions for di?erent applica-tions,e.g.,tra?c control,can also be implemented in Chronos.

3.3QoS Management

In this section,the overload detection,admission control,and adaptive update schemes supported by Chronos are described.

3.3.1Overload Detection

A RTD

B can be overloaded if many users transactions

from multiple client threads are executed concurrently in addition to frequent temporal data updates.As

a result,computational resources such as CPU cycles

and memory space can be exhausted.Moreover,many transactions can be blocked or aborted and restarted

due to data contention.

To detect overload,we de?ne the degree of timing

constraint violations.Let t s be the desired delay bound

and t m be the average service delay measured in a sam-pling period.In this paper,t m is measured at every

30s to ensure that an enough number of transactions

commit within a measurement period.(Up to approx-imately1800transactions are processed within30s in

our experiments discussed in Section4.)If t m>t s, Chronos is considered overloaded and the degree of

overload at the k th measurement period is:

δ(k)=(t m(k)?t s)/t s(1) For instance,δ(k)=0.2when t m(k)=3.6s and t s= 3s.

In reality,workloads may vary from time to time. Accordingly,the response time may vary from a mea-surement to another.If admission control and adaptive update schemes are applied based on instantaneousδvalues,RTDB performance may signi?cantly?uctuate. To address the problem,we take an exponential mov-ing average ofδover several measurement periods.The smoothed valueδs(k)at the k th measurement period is:

δs(k)=α·δ(k)+(1?α)·δs(k?1)(2) where0≤α≤1is a tunable parameter.Ifα=1 in Eq2,δs(k)only takes the currentδ(k)value into account to computeδs(k),while it considers a wider horizon as a smaller value ofαis chosen.In this paper, we setα=0.6to ensure thatδ(k?5),i.e.,theδvalue measured?ve sampling periods ago,have a weight less than0.01in computingδs(k).

3.3.2Admission Control

To avoid database thrashing due to severe data/resource contention,Chronos applies admis-sion control to incoming transactions whenδs(k)>0. For example,ifδs(k)=0.2,our admission control scheme tries to reduce the number of concurrent trans-actions by20%to support the desired delay bound. However,the database system may not be able to immediately kill transactions for database consistency reasons.Thus,in this example,the database system has to wait for20%of the transactions currently in the system to?nish,decrementingδs(k)when one trans-action?nishes within the k th measurement period.A new transaction can be admitted whenδs(k)becomes negative within the period,whileδs(k+1)is computed at the beginning of the(k+1)th period.BeeHive is a RTDB system supporting admission control;however, transaction execution times should be determined o?ine for admission control[8].This approach is only applicable to a limited set of real-time data services in which transactions and their arrival/data access patterns are known in advance.

3.3.3Adaptive Update Policy

To reduce update workloads under overload,we adopt the notion of?exible validity intervals[7]that can gracefully relax absolute validity intervals[14]used to maintain the data temporal consistency in RTDBs. When data d i’s absolute validity interval is avi[i],its update period p[i]=0.5avi[i]to maintain the freshness of the data[14].The adaptive update policy[7]based on the?exible validity interval(fvi)concept computes the access update ratio AUR[i]for each temporal data d i in the RTDB according to its update frequency,i.e., 1/p[i],and the measured access frequency:

AUR[i]=

Access F requency[i]

Update F requency[i]

(3)

If AUR[i]≥1,d i is considered hot;otherwise,it is con-sidered cold.When the system is overloaded,a fraction of cold data can be updated less frequently by increas-ing their update periods within a pre-speci?ed bound. For each temporal data d i,fvi[i]=avi[i]initially.Let βindicate the update period relaxation bound.Given β,a RTDB can increase the update period of an arbi-trary cold data d i at runtime as long as the following condition is met:

avi[i]≤fvi[i]≤β·avi[i](4)

To maintain d i’s?exible temporal validity,p[i]is al-ways equal to0.5fvi[i]in Chronos.

The coldest data with the lowest AUR value is de-graded?rst in[7];however,this requires sorting the AUR’s.The complexity of sorting is O(n log n)for n temporal data.To reduce the overhead,in this pa-per,we build an array to include the AUR[i],avi[i], and fvi[i]information for each temporal data d[i].We do a linear search to?nd the?rst cold data in the array.For this data,we check whether its update pe-riod can be further increased by a pre-speci?ed value, e.g.,10%,without violating the condition described in Eq.4.This freshness degradation is repeatedly applied to up to min{n,δs(k)·n}cold data at each freshness

adaptation period,which is equal to the overload detec-tion period described before.In our approach,no sort-ing is required.As a result,the overhead of freshness adaptation is reduced to O(n).Our overload detection, admission control,and adaptive update schemes can be further improved for more e?cient overload man-agement.For example,control theoretic approaches [7,2]can be applied to support the desired delay bound given dynamic workloads.A thorough investigation is reserved for future work.

4Performance Evaluation

In this section,we evaluate the performance of Chronos for an increasing number of client threads.For a Chronos server,we use a Dell laptop with the1.66 GHz dual core CPU and1GB memory,which runs Linux with the2.6.15kernel.We use two Dell desktop PCs to create up to1,800client threads.One PC has the3GHz CPU and2GB memory,while the other one has the same CPU and4GB memory.

The client and sever machines are connected via a 100Mbps Ethernet switch.Each client machine gen-erates between300to900client threads.Therefore, we generate600?1800client threads for performance evaluation.A client thread can issue one of the four user transactions described in Section3.More speci?-cally,60%of client requests are View-STOCK,since a large portion of requests can be stock quotes.The other40%transactions are uniformly selected among the other three types of user transactions.The number of data accesses in one transaction varies between50 and100.The think time is uniformly distributed in [0.3s,0.5s].There is a single Chronos server process in our experiments.The size of the TCP connection queue in the server is1024and the server can run up to350concurrent threads to process user transactions. (Using the pthread package,a single process can create up to350concurrent threads in our Linux settings.) In Chronos,Quotes table maintains3000stock prices.Initially,the?exible validity interval fvi[i]=1s and update period p[i]=0.5s to support the freshness for an arbitrary temporal data d[i]in the database. We set the update period relaxation boundβ=2.As described in Section3,Chronos maintains the update period p[i]=0.5fvi[i]to support the data temporal consistency.Hence,the update period of a temporal data can be increased up to1s in this paper.

Given the update and user transaction workload set-tings,we compare the performance of(1)Berkeley DB (BASE),(2)Admission Control(AC),and(3)Adaptive Update Policy(AUP)for an increasing number of client threads.In BASE,we apply neither admission con-trol nor adaptive update policy.Thus,we evaluate the performance of Berkeley DB underlying Chronos.We observe whether or not AC and AUP described in Sec-tion3.3can improve the performance.One experiment lasts for15minutes.Each performance data presented in this paper is the average of5runs.90%con?dence intervals are also derived and plotted as vertical bars in the graphs.

4.1Success Rate

120

100

80

60

40

20

1800

1500

1200

900

S

u

c

c

e

s

s

R

a

t

e

(

t

t

p

s

)

Number of client threads

BASE

AC

AUP

Figure2.Success Rate

In this paper,we use3s as the desired delay bound. Figure2shows the success rate,i.e.,the number of timely user transactions per second(ttps)that com-plete within the desired3s response time bound.Gen-erally,the success rate of AUP is the highest among the three approaches.For900client threads,AUP achieves 93.62ttps and BASE supports86.92ttps.The success rate of BASE quickly drops as the number of client threads increases.For1800client threads,BASE’s suc-cess rate is only38.87ttps due to severe overloads, while AUP can achieve46.86ttps.For1200client threads,AUP achieves a lower success rate than BASE and AC.In fact,AUP may not always be able to im-prove the transaction timeliness,since it depends on time-varying data access patterns and the strict upper boundβfor freshness degradation.This result con-trasts to the simulation-based RTDB QoS work[7,2]in which adaptive updates or temporal data imprecision can consistently improve RTDB performance compared to BASE.

In Figure2,AC generally shows the lowest success rate when the number of client threads≤1500.It implies that applying admission control to moderate workloads can impair the success rate due to unneces-sary transaction rejections.Under overload,however, AC performs well.For1800client threads,the success

rate of AC is 45.34ttps,which is close to the success rate of AUP.Admission control often drops too many transactions in our experiments,since a few transac-tions su?ering long response times signi?cantly a?ect the service delay statistics taken at a performance mea-surement period.In our experiments,more than 80%of the timely transactions ?nish within 0.5s.In con-trast,approximately 20%to 30%of the executed trans-actions,i.e.,timely +tardy ones,experience substan-tially long service delays,increasing the average service delay.In an extreme case,for example,the longest re-sponse time of a transaction in BASE is 89.25s when the number of client threads is 1200.Some transac-tions access a larger number of data than the others incurring many data/resource contention.Thus,they can be blocked,aborted,and restarted multiple times.These phenomena are hard to correctly model in sim-ulations.

In BeeHive [8],admission control ?based on execu-tion times analyzed o?ine ?is observed to be e?ective for mainly overload conditions,similar to our results.In contrast,in the previous RTDB QoS work based on simulations including [7,2],admission control improves the timeliness compared to BASE for most of the tested workloads.From these results,one can observe that RTDB performance evaluation in a real system rather than simulations are required.

To avoid the low success rate due to underutiliza-tion,admission control needs to be applied only un-der severe overload with signi?cant data/resource con-tention.To further enhance the success rate,AUP can be applied ?rst for overload management,while ap-plying AC under severe overload conditions only.A thorough investigation of more sophisticated admission control and its interactions with adaptive updates is re-served for future work.

12 10

8 6 4 2 0

1800

1500

1200

900

A v e r a g e R e s p o n s e T i m e (s e c )

Number of client threads

BASE AC AUP Figure 3.Average Response Time In Figure 3,AC,which generally achieves the low-

est success rate in Figure 2,shows the best average response time.This is because admission control is too aggressive dropping too many transactions when the the service delay is longer than the desired thresh-old.Hence,admission control should be applied more carefully.For example,it can be combined with ad-vanced performance management techniques such as feedback control.A thorough investigation is reserved for future work.Figure 3also shows that the average response time ?a performance metric commonly used in non-RTDB benchmarks ?is misleading.Thus,not the average response time,but a real-time performance metric such as the success rate,which can measure the transaction timeliness,should be considered for RTDB performance management and evaluation.

4.2Freshness

2

1.8 1.6 1.4 1.2 1

1800

1500 1200 900D e g r e e o

f P e r i o d E x t e n s i o n

Number of client threads

Figure 4.Degree of Update Period Extension

Figure 4shows the average degree of update period

extension P ext =1N N

i =1p [i ]p [i ]init where N is the to-tal number of the temporal data in the database,p [i ]is the potentially extended update period of temporal data d [i ],and p [i ]init is the initial update period of d [i ].When P ext =2,the update period of every temporal data is doubled,i.e.,p [i ]=1s for every temporal data in Chronos.Since the update period relaxation bound β=2,the result ranges in [1,2]as shown in the ?gure.Thus,the freshness requirement considered in this pa-per is met.As the number of client threads increases,AUP can extend more update periods to support the desired delay bound for more user transactions.As a result,P ext generally increases for the increasing num-ber of the client threads,while satisfying the freshness requirements de?ned by the ?exible validity intervals.

5Conclusions and Future Work As there is no open RTDB testbed,evaluating real-time data management techniques in a realistic envi-ronment is very di?cult.To address this problem,we develop an initial version of a RTDB testbed called Chronos to model stock trading.Timing and data freshness constraints are considered throughout the de-sign,development,and evaluation of Chronos.We also develop overload detection,admission control,and adaptive update schemes to enhance the transaction timeliness under overload.Via extensive experiments using the developed stock trade workloads in a real system,we observe that adaptive updates can consid-erably improve the transaction timeliness compared to the underlying database,which has no overload detec-tion and load shedding schemes.In contrast,we?nd that admission control needs to be applied under se-vere overload conditions only.In the future,we will further enhance our RTDB testbed.We plan to eval-uate key real-time transaction scheduling and concur-rency control algorithms.Further,we will investigate new techniques for RTDB QoS management. References

[1] B.Adelberg,H.Garcia-Molina,and B.Kao.Applying

Update Streams in a Soft Real-Time Database System.

In ACM SIGMOD,1995.

[2]M.Amirijoo,N.Chaufette,J.Hansson,S.H.Son,

and S.Gunnarsson.Generalized Performance Man-agement of Multi-Class Real-Time Imprecise Data Ser-vices.In Proceedings of the26th IEEE International Real-Time Systems Symposium,pages38–49,2005. [3] A.Bestavros,K.J.Lin,and S.H.Son.Real-Time

Database Systems:Issues and Applications.Kluwer Academic Publishers,1997.

[4]N.Bhatti,A.Bouch,and A.Kuchinsky.Integrating

User-Perceived Quality into Web Server Design.In9th International World Wide Web Conference,2000. [5]Oracle Berkeley DB Product Family,High Per-

formance,Embeddable Database Engines.Avail-able at https://www.doczj.com/doc/157855147.html,/database/berkeley-db/index.html.

[6]G. C.Buttazzo.Hard Real-Time Computing Sys-

tems:Predictable Scheduling Algorithms and Appli-cations.Kluwer Academic Publishers,Norwell,MA, USA,1997.

[7]K.D.Kang,S.H.Son,and J.A.Stankovic.Manag-

ing Deadline Miss Ratio and Sensor Data Freshness in Real-Time Databases.IEEE Transactions on Knowl-edge and Data Engineering,16(10):1200–1216,2004.

[8]S.Kim,S.H.Son,and J.A.Stankovic.Performance

Evaluation on a Real-Time Database.In IEEE Real-Time Technology and Applications Symposium,2002.

[9]Lockheed Martin.EagleSpeed Real-Time Database

Manager.

[10] A.M¨o enkeberg and G.Weikum.Con?ict-Driven Load

Control for the Avoidance of Data-Contention Thrash-ing.In Proceedings of the Seventh International Con-ference on Data Engineering,pages632–639,1991. [11] C.-S.Peng,K.-J.Lin,and C.Boettcher.Real-Time

Database Benchmark Design for Avionics Systems.

In the First International Workshop on Real-Time Databases:Issues and Applications,1996.

[12]Polyhedra Plc.Polyhedra White Papers,2002.

[13]H.Qu,https://www.doczj.com/doc/157855147.html,brinidis,and D.Mosse.UNIT:User-

centric Transaction Management in Web-Database Systems.In the22nd International Conference on Data Engineering,2006.

[14]K.Ramamritham.Real-Time Databases.Interna-

tional Journal of Distributed and Parallel Databases, 1(2),1993.

[15]K.Ramamritham,S.H.Son,and L.C.Dipippo.Real-

Time Databases and Data Services.In Real-Time Sys-tems,volume28,Nov.-Dec.2004.

[16]J.Stankovic,S.H.Son,and J.Hansson.Misconcep-

tions About Real-Time Databases.IEEE Computer, 32(6):29–36,June1999.

[17]The TimesTen Team.In-Memory Data Management

for Consumer Transactions The TimesTen Approach.

In ACM SIGMOD,1999.

[18]Transaction processing performance council.

https://www.doczj.com/doc/157855147.html,/.

[19]TPC-C–OLTP,Transaction Processing Performance

Council.https://www.doczj.com/doc/157855147.html,/.

[20]U.Vallamsetty,K.Kant,and P.Mohapatra.Char-

acterization of E-Commerce Tra?c.Electronic Com-merce Research,3(1-2),2003.

[21]M.Xiong,K.Ramamritham,J. A.Stankovic,

D.Towsley,and R.Sivasankaran.Scheduling

Transactions with Temporal Constraints:Exploit-ing Data Semantics.IEEE Transactions on Knowl-edge and Data Engineering,14(5):1155–1166,Septem-ber/October2002.

[22]Yahoo!Finance.http://?https://www.doczj.com/doc/157855147.html,/.

《数据库原理及应用》模拟试卷答案

《数据库原理及应用》模拟试卷答案 1.填空题(每格1分,总分20分) (1)数据库的保护功能主要包括确保数据的安全性、__________________、________________、__________________四方面的内容。 数据的完整性并发控制数据库恢复 (2)事务的性质:原子性、__________、__________、持久性。一致性隔离性(3)在SQL中,CREATE VIEW 语句用于建立视图,如果要求今后对视图用UPDATE语句更新数据时必须满足于查询中的表达式,则应当在CREATE VIEW 语句中使用 ________________________短语。WITH CHECK OPTION (4)视图是一个虚表,它是从____________中导出的表,在数据库中只存放视图的____________,不存放视图的____________。 基本表或视图定义数据 (5)数据库设计应包括两方面的内容:一是___________特性的设计,二是_____________特性的设计。结构行为 (6)关系数据操作语言(DML)的特点是:操作对象与结果均为关系、操作的非过程性强、语言一体化、并且是建立在数学理论基础之上。DML包括数据查询和________两种数据操作语句。数据更新 (7)使用游标的步骤为:定义游标、打开游标、__取出记录____________、关闭游标(释放游标)。 (8)信息的三种世界是指__________________、__________________和数据世界,其中数据世界又称为计算机世界。信息的现实世界信息世界 (9)从关系规范化理论的角度讲,一个只满足1NF的关系可能存在的四方面问题是:数据冗余度大、__________________异常、__________________异常和 __________________异常。插入修改删除 (10)在SQL中,通配符%表示__________________,下划线_表示 __________________。任何长度的字符串一个任意字符 2.单选题(每题2分,总分20分) (1)以下____B___采用了自底向上的设计分析方法 A)需求分析B)概念结构设计 C)逻辑结构设计D)物理结构设计 (2)在视图上不能完成的操作是( D )。 A、在视图上定义新的视图 B、查询操作

数据库管理系统试卷A

连云港生物工程中等专业学校徐圩校区 2018—2019学年第二学期 期 中 考 试 试 卷 考试科目: 数据库管理系统 试卷类别: 闭卷 考试时间: 90 分钟 班级 姓名 一、填空题(每空1分 共15分) 1、信息是经过加工之后形成的有价值的 。 2、三种基本关系运算是 、 、 。 3、一个关系数据库由若于个 组成;一个数据表由若干个 组成:每一个记录由若于个以字段属性加以分类的 组成。 4、在同一个数据库中,相关联的表关系的类型有 、 、 3种关系。 5、主索引的关键字段值是 的。 6、定义表结构时,要定义表中有多少个字段,同时还要定义每一个字段的 、 、 等。 7、一个数据库中可以有多个 。 二、 选择题(每题2分,共 40 分) 1、在Visual FoxPro 中“表”是指( )。 A .报表 B .关系 C .表格 D .表单 2、、数据库表可以设置字段有效性规则,字段有效性规则属于( )。 A .实体完整性范畴 B .参照完整性范畴 C .域完整性范畴 D .数据一致性范畴 3、在关系模型中,为了实现“关系中不允许出现相同元组”的约束应使用( )。 A .临时关键字 B .主关键字 C .外部关键字 D .索引关键字 4、数据表中的数据暂时不想使用,为提高数据表的使用效率,对这些“数据”最好要进行( )。 A .逻辑删除 B .物理删除 C .不加处理 D .数据过滤器 5、在建立唯一索引出现重复字段值时,只存储重复出现的( )记录。 A .第一个 B .最后一个 C .全部 D .几个 6、数据表中有30个记录,如果当前记录为第1条记录,把记录指针移到最后一个,测试当前记录号函数 recno ( )的值是( )。 A .31 B .30 C .29 D .28 7、对数据表的结构进行操作,通常是在( )环境下完成的。 A .表设计器 B .表向导 C .表浏览器 D .表编辑器 8、每一个数据工作区上只能打开( )个数据表。 A .1个 B .2个 C .10个 D .任意个 9、在当前工作区可以访问其他工作区表中的( )。 A .数据表结构 B .数据表 C .数据库 D .数据 10、在Visual FoxPro 中字段的数据类型不可以指定为( )。 A .日期型 B .时间型 C .通用型 D .备注型 11、在数据库中的数据表间( )建立关联关系。 A .随意 B .不可以 C .必须 D .可根据需要 12、一个数据表可以添加到( )数据库中。 A .两个 B .一个 C .多个 D .随意个 13、数据表间建立参照完整性后,不能设置数据表间( )操作规则。 A .更新 B .删除 C .浏览 D .插入 14、.在数据库环境下限制字段个数的操作,要在( )中进行。 ——————————————————————————————————————————————————————————装 订 线

数据库原理试题及答案

全国2001年10月自学考试数据库原理试题及答案2 作者:ryan 点击:时间:2003-10-11 上午 23:05:00 来源: 第一部分选择题 (共30分) 一、单项选择题 (本大题共15小题,每小题2分,共30分) 在每小题列出的四个选项中只有一个是符合题目要求的,请将其代码填在题后的括号内。错选或未选均无分。 1. 单个用户使用的数据视图的描述称为【】 A. 外模式 B. 概念模式 C. 内模式 D. 存储模式 2. 子模式DDL用来描述【】 A. 数据库的总体逻辑结构 B. 数据库的局部逻辑结构 C. 数据库的物理存储结构 D. 数据库的概念结构 3. 在DBS中,DBMS和OS之间的关系是【】 A. 相互调用 B. DBMS调用OS C. OS调用DBMS D. 并发运行 4. 五种基本关系代数运算是【】 A. ∪,-,×,π和σ B. ∪,-,∞,π和σ C. ∪,∩,×,π和σ D. ∪,∩,∞,π和σ 5. 当关系R和S自然联接时,能够把R和S原该舍弃的元组放到结果关系中的操作是【】 A. 左外联接 B. 右外联接 C. 外部并 D. 外联接 6. 下列聚合函数中不忽略空值 (null) 的是【】 A. SUM (列名) B. MAX (列名) C. COUNT ( * )

D. AVG (列名) 7. 设关系模式R (A,B,C),F是R上成立的FD集,F = {B→C},则分解ρ = {AB,BC}相对于F 【】 A. 是无损联接,也是保持FD的分解 B. 是无损联接,但不保持FD的分解 C. 不是无损联接,但保持FD的分解 D. 既不是无损联接,也不保持FD 的分解 8. 关系模式R分解成ρ = {R1,…,Rk},F是R上的一个FD集,那么R中满足F的每一个关系r,与其投影联接表达式mρ(r) 间的关系满足【】 A. rí mρ(r) B. mρ(r) í r C. r = mρ(r) D. r≠mρ(r) 9. 在数据库设计中,将ER图转换成关系数据模型的过程属于【】 A. 需求分析阶段 B. 逻辑设计阶段 C. 概念设计阶段 D. 物理设计阶段 10. SQL中,下列涉及空值的操作,不正确的是【】 A. AGE IS NULL B. AGE IS NOT NULL C. AGE = NULL D. NOT (AGE IS NULL) 11. 如果事务T获得了数据项Q上的排它锁,则T对Q 【】 A. 只能读不能写 B. 只能写不能读 C. 既可读又可写 D. 不能读不能写 12. DBMS中实现事务持久性的子系统是【】 A. 安全性管理子系统 B. 完整性管理子系统 C. 并发控制子系统 D. 恢复管理子系统 13. SQL的全局约束是指基于元组的检查子句和【】 A. 非空值约束 B. 域约束子句 C. 断言

数据库试卷a

学院2014至2015学年第 1 学期 数据库原理与应用 课程考试( B )卷 系 级 专业 学号 一、填空题(每空1分,共计20分) 1、数据库处理技术经历了_____________、_____________、_____________和_____________四个发展阶段。 2、数据独立性是指数据的__________________与______________互不依赖、彼此独立的特性。更进一步,数据独立性又可分为__________________和___________________。 3、在数据库系统中访问数据,既可以采用__________________方式,也可以__________________采用方式。 4、分布式数据库系统数据的分片类型有__ _分片,__ __分片,以及混合分片三种。 5、实体之间的联系类型有三种,分别是 、 和 。 6、在SQL Server 2000恢复机制中提供的备份类型有 全备份、 、 、 和 。 7、设有关系模式R (A ,B ,C ,D )与它的函数依赖集F ={AB->C ,C ->D } ,则R 的候选键为_______________,它属于______________式的关系模式 。 二、选择题(每小题2分,共计20分) ( )1、概念模型是现实世界的第一层抽象,这一类模型中最著名的模型是: A .层次模型 B .关系模型 C .网状模型 D .实体-关系模型 ( )2、一个关系只有一个: 。 A. 候选码 B.外码 C.超码 D.主码 ( )3、学生基本信息表中有日期型字段’出生日期’,字符型字段’’,下列语句命令正确的 装 订 线

全国自考《数据库系统原理》试题及参考答案

2008年1月高等教育自学考试全国统一命题考试 数据库系统原理试卷 课程代码4735 一、单项选择题(本大题共15小题,每小题2分,共30分) 在每小题列出的四个备选项中只有一个是符合题目要求的,请将其代码填写在题后的括号内。错选、多选或未选均无分。 1.数据库在磁盘上的基本组织形式是( ) A.DB B.文件 C.二维表D.系统目录 2.ER模型是数据库的设计工具之一,它一般适用于建立数据库的( ) A.概念模型B.逻辑模型 C.内部模型D.外部模型 3.数据库三级模式中,用户与数据库系统的接口是( ) A.模式B.外模式 C.内模式D.逻辑模式 4.在文件系统中,所具有的数据独立性是( ) A.系统独立性 B.物理独立性 C.逻辑独立性 D.设备独立性 5.在DB技术中,“脏数据”是指( ) A.未回退的数据 B.未提交的数据 C.回退的数据 D.未提交随后又被撤消的数据 6.关系模式至少应属于( ) A.1NF B.2NF C.3NF D.BCNF 7.设有关系模式R(ABCD),F是R上成立的FD集,F={A→B,B→C},则属性集BD的闭包(BD)+为( ) A.BD B.BCD C.BC D.CD 8.设有关系R如题8图所示:

题8图 则∏专业,入学年份(R)的元组数为 A.2 B.3 C.4 D.5 9.集合R与S的交可以用关系代数的基本运算表示为( ) A.R-(R-S) B.R+(R-S) C.R-(S-R) D.S-(R-S) l0.已知SN是一个字符型字段,下列SQL查询语句( ) SELECT SN FROM S WHERE SN LIKE′AB%′;的执行结果为 A.找出含有3个字符′AB%′的所有SN字段 B.找出仅含3个字符且前两个字符为′AB′的SN字段 C.找出以字符′AB′开头的所有SN字段 D.找出含有字符′AB′的所有SN字段 l1.现要查找缺少成绩(Grade)的学生学号(Snum),相应的SQL语句是( ) A.SELECT Snum B.SELECT Snum FROM SC FROM SC WHERE Grade=0 WHERE Grade<=0 C.SELECT Snum D.SELECT Snum FROM SC FROM SC WHERE Grade=NULL WHERE Grade IS NULL l2.下列不是 ..数据库恢复采用的方法是( ) A.建立检查点B.建立副本 C.建立日志文件 D.建立索引 13.在SQL/CLI中,将宿主程序与数据库交互的有关信息记录在运行时数据结果中。不能 ..保存此信息的记录类型是( ) A.环境记录B.连接记录 C.语句记录D.运行记录 l4.在面向对象技术中,复合类型中后四种类型——数组、列表、包、集合——统称为( ) A.行类型B.汇集类型 C.引用类型D.枚举类型 l5.在面向对象技术中,类图的基本成分是类和( ) A.属性B.操作 C.关联D.角色 二、填空题(本大题共10小题,每小题1分,共10分) 请在每小题的空格上填上正确答案。错填、不填均无分。 16.在数据库的概念设计中,客观存在并且可以相互区别的事物称为_________________。17.增强ER模型中,子类实体继承超类实体的所有________________________。 18.产生数据冗余和异常的两个重要原因是局部依赖和_________________依赖。 l9.如果Y?X?U,则X→Y成立。这条推理规则称为________________。20.ODBC规范定义的驱动程序有两种类型:即单层驱动程序和________________。21.DBMS可分为层次型、网状型、__________________型、面向对象型等四种类型。22.如果事务T对某个数据R实现了__________________锁,那么在T对数据R解除封锁之前,不允许其他事务再对R加任何类型的锁。 23.在多个事务并发执行时,系统应保证与这些事务先后单独执行时的结果一样,这是指事务的____________________性。

数据库原理-期末考试试题及答案

数据库原理-期末考试试题及答案 (本大题共15小题,每小题2分,共30分) 在每小题列出的四个备选项中只有一个是符合题目要求的,错选、 多选或未选均无分。 1. 要保证数据库的数据独立性,需要修改的是() A.三层模式之间的两种映射B.模式与内模式 C.模式与外模式D.三层模式 2. 下列四项中说法不正确的是() A.数据库减少了数据冗余B.数据库中的数据可以共享 C.数据库避免了一切数据的重复D.数据库具有较高的数据独立性 3. 公司中有多个部门和多名职员,每个职员只能属于一个部门,一个部门可以有多名职员, 从职员到部门的联系类型是() A.多对多B.一对一 C.多对一D.一对多 4.将E-R模型转换成关系模型,属于数据库的() A.需求分析B.概念设计 C.逻辑设计D.物理设计 5.五种基本关系代数运算是() A.∪,—,×,π和σB .∪,—,,π和σ C.∪,∩,×,π和σD .∪,∩,,π和σ 6.下列聚合函数中不忽略空值 (NULL) 的是()。 A.SUM (列名) B.MAX (列名) C.COUNT ( * ) D.AVG (列名) 7. SQL中,下列涉及空值的操作,不正确的是()。 A. AGE IS NULL B. AGE IS NOT NULL C. AGE = NULL D. NOT (AGE IS NULL) 8. 已知成绩关系如表1所示。 执行SQL语句: SELECT COUNT(DISTINCT学号) FROM成绩 WHERE分数>60 查询结果中包含的元组数目是() 表1 成绩关系

A. 1 B. 2 C. 3 D. 4 9. 在视图上不能完成的操作是( ) A. 更新视图 B. 查询 C. 在视图上定义新的基本表 D. 在视图上定义新视 图 10. 关系数据模型的三个组成部分中,不包括( ) A. 完整性约束 B. 数据结构 C. 恢复 D. 数据操作 11. 假定学生关系是S (S #,SNAME ,SEX ,AGE ),课程关系是C (C #,CNAME ,TEACHER ), 学生选课关系是SC (S #,C #,GRADE )。 要查找选修“COMPUTER ”课程的“女”学生姓名,将涉及到关系( ) A .S B .S C ,C C .S ,SC D .S ,SC ,C 12. 关系规范化中的删除操作异常是指( ) A .不该删除的数据被删除 B .不该插入的数据被插入 C .应该删除的数据未被删除 D .应该插入的数据未被插入 13. 从E-R 模型关系向关系模型转换时,一个m:n 联系转换为关系模式时,该关系模式的码 是( ) A .M 端实体的码 B .N 端实体的码 C .M 端实体码与N 端实体码组合 D .重新选取其他属性 14.已知关系R={A ,B ,C ,D ,E ,F},F={A →C ,BC →DE ,D →E ,CF →B}。则(AB)F + 的闭包 是( ) A .ABCDEF B .ABCDE C .ABC D .AB 15.设有关系R (A ,B ,C )和S (C ,D )。与SQL 语句select A,B,D from R,S where R.C=S.C 等价的关系代数表达式是( ) A .σR.C=S.C (πA,B,D (R×S)) B .πA,B,D (σR,C= S.C (R×S)) C .σR.C=S.C ((πA,B (R))×(π D (S))) D .σR,C=S.C (πD ((πA,B (R))×S)) 二、多项选择题 (本大题共5小题,每小题2分,共10分) 在每小题列出的四个备选项中有多个是符合题目要 求的,多选、少选、错选、不选均无分。

数据库试题及答案_

笔试样卷一 参考答案 一、简答题(25分) 1.数据库阶段数据管理的主要特点是什么? 2.解释DB、DBMS、DBS三个概念? 3.什么是物理数据独立性和逻辑数据独立性? 4.试说明DBMS的主要功能? 5.在ER模型转换为关系模型时,联系类型要根据不同的情况作不同的处理,试说明之。 二、计算题(20分) 1.设有关系R和S R: S: A B C A B C 3 6 7 3 4 5 2 5 7 7 2 3 7 3 4 4 4 3 列表计算R∪S、R-S、R×S、π 3,2(S)、δ B<5 (R)。(5分) 2.设有三个关系 S (SNO, SNAME, AGE, SEX, SDEPT) SC (SNO, CNO, GRANDE) C (CNO, CNAME, CDEPT, TNAME) 试用关系代数表达式表示下列查询

(1)检索LIU老师所授课程的课程号、课程名 (2)检索年龄大于23岁的男学生的学号和姓名 (3)检索学号为S3的学生所学课程的课程名和认课教师姓名 (4)检索WANG同学不学的课程的课程号 (5)检索至少选修了两门课程的学生的学号(10分) 三、设有三个基本表(45分) S (SNO, SNAME, AGE, SEX, SDEPT) SC (SNO, CNO, GRANDE) C (CNO, CNAME, CDEPT, TNAME) 1.试用T-SQL的查询语句表达下列查询 (1)检索LIU老师所授课程的课程号、课程名 (2)检索年龄大于23岁的男学生的学号和姓名 (3)检索学号为S3的学生所学课程的课程名和认课教师姓名 (4)检索WANG同学不学的课程的课程号 (5)检索至少选修了两门课程的学生的学号(10分) 2.试用T-SQL的查询语句表达下列查询 (1)统计有学生选修的课程的门数 (2)求选修C4课程的学生的年龄 (3)求LIU老师所授课程的每门课程的学生的平均成绩 (4)统计每门课程的学生选修人数 (5)求年龄大于所有女同学年龄的男学生的姓名和年龄(10分)3.试用T-SQL更新语句完成下列更新操作 (1)往表S中插入一个学生资料(‘S9’, ‘WU’, 18)

(完整word版)数据库原理试卷带答案

数据库原理试卷A 一、单选题(本题共20个小题,每题1分,共20分。答案唯一,多选或少选均不得分。请将答案按对应的题号写在下面的表格中) 1.下述关于数据库系统的正确叙述是( A )。 A. 数据库系统减少了数据冗余 B. 数据库系统避免了一切冗余 C. 数据库系统中数据的一致性是指数据类型一致 D. 数据库系统比文件系统能管理更多的数据 2. 数据库(DB),数据库系统(DBS)和数据库管理系统(DBMS)之间的关系是( A )。 A. DBS包括DB和DBMS B. DBMS包括DB和DBS C. DB包括DBS和DBMS D. DBS就是DB,也就是DBMS 3. 描述数据库全体数据的全局逻辑结构和特性的是( A )。 A.模式 B. 内模式 C. 外模式 D. 用户模式 4. 要保证数据库的逻辑数据独立性,需要修改的是(A )。 A. 模式与外模式的映射 B. 模式与内模式之间的映射 C. 模式 D. 三层模式 5. 数据库系统的数据独立性体现在( B )。 A.不会因为数据的变化而影响到应用程序 B.不会因为系统数据存储结构与数据逻辑结构的变化而影响应用程序 C.不会因为存储策略的变化而影响存储结构 D.不会因为某些存储结构的变化而影响其他的存储结构 6. 在一个关系中如果有这样一个属性存在,它的值能惟一地标识关系中的每一个元组,称这个属性为( C )。 A. 关键字 B. 数据项 C. 主属性 D. 主属性值 7. 现有如下关系: 患者(患者编号,患者姓名,性别,出生日起,所在单位) 医疗(患者编号,患者姓名,医生编号,医生姓名,诊断日期,诊断结果) 其中,医疗关系中的外码是( D )。 A. 患者编号 B. 患者姓名 C. 患者编号和患者姓名 D. 医生编号和患者编号 8. 自然连接是构成新关系的有效方法。一般情况下,当对关系R和S使用自然连接时,要求R或S含有一个或多 个共有的( D )。 A. 元组 B. 行 C. 纪录 D. 属性 9. 有关系SC(S_ID,C_ID,AGE,SCORE),查找年龄大于22岁的学生的学号和分数,正确的关系代数表达式是( D )。 ⅰ. πS_ID,SCORE (σAGE >22 (SC) ) ⅱ. σAGE >22 (πS_ID,SCORE (SC) ) ⅲ. πS_ID,SCORE (σAGE >22 (πS_ID,SCORE,AGE (SC) ) ) A.ⅰ和ⅱ B. 只有ⅱ正确 C. 只有ⅰ正确 D. ⅰ和ⅲ正确

数据库期末考试试卷A卷.docx

数据库期末考试试卷 A 卷 时间: 90 分钟总分: 100 分 题次一( 50 分)二( 40 分)三( 10 分)总( 100 分) 得分 注:请大家在试卷上注明自己的学号。 :一、选择题。(每题 2 分,共50 分) 名题号12345678910 姓答案 题号11121314151617181920 答案 题号2122232425 答案 1、 ACCESS 数据库是()。 A 、层状数据库 B、网状数据库 C、关系型数据库 D、树状数据库 2、在 ACCESS 数据库中,数据保存在()中。 A 、窗体 B、查询 :C、报表 号D、表 学3、数据库系统的核心是() A 、用户 B、数据 C、数据库管理系统 D、硬件 4、关系数据库中,一个关系代表一个() A 、表 B、查询 C、行 D、列 5、 ACCESS 数据库文件的扩展名是()。 A 、 DBF :B、 DBT C、 M DF 级 D、 MDB 班 6、关系类型中的“一对多”指的是()。 A 、一个字段可以有许多输入项 B、一条记录可以与不同表中的多条记录相关 C、一个表可以有多个记录 D、一个数据库可以有多个表 7、数据库文件中包含()对象。 A 、表 B、查询 C、窗体 D、以上都包含 8、在 ACCESS 的下列数据类型中,不能建立索引的数据类型是()。 A 、文本型 B、备注型 C、数字型 D、日期时间型 9、如果某一字段数据类型为文本型、字段大小为8,该字段中最多可输入()个汉字 A 、 8 B 、 4 C、 16 D 、32 10、在定义表字段时,输入掩码向导只能处理哪两种字段类型()。 A 、文本和数字B、文本和日期型 C、数据和日期型 D、货币和日期 11、下列哪一个不是设置“关系”时的选项()。 A 、实施参照完整性B、级联更新相关字段 C、级联追加相关记录 D、级联删除相关记录 12、如果字段内容为声音文件,可将此字段定义为()类型。 A 、文本B、查阅向导C、 OLE 对象D、备注 13、在表设计视图中,如果要限定数据的输入格式,应修改字段的()属性。 A 、格式B、有效性规则C、输入格式 D 、输入掩码 14、一般情况下,以下哪个字段可以作为主关键字() A 、基本工资 B 、补贴C、职工姓名D、身份证号码 15、级联删除相关记录的含义是() A、删除主表中的记录,将删除任何相关表中的相关记录 B、删除相关表中的记录,将删除主表中的记录 C、只能删除“一对一”表中的相关记录 D、不能删除“一对多”表中的相关记录 16、文本型字段最多可以存放()个字符。 A 、250B、 10C、 254D、 255 17、下面有关主键的叙述正确的是()。 A、不同的记录可以具有重复的主键值或空值 B、一个表中的主键何以是一个或多个 C、在一个表中的主键只可以是一个字段 D、表中的主键的数据类型必须定义为自动编号或文本 18、下面有关ACCESS 数据库的叙述正确的是() 1

最新数据库系统原理期末考卷及标准答案

漳州师范学院 计算机系05 级本科《数据库原理与应用》课程期末试卷A 标准答案 (2006——2007学年度第二学期) 一、选择题:(每题1.5 分,共24 分) 1.关系数据库规范化是为解决关系数据库中( A )问题而引入的. A.插入﹑删除﹑更新的异常和数据冗余 B.提高查询速度 C. 减少数据操作的复杂性 D.保证数据的安全性和完整性 2.关系代数表达式的优化策略中,首先要做的是( B ). A.对文件进行预处理 B 及早执行选择运算 C.执行笛卡尔积运算 D. 执行投影运算 3.在关系代数中,θ连接操作由( A )组合而成. A.笛卡尔积和选择 B.投影选择和笛卡尔积 C. 投影和笛卡尔积 D. 投影和选择 4.设关系模式R是3NF模式,那么下列说法不正确的是( B ). A. R必是2NF B. R必不是BCNF C. R可能不是BCNF D. R必是1NF 5.在两个实体类型间有M:N联系时,这个结构转换成的关系模式有( C )个. A. 1 B. 2 C. 3 D. 4 6.从E-R模型向关系数据模型转换时,一个M:N联系转换成一个关系模式时,该关 系模式的关键字是( C ). A. N端实体的关键字 B.M端实体的关键字 C. N端实体的关键字与M端实体的关键字的组合 D. 重新选取其它关键字

7.在一个关系R中,若每个数据项都是不可分割的,那么关系R一定至少是属于( D ). A. BCNF B.2NF C. 3NF D. 1NF 8.“年龄在15至30岁之间”属于数据库系统的( C ). A. 恢复功能 B. 并发控制 C 完整性 D. 安全性 9.数据流程图是用于数据库设计中( D )阶段的工具. A.概念设计. B可行性分析 C程序编码 D.需求分析 10.数据库系统中,用户使用的数据视图用( A )描述. A. 外模式 B. 存储模式 C. 内模式 D.概念模式 11.R为4元关系R(A, B, C,D),S为3元关系S(B, C, D), R∞C构成 的新关系是( B )元关系. A. 3 B. 4 C. 5 D. 6 12.关系代数中的Π运算符对应下面语句中的( A )子句. A.Select B. From C. Where D. Group By 13.将查询SC表的权限授予用户U1,并允许U1将此权限授予其他用户.实现此功能的 SQL语句是( D ). A.grant select to SC on U1 with public B.grant select oh SC to U1 with public C.grant select to SC on U1 with grant option D.grant select on SC to U1 with grant option 14.在数据库系统中,安全性控制可采用:用户标识和鉴定、存取控制、审计、密码 保护和( C )五级安全措施来实现. A. 游标 B.索引 C.视图 D.存储过程 15.解决并发操作带来的数据不一致性问题,可以采取( A ). A.封锁 B.恢复 C.存储 D.协商 16.在并发控制中,允许其他事务读取数据,但不允许进行数据修改叫( B). A.两段锁 B.共享锁 C.独占锁 D.意向锁

数据库原理试卷(有答案)

综合应用题之一 (每小题3分,共30分) 设有如下表所示的三个关系: S(SID,SN,AGE,SEX,DEPT) C(CID,CN,TEACHER) SC(SID,CID,GRADE) 其中:SID为学号,SN为姓名,AGE为年龄,SEX为性别,DEPT为系别,CID为课程号,CN为课程名,TEACHER为任课老师,GRADE为成绩。 1、试用关系代数完成如下查询 (1)查找年龄小于18岁男同学的学号和姓名。 πSID,SN (σAGE<18 ∧SEX = “男”(S)) 1分2分 (2)查找系别为“信息工程”的学生姓名、学号和选修的课程号。 πSID,SN,CID (σDEPT = “信息工程”(S∞SC)) 1分2分 或: πSID,SN,CID ((σDEPT = “信息工程”(S))∞SC) 1分2分 (3)查找选修了课程名为“C语言程序设计”的学生学号和姓名。 πSID,SN (σCN = “C语言程序设计”(S∞C∞SC)) 1分2分 或: πSID,SN ((σCN = “C语言程序设计”(C))∞S∞SC)) 1分2分

2、写出下列操作的SQL语句 (1)在S表中增加一条学生信息:(AP0000001,张成,19,男,交通工程)。 INSERT (1分) INTO S(SID,SN,AGE,SEX,DEPT)(1分) V ALUES(…AP0000001?,?张成?,19,?男?,?交通工程?)(1分) 或: INSERT (1分) INTO S (1分) V ALUES(…AP0000001?,?张成?,19,?男?,?交通工程?)(1分) (2)查询选修了课程名为“C语言”的学生学号和姓名。 SELECT S.SID,SN (1分) FROM S,C,SC (1分) WHERE S.SID=SC.SID AND SC.CID = C.CID AND https://www.doczj.com/doc/157855147.html, = “C语言”;(1分) (3)查询每个学生的学号、选修的课程门数和平均成绩。 SELECT SID,COUNT(*) AS 课程门数,A VG(GRADE)AS 平均成绩(1分) FROM SC (1分) GROUP BY SID;(1分) (4)将学号为“AP0000001”同学所选修的“数据库原理”成绩改为88分。 UPDATE SC(2分) SET GRADE= 88 WHERE SID=‘AP0000001’AND CID IN(SELECT CID FROM C WHERE CN=‘数据库原理’);(1分) (5)把查询SC表的权限授给用户U1。 GRANT SELECT (1分) ON TABLE SC (1分,表前不加TABLE不扣分) TO U1;(1分)

数据库试卷a

数据库试卷a

合肥学院2014至2015学年第 1 学期 数据库原理与应用 课程考试( B )卷 系 级 专业 学号 姓名 一、填空题(每空1分,共计20分) 1、数据库处理技术经历了_____________、_____________、_____________和 _____________四个发展阶段。 2、数据独立性是指数据的__________________与______________互不依赖、彼此独立的 特性。更进一步,数据独立性又可分为__________________和___________________。 3、在数据库系统中访问数据,既可以采用__________________方式,也可以__________________采用方式。 4、分布式数据库系统数据的分片类型有__ _分片,__ __分片,以及混合分片三 种。 5、实体之间的联系类型有三种,分别是 、 和 。 6、在SQL Server 2000恢复机制中提供的备份类型有 全备份、 、 、 和 。 7、设有关系模式R (A ,B ,C ,D )与它的函数依赖集F ={AB->C ,C ->D },则R 的候选 键为_______________,它属于______________范式的关系模式 。 二、选择题(每小题2分,共计20分) ( )1、概念模型是现实世界的第一层抽象,这一类模型中最著名的模型是: 装 订 线

A.层次模型B.关系模型 C.网状模型D.实体-关系模型 ( )2、一个关系只有一个:。 A.候选码 B.外码 C.超码 D.主码 ( )3、学生基本信息表中有日期型字段’出生日期’,字符型字段’姓名’,下列语句命令正确的 命题教师刘登胜共 6 页,第 1 页

数据库原理试题及答案

汕头职业技术学院 2009—2010学年度第二学期期中考试试卷 课程名称数据库原理与应用拟题人审题人_____________ 系(校区)计算机系班级姓名学号____________ 一、单项选择题:(将正确答案的编号填在下表中,每小题1.5分,共18分) 1.任何一个满足2NF但不满足3NF的关系模式都不存在() A)主属性对主码的部分依赖 B)非主属性对主码的部分依赖 C)主属性对主码的传递依赖 D)非主属性对主码的传递依赖 2.相对于非关系模型,关系数据模型的缺点之一是() A)查找记录的速度最慢 B)数据结构简单 C)数据独立性高 D)有严格的数学基础 3.创建一个用户数据库时,()数据库的内容(表和视图)就会自动地复制到新创建的数据库中。 A)master B)model C)msdb D)tempdb 4.下列聚合函数中不忽略空值(null)的是() A)sum(列名) B)max(列名) C)count(*) D)avg(列名) 5.关于唯一约束的叙述,错误的是() A)一个表可以定义多个唯一约束 B)唯一约束的值不能重复 C)唯一约束的值不能为null D)一个唯一约束可以施加到多个属性中 6.下列涉及空值的操作,不正确的是() A)age is null B)age is not null C)age=null D)not(age is null) 7.层次模型不能表示()的联系 A)多对多 B)一对多 C)多对一 D)一对一 8.下列关系运算中,()运算不属于专门的关系运算。 A)选择 B)连接 C)投影 D)广义笛卡尔积 9.数据库系统的体系结构是() A)两级模式结构和一级映射 B)三级模式结构和一级映射 C)三级模式结构和两级映射 C)三级模式结构和三级映射 10.单个用户使用的数据视图的描述称为()

数据库系统原理》试卷-A卷-试题-答案

北京邮电大学2007 —— 2008学年第2学期 《数据库系统原理》期末考试试题(A) 1. Fill in blanks.(1 9 points) (1) ______ DDL ____ i s the Ianguage for specifying the database schema and as well as other properties of the data. (2) With respect to in tegrity mecha ni sms in DBS, —trigger __ defi nes acti ons to be executed automatically whe n some events occur and corresp onding con diti ons are satisfied. (3) An entity set that does not have sufficient attributes to form a primary key is termed a weak en tity set (4) The com monly-used schemes of orga ni zati on of records in files are heap file organization , sequential file organization, and hashing file organization. (5) The three steps in query processing are parsing and translation, optimization, and evaluation (6) The recovery-management component of a database system implements the support for tran sact ion atomicity and durability .

数据库试卷a

学院2014至2015学年第1学期 数据库原理与应用课程考试(B )卷 _______ 系_级______________ 专业学号_______________________ 一、填空题(每空1分,共计20分) ______________ 和_______________ 1、数据库处理技术经历了_______________、 四个发展阶段。 2、数据独立性是指数据的____________________ 与 ________________ 不依赖、彼此独立的特 性。更进一步,数据独立性又可分为______________________ 和 ______________________ 。 3、在数据库系统中访问数据,既可以采用 __________________________________ 方式,也可以 ____________________ 用方式。 4、分布式数据库系统数据的分片类型有______________ 分片,__________ 分片,以及混合 分片三种。 5、实体之间的联系类型有三种,分别是_______________ 、_____________ 和_____________ 。 6、在SQL Server 2000恢复机制中提供的备份类型有全备份、 ____________ 、____________ 、和_____________ 。 7、设有关系模式R(A,B,C,D)与它的函数依赖集F={AB->C, C->D },则R的候选 键为_________________ ,它属于________________ 的关系模式 二、选择题(每小题2分,共计20分) 大题得分 _ ()1、概念模型是现实世界的第一层抽象,这一类模型中最著名的模型是:____________________ A ?层次模型 B ?关系模型 C ?网状模型 D ?实体-关系模型 ()2、一个关系只有一个:_______________。 A. 候选码 B.外码 C.超码 D.主码 ()3、学生基本信息表中有日期型字段’出生日期'字符型字段’,下列语句命令正确的

数据库系统原理试卷

2014--2015学年第1学期 《数据库系统原理》试卷 开课单位:计算机学院,考试形式:闭卷 案,并将其代码填入以下表格内。每小题2分,共40 1.下述关于数据库系统的正确叙述是( )。 A.数据库系统减少了数据冗余 B.数据库系统避免了一切冗余 C.数据库系统中数据的一致性是指数据类型一致 D.数据库系统比文件系统能管理更多的数据 2. 数据库系统的最大特点是( A )。 A.数据的三级抽象和二级独立性 B.数据共享性 C.数据的结构化 D.数据独立性 3. 自然连接是构成新关系的有效方法。一般情况下,当对关系R和S使用自然连接时,要求R和S含有一个或多个共有的( D )。 A.元组B.行 C.记录D.属性 4.关系模式的任何属性( A )。 A.不可再分 B.可再分 C.命名在该关系模式中可以不惟一 D.以上都不是 5、关系模型中,一个关键字是( C )。 A.可由多个任意属性组成 B.至多由一个属性组成 C.可由一个或多个其值能惟一标识该关系模式中任何元组的属性组成 D.以上都不是 6.SQL语言是( B ) 的语言,易学习。 A.过程化B.非过程化C.格式化D.导航式 7.假定学生关系是S(S#,SNAME,SEX,AGE),课程关系是C(C#,CNAME,TEACHER),学生选课关系是SC(S#,C#,GRADE)。 要查找选修“COMPUTER”课程的“女”学生姓名,将涉及到关系( D )。

精品文档 A.S B.SC,C C.S,SC D.S,C,SC 8.关系数据模型()。 A.只能表示实体间的 1 : 1 联系 B.只能表示实体间的 1 : n 联系 C.只能表示实体间的 m : n 联系 D.可以表示实体间的上述 3 种联系 9.关系运算中花费时间可能最长的运算是( C )。 A.投影B.选择C.笛卡尔积D.除 10.在数据库系统中,保证数据及语义正确和有效的功能是( D )。 A.并发控制 B.存取控制 C.安全控制 D.完整性控制 11.规范化过程主要为克服数据库逻辑结构中的插入异常,删除异常以及( A )的缺陷。 A.数据的不一致性 B.结构不合理C.冗余度大 D.数据丢失 12.关系模型中的关系模式至少是( A )。 A.1NF B.2NF C.3NF D.BCNF 13.在数据库设计中,用E-R图来描述信息结构但不涉及信息在计算机中的表示,它是数据库设计的( B )阶段。 A.需求分析B.概念设计C.逻辑设计D.物理设计 14.在数据库的概念设计中,最常用的数据模型是( D )。 A.形象模型B.物理模型C.逻辑模型D.实体联系模型15.事务的原子性是指( A )。 A.事务中包括的所有操作要么都做,要么都不做 B.事务一旦提交,对数据库的改变是永久的 C.一个事务内部的操作及使用的数据对并发的其他事务是隔离的 D.事务必须是使数据库从一个一致性状态变到另一个一致性状态 16.( B )用来记录对数据库中数据进行的每一次更新操作。 A.后援副本B.日志文件C.数据库D.缓冲区 17.在数据库物理设计阶段,建立索引的目的是为了提高数据的( C )。 A.更改效率B.插入效率C.查询效率D.删除效率 18.解决并发操作带来的数据不一致性总是普遍采用( A )。 A.封锁B.恢复C.存取控制D.协商 19.关于“死锁”,下列说法中正确的是( D )。 A.死锁是操作系统中的问题,数据库操作中不存在 B.在数据库操作中防止死锁的方法是禁止两个用户同时操作数据库 C.当两个用户竞争相同资源时不会发生死锁 D.只有出现并发操作时,才有可能出现死锁 20.并发操作会带来哪些数据不一致性( D )。 A.丢失修改、不可重复读、脏读、死锁 B.不可重复读、脏读、死锁C.丢失修改、脏读、死锁 D.丢失修改、不可重复读、脏读

相关主题
文本预览
相关文档 最新文档