0% found this document useful (0 votes)
55 views16 pages

Part 1 - SELECT Statement

This document provides an overview of concepts and skills needed for working with big data, including SQL statements. It is taught by Dr. Le Duy Dung from VinUniversity. The document covers basic SQL statements for querying single tables using SELECT, multiple tables using subqueries and joins, as well as SQL statements for creating, modifying and deleting database structures and data. It includes examples and practice questions to help learners understand fundamental SQL concepts needed for big data.

Uploaded by

chi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views16 pages

Part 1 - SELECT Statement

This document provides an overview of concepts and skills needed for working with big data, including SQL statements. It is taught by Dr. Le Duy Dung from VinUniversity. The document covers basic SQL statements for querying single tables using SELECT, multiple tables using subqueries and joins, as well as SQL statements for creating, modifying and deleting database structures and data. It includes examples and practice questions to help learners understand fundamental SQL concepts needed for big data.

Uploaded by

chi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Database Concepts and Skills for Big Data

Le Duy Dung, PhD


CECS, VinUniversity
Quiz 2 (15 mins)
Module 3-SQL
❑ Learn basic SQL SELECT statements and options for processing a single table
❑ Learn basic SQL SELECT statements for processing multiple tables with
subqueries
❑ Learn basic SQL SELECT statements for processing multiple tables with joins
❑ Learn basic SQL statements for creating database structure
❑ Learn basic SQL statements for adding data to a database
❑ Learn basic SQL statements for modifying and deleting data from a database
❑ Learn basic SQL statements for modifying and deleting database tables and
constraints
SQL-Part 1
SELECT Statements
SELECT
❑ The SELECT statement is used to select data from a database

❑ Syntax:
SELECT Column1, Column2, …
FROM Table_Name;

➢ SELECT is a SQL keyword which indicates what we want to


show (retrieve)
➢ FROM is another keyword which indicates the table(s), i.e., the
source of the data we need.
SELECT
Syntax:
SELECT Column1, Column2, …
FROM Table_Name;

<Example>
SELECT LastName
FROM CUSTOMER;

This statement returns the list of customers’ last names


SELECT one column
<Example>
SELECT LastName
FROM CUSTOMER;
SELECT more than one column
Syntax:
SELECT Column1, Column2, …
FROM Table_Name;

<Example>
SELECT CustomerID,
LastName,
FirstName
FROM CUSTOMER;

This statement returns the list of customers’ Ids, last names, and
first names.
SELECT more than one column
<Example>
SELECT CustomerID,
LastName,
FirstName
FROM CUSTOMER;
SELECT all the columns available in the table

Syntax:
SELECT *
FROM Table_Name;

<Example>
SELECT * FROM CUSTOMER;

This statement returns the list of all attributes of


CUSTOMER table.
SELECT all the columns available in the table
<Example>
SELECT * FROM CUSTOMER;
SELECT DISTINCT
❑ The SELECT DISTINCT statement is used to return only
distinct values

❑ Syntax:
SELECT DISTINCT Column1, Column2, …
FROM Table_Name;
SELECT DISTINCT

❑ Syntax:
SELECT DISTINCT Column1, Column2, …
FROM Table_Name;

<Example>
SELECT DISTINCT City
FROM CUSTOMER;
SELECT DISTINCT
SELECT City SELECT DISTINCT City
FROM CUSTOMER; FROM CUSTOMER;
Practice Questions
1. Find the cost and the price of each item.
2. Find the unique item description(s) in the ITEM table
3. Find the email addresses, last name, and first name of each
employee.
4. Find the email addresses of all vendors of the store.
5. Find the CustomerID and EmployeeID in the SALE table.
6. Find the list of the dates in which the store has (at least) a
sale.
QnA!

You might also like