Databases Unit 3 SQL Language: Basics - PoliTO

2y ago
75 Views
3 Downloads
391.88 KB
11 Pages
Last View : 10d ago
Last Download : 3m ago
Upload by : Casen Newsome
Transcription

DatabasesSQL language: basicsDatabasesUnit 3SQL language: basicsDBMGSQL language: basicsIntroductionThe SELECT statement: basicsNested queriesSet operatorsUpdate commandsTable managementDBMGElena Baralis and Tania Cerquitelli 2013 Politecnico di Torino21

DatabasesSQL language: basicsSQL language: basicsIntroductionDBMGIntroductionIntroduction to the SQL languageLanguage commandsNotationDBMGElena Baralis and Tania Cerquitelli 2013 Politecnico di Torino42

DatabasesSQL language: basicsIntroductionIntroduction to the SQL languageDBMGThe SQL languageA language for managing relational databasesStructured Query LanguageSQL provides commands todefine the schema of a relational databaseread and write datadefine the schema of derived tablesdefinire user access priviligesmanage transactionsDBMGElena Baralis and Tania Cerquitelli 2013 Politecnico di Torino63

DatabasesSQL language: basicsThe SQL languageSQL is a set-level languageoperators are applied to relationsthe result is always a relationSQL is a declarative languageit describes what to do and not how to do itit has a higher level of abstraction compared totraditional programming languagesDBMG7The SQL languageThe language may be used in two waysinteractivecompileda host language encapsulates the SQL commandsSQL commands can be distinguished from the hostlanguage commands by means of appropriatesyntactical devicesDBMGElena Baralis and Tania Cerquitelli 2013 Politecnico di Torino84

DatabasesSQL language: basicsIntroductionLanguage commandsDBMGThe SQL languageIt can be subdivided intoDML (Data Manipulation Language)language for querying and updating the dataDDL (Data Definition Language)language for defining the database structureDBMGElena Baralis and Tania Cerquitelli 2013 Politecnico di Torino105

DatabasesSQL language: basicsData Manipulation LanguageTo query a database in order to extract the dataof interestSELECTTo modify a database instanceinsertion of new information into a tableINSERTupdate of the information in the databaseUPDATEdeletion of obsolete dataDELETEDBMG11Data Definition LanguageTo define a database schemacreation, modification and deletion of tablesCREATE, ALTER, DROP TABLETo define derived tablescreation, modification and deletion of tables whosecontent is obtained from other database tablesCREATE, ALTER, DROP VIEWTo define complementary data structures forefficiently retrieving the datacreation and deletion of indicesDBMGCREATE, DROP INDEXElena Baralis and Tania Cerquitelli 2013 Politecnico di Torino126

DatabasesSQL language: basicsData Definition LanguageTo define user access privilegesgrant and revocation of privileges on resourcesGRANT, REVOKETo define transactionstermination of a transactionCOMMIT, ROLLBACKDBMG13Evolution of the SQL standardInformalnameBasic SQLSQL-2Official nameSQL-86Basic constructsSQL-89Referential integritySQL-92Relational modelSeveral new constructs3 levels: entry, intermediate, fullSQL:1999Object-relational modelOrganized into multiple partsTriggers, external functions, SQL:2003Extensions to the object modelRemoval of unused constructsNew parts: SQL/JRT, SQL/XMLSQL-3DBMGElena Baralis and Tania Cerquitelli 2013 Politecnico di TorinoFeatures147

DatabasesSQL language: basicsIntroduzioneNotationDBMGSyntax of SQL commandsNotationlanguage keywordsupper case, dark blue colorvariable termsitalic fontDBMGElena Baralis and Tania Cerquitelli 2013 Politecnico di Torino168

DatabasesSQL language: basicsSyntax of SQL commandsGrammarangle brackets to isolate a syntactic termsquare brackets [ ]to mark that the enclosed term is optionalbraces { }to mark that the enclosed term may not appear ormay repeated an arbitrary number of itemsvertical bar to mark that the term must be chosen among thoseseparated by the barsDBMG17Example databaseSupplier and part DBtable P: it describes the available productsprimary key: PIdtable S: it describes the suppliersprimary key: SIdtable SP: it describes supplies, by relating eachproduct to the suppliers that provide itprimary key: (SId, PId)DBMGElena Baralis and Tania Cerquitelli 2013 Politecnico di Torino189

