221902285-Database Lab Report 5
221902285-Database Lab Report 5
221902285-Database Lab Report 5
Student Details
Name ID
2. OBJECTIVES/AIM
• To gather knowledge about Querying and filtering data in MySQL table.
• To implement distinct and filtering data commands in MySQL table.
3. PROCEDURE / ANALYSIS / DESIGN
The SQL DISTINCT keyword is used with the SELECT statement to eliminate all the duplicate
records and fetch only unique records. There may be a situation when you have multiple duplicate
records in a table. While fetching such records, it makes more sense to fetch only those unique
records instead of fetching duplicate records.
The SQL WHERE clause is used to specify a condition while fetching the data from a single table
or by joining with multiple tables. If the given condition is satisfied, then only it returns a specific
value from the table.
4. IMPLEMENTATION
Question 1:
Input multiple data in any existing database table from previous lab report.
Query:
Question 2: Query with primary key, query with condition, query with comparison operation.
Query:
SELECT customer_name, Email FROM `customer` ;
SELECT DISTINCT customer_id, customer_name FROM `customer` ;
SELECT loan_number, branch_name FROM `loan` WHERE amount > 15000;
SELECT loan_number, branch_name, amount FROM `loan` WHERE amount <> 25000;
SELECT Email FROM `customer` WHERE customer_name = 'Tasnim';
5. TEST RESULT / OUTPUT
6. Discussion
Based on the focused objective(s) to understand about the knowledge of SELECT, WHERE and DISTINCT
commands. The additional lab exercise made me more confident towards the fulfilment of the objectives(s)