• 回答数

    5

  • 浏览数

    303

胖墩er猫
首页 > 毕业论文 > 基于sql的毕业论文

5个回答 默认排序
  • 默认排序
  • 按时间排序

nanahara0125

已采纳

难啊,数据库完整性连微软自己也没搞明白

128 评论

大懒猪001

恩,这个问题,太突兀了.触发器不需要"研究"两个字吧?触发器就是官方也没有给多少资料,太简单的一个东西,做出了肯定不会让你过,到时候你也会发现没有话说.不如,做个联系数据库的ASP网站,或者,前台应用程序之类的.这样保证你论文也有话说,而且也内容丰富!再者说,本科学习毕业论文总在实践而非理论.所以,其他,我就不多说了.呵呵....祝你顺利通过吧

186 评论

贪吃的双鱼宝宝

数据库完整性(Database Integrity)是指数据库中数据的正确性和相容性。数据库完整性由各种各样的完整性约束来保证,因此可以说数据库完整性设计就是数据库完整性约束的设计。数据库完整性约束可以通过DBMS或应用程序来实现,基于DBMS的完整性约束作为模式的一部分存入数据库中。通过DBMS实现的数据库完整性按照数据库设计步骤进行设计,而由应用软件实现的数据库完整性则纳入应用软件设计(本文主要讨论前者)。数据库完整性对于数据库应用系统非常关键,其作用主要体现在以下几个方面: 1.数据库完整性约束能够防止合法用户使用数据库时向数据库中添加不合语义的数据。 2.利用基于DBMS的完整性控制机制来实现业务规则,易于定义,容易理解,而且可以降低应用程序的复杂性,提高应用程序的运行效率。同时,基于DBMS的完整性控制机制是集中管理的,因此比应用程序更容易实现数据库的完整性。 3.合理的数据库完整性设计,能够同时兼顾数据库的完整性和系统的效能。比如装载大量数据时,只要在装载之前临时使基于DBMS的数据库完整性约束失效,此后再使其生效,就能保证既不影响数据装载的效率又能保证数据库的完整性。 4.在应用软件的功能测试中,完善的数据库完整性有助于尽早发现应用软件的错误。 数据库完整性约束可分为6类:列级静态约束、元组级静态约束、关系级静态约束、列级动态约束、元组级动态约束、关系级动态约束。动态约束通常由应用软件来实现。不同DBMS支持的数据库完整性基本相同,Oracle支持的基于DBMS的完整性约束如下表所示: 数据库完整性设计示例 一个好的数据库完整性设计首先需要在需求分析阶段确定要通过数据库完整性约束实现的业务规则,然后在充分了解特定DBMS提供的完整性控制机制的基础上,依据整个系统的体系结构和性能要求,遵照数据库设计方法和应用软件设计方法,合理选择每个业务规则的实现方式;最后,认真测试,排除隐含的约束冲突和性能问题。基于DBMS的数据库完整性设计大体分为以下几个阶段: 1.需求分析阶段 经过系统分析员、数据库分析员、用户的共同努力,确定系统模型中应该包含的对象,如人事及工资管理系统中的部门、员工、经理等,以及各种业务规则。 在完成寻找业务规则的工作之后,确定要作为数据库完整性的业务规则,并对业务规则进行分类。其中作为数据库模式一部分的完整性设计按下面的过程进行。而由应用软件来实现的数据库完整性设计将按照软件工程的方法进行。 2.概念结构设计阶段 概念结构设计阶段是将依据需求分析的结果转换成一个独立于具体DBMS的概念模型,即实体关系图(ERD)。在概念结构设计阶段就要开始数据库完整性设计的实质阶段,因为此阶段的实体关系将在逻辑结构设计阶段转化为实体完整性约束和参照完整性约束,到逻辑结构设计阶段将完成设计的主要工作。 3.逻辑结构设计阶段 此阶段就是将概念结构转换为某个DBMS所支持的数据模型,并对其进行优化,包括对关系模型的规范化。此时,依据DBMS提供的完整性约束机制,对尚未加入逻辑结构中的完整性约束列表,逐条选择合适的方式加以实现。 在逻辑结构设计阶段结束时,作为数据库模式一部分的完整性设计也就基本完成了。每种业务规则都可能有好几种实现方式,应该选择对数据库性能影响最小的一种,有时需通过实际测试来决定。 数据库完整性设计原则 在实施数据库完整性设计的时候,有一些基本的原则需要把握: 1.根据数据库完整性约束的类型确定其实现的系统层次和方式,并提前考虑对系统性能的影响。一般情况下,静态约束应尽量包含在数据库模式中,而动态约束由应用程序实现。 2.实体完整性约束、参照完整性约束是关系数据库最重要的完整性约束,在不影响系统关键性能的前提下需尽量应用。用一定的时间和空间来换取系统的易用性是值得的。 3.要慎用目前主流DBMS都支持的触发器功能,一方面由于触发器的性能开销较大,另一方面,触发器的多级触发不好控制,容易发生错误,非用不可时,最好使用Before型语句级触发器。 4.在需求分析阶段就必须制定完整性约束的命名规范,尽量使用有意义的英文单词、缩写词、表名、列名及下划线等组合,使其易于识别和记忆,如:CKC_EMP_REAL_INCOME_EMPLOYEE、PK_EMPLOYEE、CKT_EMPLOYEE。如果使用CASE工具,一般有缺省的规则,可在此基础上修改使用。 5.要根据业务规则对数据库完整性进行细致的测试,以尽早排除隐含的完整性约束间的冲突和对性能的影响。 6.要有专职的数据库设计小组,自始至终负责数据库的分析、设计、测试、实施及早期维护。数据库设计人员不仅负责基于DBMS的数据库完整性约束的设计实现,还要负责对应用软件实现的数据库完整性约束进行审核。 7.应采用合适的CASE工具来降低数据库设计各阶段的工作量。好的CASE工具能够支持整个数据库的生命周期,这将使数据库设计人员的工作效率得到很大提高,同时也容易与用户沟通。你可以围绕相关内容发表自己的看法

