Section 1

Preview this deck

WHERE

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (29)

Section 1

(29 cards)

WHERE

Front

to specify a selection criterion

Back

Example of Data Types For Temporal

Front

TIME, DATE, TIMESTAMP

Back

SELECT workername as Name FROM worker;

Front

Example of renaming column

Back

DML

Front

Example : SELECT, UPDATE, DELETE, INSERT

Back

< >

Front

also can be written as !=

Back

DROP TABLE worker;

Front

Example of delete column

Back

HAVING Clause

Front

Use when the WHERE keyword could not be used with aggregate functions.

Back

DDL

Front

Example : CREATE TABLE, USE TABLE, ALTER TABLE, DROP TABLE

Back

Update statement

Front

To modify the data in a table.

Back

LIKE condition

Front

SELECT * FROM worker WHERE workername LIKE '%M';

Back

Example of Data Types For Character

Front

CHAR / VARCHAR

Back

Example of Data Types For Numeric

Front

INT, FLOAT, MONEY

Back

SELECT WORKERNO, SUM(rent) AS TOTAL_RENT FROM building GROUP BY WORKERNO;

Front

Example of SQL to find the TOTAL RENT of each worker

Back

CREATE TABLE table_name ( column_name data type [NULL|NOT NULL], PRIMARY KEY (column_name), FOREIGN KEY (foreign_key_column) REFERENCES (parent_table_name) );

Front

Syntax to create table

Back

OR

Front

Used to join two or more conditions.

Back

Update statement syntax

Front

UPDATE table_name SET column_name = new_value WHERE column_name = some_value;

Back

DISTINCT statement

Front

to return only different values

Back

INSERT INTO worker VALUES ('A01','JOHN','MANAGER','CHERAS', '01- JANUARY-1995',12345,7000)

Front

Example of inserting data into table

Back

SELECT * FROM worker WHERE workername LIKE 'J%' ;

Front

Used to define wildcards (missing letters in the pattern) after the pattern.

Back

BETWEEN ..... AND

Front

selects a range of data between two values. *can be numbers, texts or dates.

Back

IN

Front

can be used if you know the exact value that you seek for at least one of the columns.

Back

SELECT * FROM worker;

Front

To display the entire table of worker

Back

SELECT AVG(rent) AS AVERAGE_RENT FROM building;

Front

Example of SQL to find the average value of rent

Back

DELETE FROM table_name

Front

DELETE * FROM table_name

Back

ALTER TABLE table_name ADD column_name datatype;

Front

Alter table syntax

Back

SQL statement will return persons with first names that contain the pattern 'MA'

Front

SELECT * FROM worker WHERE position LIKE '%MA%';

Back

ALTER TABLE worker DROP COLUMN gender ;

Front

Example of delete column

Back

Example of SUM syntax

Front

SELECT SUM(rent) AS SUM_RENT FROM building;

Back

CREATE DATABASE database_name;

Front

Syntax to create database

Back