پاورپوینت کامل Chapter 3: SQL 73 اسلاید در PowerPoint


در حال بارگذاری
10 جولای 2025
پاورپوینت
17870
3 بازدید
۷۹,۷۰۰ تومان
خرید

توجه : این فایل به صورت فایل power point (پاور پوینت) ارائه میگردد

 پاورپوینت کامل Chapter 3: SQL 73 اسلاید در PowerPoint دارای ۷۳ اسلاید می باشد و دارای تنظیمات کامل در PowerPoint می باشد و آماده ارائه یا چاپ است

شما با استفاده ازاین پاورپوینت میتوانید یک ارائه بسیارعالی و با شکوهی داشته باشید و همه حاضرین با اشتیاق به مطالب شما گوش خواهند داد.

لطفا نگران مطالب داخل پاورپوینت نباشید، مطالب داخل اسلاید ها بسیار ساده و قابل درک برای شما می باشد، ما عالی بودن این فایل رو تضمین می کنیم.

توجه : در صورت  مشاهده  بهم ریختگی احتمالی در متون زیر ،دلیل ان کپی کردن این مطالب از داخل فایل می باشد و در فایل اصلی پاورپوینت کامل Chapter 3: SQL 73 اسلاید در PowerPoint،به هیچ وجه بهم ریختگی وجود ندارد


بخشی از مطالب داخلی اسلاید ها

پاورپوینت کامل Chapter 3: SQL 73 اسلاید در PowerPoint

اسلاید ۴: Data Definition LanguageThe schema for each relation.The domain of values associated with each attribute.Integrity constraintsThe set of indices to be maintained for each relations.Security and authorization information for each relation.The physical storage structure of each relation on disk.Allows the specification of not only a set of relations but also information about each relation, including:

اسلاید ۵: Domain Types in SQLchar(n). Fixed length character string, with user-specified length n.varchar(n). Variable length character strings, with user-specified maximum length n.int. Integer (a finite subset of the integers that is machine-dependent).smallint. Small integer (a machine-dependent subset of the integer domain type).numeric(p,d). Fixed point number, with user-specified precision of p digits, with n digits to the right of decimal point. real, double precision. Floating point and double-precision floating point numbers, with machine-dependent precision.float(n). Floating point number, with user-specified precision of at least n digits.More are covered in Chapter 4.

اسلاید ۶: Create Table ConstructAn SQL relation is defined using the create table command:create table r (A1 D1, A2 D2, …, An Dn, (integrity-constraint1), …, (integrity-constraintk))r is the name of the relationeach Ai is an attribute name in the schema of relation rDi is the data type of values in the domain of attribute AiExample:create table branch (branch_namechar(15) not null, branch_citychar(30), assetsinteger)

اسلاید ۷: Integrity Constraints in Create Tablenot nullprimary key (A1, …, An )Example: Declare branch_name as the primary key for branch and ensure that the values of assets are non-negative.create table branch (branch_namechar(15), branch_citychar(30), assetsinteger, primary key (branch_name))primary key declaration on an attribute automatically ensures not null in SQL-92 onwards, needs to be explicitly stated in SQL-89

اسلاید ۸: Drop and Alter Table ConstructsThe drop table command deletes all information about the dropped relation from the database.The alter table command is used to add attributes to an existing relation: alter table r add A D where A is the name of the attribute to be added to relation r and D is the domain of A.All tuples in the relation are assigned null as the value for the new attribute. The alter table command can also be used to drop attributes of a relation:alter table r drop A where A is the name of an attribute of relation rDropping of attributes not supported by many databases

اسلاید ۹: Basic Query Structure SQL is based on set and relational operations with certain modifications and enhancementsA typical SQL query has the form: select A1, A2, …, An from r1, r2, …, rm where P Ai represents an attributeRi represents a relationP is a predicate.This query is equivalent to the relational algebra expression. The result of an SQL query is a relation.

اسلاید ۱۰: The select ClauseThe select clause list the attributes desired in the result of a querycorresponds to the projection operation of the relational algebraExample: find the names of all branches in the loan relation: select branch_name from loanIn the relational algebra, the query would be: branch_name (loan)NOTE: SQL names are case insensitive (i.e., you may use upper- or lower-case letters.) Some people use upper case wherever we use bold font.

اسلاید ۱۱: The select Clause (Cont.)SQL allows duplicates in relations as well as in query results.To force the elimination of duplicates, insert the keyword distinct after select.Find the names of all branches in the loan relations, and remove duplicatesselect distinct branch_name from loan The keyword all specifies that duplicates not be removed. select all branch_name from loan

