SQL day NO 1

Embed Size (px)

Citation preview

  • 8/9/2019 SQL day NO 1

    1/2

    What is the database?

    The database is a computer file that be used to store the data instructured way, this database file can be managed by software to make itaccessible to application and to manage the data

    What are kinds of database?

    a flat database : the database without any relations between its tablesand this kind is useless in the big project with bid dataRelational database : that eliminating the repeating in data and Retrievethis data more efficient

    Why we using software like SQL not store the data in text file?

    Because of these reasons1-data integrity2- over data3-outdated data4-retriving, filtering, searching5-protect data from unauthorized

    What is a SQL?

    Structure Query Language (SQL) is an application that allows you tocreate and manage database

    RDBMS

    RDBMS stands for Relational Database Management System.RDBMS is the basis for SQL, and for all modern database systems like MSSQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.this system makes managing data easy by taking care of many of themost difficult tasks , and save effort and duplicate the data more thanoncethe data integrity is the main job of the RDBMSThe data in RDBMS is stored in database objects called tables.A table is a collections of related data entries and it consists of columnsand rows.

    What Can SQL do?

    SQL can execute queries against a databaseSQL can retrieve data from a databaseSQL can insert records in a databaseSQL can update records in a databaseSQL can delete records from a databaseSQL can create new databasesSQL can create new tables in a databaseSQL can create stored procedures in a databaseSQL can create views in a databaseSQL can set permissions on tables, procedures, and views

  • 8/9/2019 SQL day NO 1

    2/2

    Types of Transact-SQL Statements

    1-Data Definition Language statements (DDL)2-Data Manipulation Language statements (DML)3- Data Control Language statements (DCL)

    DDL

    Define the data objectCREATE object nameTo create a new object like new database , new table,..ALTER object nameTo make any update in an existing objectDROP object nameTo delete any existing object like database, table, .

    DML

    TO deal with the data inside these objectSELECTTo retrieve existing data and can filter this data in retrievingINSERTTo insert new data in tableUPDATETo update information in existing dataDELETETo delete any data

    DCL

    SET or change permissions1-GRANT

    Allow user to work with data2-DENY

    Prevent the user from inheriting the permission through its group3-REVOKE

    Remove granted or denied permission