DatabasesSQL language: basicsInstance of the example nstance of the example hensDBMGElena Baralis and Tania Cerquitelli 2013 Politecnico di Torino2010

DatabasesSQL language: basicsInstance of the example databaseSPDBMGElena Baralis and Tania Cerquitelli 2013 Politecnico di 111

Unit 3 SQL language: basics DBMG 2 SQL language: basics Introduction The SELECT statement: basics Nested queries Set operators Update commands Table management. Databases SQL language: basics Elena Baralisand Tania Cerquitelli 2013 Politecnico

Related Documents:

SQL Server supports ANSI SQL, which is the standard SQL (Structured Query Language) language. However, SQL Server comes with its own implementation of the SQL language, T-SQL (Transact- SQL). T-SQL is a Microsoft propriety Language known as Transact-SQL. It provides further capab

70 Microsoft SQL Server 2008: A Beginner’s Guide SQL_2008 / Microsoft SQL Server 2008: ABG / Petkovic / 154638-3 / Chapter 4 In Transact-SQL, the use of double quotation marks is defined using the QUOTED_ IDENTIFIER option of the SET statement. If this option is set to ON, which is theFile Size: 387KBPage Count: 26Explore furtherLanguage Elements (Transact-SQL) - SQL Server Microsoft Docsdocs.microsoft.comThe 33 languages of SQL Server Joe Webb Blogweblogs.sqlteam.comThe Language of SQL Pdf - libribooklibribook.comSql And The Standard Language For Relational Database .www.bartleby.comdatabase - What are good alternatives to SQL (the language .stackoverflow.comRecommended to you based on what's popular Feedback

MS SQL Server: MS SQL Server 2017, MS SQL Server 2016, MS SQL Server 2014, MS SQL Server 2012, MS SQL Server 2008 R2, 2008, 2008 (64 bit), 2008 Express, MS SQL Server 2005, 2005 (64 bit), 2005 Express, MS SQL Server 2000, 2000 (64 bit), 7.0 and mixed formats. To install the software, follow the steps: 1. Double-click Stellar Repair for MS SQL.exe.

Server 2005 , SQL Server 2008 , SQL Server 2008 R2 , SQL Server 2012 , SQL Server 2014 , SQL Server 2005 Express Edition , SQL Server 2008 Express SQL Server 2008 R2 Express , SQL Server 2012 Express , SQL Server 2014 Express .NET Framework 4.0, .NET Framework 2.0,

D. SQL Server Agent job E. Azure SQL Data Sync Answer: E Explanation: SQL Data Sync is a service built on Azure SQL Database that lets you synchronize the data you select bi- directionally across multiple SQL databases and SQL Server instances. With Data Sync, you can keep data synchronized between your on-premises databases and Azure SQL

about optimization of SQL queries and PL/SQL scripts, however, you have to understand the basics of SQL. This manual is written for people with at least some experience with SQL or PL/SQL on Oracle databases in a production environment, in particular (aspiring) developers. Should you have only ever looked at the sample databases, you are

Use \i FULL_PATH_ass1.sql to load your ass1.sql where FULL_PATH_ass1.sql is the full path of your answer file (ass1.sql) Use \i FULL_PATH_check1.sql to load check1.sql where FULL_PATH_check1.sql is the full path of the check file (check1.sql) reate a new database for mymy2 database. Repeat the above steps using mymy2.dump and check2.sql

SQL Server 2005 SQL Server 2008 (New for V3.01) SQL Server 2008 R2 (New for V3.60) SQL Server 2012 (New for V3.80) SQL Server 2012 R2 (New for V3.95) SQL Server 2014 (New for V3.97) SQL Server 2016 (New for V3.98) SQL Server 2017 (New for V3.99) (Recommend Latest Service Pack) Note: SQL Server Express is supported for most situations. Contact .