Professional Documents
Culture Documents
1) NOW()
The NOW () function returns the current system date and time.
Syntax: SELECT NOW () FROM table_name
For example:
Now we want to display the products and prices per today's date.
2) FORMAT ()
The FORMAT () function is used to format how a field is to be displayed.
Syntax:
Parameter Description
column_name Required. The field to be formatted.
format Required. Specifies the format.
For Example:
Now we want to display the products and prices per today's date (with today's date displayed in the
following format "YYYY-MM-DD").
3) ROUND ()
The ROUND () function is used to round a numeric field to the number of decimals specified.
Parameter Description
column_name Required. The field to round.
decimals Required. Specifies the number of decimals to be returned.
For example:
ProductName UnitPrice
Kissan Jam 10
Oral B Toothbrush 33
Ponds Powder 16
4) Views ()
A view contains rows and columns, just like a real table. The fields in a view are fields from
one or more real tables in the database.
You can add SQL functions, WHERE, and JOIN statements to a view and present the data as
if the data were coming from one single table.
5) Outer join
An outer join does not require each record in the two joined tables to have a matching record.
The joined table retains each record—even if no other matching record exists. Outer joins
subdivide further into left outer joins, right outer joins, and full outer joins, depending on which
table(s) one retains the rows from (left, right, or both).
Use this when you only want to return rows that have matching data in the left table, even if there's no
matching rows in the right table.
Source Tables
Left Table
IndividualId AccessLevel
1 Administrator
2 Contributor
3 Contributor
4 Contributor
10 Administrator
Result
Use this when you only want to return rows that have matching data in the right table, even if there's no
matching rows in the left table.
Source Tables
Left Table
IndividualId AccessLevel
1 Administrator
2 Contributor
3 Contributor
4 Contributor
10 Administrator
Result
Use this when you want to all rows, even if there's no matching rows in the right table.
Source Tables
Left Table
IndividualId AccessLevel
1 Administrator
2 Contributor
3 Contributor
4 Contributor
10 Administrator
Result