Enterprise Database Systems Introduction to SQL Server Dr. Georgia Garani Dr. Theodoros Mitakos Technological.

Slides:



Advertisements
Similar presentations
Tutorial 8: Developing an Excel Application
Advertisements

Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
11 3 / 12 CHAPTER Databases MIS105 Lec14 Irfan Ahmed Ilyas.
Introduction to Databases Transparencies
A Guide to MySQL 3. 2 Objectives Start MySQL and learn how to use the MySQL Reference Manual Create a database Change (activate) a database Create tables.
Concepts of Database Management Sixth Edition
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Chapter 1 Introduction to Databases
Working with SQL and PL/SQL/ Session 1 / 1 of 27 SQL Server Architecture.
Database Management Systems (DBMS)
AGENDA Tools used in SQL Server 2000 Graphical BOL Enterprise Manager Service Manager CLI Query Analyzer OSQL BCP.
Passage Three Introduction to Microsoft SQL Server 2000.
Database Administration Chapter 16. Need for Databases  Data is used by different people, in different departments, for different reasons  Interpretation.
Week 5 – Chap. 5 Data Transfer DBAs often must transfer data to and from text files, Excel spreadsheets, Access, Oracle or other SQL Server databases This.
Introduction to Databases and Database Languages
Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
Computer for Health Sciences
Chapter 1 Database Systems. Good decisions require good information derived from raw facts Data is managed most efficiently when stored in a database.
6/1/2001 Supplementing Aleph Reports Using The Crystal Reports Web Component Server Presented by Bob Gerrity Head.
Fundamentals of Information Systems, Sixth Edition
Module 1: Introduction to Microsoft SQL Server 7.0.
A Guide to SQL, Eighth Edition Chapter Three Creating Tables.
Prentice Hall © SQL for SQL Server Bijoy Bordoloi and Douglas Bock Chapter 1: Introduction.
Overview of SQL Server Alka Arora.
Chapter 4 SQL. SQL server Microsoft SQL Server is a client/server database management system. Microsoft SQL Server is a client/server database management.
Chapter 5 Lecture 2. Principles of Information Systems2 Objectives Understand Data definition language (DDL) and data dictionary Learn about popular DBMSs.
Your Interactive Guide to the Digital World Discovering Computers 2012.
ASP.NET Programming with C# and SQL Server First Edition
Data Administration & Database Administration
Concepts of Database Management Seventh Edition
Chapter 1 Introduction to Databases Pearson Education ©
Database Technical Session By: Prof. Adarsh Patel.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
DBSQL 14-1 Copyright © Genetic Computer School 2009 Chapter 14 Microsoft SQL Server.
1 SQL Server 2000 Administration Kashef Mughal MSB.
Database control Introduction. The Database control is a tool that used by the database administrator to control the database. To enter to Database control.
“INTRODUCTION TO DATABASE AND SQL”. Outlines 2  Introduction To Database  Database Concepts  Database Properties  What is Database Management System.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
5-1 McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved.
1 Chapter Overview Preparing to Upgrade Performing a Version Upgrade from Microsoft SQL Server 7.0 Performing an Online Database Upgrade from SQL Server.
SQL Server 2012 Session: 1 Session: 3 Introduction to SQL Server 2012 Data Management Using Microsoft SQL Server.
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
A Guide to MySQL 3. 2 Introduction  Structured Query Language (SQL): Popular and widely used language for retrieving and manipulating database data Developed.
Unit 5 Microsoft SQL Server and MySQL. Key Concepts DBMS variations SQL Server features SQL Server Management Studio MySQL features Scripts Queries Database.
Introduction to Oracle. Oracle History 1979 Oracle Release client/server relational database 1989 Oracle Oracle 8 (object relational) 1999.
INTRODUCTION TO DBS Database: a collection of data describing the activities of one or more related organizations DBMS: software designed to assist in.
Database Administration
SQL.. AN OVERVIEW lecture3 1. Overview of SQL 2  Query: allow questions to be asked of the data and display only the information required. It can include.
Pasewark & Pasewark Microsoft Office 2003: Introductory 1 INTRODUCTION Lesson 1 – Microsoft Office 2003 Basics and the Internet.
Features Of SQL Server 2000: 1. Internet Integration: SQL Server 2000 works with other products to form a stable and secure data store for internet and.
Introduction to Databases Transparencies © Pearson Education Limited 1995, 2005.
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
 IS A COLLECTION OF PROGRAMS THAT MANAGES THE DATABASES STRUCTURE AND CONTROL ACCESS TO THE DATA STORED IN THE DATABASE.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 1 Database Systems.
