Introduction To SQL

 Blogpost #4

A. Engage 

a. DATA DEFINITION LANGUAGE

- Data definition language is a language for describing data and how it relates to other data in the database.

b. INTERACTIVE DATA MANIPULATION LANGUAGE 

- IDML is a programming language used for manipulating data in a database, where users can directly interact and modify data in real-time.

c. EMBEDDED DATA MANIPULATION LANGUAGE

- EDML is a programming language that is integrated into software applications to help users manipulate database data within the application. With EDML, users can easily perform data manipulation tasks without having to leave the application interface.


B. EXPLORE & EXPLAIN

1. What are the basic SQL expression?

·        SELECT: Used to retrieve data from a database table

·        INSERT: Used to add new records to a database table

·        UPDATE: Used to modify existing records in a database table

·        DELETE: Used to remove records from a database table

·        WHERE: Used to filter records based on specific conditions

·        ORDER BY: Used to sort records in ascending or descending order based on one or more columns

·        GROUP BY: Used to group records based on one or more columns

·        JOIN: Used to combine data from two or more tables based on a common column

·        LIKE: Used to search for records based on a specific pattern or string of characters

·        COUNT: Used to count the number of records in a table that meet specific criteria.

2. What is the difference between simple equijoin and natural join?

The difference between a simple equijoin and a natural join in SQL is that a simple equijoin requires the explicit specification of the join condition, while a natural join automatically joins two tables based on columns with matching names.

 

3. What are the different types of join?

·        INNER JOIN: Returns only the matching rows between two or more tables, based on a specified join condition.

·        OUTER JOIN: returns all the rows from one table and matching rows from another table, or null values for non-matching rows in the other table. There are three types of outer join: left outer join, right outer join, and full outer join.

·        CROSS JOIN: Returns the Cartesian product of two tables, meaning that it returns all possible combinations of rows from both tables.

·        SELF JOIN: It is treated as two separate tables. In a self-join, a table is temporarily renamed and treated as two separate tables that are then joined together based on a specific relationship between the columns of the same table.

 

4. What are the different components of sql structure?

·        Data Definition Language (DDL): DDL is used to define and modify the structure of database objects such as tables, views, indexes, and sequences.

·        Data Manipulation Language (DML): DML is used to manipulate data within the database objects, such as inserting, updating, deleting, and selecting data from tables.

·        Data Control Language (DCL): DCL is used to control access to the database objects by creating and managing user roles and privileges.

·        Transaction Control Language (TCL): TCL is used to control transactions within the database, such as committing or rolling back transactions.

·        Data Query Language (DQL): Used to retrieve data from a database. DQL commands are primarily used to retrieve data from one or more tables based on specific criteria, using the SELECT statement.

 

5. What is the different between write and fetch transaction?

A write transaction modifies data in a database using DML statements like INSERT, UPDATE, and DELETE, while a fetch transaction retrieves data from the database using DQL statements like SELECT. In a write transaction, data is changed, while in a fetch transaction, data is only read and not changed.

 

C. ELABORATE & EVALUATION

Where Clause 1. Consists of a predicate that involves the attributes of the relations described in the From clause.

JOIN 2. Combinations of all the relations.

Database Transaction 3. Is defined as a distinct activity within a computer system that reads or modifies the content of a database.

Structured Query Language 4. A comprehensive language that has its own DDL and DML components.

SELECT 5. Is used to list the attributes needed to be included in the output of the query.ate statements in query language.


Comments

Popular posts from this blog

XML | JSON | AJAX

Function, Advantages, Disadvantages of DBMS