Assignment 3
Assignment 3
3 -----------------------------------------
NAME:
ROLL NO:
Aim: Design at least 10 SQL queries for suitable database application using SQL DML
statements: all types of Join, Sub-Query and View.
Objective:
1. To learn and understand DML statements in MySQL
2. To learn SQL Joins, Subqueries & Views.
Hardware requirements:
Any CPU with Pentium Processor or similar, 256
MBRAM or more, 1 GB Hard Disk or more.
Software requirements:
Ubuntu 14 Operating System, MySQL
Theory:
SQL JOIN
A JOIN clause is used to combine rows from two or more tables, based on a related column
between them.
10308 2 1996-09-18
10309 37 1996-09-19
10310 77 1996-09-20
WHERE condition;
FROM table_name
WHERE condition;
Now we want to add the "Category" column to the "Product List" view. We will update the view with
the following SQL:
Subqueries:
A subquery is a SQL query nested inside a larger query.
Subquery Syntax :
The subquery (inner query) executes once before the main query (outer query) executes.
The main query (outer query) use the subquery result.
Conclusion:
Thus,we have successfully studied Joins, Subqueries and views and implemented SQL Queries.