Introduction to Core Database Concepts Getting started with Databases and Structure Query Language (SQL)
uses of DB systems DB environment DB structure Codd’s rules current common RDBMs implementations.
Agenda for Today  DATABASE Definition What is DBMS? Types Of Database Most Popular Primary Database  SQL Definition What is SQL Server? Versions Of SQL.
Database Principles: Fundamentals of Design, Implementation, and Management Chapter 1 The Database Approach.
3 A Guide to MySQL.
Aga Private computer Institute Prepared by: Srwa Mohammad
COS 346 Day 3 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
Module 1: SQL Server Overview
Introduction to Visual Basic 2008 Programming
Database Systems: Design, Implementation, and Management Tenth Edition
Introduction What is a Database?.
Database Management System (DBMS)
DATABASE MANAGEMENT SYSTEM
8 6 MySQL Special Topics A Guide to MySQL.
Chapter 11 Managing Databases with SQL Server 2000
Presentation transcript:

Enterprise Database Systems Introduction to SQL Server Dr. Georgia Garani Dr. Theodoros Mitakos Technological Educational Institution of Larissa in collaboration with Staffordshire University Larissa 2007

SQL SQL, pronounced ‘Sequel’ or simply S-Q-L, is a computer programming language that was developed especially for querying relational databases using a nonprocedural approach. The term nonprocedural means that you can extract information by simply telling the system what information is needed without telling it how to perform the data retrieval. Transact-SQL or T-SQL is Microsoft's implementation of the SQL language.

Procedural and Nonprocedural NonproceduralProcedural SELECT emp_last_name, emp_first_name FROM employee WHERE emp_last_name = 'BOCK'; intIndex = 1 DO WHILE intIndex <= Count_Of_Rows If emp_last_name = 'BOCK' Then If emp_last_name = 'BOCK' Then DISPLAY emp_last_name, DISPLAY emp_last_name, emp_first_name emp_first_name End If End If intIndex += 1 intIndex += 1LOOP

DATA Two types of data are stored within a database. Two types of data are stored within a database. User data: Data that must be stored by an organization. User data: Data that must be stored by an organization. System data: Data the database needs to manage user data to manage itself. This is also termed metadata, or the data about data. System data: Data the database needs to manage user data to manage itself. This is also termed metadata, or the data about data.

DBMS Services Data definition for defining and storing all of the objects that comprise a database such as tables and indexes Data definition for defining and storing all of the objects that comprise a database such as tables and indexes Data maintenance Data maintenance Data manipulation Data manipulation Data display Data display Data integrity Data integrity Data security Database backup and recovery Data security Database backup and recovery

SQL Server Versions EditionDescription SQL Server Standard Edition Small-and medium-sized businesses without large data center applications will find this edition best fits their budget. It supports up to four CPUs and 2GB of random access memory. SQL Server Enterprise Edition Aimed at large companies This version provides high availability and scalability. It can support up to 32 CPUs and 64GB of random access memory. SQL Server Developer Edition This is like the Enterprise Edition, but for system developers. It cannot be licensed for use in a production environment.

SQL Server Versions Contd. SQL Server Desktop Edition This Edition has the SQL Server database engine, but not all of the management tools or analysis services. Database size for this edition is limited to 2GB. It supports full application development and deployment for small business applications. SQL Server 2000 Personal Edition This version has much of the functionality of the Standard Edition. It can service small groups of concurrent access users. It will run on desktop Windows operating systems from Windows 98 to Windows 2000 Professional Edition. SQL Server 2000 Windows CE Edition This runs on the Windows CE operating system for pocket PC devices.