اسلاید ۱۲: The select Clause (Cont.)An asterisk in the select clause denotes “all attributes”select * from loanThe select clause can contain arithmetic expressions involving the operation, +, –, , and /, and operating on constants or attributes of tuples.The query: select loan_number, branch_name, amount 100 from loanwould return a relation that is the same as the loan relation, except that the value of the attribute amount is multiplied by 100.

اسلاید ۱۳: The where ClauseThe where clause specifies conditions that the result must satisfyCorresponds to the selection predicate of the relational algebra. To find all loan number for loans made at the Perryridge branch with loan amounts greater than $1200.select loan_number from loan where branch_name = ‘ Perryridge’ and amount > 1200Comparison results can be combined using the logical connectives and, or, and not. Comparisons can be applied to results of arithmetic expressions.

اسلاید ۱۴: The where Clause (Cont.)SQL includes a between comparison operatorExample: Find the loan number of those loans with loan amounts between $90,000 and $100,000 (that is, $90,000 and $100,000) select loan_number from loan where amount between 90000 and 100000

اسلاید ۱۵: The from ClauseThe from clause lists the relations involved in the queryCorresponds to the Cartesian product operation of the relational algebra.Find the Cartesian product borrower X loanselect from borrower, loan Find the name, loan number and loan amount of all customers having a loan at the Perryridge branch.select customer_name, borrower.loan_number, amount from borrower, loan where borrower.loan_number = loan.loan_number and branch_name = ‘Perryridge’

اسلاید ۱۶: The Rename OperationThe SQL allows renaming relations and attributes using the as clause:old-name as new-nameFind the name, loan number and loan amount of all customers; rename the column name loan_number as loan_id.select customer_name, borrower.loan_number as loan_id, amount from borrower, loan where borrower.loan_number = loan.loan_number

اسلاید ۱۷: Tuple VariablesTuple variables are defined in the from clause via the use of the as clause.Find the customer names and their loan numbers for all customers having a loan at some branch.select distinct T.branch_name from branch as T, branch as S where T.assets > S.assets and S.branch_city = ‘ Brooklyn’ Find the names of all branches that have greater assets than some branch located in Brooklyn.select customer_name, T.loan_number, S.amount from borrower as T, loan as S where T.loan_number = S.loan_number

اسلاید ۱۸: String OperationsSQL includes a string-matching operator for comparisons on character strings. The operator “like” uses patterns that are described using two special characters:percent (%). The % character matches any substring.underscore (_). The _ character matches any character.Find the names of all customers whose street includes the substring “Main”.select customer_name from customer where customer_street like ‘%Main%’Match the name “Main%”like ‘Main%’ escape ‘’SQL supports a variety of string operations such asconcatenation (using “||”) converting from upper to lower case (and vice versa) finding string length, extracting substrings, etc.

اسلاید ۱۹: Ordering the Display of TuplesList in alphabetic order the names of all customers having a loan in Perryridge branchselect distinct customer_name from borrower, loan where borrower loan_number = loan.loan_number and branch_name = ‘Perryridge’ order by customer_nameWe may specify desc for descending order or asc for ascending order, for each attribute; ascending order is the default.Example: order by customer_name desc

اسلاید ۲۰: DuplicatesIn relations with duplicates, SQL can define how many copies of tuples appear in the result.Multiset versions of some of the relational algebra operators – given multiset relations r1 and r2:1. (r1): If there are c1 copies of tuple t1 in r1, and t1 satisfies selections ,, then there are c1 copies of t1 in (r1).2. A (r ): For each copy of tuple t1 in r1, there is a copy of tuple A (t1) in A (r1) where A (t1) denotes the projection of the single tuple t1.3. r1 x r2 : If there are c1 copies of tuple t1 in r1 and c2 copies of tuple t2 in r2, there are c1 x c2 copies of the tuple t1. t2 in r1 x r2

اسلاید ۲۱: Duplicates (Cont.)Example: Suppose multiset relations r1 (A, B) and r2 (C) are as follows: r1 = {(1, a) (2,a)} r2

  راهنمای خرید:
  • همچنین لینک دانلود به ایمیل شما ارسال خواهد شد به همین دلیل ایمیل خود را به دقت وارد نمایید.
  • ممکن است ایمیل ارسالی به پوشه اسپم یا Bulk ایمیل شما ارسال شده باشد.
  • در صورتی که به هر دلیلی موفق به دانلود فایل مورد نظر نشدید با ما تماس بگیرید.