DB Summary PDF
Document Details
Uploaded by RazorSharpWalnutTree160
كلية تكنولوجيا الصناعة والطاقة
Tags
Summary
This document provides a summary of Database concepts and SQL commands. It covers topics including database management systems, SQL language, data types, and common commands. The content includes examples of different SQL statements and categories, including DDL and DML, suitable for database management and analysis.
Full Transcript
# Data Base - **What is Data Base?** Simply the previous arranged data using applications such as excel sheet or any other application. - **Consists of?** Groups of Tables, rows and columns that are connected by relationships. - **What is a data base management system?** It stands for DBMS, and help...
# Data Base - **What is Data Base?** Simply the previous arranged data using applications such as excel sheet or any other application. - **Consists of?** Groups of Tables, rows and columns that are connected by relationships. - **What is a data base management system?** It stands for DBMS, and helps manage the connection between end users, the DBMS itself, the DB app and the database. - **What are the components of a data base?** The end users, DB app, DBMS and the database itself. - **What is the difference between a field and a record?** A field is a column, and a record is a row. ## Introduction to SQL - SQL stands for Structured Query Language. - It is used to manage and manipulate Relational Database Management Systems. - SQL allows users to: - retrieve data - insert new data - update existing data - delete data. - **Why is SQL important?** It is a widely used language that allows users to efficiently manage and analyze large amounts of data. ## The Basics of SQL - **What are the building blocks of SQL?** - Databases and Tables - Understanding the structure of the database and its tables - Queries - Statements - Learning how to use SQL to interact with the database - **What are Data Manipulation operations, and how are they performed in SQL?** - Inserting - Updating - Deleting data - **How do you retrieve data in SQL?** By retrieving specific data from the database using `SELECT`. ## Basic SQL Commands - **SELECT:** Used to retrieve data from a database table and is the most commonly used SQL command. - **INSERT:** Used to add new rows of data to a table. - **UPDATE:** Used to modify existing data in a table. - **DELETE:** Used to remove rows of data from a table. - **Where clause**: Used to filter data based on a specified condition. - **Comparison operators:** Used in the where clause. They include: `>`, `<`, `=`, `<>`. - **Order by clause:** Used to sort retrieved data in ascending or descending order. - **Join operations:** Used to combine data from multiple tables using different types of joins. ## Getting Started with SQL 1. Setting up a database 2. Create a table 3. Inserting data 4. Running queries ## SQL categories - **Data Query language (DQL).** - **SELECT statement:** Used to select data from the database. - **SELECT DISTINCT:** Used to return only distinct unique values. - **Data Definition Language (DDL)** - **CREATE DB statement:** Used to create a new SQL database. - **DROP DB:** Used to delete SQL database. - **CREATE TABLE:** Used to create a new table in the database. - **DROP TABLE:** Used to delete a table in the database. - **Data Manipulation Language (DML)** - **INSERT INTO:** Used to insert new data into a table. - **UPDATE:** Used to update data. - **DELETE:** Used to delete data from a table. ## Commonly Used SQL Data Types - **Integer (INT):** Used for whole numbers - **Varchar**: Used for variable length characters. - **Date:** Used for date values. - **DateTime:** Used for date and time values. - **Boolean (BOOL):** Used for `True` or `False`.