SQL Server Features FeatureDescription Internet standard support SQL Server uses Microsoft's new.NET technology to support data exchange across the Internet including new detailed support for the extensible-markup language, or XML. Scalability SQL Server can be used to build very large, multiprocessor systems. Security mechanisms SQL Server's sophisticated security mechanisms control access to sensitive data through an assortment of privileges, for example, the privilege to read or write specific information within a database. Backup and recovery SQL Server's sophisticated backup and recovery programs minimize data loss and downtime if problems arise.

SQL Server Features Cont. SQL Server Features Cont. Space managemen t SQL Servers automated space management capability makes it easy for a database administrator to manage disk space for storage. These capabilities also include the ability to specify subsequent allocations on how much disk space to set aside for future requirements. Open connectivity SQL Server's open connectivity functionality provides uninterrupted access to the database throughout the day. It also provides open connectivity to and from other vendors’ software. Tools and applications SQL Server provides a wide range of development tools, end-user query tools, and support for third- party software applications that are used to model business processes and data and to generate program language code automatically.

SQL Query Analyzer GUI can be used to: Create databases. Create databases. Develop, test, and debug stored procedures. Develop, test, and debug stored procedures. Run SQL scripts – these are miniature programs that contain either DDL or DML commands or a combination of these commands. An example would be a script to create a database, and then populate the tables in the database with data. Run SQL scripts – these are miniature programs that contain either DDL or DML commands or a combination of these commands. An example would be a script to create a database, and then populate the tables in the database with data. Optimize system performance. Optimize system performance. Analyze query plans – these are the plans that the DBMS generates for processing a query. Analyze query plans – these are the plans that the DBMS generates for processing a query. Maintain and manage statistics concerning database performance. Maintain and manage statistics concerning database performance. Generate tune table indexes – the indexes are supposed to improve system performance for data retrieval. Generate tune table indexes – the indexes are supposed to improve system performance for data retrieval.

SQL Query Analyzer Contd.

Creating a Database When SQL Server is initially installed, five system databases are generated. These are named: (1) master, (2) model, (3) msdb, (4) distribution, and (5) tempdb. When you create a new database in SQL Server, the DBMS uses the model database as a template to create a new database. The command to create a user database is : The command to create a user database is : CREATE DATABASE CREATE DATABASE Note: You must have prior authorization from your system administrator to execute this command.

Using a Database After you have CREATED your database(s) you must use the USE command to select a database for future processing. You can type the USE command into the Editor pane and execute it also. USE Company; The command(s) completed successfully.

Executing Scripts Sometimes you need to execute a script that contains a series of SQL statements. The Editor pane can be used to create and save a script Sometimes you need to execute a script that contains a series of SQL statements. The Editor pane can be used to create and save a script Simply select the Editor pane to make it the active window, then use the toolbar Save option and specify the location, file name, and file format when the Save Query dialog box displays. Simply select the Editor pane to make it the active window, then use the toolbar Save option and specify the location, file name, and file format when the Save Query dialog box displays. You should use the default filename extension of.sql when naming a script file. You should use the default filename extension of.sql when naming a script file.

Executing Scripts

You can also open scripts and execute them, even if they were created with another text editor, such as Microsoft Notepad or Word. You can also open scripts and execute them, even if they were created with another text editor, such as Microsoft Notepad or Word. Select the Load SQL Script toolbar button and when the Open Query File dialog box displays, locate and select the name of the file to be opened. Select the Load SQL Script toolbar button and when the Open Query File dialog box displays, locate and select the name of the file to be opened.

Executing Scripts

T-SQL Naming Rules There are several rules for naming database objects that must be followed: Identifiers can consist of letters, digits, or the symbols $, and _ (underscore). Identifiers must be no more than 128 characters Identifiers must be no more than 128 characters The first character of an identifier must be either a letter (a- z, A-Z) or the or _ (underscore) symbol. After the first character, you may use digits, letters, or the symbols $, #, or _ (underscore). Temporary objects are named by using the # symbol as the first character of the identifier. Avoid using this symbol as the leading character when naming permanent database objects. symbol as the first character of an identifier denotes a variable name. Avoid using this symbol as the leading character when naming other database objects. SQL keywords such as SELECT and WHERE cannot be used as an identifier.