236 评论

wendyhuihui

SQL Server 是Microsoft 公司推出的关系型数据库管理系统。具有使用方便可伸缩性好与相关软件集成程度高等优点,可跨越从运行Microsoft Windows 98 的膝上型电脑到运行Microsoft Windows 2012 的大型多处理器的服务器等多种平台使用。Microsoft SQL Server 是一个全面的数据库平台,使用集成的商业智能 (BI)工具提供了企业级的数据管理。Microsoft SQL Server 数据库引擎为关系型数据和结构化数据提供了更安全可靠的存储功能,使您可以构建和管理用于业务的高可用和高性能的数据应用程序。比较好的论文题目:基于SQL Server的数据库管理系统设计

238 评论

欧罗百利

SQL (sometimes expanded as Structured Query Language) is a computer language used to create, retrieve, update and delete data from relational database management systems. SQL has been standardized by both ANSI and ISO. SQL is commonly spoken either as the names of the letters ess-cue-el (IPA: [ˈɛsˈkjuˈɛl]), or like the word sequel (IPA: [ˈsiːkwəl]). The official pronunciation of SQL according to ANSI is ess-cue-el. However, each of the major database products (or projects) containing the letters SQL has its own convention: MySQL is officially and commonly pronounced "My Ess Cue El"; PostgreSQL is expediently pronounced postgres (being the name of the predecessor to PostgreSQL); and Microsoft SQL Server is commonly spoken as Microsoft-sequel-server. History An influential paper, A Relational Model of Data for Large Shared Data Banks, by Dr. Edgar F. Codd, was published in June 1970 in the Association for Computing Machinery (ACM) journal, Communications of the ACM, although drafts of it were circulated internally within IBM in 1969. Codd's model became widely accepted as the definitive model for relational database management systems (RDBMS or RDMS). During the 1970s, a group at IBM's San Jose research center developed a database system "System R" based upon Codd's model. Structured English Query Language ("SEQUEL") was designed to manipulate and retrieve data stored in System R. The acronym SEQUEL was later condensed to SQL because the word 'SEQUEL' was held as a trademark by the Hawker Siddeley aircraft company of the UK.[citation needed] Although SQL was influenced by Codd's work, Donald D. Chamberlin and Raymond F. Boyce at IBM were the authors of the SEQUEL language design. Their concepts were published to increase interest in SQL. The first non-commercial, relational, non-SQL database, Ingres, was developed in 1974 at . Berkeley. In 1978, methodical testing commenced at customer test sites. Demonstrating both the usefulness and practicality of the system, this testing proved to be a success for IBM. As a result, IBM began to develop commercial products based on their System R prototype that implemented SQL, including the System/38 (announced in 1978 and commercially available in August 1979), SQL/DS (introduced in 1981), and DB2 (in 1983). At the same time, Relational Software, Inc. (now Oracle Corporation) saw the potential of the concepts described by Chamberlin and Boyce and developed their own version of a RDBMS for the Navy, CIA and others. In the summer of 1979, Relational Software, Inc. introduced Oracle V2 (Version2) for VAX computers as the first commercially available implementation of SQL. Oracle V2 beat IBM's release of the System/38 to the market by a few weeks. Standardization SQL was adopted as a standard by ANSI (American National Standards Institute) in 1986 and ISO (International Organization for Standardization) in 1987. However, since the dissolution of the NIST data management standards program in 1996 there has been no certification for compliance with the SQL standard so vendors must be relied on to self-certify. The SQL standard is not freely available. SQL:2003 and SQL:2006 may be purchased from ISO or ANSI. A late draft of SQL:2003 is available as a zip archive from Whitemarsh Information Systems Corporation. The zip archive contains a number of PDF files that define the parts of the SQL:2003 specification. Scope SQL is designed for a specific purpose: to query data contained in a relational database. SQL is a set-based, declarative programming language, not an imperative language such as C or BASIC. Language extensions such as Oracle Corporation's PL/SQL bridge this gap to some extent by adding procedural elements, such as flow-of-control constructs. Another approach is to allow programming language code to be embedded in and interact with the database. For example, Oracle and others include Java in the database, and SQL Server 2005 allows any .NET language to be hosted within the database server process, while PostgreSQL allows functions to be written in a wide variety of languages, including Perl, Tcl, and C. Extensions to and variations of the standards exist. Commercial implementations commonly omit support for basic features of the standard, such as the DATE or TIME data types, preferring variations of their own. SQL code can rarely be ported between database systems without major modifications, in contrast to ANSI C or ANSI Fortran, which can usually be ported from platform to platform without major structural changes. PL/SQL, IBM's SQL PL (SQL Procedural Language) and Sybase / Microsoft's Transact-SQL are of a proprietary nature because the procedural programming language they present are non-standardized. Reasons for lack of portability There are several reasons for this lack of portability between database systems: * The complexity and size of the SQL standard means that most databases do not implement the entire standard. * The standard does not specify database behavior in several important areas (. indexes), leaving it up to implementations of the database to decide how to behave. * The SQL standard precisely specifies the syntax that a conforming database system must implement. However, the standard's specification of the semantics of language constructs is less well-defined, leading to areas of ambiguity. * Many database vendors have large existing customer bases; where the SQL standard conflicts with the prior behavior of the vendor's database, the vendor may be unwilling to break backward compatibility. SQL keywords Queries The most common operation in SQL databases is the query, denoted with the SELECT keyword. SQL SELECT queries are declarative: * SELECT retrieves data from tables in a database. While often grouped with Data Manipulation Language statements, SELECT is considered by many to be separate from SQL DML. SELECT queries allow the user to specify a description of the desired result set, but it is left to the devices of the database management system (DBMS) to plan, optimize, and perform the physical operations necessary to produce that result set. A SQL query includes a list of columns to be included in the final result immediately following the SELECT keyword. An asterisk ("*") can also be used as a "wildcard" indicator to specify that all available columns of a table (or multiple tables) are to be returned. SELECT is the most complex statement in SQL, with several optional keywords and clauses: o The FROM clause indicates the source tables from which the data is to be drawn. The FROM clause can include optional JOIN clauses to join related tables to one another. o The WHERE clause includes a comparison predicate, which is used to narrow the result set. The WHERE clause eliminates all rows from the result set for which the comparison predicate does not evaluate to True. o The GROUP BY clause is used to combine rows with related values into elements of a smaller set of rows. o The HAVING clause is used to identify which of the "combined rows" (combined rows are produced when the query has a GROUP BY clause or when the SELECT part contains aggregates), are to be retrieved. HAVING acts much like a WHERE, but it operates on the results of the GROUP BYand can include aggregate functions. o The ORDER BY clause is used to identify which columns are used to sort the resulting data. Unless an ORDER BY clause is included, the order of rows returned by SELECT is never guaranteed. Data retrieval is very often combined with data projection; usually it isn't the verbatim data stored in primitive data types that a user is looking for or a query is written to serve. Often the data needs to be expressed differently from how it's stored. SQL allows a wide variety of formulas included in the select list to project data. Example 1: SELECT * FROM books WHERE price > ORDER BY title This is an example that could be used to get a list of expensive books. It retrieves the records from the books table that have a price field which is greater than . The result is sorted alphabetically by book title. The asterisk (*) means to show all columns of the books table. Alternatively, specific columns could be named. Example 2: SELECT , count(*) AS Authors FROM books JOIN book_authors ON = GROUP BY which could also be written as SELECT title, count(*) AS Authors FROM books NATURAL JOIN book_authors GROUP BY title under the precondition that book_number is the only common column name of the two tables and that a column named title only exists in books. Example 2 shows both the use of multiple tables in a join, and aggregation (grouping). This example shows how many authors there are per book. Example output may resemble: Title Authors ---------------------- ------- SQL Examples and Guide 3 The Joy of SQL 1 How to use Wikipedia 2 Pitfalls of SQL 1 How SQL Saved my Dog 1 Data manipulation First, there are the standard Data Manipulation Language (DML) elements. DML is the subset of the language used to add, update and delete data: * INSERT is used to add rows (formally tuples) to an existing table. * UPDATE is used to modify the values of a set of existing table rows. * MERGE is used to combine the data of multiple tables. It is something of a combination of the INSERT and UPDATE elements. It is defined in the SQL:2003 standard; prior to that, some databases provided similar functionality via different syntax, sometimes called an "upsert". * DELETE removes zero or more existing rows from a table. INSERT Example: INSERT INTO my_table (field1, field2, field3) VALUES ('test', 'N', NULL); UPDATE Example: UPDATE my_table SET field1 = 'updated value' WHERE field2 = 'N'; DELETE Example: DELETE FROM my_table WHERE field2 = 'N'; Transaction controls Transactions, if available, can be used to wrap around the DML operations: * BEGIN WORK (or START TRANSACTION, depending on SQL dialect) can be used to mark the start of a database transaction, which either completes completely or not at all. * COMMIT causes all data changes in a transaction to be made permanent. * ROLLBACK causes all data changes since the last COMMIT or ROLLBACK to be discarded, so that the state of the data is "rolled back" to the way it was prior to those changes being requested. COMMIT and ROLLBACK interact with areas such as transaction control and locking. Strictly, both terminate any open transaction and release any locks held on data. In the absence of a BEGIN WORK or similar statement, the semantics of SQL are implementation-dependent. Example: BEGIN WORK; UPDATE inventory SET quantity = quantity - 3 WHERE item = 'pants'; COMMIT; Data definition The second group of keywords is the Data Definition Language (DDL). DDL allows the user to define new tables and associated elements. Most commercial SQL databases have proprietary extensions in their DDL, which allow control over nonstandard features of the database system. The most basic items of DDL are the CREATE,ALTER,RENAME,TRUNCATE and DROP commands: * CREATE causes an object (a table, for example) to be created within the database. * DROP causes an existing object within the database to be deleted, usually irretrievably. * TRUNCATE deletes all data from a table (non-standard, but common SQL command). * ALTER command permits the user to modify an existing object in various ways -- for example, adding a column to an existing table. Example: CREATE TABLE my_table ( my_field1 INT, my_field2 VARCHAR (50), my_field3 DATE NOT NULL, PRIMARY KEY (my_field1, my_field2) ); Data control The third group of SQL keywords is the Data Control Language (DCL). DCL handles the authorization aspects of data and permits the user to control who has access to see or manipulate data within the database. Its two main keywords are: GRANT Authorizes one or more users to perform an operation or a set of operations on an object. REVOKE Removes or restricts the capability of a user to perform an operation or a set of operations. Example: GRANT SELECT, UPDATE ON my_table TO some_user, another_user. Other * ANSI-standard SQL supports double dash, --, as a single line comment identifier (some extensions also support curly brackets or C-style /* comments */ for multi-line comments). Example: SELECT * FROM inventory -- Retrieve everything from inventory table * Some SQL servers allow User Defined Functions Criticisms of SQL Technically, SQL is a declarative computer language for use with "SQL databases". Theorists and some practitioners note that many of the original SQL features were inspired by, but in violation of, the relational model for database management and its tuple calculus realization. Recent extensions to SQL achieved relational completeness, but have worsened the violations, as documented in The Third Manifesto. In addition, there are also some criticisms about the practical use of SQL: * Implementations are inconsistent and, usually, incompatible between vendors. In particular date and time syntax, string concatenation, nulls, and comparison case sensitivity often vary from vendor to vendor. * The language makes it too easy to do a Cartesian join (joining all possible combinations), which results in "run-away" result sets when WHERE clauses are mistyped. Cartesian joins are so rarely used in practice that requiring an explicit CARTESIAN keyword may be warranted. * It is also possible to misconstruct a WHERE on an update or delete, thereby affecting more rows in a table than desired. * SQL—and the relational model as it is—offer no standard way for handling tree-structures, . rows recursively referring other rows of the same table. Oracle offers a "CONNECT BY" clause, Microsoft offers recursive joins via Common Table Expressions, other solutions are database functions which use recursion and return a row set, as possible in PostgreSQL with PL/PgSQL. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Active Server Pages (ASP) is Microsoft's server-side script engine for dynamically-generated web pages. It is marketed as an add-on to Internet Information Services (IIS). Programming ASP websites is made easier by various built-in objects. Each object corresponds to a group of frequently-used functionality useful for creating dynamic web pages. In ASP there are six such built-in objects: Application, ASPError, Request, Response, Server, and Session. Session, for example, is a cookie-based session object that maintains variables from page to page. Most ASP pages are written in VBScript, but any other Active Scripting engine can be selected instead by using the @Language directive or the